Photo AI

A swimming club uses a database to store details of swimmers and their times in a 50 metres swim - Scottish Highers Computing Science - Question 10 - 2022

Question icon

Question 10

A-swimming-club-uses-a-database-to-store-details-of-swimmers-and-their-times-in-a-50-metres-swim-Scottish Highers Computing Science-Question 10-2022.png

A swimming club uses a database to store details of swimmers and their times in a 50 metres swim. A sample of the data stored in the swimmer table is shown below. S... show full transcript

Worked Solution & Example Answer:A swimming club uses a database to store details of swimmers and their times in a 50 metres swim - Scottish Highers Computing Science - Question 10 - 2022

Step 1

Error 1: MIN & MAX functions are wrong way round OR ALIAS assigned to wrong function

96%

114 rated

Answer

The MIN and MAX functions should be applied correctly to ensure that they return the correct values. The alias names for the minimum and maximum times might also have been assigned incorrectly.

Step 2

Error 2: no wildcard operator both sides of 1

99%

104 rated

Answer

The WHERE clause should use a LIKE statement with wildcard characters to correctly filter the squads containing '1'. It should be WHERE squad LIKE '%1%'.

Step 3

Error 3: no GROUP BY squad

96%

101 rated

Answer

To aggregate the results properly, a GROUP BY clause is necessary. The statement should include GROUP BY squad to ensure that the minimum and maximum times are calculated for each squad.

Join the Scottish Highers students using SimpleStudy...

97% of Students

Report Improved Results

98% of Students

Recommend to friends

100,000+

Students Supported

1 Million+

Questions answered

;