Download presentation
Presentation is loading. Please wait.
Published byBertha Peters Modified over 8 years ago
2
Teanna Clarke 6aQ
3
What is a Entity-Relationship Diagram? An Entity-Relationship Diagram (ERD) is a tool that graphically shows the connections among entities in a system. An Entity is an object in the system that has data.
4
An Entity-Relationship Diagram shows all the entities (organizations, departments, users, programs and data) that play roles in the system.
5
Entities are the "things" about which we seek information.
6
Attributes are the data we collect about the entities.
7
Relationships provide the structure needed to draw information from multiple entities.
8
A's relationship to B in the diagram above shown is that of a one to one relationship between the two tables. Specifically this means that for every row in table A there is one and only one corresponding row in table B. This requires that the number of rows in A must be the same as the number of rows in B.
9
C's relationship to D shown above is much more common, and will help to understand the bidirectional nature of this notation. Simply put, the symbol is to be interpreted that every row of D is uniquely related to specific row of C, while every row of C is related to at most one row of D.
10
This notation reads that a given row of E is related to one or more rows in F. To accomplish this, particular values of some foreign key in F, which is also the primary key of E, might be duplicated one or more times.
11
G:H shows the situation where a row of G corresponds to no row in H. This reads that rows of G are associated with zero or more rows of H.
13
One-to-one Relationship In a one-to one relationship, each record in Table A can have only one matching record in Table B and vice versa. A one-to-one relationship is created if both of the related fields are primary keys or unique indexes.
14
This type of relationship is not common, because most information related in this way would be one table. For example, A manager manages one department; a department has only one manager.
15
One-to-many Relationships In a one-to-many relationship, a record in Table A can have many matching records in Table B, but a record in Table B has only one matching record in Table A. A one-to-many relationship is created only if one of the related fields is a primary key or has a unique index.
16
A one-to-many relationship is the most common type of relationship. For example, one supplier can supply more than one product; but each product has only one product.
17
Many-to-many Relationships In a many-to-many relationship, a record in Table A can have many matching records in Table B, and vice versa. This type of relationship is only possible by defining a third table (called a junction or join table ) whose primary key consists of two fields- the foreign keys from both Tables A and B.
18
A many-to-many relationship is really two one- to-many relationships with a third table. For example, an Orders table and a Products table have a many-to-many, that is defined by creating two one-to-many relationships to the Orders Details table. One order can have many products, and each product can appear on many orders.
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.