Skip to content

Commit aac98f8

Browse files
committed
Add problems 570, 1193 and 1045
1 parent aedcb20 commit aac98f8

File tree

50 files changed

+38
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+38
-0
lines changed

README.md

+3
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
SELECT
2+
customer_id
3+
FROM
4+
`Customer`
5+
GROUP BY
6+
`customer_id`
7+
HAVING
8+
COUNT(DISTINCT `product_key`) = ( -- table may contain duplicates rows
9+
SELECT
10+
COUNT(`product_key`)
11+
FROM
12+
`Product`
13+
);
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
SELECT
2+
m.name
3+
FROM
4+
Employee e
5+
JOIN Employee m ON e.managerId = m.id
6+
GROUP BY
7+
m.id,
8+
m.name
9+
HAVING
10+
COUNT(e.id) > 4;
File renamed without changes.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
SELECT
2+
DATE_FORMAT(trans_date, '%Y-%m') AS month,
3+
country,
4+
COUNT(*) AS trans_count,
5+
SUM(IF(state = 'approved', 1, 0)) AS approved_count,
6+
SUM(amount) AS trans_total_amount,
7+
SUM(IF(state = 'approved', amount, 0)) AS approved_total_amount
8+
FROM
9+
Transactions
10+
GROUP BY
11+
DATE_FORMAT(trans_date, '%Y-%m'),
12+
country;
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)