instruction
stringlengths 8
43
| input
stringclasses 10
values | output
stringlengths 27
270
|
---|---|---|
amy๊ฐ 2025๋
1์ 1์ผ์ ์ฃผ๋ฌธํ ๋ด์ญ ์๋ ค์ค | {"schema": {"users": {"description": "user information", "columns": {"id": ["INT", "user id"], "name": ["VARCHAR", "user name"], "age": ["INT", "user age"], "gender": ["VARCHAR", "user gender [male, female]"]}, "primary_key": "id"}, "orders": {"description": "order list", "columns": {"id": ["INT", "order id"], "user_id": ["INT", "ordered user id"], "order_date": ["DATE", "order date"], "order_state": ["DATE", "order state [ordered, paid, delivery, done]"], "total_count": ["INT", "order items total count"], "total_price": ["INT", "order total price"]}, "primary_key": "id", "foreign_keys": {"user_id": "users.id"}}}} | "SELECT * FROM orders o JOIN users u ON o.user_id = u.id WHERE u.name = 'amy' and o.order_date='2025-01-01';" |
30์ธ ์ด์์ธ ๋จ์ฑ๋ค์ ์ด๋ฆ๊ณผ ๋์ด๋ฅผ ๋ณด์ฌ์ค. | {"schema": {"users": {"columns": {"id": ["INT", "user id"], "name": ["VARCHAR", "user name"], "age": ["INT", "user age"], "gender": ["VARCHAR", "user gender [male, female]"]}, "primary_key": "id"}}} | "SELECT name, age FROM users WHERE age >= 30 AND gender = 'male';" |
2025๋
1์์ ์ฃผ๋ฌธ๋ ๋ชจ๋ ์ฃผ๋ฌธ ๋ด์ญ์ ๋ณด์ฌ์ค. | {"schema": {"orders": {"description": "order list", "columns": {"id": ["INT", "order id"], "user_id": ["INT", "ordered user id"], "order_date": ["DATE", "order date"], "order_state": ["DATE", "order state [ordered, paid, delivery, done]"], "total_count": ["INT", "order items total count"], "total_price": ["INT", "order total price"]}, "primary_key": "id", "foreign_keys": {"user_id": "users.id"}}}} | "SELECT * FROM orders WHERE order_date BETWEEN '2025-01-01' AND '2025-01-31';" |
ํฐ์ด 2024๋
3์ 5์ผ์ ์ฃผ๋ฌธํ ์ํ๋ค์ ์ด๋ฆ๊ณผ ๊ฐ์๋ฅผ ๋ณด์ฌ์ค. | {"schema": {"users": {"description": "user information", "columns": {"id": ["INT", "user id"], "name": ["VARCHAR", "user name"], "age": ["INT", "user age"], "gender": ["VARCHAR", "user gender [male, female]"]}, "primary_key": "id"}, "orders": {"description": "order list", "columns": {"id": ["INT", "order id"], "user_id": ["INT", "ordered user id"], "order_date": ["DATE", "order date"], "order_state": ["DATE", "order state [ordered, paid, delivery, done]"], "total_count": ["INT", "order items total count"], "total_price": ["INT", "order total price"]}, "primary_key": "id", "foreign_keys": {"user_id": "users.id"}}, "items": {"description": "item information", "colums": {"id": ["INT", "item id"], "name": ["varchar", "item name"], "price": ["INT", "item price"]}, "primary_key": "id"}, "order_item": {"description": "order's item list", "colums": {"id": ["INT", "order_item id"], "order_id": ["INT", "order_id"], "item_id": ["INT", "item_id"], "amount": ["INT", "ordered item amount"]}, "primary_key": "id", "foreign_keys": {"order_id": "orders.id", "item_id": "items.id"}}}} | "SELECT i.name, oi.amount FROM orders o JOIN users u ON o.user_id = u.id JOIN order_item oi ON o.id = oi.order_id JOIN items i ON oi.item_id = i.id WHERE u.name = 'ํฐ' AND o.order_date = '2024-03-05';" |
์ด ๊ฐ๊ฒฉ์ด 50,000์ ์ด์์ธ ์ฃผ๋ฌธ๋ค์ ์ฃผ๋ฌธ ๋ ์ง์ ์ด ๊ฐ๊ฒฉ์ ๋ณด์ฌ์ค. | {"schema": {"orders": {"description": "order list", "columns": {"id": ["INT", "order id"], "user_id": ["INT", "ordered user id"], "order_date": ["DATE", "order date"], "order_state": ["DATE", "order state [ordered, paid, delivery, done]"], "total_count": ["INT", "order items total count"], "total_price": ["INT", "order total price"]}, "primary_key": "id", "foreign_keys": {"user_id": "users.id"}}}} | "SELECT order_date, total_price FROM orders WHERE total_price >= 50000;" |
์ฌ์ฑ ์ฌ์ฉ์์ ์ด๋ฆ๊ณผ ๋์ด๋ฅผ ๋ชจ๋ ๋ณด์ฌ์ค. | {"schema": {"users": {"columns": {"id": ["INT", "user id"], "name": ["VARCHAR", "user name"], "age": ["INT", "user age"], "gender": ["VARCHAR", "user gender [male, female]"]}, "primary_key": "id"}}} | "SELECT name, age FROM users WHERE gender = 'female';" |
๊ฐ์ฅ ๋น์ผ ์ํ์ ์ด๋ฆ๊ณผ ๊ฐ๊ฒฉ์ ์๋ ค์ค. | {"schema": {"items": {"description": "item information", "colums": {"id": ["INT", "item id"], "name": ["varchar", "item name"], "price": ["INT", "item price"]}, "primary_key": "id"}}} | "SELECT name, price FROM items WHERE price = (SELECT MAX(price) FROM items);" |
2023๋
4์ ๋์ ์ฃผ๋ฌธ๋ ๊ฐ ์ํ์ ์ด ํ๋งค ๊ฐ์๋ฅผ ์๋ ค์ค. | {"schema": {"orders": {"description": "order list", "columns": {"id": ["INT", "order id"], "user_id": ["INT", "ordered user id"], "order_date": ["DATE", "order date"], "order_state": ["DATE", "order state [ordered, paid, delivery, done]"], "total_count": ["INT", "order items total count"], "total_price": ["INT", "order total price"]}, "primary_key": "id", "foreign_keys": {"user_id": "users.id"}}, "items": {"description": "item information", "colums": {"id": ["INT", "item id"], "name": ["varchar", "item name"], "price": ["INT", "item price"]}, "primary_key": "id"}, "order_item": {"description": "order's item list", "colums": {"id": ["INT", "order_item id"], "order_id": ["INT", "order_id"], "item_id": ["INT", "item_id"], "amount": ["INT", "ordered item amount"]}, "primary_key": "id", "foreign_keys": {"order_id": "orders.id", "item_id": "items.id"}}}} | "SELECT i.name, SUM(oi.amount) AS total_amount FROM order_item oi JOIN items i ON oi.item_id = i.id JOIN orders o ON oi.order_id = o.id WHERE o.order_date BETWEEN '2023-04-01' AND '2023-04-30' GROUP BY i.name;" |
์บ๋ฆฌ๊ฐ ์ฃผ๋ฌธํ ์ํ๋ค์ ์ด ๊ฐ๊ฒฉ์ ๊ณ์ฐํด์ค. | {"schema": {"users": {"description": "user information", "columns": {"id": ["INT", "user id"], "name": ["VARCHAR", "user name"], "age": ["INT", "user age"], "gender": ["VARCHAR", "user gender [male, female]"]}, "primary_key": "id"}, "orders": {"description": "order list", "columns": {"id": ["INT", "order id"], "user_id": ["INT", "ordered user id"], "order_date": ["DATE", "order date"], "order_state": ["DATE", "order state [ordered, paid, delivery, done]"], "total_count": ["INT", "order items total count"], "total_price": ["INT", "order total price"]}, "primary_key": "id", "foreign_keys": {"user_id": "users.id"}}, "items": {"description": "item information", "colums": {"id": ["INT", "item id"], "name": ["varchar", "item name"], "price": ["INT", "item price"]}, "primary_key": "id"}, "order_item": {"description": "order's item list", "colums": {"id": ["INT", "order_item id"], "order_id": ["INT", "order_id"], "item_id": ["INT", "item_id"], "amount": ["INT", "ordered item amount"]}, "primary_key": "id", "foreign_keys": {"order_id": "orders.id", "item_id": "items.id"}}}} | "SELECT SUM(i.price * oi.amount) AS total_spent FROM orders o JOIN users u ON o.user_id = u.id JOIN order_item oi ON o.id = oi.order_id JOIN items i ON oi.item_id = i.id WHERE u.name = '์บ๋ฆฌ';" |
๊ฐ ์ฃผ๋ฌธ ์ํ๋ณ ์ฃผ๋ฌธ ์๋ฅผ ๊ณ์ฐํด์ค. | {"schema": {"orders": {"description": "order list", "columns": {"id": ["INT", "order id"], "user_id": ["INT", "ordered user id"], "order_date": ["DATE", "order date"], "order_state": ["DATE", "order state [ordered, paid, delivery, done]"], "total_count": ["INT", "order items total count"], "total_price": ["INT", "order total price"]}, "primary_key": "id", "foreign_keys": {"user_id": "users.id"}}}} | "SELECT order_state, COUNT(*) AS order_count FROM orders GROUP BY order_state;" |
2024๋
11์ 28์ผ์ ์ฃผ๋ฌธ๋ ์ํ๋ค์ ์ด๋ฆ๊ณผ ์ด ์ฃผ๋ฌธ ์๋ฅผ ๋ณด์ฌ์ค. | {"schema": {"orders": {"description": "order list", "columns": {"id": ["INT", "order id"], "user_id": ["INT", "ordered user id"], "order_date": ["DATE", "order date"], "order_state": ["DATE", "order state [ordered, paid, delivery, done]"], "total_count": ["INT", "order items total count"], "total_price": ["INT", "order total price"]}, "primary_key": "id", "foreign_keys": {"user_id": "users.id"}}, "items": {"description": "item information", "colums": {"id": ["INT", "item id"], "name": ["varchar", "item name"], "price": ["INT", "item price"]}, "primary_key": "id"}, "order_item": {"description": "order's item list", "colums": {"id": ["INT", "order_item id"], "order_id": ["INT", "order_id"], "item_id": ["INT", "item_id"], "amount": ["INT", "ordered item amount"]}, "primary_key": "id", "foreign_keys": {"order_id": "orders.id", "item_id": "items.id"}}}} | "SELECT i.name, SUM(oi.amount) AS total_ordered FROM order_item oi JOIN items i ON oi.item_id = i.id JOIN orders o ON oi.order_id = o.id WHERE o.order_date = '2024-11-28' GROUP BY i.name;" |
์ฃผ๋ฌธ ์ํ๊ฐ 'delivery'์ธ ์ฃผ๋ฌธ๋ค์ ์ฃผ๋ฌธ ID์ ์ฌ์ฉ์ ์ด๋ฆ์ ๋ณด์ฌ์ค. | {"schema": {"users": {"description": "user information", "columns": {"id": ["INT", "user id"], "name": ["VARCHAR", "user name"], "age": ["INT", "user age"], "gender": ["VARCHAR", "user gender [male, female]"]}, "primary_key": "id"}, "orders": {"description": "order list", "columns": {"id": ["INT", "order id"], "user_id": ["INT", "ordered user id"], "order_date": ["DATE", "order date"], "order_state": ["DATE", "order state [ordered, paid, delivery, done]"], "total_count": ["INT", "order items total count"], "total_price": ["INT", "order total price"]}, "primary_key": "id", "foreign_keys": {"user_id": "users.id"}}}} | "SELECT o.id AS order_id, u.name AS user_name FROM orders o JOIN users u ON o.user_id = u.id WHERE o.order_state = 'delivery';" |
๊ฐ ์ฌ์ฉ์๊ฐ ์ฃผ๋ฌธํ ์ด ๊ธ์ก์ ๊ณ์ฐํด์ค. | {"schema": {"users": {"description": "user information", "columns": {"id": ["INT", "user id"], "name": ["VARCHAR", "user name"], "age": ["INT", "user age"], "gender": ["VARCHAR", "user gender [male, female]"]}, "primary_key": "id"}, "orders": {"description": "order list", "columns": {"id": ["INT", "order id"], "user_id": ["INT", "ordered user id"], "order_date": ["DATE", "order date"], "order_state": ["DATE", "order state [ordered, paid, delivery, done]"], "total_count": ["INT", "order items total count"], "total_price": ["INT", "order total price"]}, "primary_key": "id", "foreign_keys": {"user_id": "users.id"}}}} | "SELECT u.name AS user_name, SUM(o.total_price) AS total_spent FROM orders o JOIN users u ON o.user_id = u.id GROUP BY u.name;" |
2024๋
11์ 28์ผ์ ์ฃผ๋ฌธ๋ ์ํ๋ค์ ์ด๋ฆ๊ณผ ์ด ์ฃผ๋ฌธ ์๋ฅผ ๋ณด์ฌ์ค. | {"schema": {"items": {"description": "item information", "colums": {"id": ["INT", "item id"], "name": ["varchar", "item name"], "price": ["INT", "item price"]}, "primary_key": "id"}, "order_item": {"description": "order's item list", "colums": {"id": ["INT", "order_item id"], "order_id": ["INT", "order_id"], "item_id": ["INT", "item_id"], "amount": ["INT", "ordered item amount"]}, "primary_key": "id", "foreign_keys": {"order_id": "orders.id", "item_id": "items.id"}}}} | "SELECT i.name, SUM(oi.amount) AS total_ordered FROM order_item oi JOIN items i ON oi.item_id = i.id GROUP BY i.name ORDER BY total_ordered DESC LIMIT 1;" |
์ฌ์ฉ์ ๋ณ๋ก ์ฃผ๋ฌธํ ์ํ์ ์๋ฅผ ๋ณด์ฌ์ค. | {"schema": {"users": {"description": "user information", "columns": {"id": ["INT", "user id"], "name": ["VARCHAR", "user name"], "age": ["INT", "user age"], "gender": ["VARCHAR", "user gender [male, female]"]}, "primary_key": "id"}, "orders": {"description": "order list", "columns": {"id": ["INT", "order id"], "user_id": ["INT", "ordered user id"], "order_date": ["DATE", "order date"], "order_state": ["DATE", "order state [ordered, paid, delivery, done]"], "total_count": ["INT", "order items total count"], "total_price": ["INT", "order total price"]}, "primary_key": "id", "foreign_keys": {"user_id": "users.id"}}}} | "SELECT u.name AS user_name, COUNT(o.id) AS order_count FROM orders o JOIN users u ON o.user_id = u.id GROUP BY u.name;" |
ํ๊ท ์ฃผ๋ฌธ ๊ธ์ก์ด 10,000์ ์ด์์ธ ์ฌ์ฉ์์ ์ด๋ฆ๊ณผ ํ๊ท ๊ธ์ก์ ๋ณด์ฌ์ค. | {"schema": {"users": {"description": "user information", "columns": {"id": ["INT", "user id"], "name": ["VARCHAR", "user name"], "age": ["INT", "user age"], "gender": ["VARCHAR", "user gender [male, female]"]}, "primary_key": "id"}, "orders": {"description": "order list", "columns": {"id": ["INT", "order id"], "user_id": ["INT", "ordered user id"], "order_date": ["DATE", "order date"], "order_state": ["DATE", "order state [ordered, paid, delivery, done]"], "total_count": ["INT", "order items total count"], "total_price": ["INT", "order total price"]}, "primary_key": "id", "foreign_keys": {"user_id": "users.id"}}}} | "SELECT u.name AS user_name, AVG(o.total_price) AS avg_order_price FROM orders o JOIN users u ON o.user_id = u.id GROUP BY u.name HAVING avg_order_price >= 10000;" |
๋ชจ๋ ์ํ์ ์ด ํ๋งค๋๊ณผ ์ด ์์ต์ ๊ณ์ฐํด์ค. | {"schema": {"order_item": {"description": "order's item list", "colums": {"id": ["INT", "order_item id"], "order_id": ["INT", "order_id"], "item_id": ["INT", "item_id"], "amount": ["INT", "ordered item amount"]}, "primary_key": "id", "foreign_keys": {"order_id": "orders.id", "item_id": "items.id"}}}} | "SELECT SUM(oi.amount) AS total_items_sold, SUM(oi.amount * i.price) AS total_revenue FROM order_item oi JOIN items i ON oi.item_id = i.id;" |
30์ธ ๋ฏธ๋ง ์ฌ์ฉ์๊ฐ ์ฃผ๋ฌธํ ๋ชจ๋ ์ฃผ๋ฌธ์ ID์ ์ฃผ๋ฌธ ๋ ์ง๋ฅผ ๋ณด์ฌ์ค. | {"schema": {"users": {"description": "user information", "columns": {"id": ["INT", "user id"], "name": ["VARCHAR", "user name"], "age": ["INT", "user age"], "gender": ["VARCHAR", "user gender [male, female]"]}, "primary_key": "id"}, "orders": {"description": "order list", "columns": {"id": ["INT", "order id"], "user_id": ["INT", "ordered user id"], "order_date": ["DATE", "order date"], "order_state": ["DATE", "order state [ordered, paid, delivery, done]"], "total_count": ["INT", "order items total count"], "total_price": ["INT", "order total price"]}, "primary_key": "id", "foreign_keys": {"user_id": "users.id"}}}} | "SELECT o.id AS order_id, o.order_date FROM orders o JOIN users u ON o.user_id = u.id WHERE u.age < 30;" |
์ฌ์ฉ์ ๋ณ๋ก ์ฃผ๋ฌธํ ์ํ๋ค์ ์ด ๊ฐ์๋ฅผ ๊ณ์ฐํด์ค. | {"schema": {"users": {"description": "user information", "columns": {"id": ["INT", "user id"], "name": ["VARCHAR", "user name"], "age": ["INT", "user age"], "gender": ["VARCHAR", "user gender [male, female]"]}, "primary_key": "id"}, "orders": {"description": "order list", "columns": {"id": ["INT", "order id"], "user_id": ["INT", "ordered user id"], "order_date": ["DATE", "order date"], "order_state": ["DATE", "order state [ordered, paid, delivery, done]"], "total_count": ["INT", "order items total count"], "total_price": ["INT", "order total price"]}, "primary_key": "id", "foreign_keys": {"user_id": "users.id"}}, "order_item": {"description": "order's item list", "colums": {"id": ["INT", "order_item id"], "order_id": ["INT", "order_id"], "item_id": ["INT", "item_id"], "amount": ["INT", "ordered item amount"]}, "primary_key": "id", "foreign_keys": {"order_id": "orders.id", "item_id": "items.id"}}}} | "SELECT u.name AS user_name, SUM(oi.amount) AS total_items_ordered FROM orders o JOIN users u ON o.user_id = u.id JOIN order_item oi ON o.id = oi.order_id GROUP BY u.name;" |
์ฃผ๋ฌธ๋ ์ํ์ด ์๋ ์ฌ์ฉ์๋ค์ ์ด๋ฆ์ ๋ณด์ฌ์ค. | {"schema": {"users": {"description": "user information", "columns": {"id": ["INT", "user id"], "name": ["VARCHAR", "user name"], "age": ["INT", "user age"], "gender": ["VARCHAR", "user gender [male, female]"]}, "primary_key": "id"}, "orders": {"description": "order list", "columns": {"id": ["INT", "order id"], "user_id": ["INT", "ordered user id"], "order_date": ["DATE", "order date"], "order_state": ["DATE", "order state [ordered, paid, delivery, done]"], "total_count": ["INT", "order items total count"], "total_price": ["INT", "order total price"]}, "primary_key": "id", "foreign_keys": {"user_id": "users.id"}}}} | "SELECT u.name FROM users u LEFT JOIN orders o ON u.id = o.user_id WHERE o.id IS NULL;" |
์ฌ์ฑ ์ฌ์ฉ์๊ฐ ์ฃผ๋ฌธํ ์ด ์ฃผ๋ฌธ ์์ ์ด ๊ธ์ก์ ๊ณ์ฐํด์ค. | {"schema": {"users": {"description": "user information", "columns": {"id": ["INT", "user id"], "name": ["VARCHAR", "user name"], "age": ["INT", "user age"], "gender": ["VARCHAR", "user gender [male, female]"]}, "primary_key": "id"}, "orders": {"description": "order list", "columns": {"id": ["INT", "order id"], "user_id": ["INT", "ordered user id"], "order_date": ["DATE", "order date"], "order_state": ["DATE", "order state [ordered, paid, delivery, done]"], "total_count": ["INT", "order items total count"], "total_price": ["INT", "order total price"]}, "primary_key": "id", "foreign_keys": {"user_id": "users.id"}}}} | "SELECT COUNT(o.id) AS total_orders, SUM(o.total_price) AS total_spent FROM orders o JOIN users u ON o.user_id = u.id WHERE u.gender = 'female';" |
์ฃผ๋ฌธ ์ํ๊ฐ 'done'์ธ ์ฃผ๋ฌธ๋ค์ ์ฌ์ฉ์ ์ด๋ฆ๊ณผ ์ฃผ๋ฌธ ๋ ์ง๋ฅผ ๋ณด์ฌ์ค. | {"schema": {"users": {"description": "user information", "columns": {"id": ["INT", "user id"], "name": ["VARCHAR", "user name"], "age": ["INT", "user age"], "gender": ["VARCHAR", "user gender [male, female]"]}, "primary_key": "id"}, "orders": {"description": "order list", "columns": {"id": ["INT", "order id"], "user_id": ["INT", "ordered user id"], "order_date": ["DATE", "order date"], "order_state": ["DATE", "order state [ordered, paid, delivery, done]"], "total_count": ["INT", "order items total count"], "total_price": ["INT", "order total price"]}, "primary_key": "id", "foreign_keys": {"user_id": "users.id"}}}} | "SELECT u.name AS user_name, o.order_date FROM orders o JOIN users u ON o.user_id = u.id WHERE o.order_state = 'done';" |
์ํ ์ด๋ฆ์ด 'Laptop'์ธ ์ํ์ ์ฃผ๋ฌธํ ์ฌ์ฉ์๋ค์ ์ด๋ฆ์ ๋ณด์ฌ์ค. | {"schema": {"users": {"description": "user information", "columns": {"id": ["INT", "user id"], "name": ["VARCHAR", "user name"], "age": ["INT", "user age"], "gender": ["VARCHAR", "user gender [male, female]"]}, "primary_key": "id"}, "orders": {"description": "order list", "columns": {"id": ["INT", "order id"], "user_id": ["INT", "ordered user id"], "order_date": ["DATE", "order date"], "order_state": ["DATE", "order state [ordered, paid, delivery, done]"], "total_count": ["INT", "order items total count"], "total_price": ["INT", "order total price"]}, "primary_key": "id", "foreign_keys": {"user_id": "users.id"}}, "items": {"description": "item information", "colums": {"id": ["INT", "item id"], "name": ["varchar", "item name"], "price": ["INT", "item price"]}, "primary_key": "id"}, "order_item": {"description": "order's item list", "colums": {"id": ["INT", "order_item id"], "order_id": ["INT", "order_id"], "item_id": ["INT", "item_id"], "amount": ["INT", "ordered item amount"]}, "primary_key": "id", "foreign_keys": {"order_id": "orders.id", "item_id": "items.id"}}}} | "SELECT DISTINCT u.name FROM order_item oi JOIN items i ON oi.item_id = i.id JOIN orders o ON oi.order_id = o.id JOIN users u ON o.user_id = u.id WHERE i.name = 'Laptop';" |
2022๋
7์์ ์ฃผ๋ฌธ๋ ๋ชจ๋ ์ฃผ๋ฌธ์ ID์ ์ด ๊ธ์ก์ ๋ณด์ฌ์ค. | {"schema": {"orders": {"description": "order list", "columns": {"id": ["INT", "order id"], "user_id": ["INT", "ordered user id"], "order_date": ["DATE", "order date"], "order_state": ["DATE", "order state [ordered, paid, delivery, done]"], "total_count": ["INT", "order items total count"], "total_price": ["INT", "order total price"]}, "primary_key": "id", "foreign_keys": {"user_id": "users.id"}}}} | "SELECT o.id AS order_id, o.total_price FROM orders o WHERE EXTRACT(YEAR FROM o.order_date) = 2022 AND EXTRACT(MONTH FROM o.order_date) = 7;" |
20์ธ ์ดํ์ ์ฌ์ฉ์๊ฐ ์ฃผ๋ฌธํ ์ํ๋ค์ ์ด๋ฆ๊ณผ ์ด ์ฃผ๋ฌธ ์๋ฅผ ๋ณด์ฌ์ค. | {"schema": {"users": {"description": "user information", "columns": {"id": ["INT", "user id"], "name": ["VARCHAR", "user name"], "age": ["INT", "user age"], "gender": ["VARCHAR", "user gender [male, female]"]}, "primary_key": "id"}, "orders": {"description": "order list", "columns": {"id": ["INT", "order id"], "user_id": ["INT", "ordered user id"], "order_date": ["DATE", "order date"], "order_state": ["DATE", "order state [ordered, paid, delivery, done]"], "total_count": ["INT", "order items total count"], "total_price": ["INT", "order total price"]}, "primary_key": "id", "foreign_keys": {"user_id": "users.id"}}, "items": {"description": "item information", "colums": {"id": ["INT", "item id"], "name": ["varchar", "item name"], "price": ["INT", "item price"]}, "primary_key": "id"}, "order_item": {"description": "order's item list", "colums": {"id": ["INT", "order_item id"], "order_id": ["INT", "order_id"], "item_id": ["INT", "item_id"], "amount": ["INT", "ordered item amount"]}, "primary_key": "id", "foreign_keys": {"order_id": "orders.id", "item_id": "items.id"}}}} | "SELECT i.name, SUM(oi.amount) AS total_ordered FROM order_item oi JOIN items i ON oi.item_id = i.id JOIN orders o ON oi.order_id = o.id JOIN users u ON o.user_id = u.id WHERE u.age <= 20 GROUP BY i.name;" |
์ด ์ฃผ๋ฌธ ๊ธ์ก์ด ๊ฐ์ฅ ๋ฎ์ ์ฌ์ฉ์์ ์ด๋ฆ๊ณผ ๊ทธ ๊ธ์ก์ ๋ณด์ฌ์ค. | {"schema": {"users": {"description": "user information", "columns": {"id": ["INT", "user id"], "name": ["VARCHAR", "user name"], "age": ["INT", "user age"], "gender": ["VARCHAR", "user gender [male, female]"]}, "primary_key": "id"}, "orders": {"description": "order list", "columns": {"id": ["INT", "order id"], "user_id": ["INT", "ordered user id"], "order_date": ["DATE", "order date"], "order_state": ["DATE", "order state [ordered, paid, delivery, done]"], "total_count": ["INT", "order items total count"], "total_price": ["INT", "order total price"]}, "primary_key": "id", "foreign_keys": {"user_id": "users.id"}}}} | "SELECT u.name AS user_name, SUM(o.total_price) AS total_spent FROM orders o JOIN users u ON o.user_id = u.id GROUP BY u.name ORDER BY total_spent LIMIT 1;" |
2025๋
์ ์ฃผ๋ฌธ๋ ๊ฐ ์ํ๋ณ ์ด ํ๋งค๋์ ๋ณด์ฌ์ค. | {"schema": {"orders": {"description": "order list", "columns": {"id": ["INT", "order id"], "user_id": ["INT", "ordered user id"], "order_date": ["DATE", "order date"], "order_state": ["DATE", "order state [ordered, paid, delivery, done]"], "total_count": ["INT", "order items total count"], "total_price": ["INT", "order total price"]}, "primary_key": "id", "foreign_keys": {"user_id": "users.id"}}, "items": {"description": "item information", "colums": {"id": ["INT", "item id"], "name": ["varchar", "item name"], "price": ["INT", "item price"]}, "primary_key": "id"}, "order_item": {"description": "order's item list", "colums": {"id": ["INT", "order_item id"], "order_id": ["INT", "order_id"], "item_id": ["INT", "item_id"], "amount": ["INT", "ordered item amount"]}, "primary_key": "id", "foreign_keys": {"order_id": "orders.id", "item_id": "items.id"}}}} | "SELECT i.name, SUM(oi.amount) AS total_sold FROM order_item oi JOIN items i ON oi.item_id = i.id JOIN orders o ON oi.order_id = o.id WHERE EXTRACT(YEAR FROM o.order_date) = 2025 GROUP BY i.name;" |
ํ ๋ฒ๋ ์ฃผ๋ฌธํ์ง ์์ ์ํ๋ค์ ์ด๋ฆ์ ๋ณด์ฌ์ค. | {"schema": {"items": {"description": "item information", "colums": {"id": ["INT", "item id"], "name": ["varchar", "item name"], "price": ["INT", "item price"]}, "primary_key": "id"}, "order_item": {"description": "order's item list", "colums": {"id": ["INT", "order_item id"], "order_id": ["INT", "order_id"], "item_id": ["INT", "item_id"], "amount": ["INT", "ordered item amount"]}, "primary_key": "id", "foreign_keys": {"order_id": "orders.id", "item_id": "items.id"}}}} | "SELECT i.name FROM items i LEFT JOIN order_item oi ON i.id = oi.item_id WHERE oi.id IS NULL;" |
์ฃผ๋ฌธ ์ํ๊ฐ 'paid'์ธ ์ฃผ๋ฌธ๋ค์ ์ด ์ฃผ๋ฌธ ์์ ํ๊ท ์ฃผ๋ฌธ ๊ธ์ก์ ๊ณ์ฐํด์ค. | {"schema": {"orders": {"description": "order list", "columns": {"id": ["INT", "order id"], "user_id": ["INT", "ordered user id"], "order_date": ["DATE", "order date"], "order_state": ["DATE", "order state [ordered, paid, delivery, done]"], "total_count": ["INT", "order items total count"], "total_price": ["INT", "order total price"]}, "primary_key": "id", "foreign_keys": {"user_id": "users.id"}}}} | "SELECT COUNT(o.id) AS total_orders, AVG(o.total_price) AS avg_order_price FROM orders o WHERE o.order_state = 'paid';" |
๊ฐ์ฅ ๋น์ผ ์ํ์ ์ฃผ๋ฌธํ ์ฌ์ฉ์์ ์ด๋ฆ๊ณผ ๊ทธ ์ํ์ ๊ฐ๊ฒฉ์ ๋ณด์ฌ์ค. | {"schema": {"users": {"description": "user information", "columns": {"id": ["INT", "user id"], "name": ["VARCHAR", "user name"], "age": ["INT", "user age"], "gender": ["VARCHAR", "user gender [male, female]"]}, "primary_key": "id"}, "orders": {"description": "order list", "columns": {"id": ["INT", "order id"], "user_id": ["INT", "ordered user id"], "order_date": ["DATE", "order date"], "order_state": ["DATE", "order state [ordered, paid, delivery, done]"], "total_count": ["INT", "order items total count"], "total_price": ["INT", "order total price"]}, "primary_key": "id", "foreign_keys": {"user_id": "users.id"}}, "items": {"description": "item information", "colums": {"id": ["INT", "item id"], "name": ["varchar", "item name"], "price": ["INT", "item price"]}, "primary_key": "id"}, "order_item": {"description": "order's item list", "colums": {"id": ["INT", "order_item id"], "order_id": ["INT", "order_id"], "item_id": ["INT", "item_id"], "amount": ["INT", "ordered item amount"]}, "primary_key": "id", "foreign_keys": {"order_id": "orders.id", "item_id": "items.id"}}}} | "SELECT u.name AS user_name, i.price FROM order_item oi JOIN items i ON oi.item_id = i.id JOIN orders o ON oi.order_id = o.id JOIN users u ON o.user_id = u.id WHERE i.price = (SELECT MAX(price) FROM items);" |
ํ ๋ฒ๋ ์ฃผ๋ฌธํ์ง ์์ ์ฌ์ฉ์๋ค์ ์ด๋ฆ์ ๋ณด์ฌ์ค. | {"schema": {"users": {"description": "user information", "columns": {"id": ["INT", "user id"], "name": ["VARCHAR", "user name"], "age": ["INT", "user age"], "gender": ["VARCHAR", "user gender [male, female]"]}, "primary_key": "id"}, "orders": {"description": "order list", "columns": {"id": ["INT", "order id"], "user_id": ["INT", "ordered user id"], "order_date": ["DATE", "order date"], "order_state": ["DATE", "order state [ordered, paid, delivery, done]"], "total_count": ["INT", "order items total count"], "total_price": ["INT", "order total price"]}, "primary_key": "id", "foreign_keys": {"user_id": "users.id"}}}} | "SELECT u.name FROM users u LEFT JOIN orders o ON u.id = o.user_id WHERE o.id IS NULL;" |
์ฃผ๋ฌธํ ์ํ ์๊ฐ 5๊ฐ ์ด์์ธ ์ฌ์ฉ์๋ค์ ์ด๋ฆ๊ณผ ์ด ์ฃผ๋ฌธ ์๋ฅผ ๋ณด์ฌ์ค. | {"schema": {"users": {"description": "user information", "columns": {"id": ["INT", "user id"], "name": ["VARCHAR", "user name"], "age": ["INT", "user age"], "gender": ["VARCHAR", "user gender [male, female]"]}, "primary_key": "id"}, "orders": {"description": "order list", "columns": {"id": ["INT", "order id"], "user_id": ["INT", "ordered user id"], "order_date": ["DATE", "order date"], "order_state": ["DATE", "order state [ordered, paid, delivery, done]"], "total_count": ["INT", "order items total count"], "total_price": ["INT", "order total price"]}, "primary_key": "id", "foreign_keys": {"user_id": "users.id"}}}} | "SELECT u.name, COUNT(o.id) AS total_orders FROM users u JOIN orders o ON u.id = o.user_id WHERE o.total_count >= 5 GROUP BY u.name;" |
2023๋
5์์ ๊ฐ์ฅ ๋ง์ด ํ๋งค๋ ์ํ์ ์ด๋ฆ๊ณผ ํ๋งค๋์ ๋ณด์ฌ์ค. | {"schema": {"orders": {"description": "order list", "columns": {"id": ["INT", "order id"], "user_id": ["INT", "ordered user id"], "order_date": ["DATE", "order date"], "order_state": ["DATE", "order state [ordered, paid, delivery, done]"], "total_count": ["INT", "order items total count"], "total_price": ["INT", "order total price"]}, "primary_key": "id", "foreign_keys": {"user_id": "users.id"}}, "items": {"description": "item information", "colums": {"id": ["INT", "item id"], "name": ["varchar", "item name"], "price": ["INT", "item price"]}, "primary_key": "id"}, "order_item": {"description": "order's item list", "colums": {"id": ["INT", "order_item id"], "order_id": ["INT", "order_id"], "item_id": ["INT", "item_id"], "amount": ["INT", "ordered item amount"]}, "primary_key": "id", "foreign_keys": {"order_id": "orders.id", "item_id": "items.id"}}}} | "SELECT i.name, SUM(oi.amount) AS total_sold FROM order_item oi JOIN items i ON oi.item_id = i.id JOIN orders o ON oi.order_id = o.id WHERE EXTRACT(YEAR FROM o.order_date) = 2023 AND EXTRACT(MONTH FROM o.order_date) = 5 GROUP BY i.name ORDER BY total_sold DESC LIMIT 1;" |
์ฌ์ฉ์๊ฐ ์ฃผ๋ฌธํ ์ํ์ ์ด ๊ธ์ก์ ์ฌ์ฉ์๋ณ๋ก ๊ณ์ฐํด์ ๋ณด์ฌ์ค. | {"schema": {"users": {"description": "user information", "columns": {"id": ["INT", "user id"], "name": ["VARCHAR", "user name"], "age": ["INT", "user age"], "gender": ["VARCHAR", "user gender [male, female]"]}, "primary_key": "id"}, "orders": {"description": "order list", "columns": {"id": ["INT", "order id"], "user_id": ["INT", "ordered user id"], "order_date": ["DATE", "order date"], "order_state": ["DATE", "order state [ordered, paid, delivery, done]"], "total_count": ["INT", "order items total count"], "total_price": ["INT", "order total price"]}, "primary_key": "id", "foreign_keys": {"user_id": "users.id"}}}} | "SELECT u.name, SUM(o.total_price) AS total_spent FROM orders o JOIN users u ON o.user_id = u.id GROUP BY u.name;" |
์ฃผ๋ฌธ ์ํ๊ฐ 'delivery'์ธ ์ฃผ๋ฌธ์ ์ฌ์ฉ์ ์ด๋ฆ๊ณผ ์ฃผ๋ฌธ ID๋ฅผ ๋ณด์ฌ์ค. | {"schema": {"users": {"description": "user information", "columns": {"id": ["INT", "user id"], "name": ["VARCHAR", "user name"], "age": ["INT", "user age"], "gender": ["VARCHAR", "user gender [male, female]"]}, "primary_key": "id"}, "orders": {"description": "order list", "columns": {"id": ["INT", "order id"], "user_id": ["INT", "ordered user id"], "order_date": ["DATE", "order date"], "order_state": ["DATE", "order state [ordered, paid, delivery, done]"], "total_count": ["INT", "order items total count"], "total_price": ["INT", "order total price"]}, "primary_key": "id", "foreign_keys": {"user_id": "users.id"}}}} | "SELECT u.name AS user_name, o.id AS order_id FROM orders o JOIN users u ON o.user_id = u.id WHERE o.order_state = 'delivery';" |
๋ชจ๋ ์ฃผ๋ฌธ์์ ๊ฐ์ฅ ์ ๊ฒ ์ฃผ๋ฌธ๋ ์ํ์ ์ด๋ฆ๊ณผ ์ฃผ๋ฌธ ์๋ฅผ ๋ณด์ฌ์ค. | {"schema": {"items": {"description": "item information", "colums": {"id": ["INT", "item id"], "name": ["varchar", "item name"], "price": ["INT", "item price"]}, "primary_key": "id"}, "order_item": {"description": "order's item list", "colums": {"id": ["INT", "order_item id"], "order_id": ["INT", "order_id"], "item_id": ["INT", "item_id"], "amount": ["INT", "ordered item amount"]}, "primary_key": "id", "foreign_keys": {"order_id": "orders.id", "item_id": "items.id"}}}} | "SELECT i.name, SUM(oi.amount) AS total_ordered FROM order_item oi JOIN items i ON oi.item_id = i.id GROUP BY i.name ORDER BY total_ordered ASC LIMIT 1;" |
2024๋
์ ์ฃผ๋ฌธ๋ ๊ฐ ์ฃผ๋ฌธ์ ID์ ์ด ๊ธ์ก์ ๋ ์ง์์ผ๋ก ์ ๋ ฌํด์ ๋ณด์ฌ์ค. | {"schema": {"orders": {"description": "order list", "columns": {"id": ["INT", "order id"], "user_id": ["INT", "ordered user id"], "order_date": ["DATE", "order date"], "order_state": ["DATE", "order state [ordered, paid, delivery, done]"], "total_count": ["INT", "order items total count"], "total_price": ["INT", "order total price"]}, "primary_key": "id", "foreign_keys": {"user_id": "users.id"}}}} | "SELECT o.id AS order_id, o.total_price FROM orders o WHERE EXTRACT(YEAR FROM o.order_date) = 2024 ORDER BY o.order_date ASC;" |
์ฌ์ฉ์๋ณ๋ก ๊ฐ์ฅ ์ต๊ทผ ์ฃผ๋ฌธ ๋ ์ง๋ฅผ ๋ณด์ฌ์ค. | {"schema": {"users": {"description": "user information", "columns": {"id": ["INT", "user id"], "name": ["VARCHAR", "user name"], "age": ["INT", "user age"], "gender": ["VARCHAR", "user gender [male, female]"]}, "primary_key": "id"}, "orders": {"description": "order list", "columns": {"id": ["INT", "order id"], "user_id": ["INT", "ordered user id"], "order_date": ["DATE", "order date"], "order_state": ["DATE", "order state [ordered, paid, delivery, done]"], "total_count": ["INT", "order items total count"], "total_price": ["INT", "order total price"]}, "primary_key": "id", "foreign_keys": {"user_id": "users.id"}}}} | "SELECT u.name, MAX(o.order_date) AS last_order_date FROM orders o JOIN users u ON o.user_id = u.id GROUP BY u.name;" |
์ด ํ๋งค๋์ด 10๊ฐ ์ด์์ธ ์ํ์ ์ด๋ฆ๊ณผ ์ด ํ๋งค๋์ ๋ณด์ฌ์ค. | {"schema": {"items": {"description": "item information", "colums": {"id": ["INT", "item id"], "name": ["varchar", "item name"], "price": ["INT", "item price"]}, "primary_key": "id"}, "order_item": {"description": "order's item list", "colums": {"id": ["INT", "order_item id"], "order_id": ["INT", "order_id"], "item_id": ["INT", "item_id"], "amount": ["INT", "ordered item amount"]}, "primary_key": "id", "foreign_keys": {"order_id": "orders.id", "item_id": "items.id"}}}} | "SELECT i.name, SUM(oi.amount) AS total_sold FROM order_item oi JOIN items i ON oi.item_id = i.id GROUP BY i.name HAVING total_sold >= 10;" |
์ฌ์ฉ์๊ฐ ์ฃผ๋ฌธํ ๊ฐ ์ํ์ ์ด๋ฆ๊ณผ ์ฃผ๋ฌธ ์๋ฅผ ์ฌ์ฉ์๋ณ๋ก ๊ทธ๋ฃนํํ์ฌ ๋ณด์ฌ์ค. | {"schema": {"users": {"description": "user information", "columns": {"id": ["INT", "user id"], "name": ["VARCHAR", "user name"], "age": ["INT", "user age"], "gender": ["VARCHAR", "user gender [male, female]"]}, "primary_key": "id"}, "orders": {"description": "order list", "columns": {"id": ["INT", "order id"], "user_id": ["INT", "ordered user id"], "order_date": ["DATE", "order date"], "order_state": ["DATE", "order state [ordered, paid, delivery, done]"], "total_count": ["INT", "order items total count"], "total_price": ["INT", "order total price"]}, "primary_key": "id", "foreign_keys": {"user_id": "users.id"}}, "items": {"description": "item information", "colums": {"id": ["INT", "item id"], "name": ["varchar", "item name"], "price": ["INT", "item price"]}, "primary_key": "id"}, "order_item": {"description": "order's item list", "colums": {"id": ["INT", "order_item id"], "order_id": ["INT", "order_id"], "item_id": ["INT", "item_id"], "amount": ["INT", "ordered item amount"]}, "primary_key": "id", "foreign_keys": {"order_id": "orders.id", "item_id": "items.id"}}}} | "SELECT u.name AS user_name, i.name AS item_name, SUM(oi.amount) AS total_ordered FROM order_item oi JOIN items i ON oi.item_id = i.id JOIN orders o ON oi.order_id = o.id JOIN users u ON o.user_id = u.id GROUP BY u.name, i.name ORDER BY u.name, total_ordered DESC;" |
๋ชจ๋ ์ฌ์ฉ์์ ์ด๋ฆ๊ณผ ๋์ด๋ฅผ ์กฐํํด์ค | {"schema": {"users": {"description": "user information", "columns": {"id": ["INT", "user id"], "name": ["VARCHAR", "user name"], "age": ["INT", "user age"], "gender": ["VARCHAR", "user gender [male, female]"]}, "primary_key": "id"}}} | "SELECT name, age FROM users;" |
20๋ ์ฌ์ฉ์๋ง ์กฐํํด์ค | {"schema": {"users": {"description": "user information", "columns": {"id": ["INT", "user id"], "name": ["VARCHAR", "user name"], "age": ["INT", "user age"], "gender": ["VARCHAR", "user gender [male, female]"]}, "primary_key": "id"}}} | "SELECT * FROM users WHERE age BETWEEN 20 AND 29;" |
๋จ์๋ง ์กฐํํด์ค | {"schema": {"users": {"description": "user information", "columns": {"id": ["INT", "user id"], "name": ["VARCHAR", "user name"], "age": ["INT", "user age"], "gender": ["VARCHAR", "user gender [male, female]"]}, "primary_key": "id"}}} | "SELECT * FROM users WHERE gender = 'male';" |
50์ด ์ด์ ์ฌ์ฉ์์ ์ด๋ฆ๊ณผ ์ฑ๋ณ ์กฐํํด์ค | {"schema": {"users": {"description": "user information", "columns": {"id": ["INT", "user id"], "name": ["VARCHAR", "user name"], "age": ["INT", "user age"], "gender": ["VARCHAR", "user gender [male, female]"]}, "primary_key": "id"}}} | "SELECT name, gender FROM users WHERE age >= 50;" |
๋์ด๊ฐ ๊ฐ์ฅ ๋ง์ ์ฌ์ฉ์๋ฅผ ์กฐํํด์ค | {"schema": {"users": {"description": "user information", "columns": {"id": ["INT", "user id"], "name": ["VARCHAR", "user name"], "age": ["INT", "user age"], "gender": ["VARCHAR", "user gender [male, female]"]}, "primary_key": "id"}}} | "SELECT * FROM users ORDER BY age DESC LIMIT 1;" |
์ฌ์ฉ์ ์ด๋ฆ์ 'a'๊ฐ ํฌํจ๋ ์ฌ์ฉ์ ์กฐํํด์ค | {"schema": {"users": {"description": "user information", "columns": {"id": ["INT", "user id"], "name": ["VARCHAR", "user name"], "age": ["INT", "user age"], "gender": ["VARCHAR", "user gender [male, female]"]}, "primary_key": "id"}}} | "SELECT * FROM users WHERE name LIKE '%a%';" |
์ฌ์ฉ์ ํ
์ด๋ธ์์ ์ค๋ณต ์์ด ์ฑ๋ณ๋ง ์กฐํํด์ค | {"schema": {"users": {"description": "user information", "columns": {"id": ["INT", "user id"], "name": ["VARCHAR", "user name"], "age": ["INT", "user age"], "gender": ["VARCHAR", "user gender [male, female]"]}, "primary_key": "id"}}} | "SELECT DISTINCT gender FROM users;" |
์ฌ์ฉ์์ ํ๊ท ๋์ด ์๋ ค์ค | {"schema": {"users": {"description": "user information", "columns": {"id": ["INT", "user id"], "name": ["VARCHAR", "user name"], "age": ["INT", "user age"], "gender": ["VARCHAR", "user gender [male, female]"]}, "primary_key": "id"}}} | "SELECT AVG(age) AS average_age FROM users;" |
์ฌ์ฑ ์ฌ์ฉ์์ ์ด ์ธ์์ด ๋ช์ธ์ง ์๋ ค์ค | {"schema": {"users": {"description": "user information", "columns": {"id": ["INT", "user id"], "name": ["VARCHAR", "user name"], "age": ["INT", "user age"], "gender": ["VARCHAR", "user gender [male, female]"]}, "primary_key": "id"}}} | "SELECT COUNT(*) AS female_count FROM users WHERE gender = 'female';" |
์ด๋ฆ์ด 'John'์ธ ์ฌ์ฉ์ ์กฐํํด์ค | {"schema": {"users": {"description": "user information", "columns": {"id": ["INT", "user id"], "name": ["VARCHAR", "user name"], "age": ["INT", "user age"], "gender": ["VARCHAR", "user gender [male, female]"]}, "primary_key": "id"}}} | "SELECT * FROM users WHERE name = 'John';" |
๋ชจ๋ ์ฃผ๋ฌธ์ ID์ ๋ ์ง๋ฅผ ์กฐํ | {"schema": {"orders": {"description": "order list", "columns": {"id": ["INT", "order id"], "user_id": ["INT", "ordered user id"], "order_date": ["DATE", "order date"], "order_state": ["DATE", "order state [ordered, paid, delivery, done]"], "total_count": ["INT", "order items total count"], "total_price": ["INT", "order total price"]}, "primary_key": "id", "foreign_keys": {"user_id": "users.id"}}}} | "SELECT id, order_date FROM orders;" |
'paid' ์ํ์ธ ์ฃผ๋ฌธ๋ง ์กฐํ | {"schema": {"orders": {"description": "order list", "columns": {"id": ["INT", "order id"], "user_id": ["INT", "ordered user id"], "order_date": ["DATE", "order date"], "order_state": ["DATE", "order state [ordered, paid, delivery, done]"], "total_count": ["INT", "order items total count"], "total_price": ["INT", "order total price"]}, "primary_key": "id", "foreign_keys": {"user_id": "users.id"}}}} | "SELECT * FROM orders WHERE order_state = 'paid';" |
2025๋
์ ์ฃผ๋ฌธ๋ ์ฃผ๋ฌธ ์กฐํ | {"schema": {"orders": {"description": "order list", "columns": {"id": ["INT", "order id"], "user_id": ["INT", "ordered user id"], "order_date": ["DATE", "order date"], "order_state": ["DATE", "order state [ordered, paid, delivery, done]"], "total_count": ["INT", "order items total count"], "total_price": ["INT", "order total price"]}, "primary_key": "id", "foreign_keys": {"user_id": "users.id"}}}} | "SELECT * FROM orders WHERE EXTRACT(YEAR FROM order_date) = 2025;" |
์ด ๊ธ์ก์ด 100,000 ์ด์์ธ ์ฃผ๋ฌธ ์กฐํ | {"schema": {"orders": {"description": "order list", "columns": {"id": ["INT", "order id"], "user_id": ["INT", "ordered user id"], "order_date": ["DATE", "order date"], "order_state": ["DATE", "order state [ordered, paid, delivery, done]"], "total_count": ["INT", "order items total count"], "total_price": ["INT", "order total price"]}, "primary_key": "id", "foreign_keys": {"user_id": "users.id"}}}} | "SELECT * FROM orders WHERE total_price >= 100000;" |
์ฃผ๋ฌธ ๋ ์ง ์์ผ๋ก ๋ชจ๋ ์ฃผ๋ฌธ ์กฐํ | {"schema": {"orders": {"description": "order list", "columns": {"id": ["INT", "order id"], "user_id": ["INT", "ordered user id"], "order_date": ["DATE", "order date"], "order_state": ["DATE", "order state [ordered, paid, delivery, done]"], "total_count": ["INT", "order items total count"], "total_price": ["INT", "order total price"]}, "primary_key": "id", "foreign_keys": {"user_id": "users.id"}}}} | "SELECT * FROM orders ORDER BY order_date ASC;" |
์ต๊ทผ ์ฃผ๋ฌธ๋ ์ฃผ๋ฌธ 3๊ฑด ์กฐํ | {"schema": {"orders": {"description": "order list", "columns": {"id": ["INT", "order id"], "user_id": ["INT", "ordered user id"], "order_date": ["DATE", "order date"], "order_state": ["DATE", "order state [ordered, paid, delivery, done]"], "total_count": ["INT", "order items total count"], "total_price": ["INT", "order total price"]}, "primary_key": "id", "foreign_keys": {"user_id": "users.id"}}}} | "SELECT * FROM orders ORDER BY order_date DESC LIMIT 3;" |
'delivery' ์ํ์ธ ์ฃผ๋ฌธ ์ ๊ณ์ฐ | {"schema": {"orders": {"description": "order list", "columns": {"id": ["INT", "order id"], "user_id": ["INT", "ordered user id"], "order_date": ["DATE", "order date"], "order_state": ["DATE", "order state [ordered, paid, delivery, done]"], "total_count": ["INT", "order items total count"], "total_price": ["INT", "order total price"]}, "primary_key": "id", "foreign_keys": {"user_id": "users.id"}}}} | "SELECT COUNT(*) AS delivery_count FROM orders WHERE order_state = 'delivery';" |
'ordered' ์ํ์ ํ๊ท ์ฃผ๋ฌธ ๊ธ์ก ๊ณ์ฐ | {"schema": {"orders": {"description": "order list", "columns": {"id": ["INT", "order id"], "user_id": ["INT", "ordered user id"], "order_date": ["DATE", "order date"], "order_state": ["DATE", "order state [ordered, paid, delivery, done]"], "total_count": ["INT", "order items total count"], "total_price": ["INT", "order total price"]}, "primary_key": "id", "foreign_keys": {"user_id": "users.id"}}}} | "SELECT AVG(total_price) AS average_order_price FROM orders WHERE order_state = 'ordered';" |
์ฃผ๋ฌธ ์ํ๋ณ ์ฃผ๋ฌธ ์ ์๋ ค์ค | {"schema": {"orders": {"description": "order list", "columns": {"id": ["INT", "order id"], "user_id": ["INT", "ordered user id"], "order_date": ["DATE", "order date"], "order_state": ["DATE", "order state [ordered, paid, delivery, done]"], "total_count": ["INT", "order items total count"], "total_price": ["INT", "order total price"]}, "primary_key": "id", "foreign_keys": {"user_id": "users.id"}}}} | "SELECT order_state, COUNT(*) AS state_count FROM orders GROUP BY order_state;" |
์ด ์ํ ์๊ฐ 10๊ฐ ์ด์์ธ ์ฃผ๋ฌธ ์กฐํ | {"schema": {"orders": {"description": "order list", "columns": {"id": ["INT", "order id"], "user_id": ["INT", "ordered user id"], "order_date": ["DATE", "order date"], "order_state": ["DATE", "order state [ordered, paid, delivery, done]"], "total_count": ["INT", "order items total count"], "total_price": ["INT", "order total price"]}, "primary_key": "id", "foreign_keys": {"user_id": "users.id"}}}} | "SELECT * FROM orders WHERE total_count >= 10;" |
๋ชจ๋ ์ํ์ ์ด๋ฆ๊ณผ ๊ฐ๊ฒฉ ์กฐํ | {"schema": {"items": {"description": "item information", "colums": {"id": ["INT", "item id"], "name": ["varchar", "item name"], "price": ["INT", "item price"]}, "primary_key": "id"}}} | "SELECT name, price FROM items;" |
๊ฐ๊ฒฉ์ด 500,000์ ์ด์์ธ ์ํ ์กฐํ | {"schema": {"items": {"description": "item information", "colums": {"id": ["INT", "item id"], "name": ["varchar", "item name"], "price": ["INT", "item price"]}, "primary_key": "id"}}} | "SELECT * FROM items WHERE price >= 500000;" |
๊ฐ๊ฒฉ์ด 5,000์ ์ดํ์ธ ์ํ ์กฐํ | {"schema": {"items": {"description": "item information", "colums": {"id": ["INT", "item id"], "name": ["varchar", "item name"], "price": ["INT", "item price"]}, "primary_key": "id"}}} | "SELECT * FROM items WHERE price <= 5000;" |
๊ฐ์ฅ ๋น์ผ ์ํ ์กฐํ | {"schema": {"items": {"description": "item information", "colums": {"id": ["INT", "item id"], "name": ["varchar", "item name"], "price": ["INT", "item price"]}, "primary_key": "id"}}} | "SELECT * FROM items ORDER BY price DESC LIMIT 1;" |
๊ฐ์ฅ ์ ๋ ดํ ์ํ ์กฐํ | {"schema": {"items": {"description": "item information", "colums": {"id": ["INT", "item id"], "name": ["varchar", "item name"], "price": ["INT", "item price"]}, "primary_key": "id"}}} | "SELECT * FROM items ORDER BY price ASC LIMIT 1;" |
์ํ ์ด๋ฆ์ 'toy'๊ฐ ํฌํจ๋ ์ํ ์กฐํ | {"schema": {"items": {"description": "item information", "colums": {"id": ["INT", "item id"], "name": ["varchar", "item name"], "price": ["INT", "item price"]}, "primary_key": "id"}}} | "SELECT * FROM items WHERE name LIKE '%toy%';" |
์ํ์ ํ๊ท ๊ฐ๊ฒฉ ๊ณ์ฐ | {"schema": {"items": {"description": "item information", "colums": {"id": ["INT", "item id"], "name": ["varchar", "item name"], "price": ["INT", "item price"]}, "primary_key": "id"}}} | "SELECT AVG(price) AS average_price FROM items;" |
๊ฐ๊ฒฉ์ด ๋์ ์์๋๋ก ๋ชจ๋ ์ํ ์กฐํ | {"schema": {"items": {"description": "item information", "colums": {"id": ["INT", "item id"], "name": ["varchar", "item name"], "price": ["INT", "item price"]}, "primary_key": "id"}}} | "SELECT * FROM items ORDER BY price DESC;" |
์ํ ์ด๋ฆ ์ค๋ณต ์์ด ์กฐํ | {"schema": {"items": {"description": "item information", "colums": {"id": ["INT", "item id"], "name": ["varchar", "item name"], "price": ["INT", "item price"]}, "primary_key": "id"}}} | "SELECT DISTINCT name FROM items;" |
์ํ ์ด๋ฆ์ด 'Book'์ธ ์ํ ์กฐํ | {"schema": {"items": {"description": "item information", "colums": {"id": ["INT", "item id"], "name": ["varchar", "item name"], "price": ["INT", "item price"]}, "primary_key": "id"}}} | "SELECT * FROM items WHERE name = 'Book';" |
๋ชจ๋ ์ฃผ๋ฌธ ํญ๋ชฉ ์กฐํ | {"schema": {"order_item": {"description": "order's item list", "colums": {"id": ["INT", "order_item id"], "order_id": ["INT", "order_id"], "item_id": ["INT", "item_id"], "amount": ["INT", "ordered item amount"]}, "primary_key": "id", "foreign_keys": {"order_id": "orders.id", "item_id": "items.id"}}}} | "SELECT * FROM order_item;" |
ํน์ ์ฃผ๋ฌธ(id = 1)์ ๋ํ ๋ชจ๋ ์ฃผ๋ฌธ ํญ๋ชฉ ์กฐํ | {"schema": {"order_item": {"description": "order's item list", "colums": {"id": ["INT", "order_item id"], "order_id": ["INT", "order_id"], "item_id": ["INT", "item_id"], "amount": ["INT", "ordered item amount"]}, "primary_key": "id", "foreign_keys": {"order_id": "orders.id", "item_id": "items.id"}}}} | "SELECT * FROM order_item WHERE order_id = 1;" |
์ฃผ๋ฌธ๋ณ๋ก ํฌํจ๋ ์ํ ๊ฐ์ ์กฐํ | {"schema": {"order_item": {"description": "order's item list", "colums": {"id": ["INT", "order_item id"], "order_id": ["INT", "order_id"], "item_id": ["INT", "item_id"], "amount": ["INT", "ordered item amount"]}, "primary_key": "id", "foreign_keys": {"order_id": "orders.id", "item_id": "items.id"}}}} | "SELECT order_id, SUM(amount) AS total_items FROM order_item GROUP BY order_id;" |
ํน์ ์ฃผ๋ฌธ์ ๋ํด ์ฃผ๋ฌธ๋ ์ด ๊ธ์ก ๊ณ์ฐ (๊ฐ๊ฒฉ x ์๋) | {"schema": {"items": {"description": "item information", "colums": {"id": ["INT", "item id"], "name": ["varchar", "item name"], "price": ["INT", "item price"]}, "primary_key": "id"}, "order_item": {"description": "order's item list", "colums": {"id": ["INT", "order_item id"], "order_id": ["INT", "order_id"], "item_id": ["INT", "item_id"], "amount": ["INT", "ordered item amount"]}, "primary_key": "id", "foreign_keys": {"order_id": "orders.id", "item_id": "items.id"}}}} | "SELECT oi.order_id, SUM(i.price * oi.amount) AS total_price FROM order_item oi JOIN items i ON oi.item_id = i.id WHERE oi.order_id = 1 GROUP BY oi.order_id;" |
์ฃผ๋ฌธ ํญ๋ชฉ์ ์๋์ด 5๊ฐ ์ด์์ธ ์ฃผ๋ฌธ ํญ๋ชฉ ์กฐํ | {"schema": {"order_item": {"description": "order's item list", "colums": {"id": ["INT", "order_item id"], "order_id": ["INT", "order_id"], "item_id": ["INT", "item_id"], "amount": ["INT", "ordered item amount"]}, "primary_key": "id", "foreign_keys": {"order_id": "orders.id", "item_id": "items.id"}}}} | "SELECT * FROM order_item WHERE amount >= 5;" |
README.md exists but content is empty.
- Downloads last month
- 31