Standard difficulty · 20 questions · 40 marks · Time: 39 minutes
Show your working for Sections B and C. Answers are on the last page — try every question first!
Querying and SQL Functions · AW-12IP-SQF-2026-V1 · For parents — fold back or tear off before handing the sheet to your child.
| Q | Answer | Working |
|---|---|---|
| 1 | (d) gives one result for each row it is applied to | — |
| 2 | (c) 926.72 | ROUND keeps 2 decimal places, rounding a 5 or more up |
| 3 | (a) pre | 3 letters from position 2: pre |
| 4 | (c) Wednesday | 2025-07-09 falls on a Wednesday |
| 5 | (d) 3 | COUNT(DISTINCT …) counts each different value once |
| 6 | (b) 2 | 5 rows make 3 groups; HAVING keeps the groups with more than 1 |
| 7 | (c) degree 6, cardinality 18 | columns add: 2 + 4; rows multiply: 3 × 6 |
| 8 | (b) COUNT(*) | — |
| 9 | Math (numeric) functions, e.g. ROUND(); text (string) functions, e.g. LENGTH(); date functions, e.g. MONTH(). | — |
| 10 | 861.4 | round 861.398 to 1 decimal place |
| 11 | 11 | RTRIM removes the trailing spaces; 7 letters + 4 |
| 12 | re | RIGHT gives re; LOWER makes it small letters |
| 13 | 8 | 2026-08-12: year 2026, month 8, day 12 |
| 14 | 180 | Store = 'North': 355, 180 |
| 15 | City | COUNT(*) Indore | 1 Jaipur | 1 Shimla | 3 | one row for each group, in alphabetical order of the group |
| 16 | Diya, Meena, Zoya | Marks > 56, arranged highest first |
| 17 | GROUP BY collects rows with the same value of a column into groups; an aggregate function then gives one value per group. HAVING keeps only the groups that satisfy a condition. Example: SELECT City, COUNT(*) FROM STUDENT GROUP BY City HAVING COUNT(*) > 2; lists each city with more than two students and the number of students. | definition of each (2); a correct query (2) |
| 18 | (a) 3; (b) 1360; (c) 330 | (b) adds the Price values of 110 or more; (c) is 420 − 90 |
| 19 | (a) EName | DName Farhan | Sales Imran | Accounts Isha | Training Pooja | Accounts Rohan | Accounts (b) 20 | (a) an equi-join keeps only the pairs with matching DeptId, here sorted by EName; (b) the Cartesian product has 5 × 4 rows |
| 20 | (a) SELECT IName FROM ITEM WHERE Store = 'North' ORDER BY IName; (b) SELECT Store, MAX(Price) FROM ITEM GROUP BY Store; (c) SELECT IName, YEAR(StockDate) FROM ITEM WHERE MONTH(StockDate) = 2; | any equivalent query is correct (for example, ORDER BY … ASC in (a)) |