Q

조건 : 이름으로 필터링

select * from sales.customers where first_name = 'Debra' and last_name = 'Burks';

image.png

조건 : 주문 년도 2016으로 필터링

select order_id, customer_id, order_status from sales.orders where shipped_date like '2016%';

image.png

강사님 답안

SELECT order_id, customer_id, order_status
FROM sales.orders 
WHERE YEAR(order_date) = 2016;

image.png

조건 : 가격대

select product_name, list_price from production.products where list_price >= 500 and list_price < 1000;

image.png

조건 : id , 출력 : 이름, email

select first_name, last_name, email from sales.staffs where store_id = 2

image.png

조건 : 브랜드명에서 해당 글자가 포함된 것만 출력

select * from production.brands where brand_name like '%H%' or brand_name like '%h%'

image.png

강사님 답안