Lesson 4.10.2.1

4.10.2.1 Relational databases Quiz: AQA Computer Science, Unit 10

20 questions

In partnership with Revision Ninja

Lesson 4.10.2.1, Relational databases: 20 multiple choice questions for the AQA Computer Science (7517), Unit 10: Fundamentals of databases, written with Revision Ninja.

Host it live on the board and students join with a game code on their own devices, or revise alone with Free Play. The answers are revealed in the game.

Host this setFree Play

The 20 questions

  1. What is an attribute in a relational database table?

    • The name of the database that holds the relation together with its indexes, and which is stored separately from the relation on disk.
    • A rule that restricts which values may be entered into a table of records.
    • A named column in a table that holds one type of data for each row, such as Surname.
    • A single row that represents one record stored in the table of a database.
  2. What is a primary key?

    • The first column of a table, which must always hold a text value of fixed length.
    • An attribute that links a table to another table in the same database system.
    • An attribute, or set of attributes, whose value uniquely identifies each row in a table.
    • A value that is allowed to repeat across rows so that searches can be made faster, because a repeated value is easier to index.
  3. What is a composite primary key?

    • A primary key that combines the data from two different databases into one table.
    • A primary key that is made from a foreign key and an index in the same table.
    • A primary key that is generated automatically from the time each row was inserted into the table, using a clock value stored in the row.
    • A primary key made up of two or more attributes whose combined values are unique for each row.
  4. What is a foreign key?

    • A primary key that is only allowed to hold values taken from a list of countries.
    • An attribute that is always numeric and never refers to any other table in the database.
    • An attribute in one table that refers to the primary key of another table.
    • An attribute that is stored in a separate file outside the database system entirely.
  5. Which term describes a row in a relational table?

    • A domain, which is the set of values allowed in one column of the table.
    • A schema, which is the complete description of the structure of the database.
    • An attribute, which is a column that holds one data item for every record.
    • A tuple, which is one record in the relation.
  6. What does the term relation refer to in a relational database?

    • A table, consisting of rows and columns that hold related data.
    • A query that combines several tables into one result set using a join condition.
    • A link between two separate database servers over a network connection in the cloud.
    • A rule that ensures that every foreign key value matches a primary key value somewhere.
  7. In a Customer table with CustomerID as the primary key, which statement is true?

    • CustomerID may be left empty for some rows so that the key remains flexible.
    • CustomerID must be changed to a new value each time the customer places an order.
    • No two customers may have the same CustomerID value.
    • Two customers may share a CustomerID so long as they live at different addresses.
  8. Which attribute would be the best primary key for a table of books?

    • Title, because book titles are always displayed in the library catalogue.
    • Price, because all books are priced differently from each other in the shop.
    • Author, because each author is listed only once in the library system.
    • ISBN, because each published book has a unique ISBN.
  9. An Order table has CustomerID as a foreign key that refers to the Customer table. What does this ensure?

    • Customer rows are deleted automatically whenever their orders are removed.
    • Order rows are sorted by customer name whenever the table is displayed on screen.
    • Each order is linked to a customer who exists in the Customer table.
    • Every customer must place exactly one order, no more and no fewer than that.
  10. A table of enrolments uses StudentID and CourseID together as its key. What type of key is this?

    • A surrogate key that is generated by the system for each new enrolment.
    • A composite primary key.
    • A candidate index that is never used to identify any row in the table.
    • A single foreign key that refers to a table of course descriptions.
  11. In a table Enrolment (StudentID, CourseID, Grade), which attributes form the composite key?

    • StudentID and CourseID together.
    • Grade alone, because it changes for each student in each course.
    • CourseID alone, because each course has only one grade recorded for it.
    • StudentID alone, because every student identifier is always unique.
  12. A table has no column whose values are unique for each row. What is the consequence?

    • The table must be split so that each row holds two primary keys at the same time.
    • The table has no primary key, so individual rows cannot be reliably identified.
    • The table can only be queried using a foreign key and not by any other attribute.
    • The database will automatically add a column of duplicate names to identify each row.
  13. Which statement about foreign key values is correct?

    • A foreign key value must either match an existing primary key value in the referenced table or be empty, where empty values are allowed.
    • A foreign key value can be any text, because it is unrelated to the referenced table.
    • A foreign key is never allowed to be used in a join condition between two tables.
    • A foreign key must always be unique across the whole database, not only in its own table.
  14. A Book table has ISBN as primary key, and a Loan table has ISBN as a foreign key. What does a loan with ISBN 978-1 imply?

    • The ISBN is a duplicate and must be removed from the Loan table before it is saved.
    • The book 978-1 has been deleted from the Book table, so the loan is invalid.
    • The Loan table is the primary key of the Book table, so the two tables are identical.
    • The loan refers to the book with ISBN 978-1, which must exist in the Book table.
  15. A Teacher table has primary key TeacherID. A Class table also holds TeacherID. What is TeacherID in Class?

    • An attribute that is never allowed to hold any value at all in the table.
    • A composite primary key for the Class table that uses the teacher's name too.
    • A foreign key that refers to the Teacher table.
    • A duplicate of the Class table's name, stored to make searches faster.
  16. Which attribute must be unique in a Student table with columns StudentID, Name and Form?

    • StudentID, because it is the primary key identifying each student.
    • Form, because each form group has a single list of students recorded in it.
    • Name, because each student's name is stored once only in the school system.
    • Name and Form together, because students of the same name are always in different forms.
  17. Why does a relational database store data in separate linked tables rather than one large table?

    • So that every table can share the same primary key values without any restrictions.
    • To reduce repetition of data and to link related records through keys.
    • To store each attribute value in a separate file on the server, which is faster to search.
    • Because SQL cannot process any table that contains more than one column of data.
  18. Evaluate: which statement best explains why a foreign key is useful?

    • It stores every value of the referenced table so that backups are not needed.
    • It makes every table in the database unique so that no duplicate rows ever exist.
    • It removes the need for a primary key in the related table, so storage is saved.
    • It keeps related records consistent, because each reference points to an existing record in another table.
  19. A Phone table stores CustomerID and PhoneNumber. A customer may have several phone numbers. What is a suitable primary key for Phone?

    • PhoneNumber alone, which is never a foreign key that refers to another table.
    • A composite key of CustomerID and PhoneNumber, provided each number is unique for that customer.
    • A new column with no values, which is not used as a key in the table.
    • CustomerID alone, since each customer is assumed to have only one phone number.
  20. A relation has attributes (Ticket, Seat, Event), and Ticket is unique for every row. Which statement is correct?

    • Ticket is a candidate key for the relation, so it could be used as the primary key.
    • No attribute can be a primary key, because the relation has three attributes only.
    • Event is the primary key, because it is the last attribute listed in the relation.
    • Seat must be the primary key, because it changes less often than the ticket does.

All AQA Computer Science quizzes