Download - data base management system
![Page 1: data base management system](https://reader036.vdocuments.mx/reader036/viewer/2022081412/5461b696af79595d448b6426/html5/thumbnails/1.jpg)
Database Management Entity – Relationship (ER) Diagram
Prof. Sridhar Vaithianathan
![Page 2: data base management system](https://reader036.vdocuments.mx/reader036/viewer/2022081412/5461b696af79595d448b6426/html5/thumbnails/2.jpg)
DATA MODELING
A Data Model is a map or diagram that represents entities and their relationships.
![Page 3: data base management system](https://reader036.vdocuments.mx/reader036/viewer/2022081412/5461b696af79595d448b6426/html5/thumbnails/3.jpg)
![Page 4: data base management system](https://reader036.vdocuments.mx/reader036/viewer/2022081412/5461b696af79595d448b6426/html5/thumbnails/4.jpg)
![Page 5: data base management system](https://reader036.vdocuments.mx/reader036/viewer/2022081412/5461b696af79595d448b6426/html5/thumbnails/5.jpg)
![Page 6: data base management system](https://reader036.vdocuments.mx/reader036/viewer/2022081412/5461b696af79595d448b6426/html5/thumbnails/6.jpg)
![Page 7: data base management system](https://reader036.vdocuments.mx/reader036/viewer/2022081412/5461b696af79595d448b6426/html5/thumbnails/7.jpg)
Some Definitions
A File/Entity/Table: A group or collection of similar records
A record / Tuple: one piece of data, i.e., one student's information, a recipe, a test question.
Records = rows A field/Attributes: one category of information,
i.e., Name, Address, Semester Grade, Academic topic
(Fields = columns)
![Page 8: data base management system](https://reader036.vdocuments.mx/reader036/viewer/2022081412/5461b696af79595d448b6426/html5/thumbnails/8.jpg)
ER Diagram - Example
![Page 9: data base management system](https://reader036.vdocuments.mx/reader036/viewer/2022081412/5461b696af79595d448b6426/html5/thumbnails/9.jpg)
![Page 10: data base management system](https://reader036.vdocuments.mx/reader036/viewer/2022081412/5461b696af79595d448b6426/html5/thumbnails/10.jpg)
![Page 11: data base management system](https://reader036.vdocuments.mx/reader036/viewer/2022081412/5461b696af79595d448b6426/html5/thumbnails/11.jpg)
![Page 12: data base management system](https://reader036.vdocuments.mx/reader036/viewer/2022081412/5461b696af79595d448b6426/html5/thumbnails/12.jpg)
![Page 13: data base management system](https://reader036.vdocuments.mx/reader036/viewer/2022081412/5461b696af79595d448b6426/html5/thumbnails/13.jpg)
![Page 14: data base management system](https://reader036.vdocuments.mx/reader036/viewer/2022081412/5461b696af79595d448b6426/html5/thumbnails/14.jpg)
![Page 15: data base management system](https://reader036.vdocuments.mx/reader036/viewer/2022081412/5461b696af79595d448b6426/html5/thumbnails/15.jpg)
![Page 16: data base management system](https://reader036.vdocuments.mx/reader036/viewer/2022081412/5461b696af79595d448b6426/html5/thumbnails/16.jpg)
CARDINALITY AND MODALITY
![Page 17: data base management system](https://reader036.vdocuments.mx/reader036/viewer/2022081412/5461b696af79595d448b6426/html5/thumbnails/17.jpg)
Entity Relationship Diagram - Notation
Entitiy
Relationship
Associated Object
Mandatory (Exactly) One
Optional (Zero or one) One
Mandatory Many
Optional Many
Optional
Mandatory
![Page 18: data base management system](https://reader036.vdocuments.mx/reader036/viewer/2022081412/5461b696af79595d448b6426/html5/thumbnails/18.jpg)
E – R Diagram Example
Basket Ball Game
Entities:
Home Stadium
Team
Player
Games
![Page 19: data base management system](https://reader036.vdocuments.mx/reader036/viewer/2022081412/5461b696af79595d448b6426/html5/thumbnails/19.jpg)
ER – Diagram Example – Basket Ball Game
HOME STADIUM TEAM
PLAYER
Has
Has
GAME
Participates
Has
![Page 20: data base management system](https://reader036.vdocuments.mx/reader036/viewer/2022081412/5461b696af79595d448b6426/html5/thumbnails/20.jpg)
Entities, Attributes and Relationship Strong Entity Vs Weak entity ( EMPLOYEE &
DEPENDENT) Simple Vs Composite Attributes Single Valued Vs Multi Valued Attributes Stored Vs Derived Attributes Identifier Attribute – Primary Key Composite Identifier Foreign Key Sub-Type Vs Super Type Relationship
![Page 21: data base management system](https://reader036.vdocuments.mx/reader036/viewer/2022081412/5461b696af79595d448b6426/html5/thumbnails/21.jpg)
Database Associations ExampleHOME STADIUM
Stadium Id Stadium Name, Capacity, Location
TEAM
Team Id Team Name
PLAYER
Player Id Player Name, Position
GAME
Team id(1) Team id(2) Date Final Score
BASKET BALL GAME
![Page 22: data base management system](https://reader036.vdocuments.mx/reader036/viewer/2022081412/5461b696af79595d448b6426/html5/thumbnails/22.jpg)
Relationship Example Instructions
One-to-One.
TEAMTeam Id Team Name, Stadium Id
Each team has only one home stadium, and each home stadium has only one team.
STADIUM and TEAM
Place the primary key from one entity to other entity as a foreign key and vice versa.(i.e. foreign key can be placed at either side of the relationship.)
One-to-Many
PLAYERPlayer Id Player Name, Position, Team Id
Each player is on only one team, but each team has many players.
PLAYER and TEAM
Place the primary key from the entity on the one side of the relationship as a foreign key in the table for the entity on the many side of the relationship
Many-to-Many
PLAYER STATISTICS
Team id(1), Team id(2), Date, Player Id Points
Each player participates in many games and each game has many players.
PLAYER and GAME
Create a third entity/table and place the primary keys from each of the original entities together in the third table as a combination primary key
DATABASE ASSOCIATIONS …
![Page 23: data base management system](https://reader036.vdocuments.mx/reader036/viewer/2022081412/5461b696af79595d448b6426/html5/thumbnails/23.jpg)
ER – Diagram : Basket Ball Game
HOME STADIUM TEAM
GAME STATISTICS
PLAYER
GAME
Has
Partici-pates Has
Has
Has
![Page 24: data base management system](https://reader036.vdocuments.mx/reader036/viewer/2022081412/5461b696af79595d448b6426/html5/thumbnails/24.jpg)
ERD Development Process
Identify the entities Determine the attributes for each entity Select the primary key for each entity Establish the relationships between the
entities Draw an entity model Test the relationships and the keys
![Page 25: data base management system](https://reader036.vdocuments.mx/reader036/viewer/2022081412/5461b696af79595d448b6426/html5/thumbnails/25.jpg)
THANKS
THANKS
THANKS
THANKS
THANKS