Databases questions

By Interwoven Maths

Databases question collection

Review Databases questions for Computer Science, with correct answers shown and coverage across tables, records and fields; primary keys; queries and criteria.

Back to Databases practice Back to Computer Science

Question 1

What is a database?
  1. An organised collection of related data
  2. A single unstructured data file
  3. A program that displays one record
  4. A network that transfers data

Question 2

What does one relational database table usually store?
  1. Records about one entity type
  2. Fields from several unrelated entities
  3. One value from a single record
  4. Results from every possible query

Question 3

What is a record in a database table?
  1. Row in a table
  2. Column in a table
  3. Query in SQL
  4. Form in an app

Question 4

What is a field in a database table?
  1. Column in a table
  2. Row in a table
  3. Table relationship
  4. Primary key

Question 5

Which property must a primary key have?
  1. A unique value for every record
  2. A repeated value in related records
  3. A text value in every record
  4. A value copied from a foreign key

Question 6

What is a foreign key used for?
  1. Linking a record to another table
  2. Uniquely identifying every record in its table
  3. Sorting records by one field
  4. Checking a value against a range

Question 7

In SQL, which command retrieves data?
  1. SELECT
  2. UPDATE
  3. DELETE
  4. INSERT

Question 8

In SQL, which clause filters rows?
  1. WHERE
  2. ORDER BY
  3. FROM
  4. JOIN

Question 9

What is ORDER BY used for in SQL?
  1. Sort results
  2. Delete results
  3. Count fields
  4. Create tables

Question 10

What ordering does ASC specify?
  1. Lowest to highest
  2. Highest to lowest
  3. Newest to oldest
  4. Last letter to first

Question 11

What ordering does DESC specify?
  1. Highest to lowest
  2. Lowest to highest
  3. Oldest to newest
  4. First letter to last

Question 12

What does WHERE YearGroup = 10 do in an SQL query?
  1. Selects records for Year 10
  2. Sorts records by year group
  3. Changes every year group to 10
  4. Adds a new Year 10 record

Question 13

Which clause sorts pupils alphabetically by surname?
  1. ORDER BY Surname ASC
  2. ORDER BY Surname DESC
  3. WHERE Surname = 'ASC'
  4. SELECT ASC(Surname)

Question 14

Which SQL command adds a new record to a table?
  1. INSERT INTO
  2. UPDATE
  3. DELETE FROM
  4. ORDER BY

Question 15

What does AND mean in an SQL condition?
  1. Both conditions must be true
  2. Either condition can be true
  3. No condition is checked
  4. Rows are sorted descending

Question 16

When is an SQL condition joined by OR true?
  1. When at least one condition is true
  2. Only when both conditions are true
  3. Only when exactly one condition is true
  4. When both conditions are false

Question 17

What does INSERT INTO do?
  1. Adds new records
  2. Changes existing records
  3. Removes existing records
  4. Retrieves matching records

Question 18

What is UPDATE used for in SQL?
  1. Change existing records
  2. Create a new database
  3. Delete a table
  4. Count all rows

Question 19

What is DELETE used for in SQL?
  1. Remove records
  2. Add records
  3. Encrypt records
  4. Sort records

Question 20

Which field is the best primary key for a Customers table?
  1. CustomerID
  2. Surname
  3. Town
  4. DateOfBirth

Question 21

Which field in Orders should link each order to Customers?
  1. CustomerID
  2. OrderDate
  3. Quantity
  4. DeliveryTown

Question 22

Which query removes pupil 42 without deleting other pupils?
  1. DELETE FROM Pupils WHERE PupilID = 42
  2. DELETE FROM Pupils
  3. UPDATE Pupils WHERE PupilID = 42
  4. DELETE PupilID = 42 FROM Pupils

Question 23

What is an entity in database design?
  1. A real-world object stored as data
  2. One property stored in a field
  3. One row returned by a query
  4. A rule that validates input

Question 24

Which SQL keyword names the table used by a SELECT query?
  1. FROM
  2. WHERE
  3. ORDER BY
  4. UPDATE

Question 25

How can a database avoid inconsistent copies of a customer's address?
  1. Store it once in Customers
  2. Copy it into every order
  3. Use a different format in each table
  4. Remove CustomerID from Orders

Question 26

What is double-entry verification?
  1. Entering data twice and comparing the entries
  2. Checking data against permitted limits
  3. Encrypting data before it is stored
  4. Counting duplicate records after entry

Question 27

Why use validation in a database?
  1. To prevent invalid data being stored
  2. To correct every invalid value automatically
  3. To choose a primary key
  4. To encrypt all stored data

Question 28

Which example is a one-to-many relationship?
  1. One customer placing several orders
  2. One pupil having one candidate number
  3. Several pupils joining several clubs
  4. Several doctors treating several patients

Question 29

What does a database field's data type specify?
  1. The kind of value it can store
  2. Whether its value must be unique
  3. Which table it links to
  4. How its records are sorted

Question 30

Why is a WHERE clause important in an UPDATE query?
  1. It limits which records are changed
  2. It chooses which fields are displayed
  3. It sorts the updated records
  4. It creates a new table

About this topic

Review Databases questions for Computer Science, with correct answers shown and coverage across tables, records and fields; primary keys; queries and criteria.

This topic covers

Example question types