TK Study

Software Engineering › How to answer › Drawing › an entity relationship diagram (ERD)

How to draw an entity relationship diagram (ERD)

Low priority Your school course says the ERD is “technically not in your syllabus” and the course specification has no ERD symbols. Learn it last, but know primary and foreign keys, which are in the course. From course notes

What it looks like in the real exam

Reasoned No ERD question appears in the 2025 NESA papers in our bank. The school’s grid gives it about 4 marks (target band 4–5). Primary and foreign keys appear in the SQL join questions (2025 NESA sample exam, Q17, 2025 NESA familiarisation exam, Q12B).

From course notes Course grid: ERD is worth about 4 marks in the school’s exam-style grid (target band 4–5).

Notation

ItemHow to draw it
Entity (table)A box with the table name at the top, fields below
Primary keyMark the unique field PK (or underline)
Foreign keyMark the field that holds another table’s key FK
RelationshipA line between boxes, labelled with a verb; the “many” end shows a crow’s foot (three prongs)
One-to-manyCrow’s foot on the many side; the foreign key is stored on the many side

Reasoned The crow’s foot is the most common ERD convention, not text from the course specification. If your school taught a different notation (for example “1” and “M” at the ends of the line), use that.

Method

  1. List the entities (nouns) in the scenario: Customer, Order, Product. General advice
  2. List the fields for each and choose a primary key (an ID that is unique). From course notes
  3. Decide each relationship: one Customer places many Orders (one-to-many). General advice
  4. Put the foreign key on the “many” side: Order stores CustID. From course notes
  5. Many-to-many? Add a link table (here Order links Customer and Product). General advice
  6. Draw boxes, lines, crow’s feet, and mark PK and FK. Label the lines. General advice

Worked example: customers, orders and products (original)

CustomerCustID (PK)CustNameEmailOrderOrderID (PK)CustID (FK)ProductID (FK)QuantityProductProductID (PK)ProductNamePriceplacesis ordered inOne Customer places many Orders. One Product appears in many Orders. The foreign key goes on the MANY side.Crow’s foot = many. Double bar = exactly one. Circle = zero (optional). PK = primary key, FK = foreign key.
Entity relationship diagram with crow’s foot notation: Customer one-to-many Order, Product one-to-many Order, with primary and foreign keys marked

Original practice The foreign keys CustID and ProductID in Order are what an SQL join uses: FROM Customer, Order WHERE Customer.CustID = Order.CustID.

Markers’ checklist

  • Every entity is a box with a name and its fields.
  • Each table has a primary key marked.
  • Foreign keys are marked and sit on the many side.
  • Each relationship line is labelled and shows one or many at both ends.
  • Entities and fields match the scenario.

Common mistakes

  • General advice Putting the foreign key on the “one” side.
  • General advice Forgetting to mark keys.
  • General advice Many-to-many drawn directly between two tables with no link table.

Time per mark

Derived The paper averages 1.75 minutes per mark (140 minutes ÷ 80 marks), so a 4-mark drawing question is about 7 minutes in total. General advice Suggested split: 1 minute reading and planning, most of the time drawing, and the last minute checking labels against the checklist. Drawing in an online tool is slower than on paper, so practise with the tool on NESA’s familiarisation site.

Practice (3 prompts, with answers)

Item 1 · school

Entities Student, Class. A class has many students; a student is in one class. Where does the foreign key go?

Show the answer

In Student (ClassID, FK), because Student is the “many” side. Original practice (matches the course example: ClassID is the primary key of Class and a foreign key in Student).

Item 2 · many-to-many

Students can enrol in many subjects and subjects have many students. Show it.

Show the answer

Add a table Enrolment (StudentID FK, SubjectID FK). Student 1–many Enrolment, Subject 1–many Enrolment. Original practice

Item 3 · draw

A shop has Customers who place Orders. Draw the ERD with fields.

Show the answer

Customer (CustID PK, Name, Email); Order (OrderID PK, CustID FK, Date); a line labelled “places”, crow’s foot at Order. Original practice

← How to draw and simplify a decision treeHow to draw a storyboard →