170 likes | 277 Views
An Entity Relationship Diagram (ERD) is a visual representation used to illustrate the relationships between entities in a database. ERDs utilize specific symbols: boxes represent entities, diamonds depict relationships, and ovals indicate attributes. There are three primary types of relationships: one-to-one, where each record in a table corresponds to exactly one record in another; one-to-many, where one record links to multiple records; and many-to-many, where multiple records relate to multiple counterparts. These diagrams are essential for effective database design and management.
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.