TK Study

Software Engineering › Past questions › SQL

Past questions: SQL

5 questions.

2025 4 marks SQL Programming for the Web (Year 12) SQL queries

NESA 2025 HSC Software Engineering exam (online) - Marking Guidelines

Below is the Issues table for a technical support company. FixTime, in minutes, is the time taken to complete each job. [table image not extractable: columns include JobID, Category, Status, FixTime] Construct a SQL query that displays: the number of pending software jobs; the number of pending hardware jobs; the number of escalated software jobs; the number of escalated hardware jobs. List the results in order from the highest to lowest, based on the number of jobs. (4 marks)

Marking criteria

4: Correct SQL query that extracts 'Pending' and 'Escalated' jobs for the 'Software' and 'Hardware' categories, counts the jobs for each status in each category, and outputs results in descending order. 3: Addresses most requirements. 2: Some understanding of the problem. 1: Some understanding of SQL or the problem.

Sample answer

SELECT Category, Status, COUNT(JobID) AS Jobs FROM Issues WHERE (Status = 'Pending' OR Status = 'Escalated') GROUP BY Status, Category ORDER BY Jobs DESC

Question page · Practise and get marked

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

Question page · Practise and get marked

2025 2 marks SQL Programming for the Web (Year 12) SQL (GROUP BY)

NESA HSC Software Engineering Sample Examination + Marking Guidelines (official, 2025)

A table Students(StudentID, FirstName, Surname, Attended, Level) tracks students at a coding club (12 rows; levels Beginner, Intermediate, Expert). Complete the SQL query to generate the number of students at each level: SELECT Level, ??? FROM Students ??? BY Level;

Marking criteria

2: Correctly completes the SQL query. 1: Correctly selects at least TWO correct options.

Sample answer

SELECT Level, COUNT(StudentID) FROM Students GROUP BY Level;

Question page · Practise and get marked

2025 2 marks SQL Programming for the Web (Year 12) SQL

NESA 2025 HSC Software Engineering Familiarisation Questions - Marking Guidelines (official, 12 June 2025)

[Question stem not available as text (it is on the interactive NESA familiarisation site). Task per the NESA mapping grid: give the output of an SQL query on a product table, including correct ordering of rows]

Marking criteria

2: Correct output for the SQL query, including the correct ordering of the rows. 1: Some relevant information.

Sample answer

ProductName / ProductPrice: Discovery 1 & 2 (DVD) 26.98; The Plant (DVD) 28.00

Question page · Practise and get marked

2025 3 marks SQL Programming for the Web (Year 12) SQL (joins, AS)

NESA 2025 HSC Software Engineering Familiarisation Questions - Marking Guidelines (official, 12 June 2025)

[Question stem not available as text (it is on the interactive NESA familiarisation site). Task per the NESA mapping grid: write a SQL query over Customers, Products and Orders showing customer, product and quantity with renamed columns, ordered by OrderID]

Marking criteria

3: Correct SQL query. 2: Substantially correct query with at least TWO of: renaming the columns; selecting the three tables; joining the tables. 1: Some understanding of renaming the columns or joining the tables.

Sample answer

SELECT Customers.CustName as 'Customer', Products.ProductName as 'Product', Orders.OrderQuantity as 'Quantity' FROM Products, Customers, Orders WHERE Orders.ProductID = Products.ProductID AND Orders.CustID = Customers.CustID ORDER BY Orders.OrderID ASC

Question page · Practise and get marked