Technical Training (Oracle DBMS)
Assignment I
Hospital Management System
Student Name
Student ID
Batch BCS3A
Date 25/04/2017
Assignment -1
Hospital Management System
Fig. Entity Relationship Diagram (ERD) for Hospital Management System
[Note - Here, employee is further divided into entities doctor, nurse and receptionist,
following the specialization model (top-down design process) as they are distinctive from
each other in the employee set.
Hence these subgroups become lower-level entity sets that have attributes or participate in
relationships that do not apply to the higher-level entity set, i.e., employee.]
Tables
Table 1 employee
Attribute Description Data type Condition
EID Employee ID Varchar2 Primary Key
EName Employee Name Varchar2
EAddress Employee Address Varchar2
ECNo Contact Number Number
EJob Job Description Varchar2
Esal Employee Salary Number
Table 2 patient
Attribute Description Data type Condition
PID Patient ID Varchar2 Primary Key
EID Employee ID Varchar2 Foreign Key (ref employee)
Name Patient Name Varchar2
Address Patient Address Varchar2
CNo Contact Number Number
D_O_Ad Date Of Admission Varchar2
D_O_Dis Date Of Discharge (Probable) Varchar2
Table 3 doctor
Attribute Description Data type Condition
EID Employee ID Varchar2 Foreign Key (ref employee)
PID Attending Patient(s) ID Varchar2 Foreign Key (ref patient)
DName Doctors Name Varchar2
D_Sp Specialization Varchar2
Table 4 nurse
Attribute Description Data type Condition
EID Employee ID Varchar2 Foreign Key (ref employee)
PID Patient ID Varchar2 Foreign Key (ref patient)
NName Nurses Name Varchar2
Table 5 receptionist
Attribute Description Data type Condition
EID Employee ID Varchar2 Foreign Key (ref employee)
RName Receptionists Name Varchar2
Table 6 records
Attribute Description Data type Condition
RNo Record Number Varchar2 Primary Key
PID Patient ID Varchar2 Foreign Key (ref patient)
EID Employee ID Varchar2 Foreign Key (ref employee)
EType Employee Type Varchar2
RDetails Record Details Varchar2
Table 7 rooms
Attribute Description Data type Condition
ReID Room Record ID Varchar2 Primary Key
RoNo Room Number Number
Rtype Room Type Varchar2
PID Patient ID Varchar2 Foreign Key (ref patient)
EID Employee ID Varchar2 Foreign Key (ref employee)
EType Employee Type Varchar2
Table 8 medicines
Attribute Description Data type Condition
MID Medicine ID Varchar2 Primary Key
PID Patient ID Varchar2 Foreign Key (ref patient)
Quantity Quantity Number
MName Medicine Name Varchar2
Oracle SQL Commands
1. Creating Table employee
2. Creating Table patient
3. Creating Table doctor
4. Creating Table nurse
5. Creating Table rooms
6. Creating Table receptionist
7. Creating Table records
8. Creating Table medicines
9. Inserting data and viewing table employee
10. Inserting data and viewing table patient
11. Inserting data and viewing table doctor
12. Inserting data and viewing table nurse
13. Inserting data and viewing table rooms
14. Inserting data and viewing table receptionist
15. Inserting data and viewing table medicines
16. Inserting data and viewing table records