문제
입력 코드
1.
SELECT
p.project_id,
ROUND(AVG(e.experience_years), 2) AS average_years
FROM Project AS p
JOIN Employee AS e
ON p.employee_id = e.employee_id
GROUP BY p.project_id
2.
SELECT
p.project_id,
ROUND(SUM(e.experience_years)/COUNT(e.experience_years), 2) AS average_years
FROM Project AS p
JOIN Employee AS e
ON p.employee_id = e.employee_id
GROUP BY p.project_id
코드 설명
#SELECT #ROUND #AVG #SUM #COUNT #JOIN #GROUP BY
문제 출처
'SQL' 카테고리의 다른 글
#93. [LeetCode / MySQL] 1211. Queries Quality and Percentage (0) | 2023.09.19 |
---|---|
#92. [LeetCode / MySQL] 1633. Percentage of Users Attended a Contest (0) | 2023.09.18 |
#90. [LeetCode / MySQL] 1251. Average Selling Price (0) | 2023.09.16 |
#89. [LeetCode / MySQL] 620. Not Boring Movies (0) | 2023.09.15 |
#88. [LeetCode / MySQL] 1934. Confirmation Rate (0) | 2023.09.14 |