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
- Multiple choice: Pick the option that matches the definition or example.
- Fill in the blanks: Choose this term to complete a statement or table.
- Short answer: Define, outline or explain it and tie it to the scenario.
Where it has appeared in the paper
The Software Engineering Project (Part A). Part letters follow each paper’s own layout.
Related past questions
- 2025 HSC Q15a (3 marks): Data dictionary The Software Engineering Project (Part A) · 3 marks
These are the questions the flashcard set links to this term. Open each one and compare your answer with its marking criteria.
Study links
- Flashcard: SQL constraints in Programming for the Web (Year 12) · study that set
- Memorise: SQL vs ORM
How to use it in an answer
A model sentence
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
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
- Multiple choice: Read all four options, rule out wrong ones, pick one; no penalty for guessing so never leave blank.
- Fill in the blanks: Choose the right word from a list; use exact syllabus terms.
- Short answer: One clear point per mark, use the stimulus and course terms, and answer the command word.
What the marking guidelines and feedback say
Know the data dictionary columns: Variable, Data type, Format for display, Size in bytes, Size for display, Description, Example, Validation.
Common mistakes
- 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.
Related terms
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