Presentation is loading. Please wait.

Presentation is loading. Please wait.

Week 2 Lab2 ER Diagram Dina A. Said

Similar presentations


Presentation on theme: "Week 2 Lab2 ER Diagram Dina A. Said"— Presentation transcript:

1 Week 2 Lab2 ER Diagram Dina A. Said dasaid@ucalgary.ca

2 Entity-Relations (ER) Diagram  illustrates the interrelationships between entities in a database. 4/08/2009CPSC203-DesignSkills- Week2- Lab22 Product -Product ID -Product Name -Description -Supplier -Supplier ID -Supplier Name -Phone -Address Orders -Product ID -Supplier ID -Shipment Date -Quantity -Price per unit

3 Example: DVD rental Store System 4/08/2009CPSC203-DesignSkills- Week2- Lab23

4 Case Study  Consider an appointment system in a clinic, where a patient can request to make an appointment to see a certain doctor at a specific time. Additionally, a doctor can use that system to record the timings where he would be available to see his patients.  Upon reserving an appointment, the receptionist has to make sure that the doctor speaks a language that the patient knows.  If the patient requests a specific device to be in the clinic, the receptionist should make sure that this device is available in the clinic to be reserved  Also, the receptionist should print information of the reserved appointment including the date, time, and clinic location 4/08/2009CPSC203-DesignSkills- Week2- Lab24

5 4/08/2009CPSC203-DesignSkills- Week2- Lab25 Patients -Patient ID -Name -Address -Phone -Sex -Birth Date -Language ID Doctors -Doctor ID -Name -Address -Phone -Sex -Birth Date -Certificates -Specialist -Salary -Language ID Language -Language ID -Language Available Times -Doctor ID -Date -Start Time -End Time Appointments -Patient ID -Doctor ID -Date -Start time -End time -Charges -Paid/Not Paid -Clinic ID Clinics -Clinic ID -Location -Available Devices

6 4/08/2009CPSC203-DesignSkills- Week2- Lab26 Clinics -Clinic ID -Location -Available Devices Clinics -Clinic ID -Location Devices -Device ID -Device Name -Description -Clinic ID This is because every device exists in only one clinic but clinics may have multiple devices

7 What if the doctor speaks more than one language? 4/08/2009CPSC203-DesignSkills- Week2- Lab27 Doctors -Doctor ID -Name -Address -Phone -Sex -Birth Date -Certificates -Specialist -Salary -Language ID Language -Language ID -Language

8 4/08/2009CPSC203-DesignSkills- Week2- Lab28 Doctors -Doctor ID -Name -Address -Phone -Sex -Birth Date -Certificates -Specialist -Salary Language -Language ID -Language Doctor-Language -Doctor ID -Language ID This called many to many relationships

9 Exercise Construct an ER Diagram for an online travel agency system. A new user is required to create a new profile with a username and password. After logging in the system, the user inquires about different flights. The user can perform booking, changing, and canceling flight reservations. Tips: - You have three main tables; users, flights, and booked-flight - Think what information should be included in each table and what the relationships among them should be - Expand your ER diagram to contain information about planes, airlines, and preferred meals 4/08/2009CPSC203-DesignSkills- Week2- Lab29


Download ppt "Week 2 Lab2 ER Diagram Dina A. Said"

Similar presentations


Ads by Google