Day3 Exercise - Healthcare
Day3 Exercise - Healthcare
Doctor table
Patient
Case
Patient table
Case table
1. Find all the patients who are treated in the first week of this month.
2. Find all the doctors who have more than 3 admissions today
3. Find the patient name (first,last) who got admitted today where the doctor is ‘TIM’
4. Find the Doctors whose phone numbers were not update (phone number is null)
5. Display the doctors whose specialty is same as Doctor ‘TIM’
6. Find out the number of cases monthly wise for the current year
7. Display the doctors who don’t have any cases registered this week
8. Display Doctor Name, Patient Name, Diagnosis for all the admissions which happened on 1st of
Jan this year
9. Display Doctor Name, patient count based on the cases registered in the hospital.
10. Display the Patient_name, phone, insurance company, insurance code (first 3 characters of
insurance company)
11. Create a view which gives the doctors whose specialty is ‘ORTHO’ and call it as ortho_doctors
HealthCare
insert all
into doctor values('d1','arun','patel','ortho',9675093453)
into doctor values('d2','tim','patil','general',9674560453)
into doctor values('d3','abhay','sharma','heart',9675993453)
select * from dual;
insert all
into patient values('p1','akul','shankar','y',9148752347)
into patient values('p2','aman','shetty','y',9512896317)
into patient values('p3','ajay','shetty','n',9987321564)
into patient values('p4','akshay','pandit','y',9112255889)
into patient values('p5','adi','shankar','n',9177788821)
select * from dual;
insert all
into case values('10-jun-16','p1','d1','fracture')
into case values('03-may-16','p2','d1','bone cancer')
into case values('17-apr-16','p2','d2','fever')
into case values('28-oct-15','p3','d2','cough')
into case values('10-jun-16','p3','d1','fracture')
into case values('1-jan-16','p3','d1','bone cramp')
into case values('11-sep-15','p3','d3','heart attack')
into case values('30-nov-15','p4','d3','heart hole')
into case values('10-nov-15','p4','d3','angioplasty')
into case values('1-jan-16','p5,'d3','angiogram')
select * from dual;