Easier to read with cream paper, a tint, more contrast or larger text? Choose your colours and text, once, for every page.

Preview

DA 3.7: Conceptual, logical and physical models

This is the first page of the lesson. Read it and have a go at the activities. The rest is in the full lesson.

60 minutes

Plan the house before the bricks

Nobody builds a house by laying bricks and hoping. First comes a sketch of the rooms. Then a plan with sizes. Last comes the real building.

A data system is built the same way. Today we plan a made-up bike hire scheme in three steps.

Key words

WordWhat it meansExample
Data modelA plan that shows what data a system holds and how the parts connect.A diagram of customers, bikes and hires
EntityA thing the business keeps data about.Customer, Bike, Hire
AttributeOne fact about an entity.A customer name
RelationshipHow two entities connect.A customer makes many hires
Conceptual modelThe big picture: entities and relationships, no technical detail.Boxes and lines
Logical modelThe same picture with attributes, keys and data types.Customer has an id and a name
Physical modelThe model built for a real tool, with exact types and rules.A create table statement
Primary keyA column whose value is different in every row.customer_id
Foreign keyA column that holds the primary key of a row in another table.customer_id inside hire
DatabaseA store of organised data, kept in tables.The hire tables
Data typeThe kind of value a column holds, such as whole number, text or date.Integer, text, date

The cells students fill in are left blank in this preview.

By the end of this lesson

Note

I can tell the three kinds of data model apart, say what each shows, and read a simple entity relationship diagram.

Starter: what you already know

Have a go

Starter: what you already know

3 questions
Have a go: your answers are marked here and then forgotten. Sign in if you would like your score kept, and to pick up where you left off.Sign in to keep your score

Your answers are marked here and are not kept. A college account keeps every student’s marks.

Why model first

A data model gives people a shared picture before any system exists. The customer, the analyst and the builder can all point at it and say "that is wrong".

Changing a drawing costs minutes. Changing a built system costs weeks. So we move from the broad picture to the detail in three levels.

Worked example: three levels compared

LevelWhat it showsWho it is forBike hire example
ConceptualEntities and how they relate. Attributes at most named in wordsBusiness peopleCustomer, Bike and Hire, joined by lines
LogicalAttributes, keys and data types, but no tool chosenAnalysts and designersHire has a hire_id key and two foreign keys
PhysicalThe model built for one tool, with exact types and rulesBuildersA create table statement for a database

The cells students fill in are left blank in this preview.

Check: read the big picture

Have a go

Check: read the big picture

3 questions
Have a go: your answers are marked here and then forgotten. Sign in if you would like your score kept, and to pick up where you left off.Sign in to keep your score

Your answers are marked here and are not kept. A college account keeps every student’s marks.

The lesson goes on

9 more parts of this lesson are in the full curriculum, with the tasks, the final check and the labs. A college account gives your students all of it.