LeetCode - 1075. Project Employees I (MySQL)

조민수·2024년 6월 9일
0

LeetCode

목록 보기
25/64
post-custom-banner

Easy, SQL - 기초

RunTime : 967 ms


문제

Write an SQL query that reports the average experience years of all the employees for each project, rounded to 2 digits.

Return the result table in any order.

The query result format is in the following example.


풀이

  • 프로그래머스 Lv2 수준에서 흔히 접하던 문제
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 1
profile
사람을 좋아하는 Front-End 개발자
post-custom-banner

0개의 댓글