Прокачиваем SQL — must have skill для хорошего тестировщика.
От создателей @godoftesting
По всем вопросам: @anothertechrock
Post #94
2.51K
- 🔥 12
- 👍 6
- ❤ 3
SQ @sql_for_qa
Showing posts older than #96 · Back to latest


orders с колонками order_id, customer_id, order_date, total_amount. Какой из следующих SQL запросов вернет топ-3 месяца с наибольшим количеством заказов?SELECT MONTH(order_date) AS month, SUM(total_amount) AS total_order_amount
FROM orders
GROUP BY month
ORDER BY total_order_amount DESC
LIMIT 3;
B) SELECT EXTRACT(MONTH FROM order_date) AS month, SUM(total_amount) AS total_order_amount
FROM orders
GROUP BY month
ORDER BY total_order_amount DESC
LIMIT 3;
C) SELECT DATE_TRUNC('month', order_date) AS month, SUM(total_amount) AS total_order_amount
FROM orders
GROUP BY month
ORDER BY total_order_amount DESC
LIMIT 3;
D) SELECT STRFTIME('%Y-%m', order_date) AS month, SUM(total_amount) AS total_order_amount
FROM orders
GROUP BY month
ORDER BY total_order_amount DESC
LIMIT 3;
Ответить на вопрос можно ниже ⬇️





