Past questions › sample-q17
2025 3 marks SQL Programming for the Web (Year 12) SQL (join, filter, order)
NESA HSC Software Engineering Sample Examination + Marking Guidelines (official, 2025)
A shop uses an online database with a Products table (ProductID, Name, Price, Mass, Producer, Quantity, SupplierID) and a Suppliers table (SupplierID, Name). The prices are in dollars and the masses are in grams. The shop wants to identify all the products with a mass of at least 50 grams that are produced by Yumtreats. Write an SQL query to display the product names and supplier names, in descending order by product name. (3 marks)
Marking criteria
3: Correct SQL query. 2: Addresses some of the requirements. 1: Some understanding of SQL.
Sample answer
SELECT Products.Name AS 'Product', Suppliers.Name AS 'Supplier' FROM Products, Suppliers WHERE Products.SupplierID = Suppliers.SupplierID AND Products.Producer = 'Yumtreats' AND Products.Mass >= 50 ORDER BY Products.Name DESC