묶어서 집계하기
마지막 연습 문제에서는 이 장에서 배운 MIN 같은 집계 함수와 GROUP BY를 함께 사용해 보겠습니다.
이 장을 마무리하면서 1장에서 사용했던 eurovision 테이블로 돌아가 보겠습니다.
이 연습은 강의의 일부입니다
SQL Server 입문
실습형 인터랙티브 연습
이 예제를 이 샘플 코드를 완성하여 풀어보세요.
-- Retrieve the minimum and maximum place, and point values
SELECT
-- the lower the value the higher the place, so MIN = the highest placing
MIN(place) AS hi_place,
___(place) AS lo_place,
-- Retrieve the minimum and maximum points values. This time MIN = the lowest points value
___(points) AS min_points,
MAX(points) AS max_points
FROM
eurovision;