Cambridge International AS Level · Computer Science (9618)

Databases: Practice Questions

5 multiple-choice questions marked as you go, and 5 written questions with worked solutions. All on Databases.

10 questions28 marksFree, no account
Question 1
1 mark

Which of the following is a primary limitation of using a file-based approach compared to a relational database for data storage and retrieval?

Question 2
1 mark

A developer is using Data Definition Language (DDL) to create a new table. Which SQL statement correctly defines a table named Staff with an integer ID and a variable character name?

Question 3
1 mark

In a database with referential integrity enforced, what happens if a user attempts to delete a record from a parent table that is still referenced by a foreign key in a child table?

Question 4
1 mark

Which of the following data types is most appropriate for a field that stores whether a student has paid their tuition fees or not?

Question 5
1 mark

In a relational database, what is the effect of applying an index to a field like CustomerLastName?

Question 6
2 marks

When using Data Definition Language (DDL), which SQL keyword is used to permanently remove an entire table structure and all its data from the database?

Write your answer out first, then check it against the worked solution.

Question 7
3 marks

In a relational database, what is the role of a secondary key?

Write your answer out first, then check it against the worked solution.

Question 8
6 marks

Write a single SQL DDL statement to modify an existing table named Student by adding a new foreign key ClassID that references the Class table.

Write your answer out first, then check it against the worked solution.

Question 9
7 marks

A company uses a database to track its sales and inventory. Two of the tables in the database are PRODUCT and CATEGORY. Every product belongs to exactly one category, while a category can contain many products.

a) Define the term foreign key and identify which table should contain it in this scenario. (2 points)
b) Explain the importance of referential integrity when a user attempts to delete a record from the CATEGORY table. (2 points)
c) Write an SQL query to display the ProductName and the CategoryName for all products where the Price is greater than 100. Assume the primary keys are ProductID and CategoryID respectively. (3 points)

Write your answer out first, then check it against the worked solution.

Question 10
5 marks

A retail company stores sales data in a table that is currently in First Normal Form (1NF). The table structure is:
SALES(StoreID, ProductID, StoreLocation, ProductName, UnitPrice, QuantitySold)

a) Explain why this table is not in Second Normal Form (2NF), referring specifically to partial functional dependencies. (3 points)
b) Redesign the data into a set of tables that are in 2NF. (2 points)

Write your answer out first, then check it against the worked solution.

* The content provided by thinka is generated by AI and may not always be accurate or up-to-date. Please use it as a supplementary resource and verify with official materials.

You've seen the model answer. Now get yours marked.

This page can show you how a good answer looks. It cannot tell you what your answer was missing. thinka marks your written work against the real mark scheme in about 15 seconds.

Want more questions like these? Get a fresh set on this topic, graded as you go.

Practice More