170 likes | 270 Views
What is an Entity R elationship Diagram?. An Entity R elationship D iagram is a graphic that is speacialized to illustrate or give examples of the inter –relationships between entities in a database. What are the symbols used in E ntity Relationship D iagrams?.
E N D
An Entity Relationship Diagram is a graphic that is speacialized to illustrate or give examples of the inter –relationships between entities in a database.
Entity relationship diagrams often use symbols to represent three different types of information • Boxes –are commonly used to represent entities. • Diamonds-are normally used to represent relationships. • Ovals-are used to represent attributes.
One-one relationship occurs when there is exactly one record in the first table
If a database table contains a few columns of data that is frequently used and the remaining columns being infrequently used, the database designer may split the single table into 2 tables linked through a one-to-one relationship. Such a design would reduce the overhead needed to retrieve the infrequently used columns whenever query is performed on the contents of the database table.
One –many Relationships occurs when each record in a table labelled “A” have many linked records in a table labelled “B” which has only one corresponding recording in Table A
All the customers belonging to a business is stored in a customer table while all the customer invoices are stored in an invoice table. Each customer can have many invoices but each invoice can only be generated for a single customer.
Many-many relationship is when one record in either table can relate to many records in the other table .
All the customers belonging to a bank is stored in a customer table while all the bank's products are stored in a product table. Each customer can have many products and each product can be assigned to many customers.