Uploaded by Rania Abdeltawab Ali Abdelhafez

lab 1

advertisement
 Requirements of the Company (oversimplified for illustrative purposes)
› The company is organized into DEPARTMENTs. Each department has a name,
number and an employee who manages the department. We keep track of the
start date of the department manager.
› Each department controls a number of PROJECTs. Each project has a name,
number and is located at a single location.
› We store each EMPLOYEE’s social security number, address, salary, more than
one phone, sex, and birthdate. Each employee must works for one department
but may work on several projects. We keep track of the number of hours per
week that an employee currently works on each project. We also keep track of
the direct supervisor of each employee.
 Hospital requirement
› Each Doctor is described by Doc ID, name, more one Phone, address, and
specialization. Each doctor is allowed to must work in only one department. Each
doctor may have a car with its type. We also keep track of the direct supervisor
of each doctor.
› Each department is described by Dept no, Name, No of doctors and must be
supervised by a doctor.
› Each patient is described by Card number, name, address, and phone. Each
patient is assigned to one or more department. It’s required to keep track each
admission date.
› Each lab is described by Lab No, name. It’s required to keep track any lab
service that may be done to the patient.
Doctor (doc_ID , First_name, Mid_name, l_name, add,Dept_ID) // Dept_ID FK for Work relation (Doctor&Dept)
Doc_phone (Doc_ID, phone) // multivalued phone attribute
Doc_car(Doc_ID,Car_Num,Car_type) /// car weak entity
Doc_Supervise (Doc_ID,Supervisor_Doc) // for recursive entity unary degree between Doctor entity with itself
Dept(Dept_ID ,Name,Location ,Doc_ID) //Doc_ID Here FK apply supervise relation between Doctor and Dept
Dept_Patient (Dept_ID, Card_Num, Date) //the third table for M to M relation Between Dept and Patient
Patient (Card_Num , Name,Address,phone)
Patient_Lab(Card_Num, Lab.No,Service_Type)
Lab (Lab.No,Lab_Name)
// the third table due to M to M relation Between Lab and Patient
Department
Project
Employee
SS
N
Employee_Na
me
Address
Salar
y
Gende
r
BD
Dept_n
o
1
Heba
Riyad
00111
female
2/2/198
5
01
2004
2
Amal
Damma
m
00111
female
4/6/198
0
01
2009
Project_Employee
Pro_no
Employee_Name
hours
Supervisor_
n
202
Amal
21
201
Heba
20
Doctor
Doc_ID
Phone_No
address
1
45865231
2
3
specialization
Salary
Dept_No
dammam H
19000
10
25647895
Abha
G
15000
10
47895625
Riyadh
J
16000
20
Department
Dept_No
Dept_Name
No_of_Doc
Doc_ID
10
AA
10
1
20
BB
15
2
Patient
Card_No
Name
Address
Phone_No
103
hasnaa
Dammam
6955678
204
hafsa
Jeddah
6677990
Lab
Lab_No
Lab_Name
101
ASD
102
SHS
103
FGH
Dept_patient
Dept_No
Card_No
Admission date
10
103
3/4/2007
30
101
6/8/2008
20
102
7/7/2008
Lab_No
Card_No
Service_tayp
101
103
AAA
Lap_patient
102
101
BBB
Download