TK Study

Software Engineering › Flashcards › SQL questions

Flashcards for SQL questions

15 cards where the term can be tested as a sql question. Study these as flip cards Random

Data types Term Programming Fundamentals (Year 11)

The kind of value a variable holds: character, string, Boolean, integer, real (single-precision floating point) and date/time. The type decides how much memory it uses and what operations are allowed.

Example: 'Age = integer; price = real; isMember = Boolean; name = string.'

Where you would use it in the test
  • Multiple choice: Multiple choice: pick the option that matches the definition or example.
  • Fill in the blanks: Pick the data type for a field in a data dictionary or ERD
  • Python: Python question: write or complete it in the online Python tool.
  • SQL: SQL question: write or read it in the SQL query tool.

Related past questions: Sample exam Q9 (2 marks): Algorithm design (guessing game)

Memorise: Data structures

SQL SELECT Code pattern Programming for the Web (Year 12)

Chooses the fields (columns) to return from a table: SELECT name, mark FROM students; SELECT * returns all columns.

Example: 'SELECT FirstName FROM Customer;'

Where you would use it in the test
  • SQL: Select fields
  • Fill in the blanks: Complete the query (sample Q22a)
  • Code reading: Code or algorithm reading: interpret a fragment and state its output or purpose.
  • Multi-select: Multi-select: you tick every correct option, so know all its features or goals.

Related past questions: 2025 HSC Q21 (4 marks): SQL queries; Sample exam Q17 (3 marks): SQL (join, filter, order); Familiarisation Q12a (2 marks): SQL

Memorise: SQL vs ORM

SQL WHERE Code pattern Programming for the Web (Year 12)

Filters rows using conditions (=, <>, >, <, AND, OR). Text values need quotes. 2025 marker note: use quotes around searched text and combine conditions with AND or OR.

Example: "WHERE Suburb = 'Parramatta' AND Age > 18"

Where you would use it in the test
  • SQL: SQL question: write or read it in the SQL query tool.
  • Fill in the blanks: Fill in the blanks or dropdown: choose this term to complete a statement or table.
  • Code reading: Code or algorithm reading: interpret a fragment and state its output or purpose.
  • Multi-select: Multi-select: you tick every correct option, so know all its features or goals.

Related past questions: 2025 HSC Q21 (4 marks): SQL queries; Sample exam Q17 (3 marks): SQL (join, filter, order); Familiarisation Q12b (3 marks): SQL (joins, AS)

Memorise: SQL vs ORM

SQL ORDER BY Code pattern Programming for the Web (Year 12)

Sorts results by a field, ascending (ASC, the default) or descending (DESC).

Example: 'ORDER BY mark DESC'

Where you would use it in the test
  • SQL: SQL question: write or read it in the SQL query tool.
  • Fill in the blanks: Fill in the blanks or dropdown: choose this term to complete a statement or table.
  • Code reading: Code or algorithm reading: interpret a fragment and state its output or purpose.

Related past questions: 2025 HSC Q21 (4 marks): SQL queries; Sample exam Q17 (3 marks): SQL (join, filter, order)

Memorise: SQL vs ORM

SQL GROUP BY Code pattern Programming for the Web (Year 12)

Groups rows that share a value so aggregate functions (COUNT, SUM, AVG, MIN, MAX) can be applied to each group.

Example: 'SELECT class, COUNT(*) FROM students GROUP BY class;'

Where you would use it in the test
  • SQL: 2025 Q21 and sample Q22a
  • Fill in the blanks: Fill in the blanks or dropdown: choose this term to complete a statement or table.
  • Code reading: Code or algorithm reading: interpret a fragment and state its output or purpose.
  • Multi-select: Multi-select: you tick every correct option, so know all its features or goals.

Related past questions: 2025 HSC Q21 (4 marks): SQL queries; Sample exam Q22a (2 marks): SQL (GROUP BY)

Memorise: SQL vs ORM

SQL aggregate functions (COUNT, SUM, AVG) Code pattern Programming for the Web (Year 12)

Functions that calculate one value from many rows: COUNT (number), SUM (total), AVG (mean), MIN and MAX.

Example: 'SELECT AVG(mark) FROM results;'

Where you would use it in the test
  • SQL: SQL question: write or read it in the SQL query tool.
  • Fill in the blanks: Fill in the blanks or dropdown: choose this term to complete a statement or table.
  • Code reading: Code or algorithm reading: interpret a fragment and state its output or purpose.

Related past questions: 2025 HSC Q21 (4 marks): SQL queries; Sample exam Q22a (2 marks): SQL (GROUP BY)

Memorise: SQL vs ORM

SQL JOIN Code pattern Programming for the Web (Year 12)

Combines rows from two or more tables by matching a primary key to a foreign key (INNER JOIN ... ON a.id = b.id).

Example: 'FROM Student JOIN Class ON Student.ClassID = Class.ClassID'

Where you would use it in the test

Related past questions: Familiarisation Q12b (3 marks): SQL (joins, AS); Sample exam Q17 (3 marks): SQL (join, filter, order); 2025 HSC Q9 (1 mark): ORM and SQL; Familiarisation Q2 (3 marks): SQL

Memorise: SQL vs ORM

SQL alias (AS) Code pattern Programming for the Web (Year 12)

Gives a table or column a temporary name to make queries shorter and clearer: SELECT s.name AS student FROM Student AS s.

Example: 'FROM Student AS s JOIN Class AS c'

Where you would use it in the test
  • SQL: SQL question: write or read it in the SQL query tool.
  • Code reading: Code or algorithm reading: interpret a fragment and state its output or purpose.

Related past questions: Familiarisation Q12b (3 marks): SQL (joins, AS)

Memorise: SQL vs ORM

Check this one: Not found word-for-word in the supplied syllabus, specifications, marking guidelines or notes; the definition is standard computing knowledge, so check it against your class notes.

Primary key and foreign key Code pattern Programming for the Web (Year 12)

A primary key uniquely identifies each record in a table; a foreign key is a field that holds another table's primary key to link the tables.

Example: 'ClassID is the primary key of Class and a foreign key in Student.'

Where you would use it in the test
  • Multiple choice: Multiple choice: pick the option that matches the definition or example.
  • Fill in the blanks: Fill in the blanks or dropdown: choose this term to complete a statement or table.
  • Drawing: ERD
  • SQL: SQL question: write or read it in the SQL query tool.

Related past questions: Familiarisation Q12b (3 marks): SQL (joins, AS); 2025 HSC Q15a (3 marks): Data dictionary

Memorise: SQL vs ORM

CRUD Code pattern Programming for the Web (Year 12)

Create, Read, Update, Delete: the four basic database operations (INSERT, SELECT, UPDATE, DELETE).

Example: "UPDATE Student SET mark = 80 WHERE id = 3"

Where you would use it in the test
  • Multiple choice: Multiple choice: pick the option that matches the definition or example.
  • SQL: SQL question: write or read it in the SQL query tool.
  • Fill in the blanks: Fill in the blanks or dropdown: choose this term to complete a statement or table.

Memorise: SQL vs ORM

Check this one: From the school notes, not named in the syllabus.

SQL statement structure Code pattern Code Patterns: Pseudocode, Python, SQL, CSS (Years 11 and 12)

SELECT fields FROM table WHERE criteria GROUP BY field ORDER BY field ASC or DESC; keyword AS renames a field for display.

Example: 'SELECT Name FROM Games WHERE Cost > 20 ORDER BY Name ASC'

Where you would use it in the test
  • SQL: Write a query (2025 Q21)
  • Code reading: Code or algorithm reading: interpret a fragment and state its output or purpose.
  • Multi-select: Familiarisation Q2

Related past questions: 2025 HSC Q21 (4 marks): SQL queries; Sample exam Q17 (3 marks): SQL (join, filter, order); Familiarisation Q12a (2 marks): SQL; Familiarisation Q12b (3 marks): SQL (joins, AS)

Memorise: SQL: HSC syntax and must-know queries

SQL relational and logical operators Code pattern Code Patterns: Pseudocode, Python, SQL, CSS (Years 11 and 12)

Relational operators: CONTAINS, DOES NOT CONTAIN, EQUALS, NOT EQUAL TO, GREATER THAN (OR EQUAL TO), LESS THAN (OR EQUAL TO). Logical operators: AND, OR, NOT. Put text and dates in quotes.

Example: "WHERE Name CONTAINS 'war' AND Cost < 50"

Where you would use it in the test
  • SQL: SQL question: write or read it in the SQL query tool.
  • Code reading: Code or algorithm reading: interpret a fragment and state its output or purpose.

Related past questions: 2025 HSC Q21 (4 marks): SQL queries

Memorise: SQL: HSC syntax and must-know queries

SQL calculated aggregate with GROUP BY Code pattern Code Patterns: Pseudocode, Python, SQL, CSS (Years 11 and 12)

SELECT Developer, SUM(Cost) AS Totalcost FROM Games GROUP BY Developer ORDER BY Developer DESC.

Example: 'SUM (Games.cost) AS Totalcost'

Where you would use it in the test
  • SQL: SQL question: write or read it in the SQL query tool.
  • Code reading: Code or algorithm reading: interpret a fragment and state its output or purpose.

Related past questions: 2025 HSC Q21 (4 marks): SQL queries; Sample exam Q22a (2 marks): SQL (GROUP BY)

Memorise: SQL: HSC syntax and must-know queries

Construct Command word Command Words and Question-type Skills

Make; build; put together items or arguments.

Example: 'Construct a SQL query.' Answer: build the diagram, query or code with every required feature.

Where you would use it in the test
  • Drawing: Drawing question: draw or label it in the online drawing tool.
  • Python: Python question: write or complete it in the online Python tool.
  • SQL: SQL question: write or read it in the SQL query tool.
  • Pseudocode: Pseudocode question: use it correctly in the exam pseudocode editor.

Related past questions: 2025 HSC Q21 (4 marks): SQL queries; 2025 HSC Q22 (3 marks): Modelling tools

Memorise: NESA key verbs: what each one asks for

SQL questions Process Command Words and Question-type Skills

Use SELECT, FROM, WHERE, GROUP BY, ORDER BY in order; put text in quotes; combine conditions with AND or OR; name the right tables.

Example: 2025 Q21.

Where you would use it in the test
  • SQL: SQL question: write or read it in the SQL query tool.

Related past questions: 2025 HSC Q21 (4 marks): SQL queries

Memorise: Exam day facts, key verbs and technique