Entity Relationship Diagrams

11.4.1.6 define the connections between tables in database

11.4.1.7 create an entity-relationship (ER) model

Entity Relationship Diagrams

An Entity Relationship Diagram (ERD) is a graphical illustration of how “entities” relate to each other within a system.  

ERDs for your project will need to show the relationships between your tables in your database.

Three types of an entity-relationship:

Diagram Name Description
One-to-One A Country has only one Capital, and a Capital is in only one Country.
One-to-Many A Biological Mother can have many children, and a child can have only Biological Mother.
Many-to-Many An Author can write several Books, and a Book can be written by several Authors

When linking between two tables, it is common for a field in the first table to link to the primary key of another table. In this case, the field in the first table will be called a foreign key.

Foreign key is a field in one table that is linked to the primary key in another table. 

Scenario

The school holds competitions among Shanyrak/Teams. For each useful action, Shanirak points are scored. The deputy director keeps a record of all the items in the notebook. Counting and identifying all points takes a long time, and there may be errors. Automate the work.

Task:

Define entities for automated system and types of relationships between entities.

Example

 


Questions:

1. What is the usage of ERD?

2. How to draw ERD?

3. Explain what does "One-to-Many" mean?

4. Give examples of relationships "One-to-One", "One-to-Many", "Many-to-Many".

5. Name foreign keys on ERD

Exercises:

Ex. 1:

Ex. 2:

Exam questions:

Категория: Relational databases | Добавил: bzfar77 (03.11.2020)
Просмотров: 212 | Теги: Entity Relationship Diagram, ERD, One-to-One, Many-to-Many, One-to-Many | Рейтинг: 5.0/1
Всего комментариев: 0
avatar