Skip to main content

Command Palette

Search for a command to run...

Where Clause

Updated
1 min readView as Markdown

Show me all data from orders table excluding '웹개발 종합반'.

select * from orders
where course_title != "웹개발 종합반";

Show me all data from orders created on 13th July 2020 and 14th July 2020.

select * from orders
where created_at between '2020-07-13' and '2020-07-15'

Show me comment from those who are in week 1 or 3 only.

select * from checkins 
where week in (1, 3);

**Options in the parentheses can be more than 2.

Show me users having daum email account.

select * from users 
where email like '%daum.net';

% means show me everything that ends with 'daum.net'

where email like 'a%t'

means anything that starts with a and ends with t.

Quiz1. Data where a card is not used as a payment method.

select * from orders
where payment_method != 'CARD';

Quiz2. Users who are having 20000-30000 points.

select * from point_users
where point between 20000 and 30000

Quiz3. Users whose email starts with s and ends with com.

select * from users
where email like 's%com';

Quiz4. Uses whose email starts with s and ends with com and the family name is '이'.

select * from users
where email like 's%com' and name = "이**";

More from this blog

Ollie Seongyong Kim

85 posts