9. Databases
A section of Computer Science, 0478
Listing 10 of 13 questions
A shop that sells books has set up a new database table called BookList to store book details. Part of this table is given. CatNo Title Fiction Author PaperBack Price StockLevel BK01 The Princes’ Story Yes B Penn Yes 4.50 BK02 The Princesses’ Story Yes B Penn Yes 4.50 BK03 Computer Science No Way Yu Yes 19.99 BK04 The Modern World No P Patel No 25.00 BK05 The Ancient World Yes P Patel No 25.00 BK06 Computer Science No R Dale Yes 27.35 BK07 The Princes’ Story Yes B Penn No 12.50 BK08 The Princesses’ Story Yes B Penn No 12.50 BK12 Famous Five Yes E Bly Yes 2.75 BK15 Secret Seven Yes E Bly Yes 2.75 BK16 The Last Knight Yes P Mann Yes 5.99 BK17 The Dark Tower Yes P Mann Yes 5.99 BK19 The Final Chase Yes P Mann Yes 5.99 BK21 Maths Today Part 1 No B Ward Yes 6.75 BK22 Maths Today Part 2 No B Ward Yes 6.75 BK23 Maths Today Part 3 No B Ward Yes 6.75 BK26 Maths Today Workbook No B Ward Yes 6.75 BK27 Knitting for Beginners No A Smith Yes 6.99 BK30 Woodwork for Beginners No A Smith Yes 6.99 BK31 Networking for Beginners No A Smith Yes 6.99 State the number of records in this part of the database table. Give the name of the field that would be used for the primary key. State the reason for choosing this field for the primary key. Complete the table to identify the most appropriate data type for each field based on the data shown in the table BookList Field Data type CatNo Title Fiction Price Write the output from this structured query language (SQL) statement. SELECT CatNo, Title, Author FROM BookList WHERE StockLevel = 0; Complete this SQL statement to display all the titles by the author B Penn. SELECT FROM WHERE ;
0478_m23_qp_22
THEORY
2023
Paper 2, Variant 2
A sanctuary for pheasants has set up a new database table called PheasantList to store details of the different species of bird at the sanctuary. Part of this table is given, showing: species, description, number of birds at the sanctuary, if the birds are breeding or not, and number of young born this year. Species Description NumberBirds Breeding Young Edwards blue-black with white tail Yes Japanese green dark green with pale grey tail Yes Reeves golden, white and red scaled plumage Yes Crawfords Kalij glossy blue-black plumage No Crested fireback blue-black with black tail No True silver white laced top half and black lower half Yes Siamese fireback grey plumage with crimson legs and feet No Mikado iridescent plumage with white striped wings Yes Red junglefowl many colours Yes Himalayan monal many colours with metallic green crest Yes White eared white with ear tufts Yes Brown eared brown with ear tufts Yes Ring necked long tail with white ring neck Yes Golden rainbow coloured Yes State the number of records and fields in this part of the database table. Records Fields Give the name of a field that could be used for the primary key. Explain why the sanctuary might decide not to use the field in as the primary key. A new field SpeciesID is added to the database table. This field contains a six-character code, for example Ph0001. Give a reason why this field would be a better primary key. Write the output that would be given by this structured query language (SQL) statement: SELECT Species, Description FROM PheasantList WHERE NumberBirds > 6; Complete this SQL statement to display all the species of pheasant where the birds are breeding and there were no young born this year: SELECT FROM WHERE ;
0478_w23_qp_23
THEORY
2023
Paper 2, Variant 3
Questions Discovered
13