Naming columns, primary keys and foreign keys
A key column name in lowercase with an _id suffix. A primary key uses it in its own table, and a foreign key reuses the exact same name in a related table.
Understanding Naming columns, primary keys and foreign keys in VCE Spreadsheets, SQL & Visualisation
What it does: The primary key column is named student_id in its own table, using the _id suffix. The foreign key column has exactly the same name as the primary key it points to, so the link between the tables is easy to see. Key names should be descriptive and end in _id, so student_id tells you exactly what the column holds. Pick one style, such as lowercase with underscores, and use it for every column in the database. A short descriptive name with an _id suffix, like book_id, is clear and consistent. Column names must follow one style throughout. Mixing capitals, spaces and hyphens makes the names inconsistent and harder to use in queries.
Common mistakes: Column names must follow one style. The others use lowercase snake_case, so YearLevel should be year_level. A foreign key reuses the exact name of the primary key it points to. It should be student_id, not stu_id.
Free printable worksheet with full answer key — or add this module to a class and your students practise it interactively.
This module's key terms are also in a printable crossword (Modules 35–44) and word search (Modules 35–54).
Take this worksheet further — free with Cloodit
Each concept is reinforced from every angle — learned, then applied, then tested.
Cloodit turns curriculum-aligned coding content into journeys students work through one biome at a time.
Over 100 of them, across seven natural biomes.
Turns their work into revision material ready for Flash Cards and Exam study.
Live, competitive practice for the start of the lesson or a teacher-led lesson finisher.
Honour your top performers, or encourage a student who's trying hard — ready to print in seconds.
Quick Questions
Match the Pairs
Key Term
student_idFill in the Blanks
Spot the Error
Student with a class code? Join your class →