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.
The 20 questions
-
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.
-
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.
-
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.
-
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.
-
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.
-
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.
-
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.
-
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.
-
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.
-
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.
-
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.
-
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.
-
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.
-
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.
-
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.
-
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.
-
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.
-
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.
-
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.
-
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.
Related quizzes
- Entity relationship modelling Quiz · 4.10.1.1 · 20 questions
- Database design and normalisation Quiz · 4.10.3.1 · 20 questions
- Structured Query Language (SQL) Quiz · 4.10.4.1 · 20 questions
- Client server databases Quiz · 4.10.5.1 · 20 questions
- Data types Quiz · 4.1.1.1 · 20 questions
- Big Data Quiz · 4.11.1.1 · 20 questions
- Function types and first-class objects Quiz · 4.12.1.1 · 20 questions
- Analysis Quiz · 4.13.1.1 · 20 questions
- Data structures and abstract data types Quiz · 4.2.1.1 · 20 questions
- Breadth-first and depth-first search Quiz · 4.3.1.1 · 20 questions