Skip to content

Commit 0150e62

Browse files
committed
Solvesql Solution
- SQL
1 parent daace43 commit 0150e62

6 files changed

Lines changed: 45 additions & 1 deletion

File tree

README.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,12 @@
1414

1515
- [List](https://github.com/SubAkBa/Algorithm_Solution/tree/master/Programmers)
1616
<hr>
17-
17+
18+
<a href="https://solvesql.com/" target="_blank"><img src="./img/solvesql.png" width="220" height="70"></a>
19+
20+
- [List](https://github.com/SubAkBa/Algorithm_Solution/tree/master/Solvesql)
21+
<hr>
22+
1823
<a href="https://swexpertacademy.com/main/main.do" target="_blank"><img src="./img/swea.png" width="300" height="70"></a>
1924

2025
- [List](https://github.com/SubAkBa/Algorithm_Solution/tree/master/SWEA)

Solvesql/README.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Solvesql
2+
3+
## 난이도 2
4+
5+
<details open> <summary> 접기 / 펼치기 </summary>
6+
7+
| Idx | Question | Category | Solution | Note |
8+
|:---:|-------------------------------------------------------| -------------------------------------------------------------------------- |-------------------------------------------------------------------------------------------------------------| ---- |
9+
| 1 | [두 테이블 결합하기](https://solvesql.com/problems/join/) | JOIN/UNION | [Solution]() | |
10+
| 2 | [레스토랑 웨이터의 팁 분석](https://solvesql.com/problems/tip-analysis/) | Aggregate | [Solution]() | |
11+
| 3 | [일별 블로그 방문자 수 집계](https://solvesql.com/problems/blog-counter/) | Aggregate | [Solution]() | |
12+
13+
14+
</details>
15+
16+
<br />
17+
<br />
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
SELECT DISTINCT athlete_id
2+
FROM records
3+
WHERE EXISTS (
4+
SELECT 1
5+
FROM events
6+
WHERE sport = 'Golf'
7+
AND events.id = records.event_id
8+
);
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
SELECT day
2+
, time
3+
, ROUND(AVG(tip), 2) as avg_tip
4+
, ROUND(AVG(size), 2) as avg_size
5+
FROM tips
6+
GROUP BY day, time
7+
ORDER BY day, time;
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
SELECT event_date_kst AS dt
2+
, COUNT(DISTINCT user_pseudo_id) AS users
3+
FROM ga
4+
WHERE event_date_kst >= '2021-08-02'
5+
AND event_date_kst <= '2021-08-09'
6+
GROUP BY event_date_kst
7+
ORDER BY dt;

img/solvesql.png

9.89 KB
Loading

0 commit comments

Comments
 (0)