SolveSQL 3

[SolveSQL/난이도 1] Advent of SQL 2024(MySQL, SQLite)

크리스마스 게임 찾기SELECT game_id, name, year FROM gamesWHERE name LIKE '%Christmas%' OR name LIKE '%Santa%' 펭귄 조사하기SELECT DISTINCT(species), island FROM penguinsORDER BY island ASC, species ASC 지자체별 따릉이 정류소 개수 세기SELECT local, COUNT(*) as `num_stations` FROM stationGROUP BY localORDER BY `num_stations` ASC 메리 크리스마스 2024SELECT 'Merry Christmas!'

[SolveSQL/난이도 2] 데이터리안 SQL 데이터 분석 캠프 실전반(MySQL)

레스토랑의 대목SELECT A.total_bill, A.tip, A.sex, A.smoker, A.day, A.time, A.size FROM tips AS A JOIN ( SELECT day, SUM(total_bill) AS `sales` FROM tips GROUP BY day HAVING `sales` >= 1500) AS B ON A.day = B.day 레스토랑의 요일별 VIPSELECT A.total_bill, A.tip, A.sex, A.smoker, A.day, A.time, A.size FROM tips AS A JOIN ( SELECT MAX(total_bill) as `max`, day FROM tips GROUP BY day) AS B ON (A.day = B.day) A..

[SolveSQL/난이도 1] 데이터리안 SQL 데이터 분석 캠프 실전반(MySQL)

첫 주문과 마지막 주문DATE()를 사용하면 yyyy-MM-dd 형태로 변환된다.SELECT DATE(MIN(order_purchase_timestamp)) AS `first_order_date`,DATE(MAX(order_purchase_timestamp)) AS `last_order_date`FROM olist_orders_datasetORDER BY order_purchase_timestamp 많이 주문한 테이블 찾기SELECT * FROM tipsWHERE total_bill > (SELECT AVG(total_bill) FROM tips) 레스토랑의 일일 평균 매출액 계산하기SELECT ROUND(AVG(`sales`), 2) AS `avg_sales` FROM ( SELECT day, SUM..