Presentation is loading. Please wait.

Presentation is loading. Please wait.

April 20022CS3X1 Database Design Entity-relationship modelling John Wordsworth Department of Computer Science The University of Reading

Similar presentations


Presentation on theme: "April 20022CS3X1 Database Design Entity-relationship modelling John Wordsworth Department of Computer Science The University of Reading"— Presentation transcript:

1 April 20022CS3X1 Database Design Entity-relationship modelling John Wordsworth Department of Computer Science The University of Reading J.B.Wordsworth@rdg.ac.uk Room 129, Ext 6544

2 April 20022CS3X2 Lecture objectives Identify entities and relationships in informal descriptions. Explain what is meant by the degree and multiplicity of a relationship. Create a simple UML diagram to record entities and relationships. Describe the process of investigating entities and relationships in a domain.

3 April 20022CS3X3 A reminder Entity Entity-set  Entity type Attribute Domain data type Key: superkey, candidate key, foreign key

4 April 20022CS3X4 Weak and strong Strong entity types: arise from obvious sets of real-world objects Weak entity types: arise because they are needed to make a workable database

5 April 20022CS3X5 Relationships  An association between entity types  Example: a person owns zero or more cars, and each car is owned by one person  This is a one-to-many relationship people cars

6 April 20022CS3X6 The Unified Modelling Language Developed for modelling object-oriented relationships. Can be used for entity-relationship diagrams.

7 April 20022CS3X7 An E-R diagram in UML PersonCar Owns age name address regNo make model 1..10..*

8 April 20022CS3X8 Cardinality of relationships The relationship A to B is: 1-1: each A is related to at most one B, (and each B is related to at most one A). 1-M: an A can be related to more than one B, but each B is related to at most one A. M-N: an A can be related to more than one B, and a B can be related to more than one A.

9 April 20022CS3X9 Definitions Degree: number of entity types paticipating in a relationship Binary: people own cars. Ternary: patients are given treatments by consultants. Quaternary: lecturer teaches a class in a lecture theatre at a certain time.

10 April 20022CS3X10 A ternary relationship Seat Performance Booking location {PK} price date {PK} time {PK} piece 1..1 Patron phone {PK} name address ccNum 1..*

11 April 20022CS3X11 Roles Flight Airport DepartsFrom departure destination origin ArrivesAt 0..* 1..1 0..*

12 April 20022CS3X12 Constructing an E-R model Identify the entity types. Identify the key attributes. Identify and draw the relationships, noting degree and cardinality. Identify the non-key attributes of the entitites.

13 April 20022CS3X13 Key points E-R models give an abstract view of an enterprise's data. Entities have attributes, some of which make up a primary key. Relationships are associations between entities, of various degrees and multiplicities. There is a simple (iterative) method of investigating an enterprise's entities and relationships.


Download ppt "April 20022CS3X1 Database Design Entity-relationship modelling John Wordsworth Department of Computer Science The University of Reading"

Similar presentations


Ads by Google