Untitled Document 1
Untitled Document 1
Customer-Order Relationship
+ + + + + +
| Customer | | Order | | Product |
+ + + + + +
| CustomerID |---------| OrderID |--------|ProductID |
| Name | | Date | | Name |
| ContactInfo | +----------------+ | Price |
| |<-------| CustomerID | +----------------------+
+-----------------+ +-----------------+ |ProductCategory|
+ +
| CategoryID |
| Name |
+ +
2. Order-Product Relationship
+ + + +
| Order | | Product |
+ + + +
| OrderID |--------| ProductID |
| Date | | Name |
| CustomerID | | Price |
+ + + +
| (1 to many) | (0 to many)
|
|
v
+ +
| OrderProduct |
+ +
| OrderID |
| ProductID |
| Quantity |
+ +
3. Product-Category Relationship
+ + + +
| Product | | Category |
+ + + +
| ProductID |--------| CategoryID |
| Name | | Name |
| Price | +-------------------+
+ +
| (1 to many)
|
|
v
+ +
| ProductCategory |
+ +
| ProductID |
| CategoryID |
+ +
Constraints
1. Entity Constraints
Customer Entity:
+--------------+
| Customer |
+--------------+
|CustomerID| <------Unique
| Name |
| ContactInfo|
+--------------+
Product Entity:
+ +
| Product |
+ +
| ProductID | <-----Unique
| Name |
| Price |
+ +
Order Entity:
+ +
| Order |
+ +
| OrderID | <-----Unique
| Date |
| CustomerID |
+ +
Category Entity:
+ +
| Category |
+ +
| CategoryID | <-----Unique
| Name |
+ +
1. Patient-Doctor Relationship
+ + + +
| Patient | | Doctor |
+ + + +
| PatientID |---------| DoctorID |
| Name | | Name |
| DateOfBirth | | Specialty |
|ContactDetails| | ContactInfo |
|MedicalHistory| | Credentials |
+ + + +
| (0 to many) | (0 to many)
| |
+ +
|
+ +
| PatientDoctor |
+ +
| PatientID |
| DoctorID |
+ +
+ + + +
|MedicalRecord | | Appointment |
+ + + +
| RecordID | | AppointmentID |
| Diagnosis | | Date |
|TreatmentDetails| | Time |
| Prescriptions | | Duration |
| PatientID | | DoctorID |
+-------------------+ | PatientID |
+ +