Download presentation
Presentation is loading. Please wait.
1
Database Design and Development
Entity Relationships
2
Learning Intention I will learn about entity relationships.
3
Entity Relationships We have already seen a number of relationships between different entities: A vets customers and their pets PS teachers and their pupils Football players and their agents Airline customers and their flights
4
One customer can have many pets.
Entity Relationships An entity-relationship diagram is a graphical representation of the entities in a system. Shows the relationship between two or more entities. e.g a vet surgeries customers and their pets: One customer can have many pets. Customer Pet is the owner of
5
Entity Relationships (cont)
entities description of relationship looks after contracts of Agent Player one-to-many (cardinality) Each agent looks after many players.
6
Cardinality A relationship between two entities can be one of the following: one to one e.g. one jockey rides one horse in a race one to many e.g. one coach teaches many players many to many e.g. many school pupils learn many subjects
7
Entity Relationships (cont)
Draw the entity relationship diagram for the relationship between the following entities. Include the entities, the description of the relationship and the cardinality. Personal Support Teachers and Pupils A Country and its Cities TIME UP 5min min min min min
8
PS Support Teachers and Pupils
registers and teaches PS Teacher Pupil One PS Teacher registers and teaches many pupils.
9
Countries and cities Country City
has within its borders Country City One country has many cities within its borders.
10
Entity Relationship with attributes
Entity relationship diagrams can also be used to show the attributes of each entity: Pet ID Customer ID Forename Pet Name is the owner of Customer Pet Surname Type of Animal Customer ID*
11
Entity Relationship with attributes (cont)
Primary Keys are underlined. Foreign Keys are marked with an asterisk *
12
Entity Relationships with attributes
Draw the entity relationship diagram including attributes for the following entities. Include the entities, the attributes, the description of the relationship and the cardinality. Flights and Customers (see booklet) Footballers and Agents (see booklet) TIME UP 10min min min min min
13
Extension Task Complete the Entity Relationships Extension Task sheet.
14
Success Criteria I can describe and exemplify the entity-relationship diagram between two entities.
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.