GCSEBeast

Databases and SQL

GCSE Computer Science practice questions on databases and sql. Try 3 for free below — with hints, the answer and why the wrong answers are tempting. GCSE Beast has 20 questions on this topic.

Question 1 of 3Difficulty ●●●●●

A school keeps the details of its science fair in a database table called ScienceFair.

EntryIDTitleCategoryYearGroupPrize
SF01Bottle RocketsPhysics8TRUE
SF02Mould on BreadBiology9FALSE
SF03Solar OvenPhysics10TRUE
SF04Plant MusicBiology8FALSE
SF05Water FiltersChemistry9TRUE
SF06Paper BridgesEngineering7FALSE
SF07Fizzing TabletsChemistry10FALSE

All the data stored about one entry, for example everything in the row for SF04, is called a …

Question 2 of 3Difficulty ●●●●●

A branch railway line stores its morning timetable in a table called Trains.

TrainIDDestinationPlatformDepartsExpress
T401Seaview207:15TRUE
T402Hillcrest107:40FALSE
T403Seaview208:05FALSE
T404Oakfield308:20TRUE
T405Hillcrest208:45FALSE
T406Seaview109:10TRUE
T407Oakfield209:30TRUE
T408Hillcrest309:55FALSE
T409Seaview210:20FALSE
T410Oakfield110:45FALSE

How many records are returned by this query?

SELECT TrainID, DepartsFROM TrainsWHERE Platform = 2 AND Express = TRUE;
Question 3 of 3Difficulty ●●●●●

A museum stores its dinosaur fossils in a table called Fossils. Complete is TRUE when the whole skeleton was found.

FossilIDSpeciesPeriodLengthMCompleteCountry
FC01CoelophysisTriassic2.5TRUEUSA
FC02AllosaurusJurassic8.5FALSEUSA
FC03SpinosaurusCretaceous14.0FALSEMorocco
FC04PlateosaurusTriassic7.0TRUEGermany
FC05StegosaurusJurassic9.0TRUEUSA
FC06GiganotosaurusCretaceous12.5TRUEArgentina
FC07HerrerasaurusTriassic4.5FALSEArgentina
FC08BrachiosaurusJurassic22.0FALSETanzania
FC09PsittacosaurusCretaceous1.8FALSEMongolia
FC10DilophosaurusJurassic7.0TRUEUSA

The museum wants to count the fossils that are from the Jurassic or the Cretaceous period and are complete. The query starts:

SELECT COUNT(FossilID)FROM Fossils

Which line completes the query correctly?