• Practice
  • About 14 min
  • 5 practice questions

Database mixed practice

Attempt mixed questions on tables, keys, SQL and design terms.

If something looks wrong, please tell us.

Mixed questions can combine a small table, a query and a definition. Work out the table first, then apply the query or term.

Revision table

Cue and answer
CueAnswer
RowRecord
ColumnField
Unique identifierPrimary key
Points to another tableForeign key
Retrieve dataSELECT
Reduce repeated dataNormalisation

Worked examples

Example 1. A table Item has these prices: 40, 25, 60, 75. What does SELECT MAX(Price) return? 75, the largest price. And SUM(Price) = 40 + 25 + 60 + 75 = 200.

Example 2. An Orders table stores CustomerID that matches the ID in the Customer table. What is CustomerID in Orders? A foreign key.

Work out the table first, then apply the query or term.

— Exam method

Key takeaways: use the cue table and double-check boundary conditions in queries.

Check your understanding

  1. 1. Item table prices: 40, 25, 60, 75. What does SELECT MAX(Price) FROM Item; return?

    1. 75
    2. 60
    3. 40
    4. 200
    Show answer

    Answer: A. MAX returns the largest value, 75.

  2. 2. Item table prices: 40, 25, 60, 75. What does SELECT SUM(Price) FROM Item; return?

    1. 190
    2. 200
    3. 175
    4. 50
    Show answer

    Answer: B. 40 + 25 + 60 + 75 = 200.

  3. 3. Item table prices: 40, 25, 60, 75. What does SELECT AVG(Price) FROM Item; return?

    1. 40
    2. 60
    3. 50
    4. 200
    Show answer

    Answer: C. Sum 200 divided by 4 items = 50.

  4. 4. An Orders table stores CustomerID, which matches the ID in the Customer table. In Orders, CustomerID is a

    1. Primary key of Orders
    2. Composite key
    3. Data dictionary
    4. Foreign key
    Show answer

    Answer: D. It refers to the primary key of another table, so it is a foreign key.

  5. 5. A table has 12 rows and 5 columns. How many fields does it have?

    1. 5
    2. 12
    3. 60
    4. 17
    Show answer

    Answer: A. Fields are columns, so 5. (12 is the number of records.)

Sign in to keep track of the lessons you finish.

Next lesson → SQL output drills: predict the rows

Privacy · Terms · Refunds · Delivery