Tip: Choose Save as PDF in the print dialog to download. Use A4 paper size.
Shade in the A or B circle for each question.
Draw a line connecting each item on the left to its match on the right.
| Left column | Right column | |
|---|---|---|
| 1SELECT COUNT(*) FROM Students; | ASELECT COUNT(*) FROM Books; | |
| 2SELECT COUNT(StudentID) FROM Students WHERE Year = 10; | BThe FROM keyword is missing, so the SQL does not say which table to count the records in. | |
| 3To find how many records are in a table called Books, use COUNT rather than listing every record. | CSUM was used to count records. SUM adds up the values of a numeric field and cannot be used with *. COUNT(*) should be used. | |
| 4To add up the values in a numeric Price field instead of counting records, use SUM, not COUNT. | DOutputs one row containing the number of records in the Students table. | |
| 5SELECT COUNT(*) Students; | ECounts only the records where Year is 10 and outputs that total. | |
| 6SELECT SUM(*) FROM Students; | FSELECT SUM(Price) FROM Books; |
Complete each line of code by filling in the missing parts.
Shade in the letter of the line that contains an error.
COUNT(*) — SQL function that counts records. SELECT COUNT(*) FROM Students; outputs one row with the number of records in the table. It counts rows, whereas SUM adds up values.SELECT COUNT(*) FROM Students;SELECT COUNT(*) FROM Students;SELECT COUNT(*) FROM Students;SELECT COUNT(*)
FROM Students
WHERE Year = 9;SELECT SUM(Points) FROM Students;