390 likes | 528 Views
ECIS466: Database Management Systems. Class 2. Data Modeling. Entity-Relationship Diagrams. Traditional Systems Development Lifecycle. Planning. Analysis. Logical Design. Physical Design. Implementation. Traditional Systems Development Lifecycle. Planning. Analysis. Logical
E N D
ECIS466: Database Management Systems Class 2 Data Modeling Entity-Relationship Diagrams
Traditional Systems Development Lifecycle Planning Analysis Logical Design Physical Design Implementation
Traditional Systems Development Lifecycle Planning Analysis Logical Design Physical Design Implementation
The Analysis Stage • Requirements Determination • Requirements Structuring • Process Modeling (Data Flow Diagrams) • Logic Modeling (structured English) • Conceptual Modeling (ER Diagrams) • Alternative Generation
Man is a knot, a web, a mesh into which relationships are tied. Only those relationships matter.- Saint-Exupery in Flight to Arras
E-R Models • Type of conceptual data model • Most common tool for user-designer communication(Analysis Phase) • Easy, good CASE-support, natural way to model a user’s reality • Expressed in terms of entities, relationships, and attributes • Expressed graphically using E-R diagrams
Major Terminology • Entities • person, place, object, event, or concept in the user environment about which the organization wishes to maintain data • usually a noun • instance of entity Vs. entity class • example of class = CUSTOMER • example of instance = “Bob Knight”
Attributes • Also called properties • Describe entity characteristics • Examples for the entity class CUSTOMER • Custname • Custnumber • Address • All entity instances share same attributes
Identifiers • Each instance has unique identifying attribute(s). • Examples • Custnumber (for CUSTOMER) • SSN# (for STUDENT) • FacName and FacOffice (for FACULTY)
Relationships • Association between entities • A relationship can include many entities (degree of relationship) • Most relationships are binary
Relationships • Association between entities • A relationship can include many entities (degree of relationship) • Most relationships are binary • Represented as Team • Player
Unary Relationships • Also calledrecursive relationships • Relationships between instances of single entity class
Unary Relationships • Also calledrecursive relationships • Relationships between instances of single entity class is married to Person
Binary Relationships • Between instances of two entity classes • Most common relationship • Also referred to as HAS-A relationships
Binary Relationships • Between instances of two entity classes • Most common relationship • Also referred to as HAS-A relationships Order Salesperson
Ternary Relationships • Involves three entities • Relationship must be simultaneous • Different from three separate binary relationships
Ternary Relationships • Involves three entities • Relationship must be simultaneous • Different from three separate binary relationships Parts Warehouse Vendors ships
Cardinality • The number of instances of Entity B that can (or must be) associated with each instance of Entity A • Types • Maximum cardinality • Minimum cardinality
Cardinality • The number of instances of Entity B that can (or must be) associated with each instance of Entity A • Types • Maximum cardinality • Minimum cardinality Entity A Entity B
Three Binary Relationships • One-to-one (1:1) • One-to-many (1:N) • Many-to-many (N:M)
One-to-One Relationships • Each instance of Entity B matches to one instance of Entity A.
One-to-One Relationships • Each instance of Entity B matches to one instance of Entity A. Professor Office 1:1
One-to-One Relationships • Each instance of Entity B matches to one instance of Entity A. Professor Office 1:1 1:1 Employee Parking Space
One-to-Many Relationships • Each instance of Entity A matches to many instances of Entity B
One-to-Many Relationships • Each instance of Entity A matches to many instances of Entity B Student 1:N Academic Advisor
One-to-Many Relationships • Each instance of Entity A matches to many instances of Entity B Student 1:N AcademicAdvisor Employees Department 1:N
Many-to-Many Relationships • Each instance of Entity A matches to many instances of Entity B and each instance of Entity B matches to many instances of Entity A
Many-to-Many Relationships • Each instance of Entity A matches to many instances of Entity B and each instance of Entity B matches to many instances of Entity A N:M Student Course
Many-to-Many Relationships • Each instance of Entity A matches to many instances of Entity B and each instance of Entity B matches to many instances of Entity A N:M Student Course N:M Actor Movie
Other Representations 1:1 Office Professor 1:N Department Employee N:M Movie Actor
Minimum Cardinality • The minimum number of instances of Entity B that may be associated with each instance of Entity A. Customer Order Student Dormitory
Generalization • Some entities are subtypes of other, more general entities • Also called IS-A relationships Employee Consultant Hourly Salaried
Exclusive relationship • Subtypes of supertype are mutually exclusive Teacher Part-time Full-time
Non-Exclusive Relationship • Subtypes may overlap Client Personal Computers Client- Server Mainframe
Inheritance • Property by which all the attributes of the supertype are inherited by each subtype • Example • STUDENT: SSUID, Name, Address, Phone, Email • GA: SSUID, Name, Faculty, Email, Address, Phone • UGA: SSUAID, Name, Location, Supervisor, Email, Phone, Address
STUDENT: SSUID, Name, Address, Phone, Email • GA: SSUID, Faculty • UGA:SSUID, Location, Supervisor Name Phone Address Email AUID Student AUID AUID Location UGA GA Supervisor Faculty
Multivalued Attributes • Can have more than one value for each entity instance Employee SKILL EmpNo Name
Quick Recap • Entities • Attributes • Relationships • unary • binary • ternary • Cardinality • maximum • minimum • Generalization • exclusive • non-exclusive • Inheritance