Professional Documents
Culture Documents
Programming Assignment 7
Programming Assignment 7
CS-2203
Programming Assignment-7
28.12.2022
Create Specialty Table with SQL Statement
('S1','Dermatology');
('S2','Psychiatry');
('S4','Cardiology');
('S6','Pediatrics');
Name char (40) Not Null, Phone char (20) Not Null,
Supervisor char(10),
(SpecialtyNumber)REFERENCES Specialty(SpecialtyNumber);
('D1','DoctorKaren','555-1212','S6','');
Insert Into Doctor (DoctorID, Name, Phone, SpecialtyNumber, Supervisor) Values
('D2','DoctorJohn','555-2934','S2','D1');
('D3','DoctorRobert','555-6723','S6','D1');
('D4','DoctorDavid','555-1745','S4','D1');
('D5','DoctorMary','555-6565','S5','D1');
('D6','DoctorLinda','555-4889','S1','D1');
('D7','DoctorSusan','555-4581','S3','D1');
('D8','DoctorZeynep','555-7891','S4','D1');
('D9','DoctorMat','555-7791','S1','D1');
Retrieve All Data from Doctor
1');
13');
Insert Into Patient (PatientID, DoctorID, Name, Phone, Email, Address, AddedDate)
Values('P3','D6','Patient Karl','444-6723','P3@email.com','2176 Baker St.','2009-5-10');
18');
7');
23');
13');
Insert Into Patient (PatientID, DoctorID, Name, Phone, Email, Address,
10');
6-20');
18');
15');
Retrieve All Data from Patient
);
success');
rate');
spots');
rate');
checked');
spots');
Insert Into Appointment (AppointmentID, PatientID, DoctorID, AppointmentDate,
treatment');
better');
heartrate');
teeth');
better');
treatment');
dreams');
Insert Into Appointment (AppointmentID, PatientID, DoctorID, AppointmentDate,
spots');
treatment');
);
Appointment(AppointmentID),
Medicine(MedicineID)
);
Populate PatientMedicine table with Data
Insert Into
Values('A15', 'M1');
Insert Into
Values('A2', 'M6');
Insert Into
Values('A8', 'M3');
Insert Into
Values('A6', 'M3');
Insert Into
Values('A15', 'M2');
Insert Into
Values('A10', 'M6');
Insert Into
Values('A10', 'M2');
Insert Into
Values('A4', 'M5');
Insert Into
Values('A3', 'M5');
Insert Into
Values('A1', 'M2');
Retrieve All Data from PatientMedicine
Reference
Sharma, N., Perniu, L., Chong, R. F., Iyer, A., Nandan, C., Mitea, A. C., Nonvinkere, M., &
Danubianu, M. (2010). Databases fundamentals.