-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathEasy(Hospitaldb)
28 lines (27 loc) · 1.31 KB
/
Easy(Hospitaldb)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
SELECT first_name,last_name ,gender from patients where gender='M';
select first_name ,last_name from patients where allergies is null;
select first_name from patients where first_name like 'c%';
SELECT first_name,last_name from patients where weight between 100 and 120;
update patients set allergies='NKA' where allergies is null
select concat(first_name,' ',last_name) from patients;
select first_name,last_name,province_name from patients p join province_names pn
on p.province_id=pn.province_id;
select count(*) as total_patients from patients where year(birth_date)=2010 ;
SELECT first_name,last_name ,height from patients where height =
(select max(height) from patients);
select * from patients where patient_id in (1,45,534,879,1000);
select count(*) patient_id from admissions;
select * from admissions where admission_date=discharge_date;
select patient_id ,count(*) patient_id from admissions where patient_id=579;
select distinct city from patients where province_id='NS';
select first_name,last_name,birth_date from patients where height >160 and weight>70;
select first_name,last_name,allergies from patients
where allergies is not null and city='Hamilton ';
select distinct city
from patients
where city like 'a%' OR
city like 'e%' OR
city like 'i%' OR
city like'o%'or
city like'u%'
order by city;