Skip to content
Michelle’s Computer
Terminal

Databases and SQL quiz

Practise records, fields, primary keys, validation, filtering, sorting, and simple single-table SQL queries.

syllabus — topic scope & references
  • Identify fields, records, and primary keys
  • Read SELECT, WHERE, COUNT, and ORDER BY queries
  • Distinguish validation from proof that data is accurate

Cambridge IGCSE 0478 (2026–2028): 9 Databases.

IB Computer Science (first assessment 2027): A.3 Databases.

Original practice on shared foundations. Topic-area links do not imply complete syllabus or SL/HL coverage. Not affiliated with or endorsed by Cambridge or the IB.

Related: Programming fundamentals · Boolean logic and truth tables

DATABASES AND SQL QUIZ
10 questions. Type a, b, or c, then Enter. Explanations follow each answer.
Type review for all worked answers; quiz to restart; topics to switch.
 
Question 1/10: In a database table, what is a record?
a) A single column heading
b) One row describing an instance of the thing stored
c) The entire database software package
Type answer a, answer b, or answer c. (A single letter works too.)
review — read all questions & worked answers

Databases and SQL: questions, answers & explanations

This is the readable reference for the same 10 MCQs. Close this file to continue your quiz, or type quiz to start again.

1. In a database table, what is a record?

  1. a) A single column heading
  2. b) One row describing an instance of the thing stored
  3. c) The entire database software package

Answer: b) One row describing an instance of the thing stored

A record is one row, such as one student's details. Each field holds a particular attribute in that record.

2. What is a field in a database table?

  1. a) An attribute represented by a column, such as surname
  2. b) A complete collection of all tables
  3. c) A command to delete the database

Answer: a) An attribute represented by a column, such as surname

A field represents an attribute of the stored items. For example, each student record may have a surname field.

3. Which statement about a primary key is correct?

  1. a) It must be the person's first name
  2. b) Its value should be duplicated in every record
  3. c) It uniquely identifies each record and cannot be null

Answer: c) It uniquely identifies each record and cannot be null

A primary key must distinguish each record. A unique student ID is more suitable than a first name that several students might share.

4. What does this SQL query select? SELECT name FROM Students WHERE mark >= 50;

  1. a) Every field from every student
  2. b) Names of students whose mark is at least 50
  3. c) Only students whose mark is exactly 50

Answer: b) Names of students whose mark is at least 50

SELECT chooses the name field. WHERE keeps records for which mark is greater than or equal to 50.

5. What does COUNT(*) return for a query's matching records?

  1. a) The number of matching rows
  2. b) The sum of all numeric fields
  3. c) The number of characters in the table name

Answer: a) The number of matching rows

COUNT(*) counts rows. SUM would be used to add a numeric field's values.

6. What does ORDER BY mark ASC do?

  1. a) Delete the lowest mark
  2. b) Put the greatest mark first
  3. c) Sort results from the smallest mark to the greatest

Answer: c) Sort results from the smallest mark to the greatest

ASC means ascending order. For numeric marks, that means lowest to highest.

7. Which data type suits a field that stores whether a library book is on loan?

  1. a) An image
  2. b) Boolean
  3. c) A long paragraph of text

Answer: b) Boolean

The status has two possibilities, such as true for on loan and false for available, so a Boolean is suitable.

8. An age passes a range check of 0 to 120. What does that establish?

  1. a) It falls within the allowed range, but may still be the wrong person's age
  2. b) It is definitely the correct age
  3. c) It has been encrypted

Answer: a) It falls within the allowed range, but may still be the wrong person's age

Validation checks acceptability according to rules. A valid value can still be factually inaccurate.

9. Three student records have marks 40, 50, and 80. How many records satisfy WHERE mark >= 50?

  1. a) 1
  2. b) 3
  3. c) 2

Answer: c) 2

The marks 50 and 80 both satisfy the condition. A greater-than-or-equal comparison includes the boundary value 50.

10. What does WHERE city = 'Accra' AND active = TRUE require?

  1. a) Either condition may be true
  2. b) Both conditions must be true
  3. c) The city must be any value except Accra

Answer: b) Both conditions must be true

AND retains records only when both tests are true: the city is Accra and the active flag is true.

↑ ↓ recall commands · Tab autocomplete · Enter run