Download presentation
Presentation is loading. Please wait.
Published byLucy Barber Modified over 9 years ago
1
Conceptual Design Lecture - 2 Database Development
2
At the end of this lecture You will be able to identify and represent on a diagram: –a strong entity –a weak entity –three association types –a recursive relationship –a unique identifier –an optional relationship –a required relationship from a given description.
3
Basic constructs of the Entity Relationship Model Entity Representation of an Entity on an ER diagram is: –a box with square corners –labelled with the entity name. Note – the entity name is always singular Student
4
Basic constructs of the Entity Relationship Model Entity types An Entity may be classified as either a weak entity or a strong entity
5
Basic constructs of the Entity Relationship Model Weak Entity Representation of a Weak Entity on an ER diagram is: –a box with rounded corners –labelled with the entity name (singular) NextOfKin
6
Basic constructs of the Entity Relationship Model Strong Entity By default an entity which is not a weak entity is a strong entity. Student
7
The ER Model Description An order may only be placed with a supplier who has been validated by the company. Two possible entities from the description are –Order –Supplier
8
The ER Model What kind of entity is an Order? –Weak entity? –Strong entity? What kind of entity is an Supplier? –Weak entity? –Strong entity?
9
The ER Model What kind of entity is an Order? –A Weak entity! What kind of entity is an Supplier? –Strong entity! Supplier Order
10
ER Model Relationship Types Relationships we will use. One to One One to Many Many to Many Inheritance
11
ER Model Relationship Types One to One –An employee is allocated a single parking space, a parking space belongs to only one employee. 1:1 Employee ParkingSpace
12
ER Model Relationship Types One to Many –A department has many employees assigned to it, each employee is assigned to only one department. 1:M Department Employee
13
ER Model Relationship Types Many to Many –An employee attends many staff development sessions, each staff development session is attended by many employees. N:M StaffDevSess Employee
14
ER Model Relationship Types Many to Many –An employee attends many staff development sessions, each staff development session is attended by many employees. N:M StaffDevSess Employee
15
ER Model Relationship Types Inheritance –A technician is a kind of employee about whom we wish to record, in addition to his other attributes, his highest technical qualification. Technician Employee
16
ER Model Relationship Existence In Object Oriented Software Development you could show if an association was optional or required as follows. Optional related class instance was shown as 0..* –An association between an instance of one class with Zero or more related instances from another class
17
ER Model Relationship Existence Required related class instance was shown as 1..* –An association between a minimum of one or more related class instances. In ER diagrams you do not use the same notation
18
ER Model Relationship Existence In the ER model optional association existence is shown as. An employee may be a member of one of the works football teams. 1:M FootballTeam Employee
19
ER Model Relationship Existence In the ER model mandatory association existence is shown as. An employee must be a member of one of the unions recognised by the company. 1:M Union Employee
20
ER Model Relationship Recursive relationship. An employee may also be a manager. A number of employees are managed by a single manager Employee 1:M Employee Manager
21
Attributes What is an attribute? An attribute is a piece of information about the object or event that we wish to store in our database. It can be said to describe the object. An example of some possible attributes for Employee could be EmployeeID, EmpFirstName, EmpSurname
22
Attributes
23
ER Model Representation of Attributes Only attributes which uniquely identify an entity will be represented on your ER diagram. A key attribute may be represented as follows Employee EmployeeID
24
ER Model Representation of Attributes What about other attributes? –These will be put on a diagram script. More about this next week.
25
ER Diagram Summary How to represent –an Entity. –an Association –Inheritance –Recursive Relationship –Key Field
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.