TK Study

Software Engineering › Key terms › Y12 Programming for the Web › SQL constraints

SQL constraints

Code pattern Y12 Programming for the Web

Definition

Rules on the data: PRIMARY KEY (unique identifier), FOREIGN KEY (links tables), NOT NULL and UNIQUE; in queries, constraints on results are set with WHERE.

Example: Primary key uniquely identifies each row.

Found in: syllabus, sample exam and familiarisation guidelines, school notes.

Where it is used in the test

Syllabus area: Y12 Programming for the Web.

Question types it can appear in

Where it has appeared in the paper

The Software Engineering Project (Part A). Part letters follow each paper’s own layout.

Related past questions

These are the questions the flashcard set links to this term. Open each one and compare your answer with its marking criteria.

Study links

How to use it in an answer

A model sentence

General advice, built from the definition and example above

Code pattern: “Rules on the data: PRIMARY KEY (unique identifier), FOREIGN KEY (links tables), NOT NULL and UNIQUE; in queries, constraints on results are set with WHERE.” Then apply it: Primary key uniquely identifies each row.

In a short answer, give the definition in your own words first, then tie it to the situation in the question. Do not copy the example above unless it fits the scenario.

Command words used with it

General advice

No linked question shows the command word for this term. Across the past short answer questions in this bank the words used most are: Explain, Outline, Describe, Compare, Classify, Analyse. Check the actual word in your question.

Technique for the question types

What the marking guidelines and feedback say

2025 HSC Q15a (3 marks): Data dictionary

Know the data dictionary columns: Variable, Data type, Format for display, Size in bytes, Size for display, Description, Example, Validation.

Common mistakes

General advice
  • Use the term exactly as the syllabus words it, then link it to the scenario in the question; the 2025 feedback repeatedly rewards using the stimulus.
  • Answer the command word: outline gives main points only, explain gives a reason or cause, discuss gives both sides.

Same group in the syllabus: Shell commands (mkdir, cd, touch, cp, rm, cat, grep) · SQL SELECT · SQL WHERE · SQL ORDER BY · SQL GROUP BY · SQL aggregate functions (COUNT, SUM, AVG) · SQL JOIN · SQL alias (AS) · Primary key and foreign key · Object-relational mapping (ORM) · Service worker · Web app manifest · CRUD

← SQL and non-SQL databasesIn Y12 Programming for the WebSQL GROUP BY →