DBMS Lecture 02 ER Diagram
DBMS Lecture 02 ER Diagram
DBMS Lecture 02 ER Diagram
1) Stephens, R.K. and Plew. R.R., 2001. Database Design. SAMS, Indianapolis , IN.
Attribute
• “An attribute is a sub-group of information
within an entity.”
1) Stephens, R.K. and Plew. R.R., 2001. Database Design. SAMS, Indianapolis , IN.
Entity Relationship Models
Schema
Database!!!!!
name
ER Model Basics ssn DoB
Employees
De
pe
nd
en
cy
Employee
Attribute
Age
Student
Skill Address
Street House
Zip
Classification
• Simple Attribute:
• Combined of only one attribute. E.g. ID
• Complex Attribute:
• Combined of more than one attribute
– Example: Address
WEAK Entity & WEAK Relationship
• For converting ER to Relational Schema,
Weak entity will accept the primary key of strong
entity.
We need not to convert the weak relationship into
table.
name
since Employees
name dname
super-
ssn DoB did budget visor subor-
dinate
Reports_To
Employees Works_In Departments
• Relationship: Association among two or more entities. E.g., Peter works in Pharmacy
department.
• Schema
• Employee(ssn, name, DoB)
• Department(did, dname, budget)
• Works_in(since, ssn, did )
Key Constraints (Cardinality)
since
• . name dname
ssn lot did budget