Lecture 2 - Models
Lecture 2 - Models
Entity-Relationship model
Relational model
Entity-Relationship model
Preview
• What is an ER Diagram
• What is an ER Model
• History of ER models
• Why Use ER Diagrams in DBMS
• Symbols Used in ER Diagrams
• Components of ER Diagram
• How to Draw an ER Diagram
• Conclusion
What is an ER Diagram ?
Domain constraints specify that within each tuple, and the value of
each attribute must be unique. This is specified as data types which
include standard data types integers, real numbers, characters,
Booleans, variable length strings, etc.
Key Constraints
An attribute that can uniquely identify a tuple in a relation is called
the key of the table. The value of the attribute for different tuples in
the relation has to be unique. Example:
In the given table, CustomerID is a key attribute of Customer Table. It is most
likely to have a single key for one customer, CustomerID =1 is only for the
CustomerName =” Google”.
CustomerID CustomerName Status
1 Google Active
2 Amazon Active
3 Apple Inactive
Referential Integrity Constraints
• The insert operation gives values of the attribute for a new tuple which
should be inserted into a relation.
Update Operation
The Delete operation could violate referential integrity if the tuple which is
deleted is referenced by foreign keys from other tuples in the same database.
Select Operation