Download presentation
Presentation is loading. Please wait.
Published byAllison Robertson Modified over 6 years ago
1
Entity Relationship Diagram Prepared by: Lobna Morsy
(ERD) Prepared by: Lobna Morsy Suppliers #supplier_code supplier_name Products #product_id product_name product_price Customer_Orders_Products #order_line_id quantity Customer_Orders # order_id date_order_placed discount_rate Customers #customer_id first_name middle_name last_name Customer_Addresses #address_id street_address city state_province_county country Customers_Payment _Methods # card_number date_from date_to Product_Types #product_type_code product_type_name Payment_Methods #payment_ method_code payment_ method_name supply supplied by belongs to has places placed by ordered include includes included in chosen chooses belongs to owns owned
2
Agenda Database Components of ERD Practice Reading ERDs
3
What is a database? Database: Central source of data meant to be shared by many users for a variety of applications
4
Components on an ERD Entities (table) Relationships (business rules)
Attributes (column) Entity Name verb Entity Name #attribute_1 attribute_2 attribute_3
5
Entities Entity Name Entity: Something about which someone chooses to collect data (table) Person Place Thing Event Unit of time Customers Cinemas Tickets Purchases Show times
6
Relationships verb Relationships: Associations between entities (business rules) Optionality Mandatory Optional verb One Many Cardinality
7
Relationships verb Cardinality One Many Optionality Optional Mandatory
8
Reading Relationships
Employees Tasks belong to assigned to entity_name one and only one/many verb may/must entity_name Each Each entity_name may/must verb one and only one/many entity_name Each task must belong to one and only one employee Each employee may be assigned to many tasks
9
Examples of Relationships
Each entity_name may/must verb one and only one/many entity_name Instructors Courses teach taught by Employees Offices assigned to assigned for Suppliers Products supply supplied by
10
Attributes Entity Name #attribute_1 attribute_2 attribute_3 Attribute: some characteristics of an entity (column) Primary key: used to uniquely identify a record. Suppliers #supplier_code supplier_name contact_person contact_person_phone
11
Customer_Orders_Products
Suppliers #supplier_code supplier_name Products #product_id product_name product_price Customer_Orders_Products #order_line_id quantity Customer_Orders # order_id date_order_placed discount_rate Customers #customer_id first_name middle_name last_name Customer_Addresses #address_id street_address city state_province_county country Customers_Payment _Methods # card_number date_from date_to Product_Types #product_type_code product_type_name Payment_Methods #payment_ method_code payment_ method_name supply supplied by belongs to has places placed by ordered include includes included in chosen chooses belongs to owns owned
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.