Base SQL homework
This commit is contained in:
@@ -0,0 +1,28 @@
|
|||||||
|
select * from users
|
||||||
|
|
||||||
|
select id, name, country from users
|
||||||
|
order by name;
|
||||||
|
|
||||||
|
select id, name, country, created_at from users
|
||||||
|
where country = 'KZ'
|
||||||
|
order by created_at desc;
|
||||||
|
|
||||||
|
select id, name from users
|
||||||
|
where email is null;
|
||||||
|
|
||||||
|
select id, name from users
|
||||||
|
where email is not null;
|
||||||
|
|
||||||
|
update users
|
||||||
|
set email = 'alice@mail.com'
|
||||||
|
where name = 'Alice'; -- в моей таблице ни у кого нет email, добавил чтобы посмотреть.
|
||||||
|
|
||||||
|
select id, name, UPPER(email) as email_upper from users;
|
||||||
|
|
||||||
|
select id, name, LOWER(email) as email_lower from users
|
||||||
|
where email is not null;
|
||||||
|
|
||||||
|
select id, name, created_at from users
|
||||||
|
where created_at > '2024-01-11'
|
||||||
|
order by created_at desc
|
||||||
|
limit 2;
|
||||||
Reference in New Issue
Block a user