Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 1. Напишите запрос, который выводит всех пациентов, рожденных 3 и 4 октября 2003 с использование оператора IN и оператора BETWEEN.
- postgres=# select * from patients where birthdate between '2003-10-03' and '2003-10-04';
- id | name | sex | status | birthdate
- ----+------+-----+--------+-----------
- (0 rows)
- 2. Напишите запрос, который выводит всех пациентов, чьи имена начинаются с буквы, попадающей в диапазон от «А» до «Л».
- postgres=# select * from patients where name between 'А%' and 'Л%';
- id | name | sex | status | birthdate
- ----+----------------------------+-----+----------+----------------------------
- 1 | Коваленко Денис Сергеевич | Муж | Учащийся | 2021-06-22 18:28:38.065201
- 3. Напишите запрос, который выберет всех пациентов, чьи имена начинаются с буквы «К».
- postgres=# select * from patients where name like 'К%';
- id | name | sex | status | birthdate
- ----+----------------------------+-----+----------+----------------------------
- 1 | Коваленко Денис Сергеевич | Муж | Учащийся | 2021-06-22 18:28:38.065201
- (1 row)
- 4. Напишите запрос, который выберет всех врачей, имеющие нулевые значения или пропущенные значения NULL в поле Квалификация.
- postgres=# select * from doctors where qualification = null;
- id | name | qualification | specialisation
- ----+------+---------------+----------------
- (0 rows)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement