Paper Generator › IGCSE Computer Science › Databases & logic › Databases & SQLIGCSE · Computer Science 0478 · Databases & logic
Databases & SQL: IGCSE Computer Science questions with answers Free Databases & SQL questions for IGCSE Computer Science (0478), part of Databases & logic. Each question has the answer and the marking points an examiner would look for.
Generate a full Databases & SQL worksheet → All Databases & logic questions
Databases & SQL practice questions Question 1 Structured · 7 marks
A shop stores data in a database table called PRODUCTS.
ProductID Name Category Price Stock P101 Puzzle Toy 15.18 34 P102 Atlas Book 5.78 51 P103 Chess Game 8.53 24 P104 Robot Toy 15.62 39 P105 Novel Book 22.62 55 P106 Cards Game 19.77 55 P107 Kite Toy 4.31 49
Table 1.1
(a) State the field that is the most suitable primary key.
[1] (b) Write an SQL query to display the Name and Price of products in the category Toy with a price greater than 12, in descending order of Price.
[4] (c) State the output of: SELECT Name FROM PRODUCTS WHERE Stock < 18;
[2] Show answers and mark scheme Part Answer and marking points Marks (a) ProductIDProductID B1
1 (b) SELECT Name, Price FROM PRODUCTS WHERE Category = 'Toy' AND Price > 12 ORDER BY Price DESC;SELECT Name, Price B1 FROM PRODUCTS B1 WHERE Category = 'Toy' AND Price > 12 B1 ORDER BY Price DESC B1
4 (c) no recordsAll correct names B2 B1 for one error/omission
2
Question 2 Structured · 6 marks
A school stores data in several database tables. The table shows some of the fields.
(a) Identify the most suitable data type for each field.
Field Data type the height of a plant in metres a parent’s email address the price of a meal whether a member has paid
Table 2.1
[4] (b) Explain why a phone number is not stored as an integer.
[2] Show answers and mark scheme Part Answer and marking points Marks (a) the height of a plant in metres: real; a parent’s email address: text / string; the price of a meal: real; whether a member has paid: Booleanthe height of a plant in metres: real B1 a parent’s email address: text / string B1 the price of a meal: real B1 whether a member has paid: Boolean B1
4 (b) It may start with 0 / contain spaces or + signs, which would be lost; no calculations are done on itLeading zeros / spaces / symbols would be lost B1 It is never used in calculations B1
2
Question 3 Structured · 6 marks
A sports centre stores data about its trainers in a table called TRAINERS.
TrainerID Name Site Hours YearJoined T201 Asha East 12 2022 T202 Ben North 8 2024 T203 Chen North 5 2022 T204 Dina North 3 2024 T205 Eli South 4 2020 T206 Farah North 9 2016 T207 Gita South 6 2020
Table 3.1
(a) State the number of records and the number of fields in the table.
[2] (b) State the output of: SELECT COUNT(*) FROM TRAINERS WHERE Site = 'East';
[1] (c) Write an SQL query to output the total Hours worked by trainers who joined after 2020.
[3] Show answers and mark scheme Part Answer and marking points Marks (a) 7 records, 5 fields7 records B1 5 fields B1
2 (b) 11 B1
1 (c) SELECT SUM(Hours) FROM TRAINERS WHERE YearJoined > 2020; (gives 28)SELECT SUM(Hours) B1 FROM TRAINERS B1 WHERE YearJoined > 2020 (accept >= 2021) B1
3
Question 4 Structured · 2 marks
(a) State what is meant by the term primary key.
[1] (b) State what is meant by the term record.
[1] Show answers and mark scheme Part Answer and marking points Marks (a) A field that uniquely identifies each recordA field that uniquely identifies each record B1
1 (b) A collection of related fields about one itemA collection of related fields about one item B1
1
Question 5 Structured · 7 marks
A shop stores data in a database table called PRODUCTS.
ProductID Name Category Price Stock P101 Puzzle Toy 8.05 9 P102 Atlas Book 10.07 51 P103 Chess Game 30.95 40 P104 Robot Toy 18.21 34 P105 Novel Book 23.16 57 P106 Cards Game 29.35 17 P107 Kite Toy 9.55 34
Table 5.1
(a) State the field that is the most suitable primary key.
[1] (b) Write an SQL query to display the Name and Price of products in the category Game with a price greater than 27, in descending order of Price.
[4] (c) State the output of: SELECT Name FROM PRODUCTS WHERE Stock < 20;
[2] Show answers and mark scheme Part Answer and marking points Marks (a) ProductIDProductID B1
1 (b) SELECT Name, Price FROM PRODUCTS WHERE Category = 'Game' AND Price > 27 ORDER BY Price DESC;SELECT Name, Price B1 FROM PRODUCTS B1 WHERE Category = 'Game' AND Price > 27 B1 ORDER BY Price DESC B1
4 (c) Puzzle, CardsAll correct names B2 B1 for one error/omission
2
Question 6 Structured · 6 marks
A sports centre stores data about its trainers in a table called TRAINERS.
TrainerID Name Site Hours YearJoined T201 Asha North 3 2017 T202 Ben East 11 2023 T203 Chen East 6 2021 T204 Dina South 6 2023 T205 Eli South 7 2019 T206 Farah East 9 2019 T207 Gita South 5 2017
Table 6.1
(a) State the number of records and the number of fields in the table.
[2] (b) State the output of: SELECT COUNT(*) FROM TRAINERS WHERE Site = 'South';
[1] (c) Write an SQL query to output the total Hours worked by trainers who joined after 2020.
[3] Show answers and mark scheme Part Answer and marking points Marks (a) 7 records, 5 fields7 records B1 5 fields B1
2 (b) 33 B1
1 (c) SELECT SUM(Hours) FROM TRAINERS WHERE YearJoined > 2020; (gives 23)SELECT SUM(Hours) B1 FROM TRAINERS B1 WHERE YearJoined > 2020 (accept >= 2021) B1
3
More Databases & logic questions
Want a mentor, not just a paper? Riyaz Shaikh has mentored IGCSE, IB and A Level students for 15+ years, one-on-one, online and in Mumbai. The hardest questions on this site are the ones he uses to find a student's weak points.
Meet Riyaz →
Original Cambridge-style practice questions written for mentorriyaz.in. These are not Cambridge past paper questions, and this site is not affiliated with or endorsed by Cambridge University Press & Assessment. Updated 2026-11-04. Paper generator · mentorriyaz.in