Skip to content

SQL Practice 8

1. 문제 [[object Object]]

키가 가장 큰 환자의 성, 이름, 신장을 표시하시오.

patient_idfirst_namelast_namegenderbirth_datecityprovince_idallergiesheightweight
301RicardoAndrewsM1987-07-21HamiltonONNULL177112
302PaulVondopoulosM2010-05-22BrantfordONNULL10736
303AgnesParkinsonF1975-01-11HamiltonONSulfa Drugs15847
304JeffreyPascoeM1957-05-12HamiltonONSulfa17484
305AmaneFluteF2006-03-27HamiltonONNULL13048
306MattFranchettiM2007-09-25BurlingtonONMilk15760

2. 정답

SELECT
  first_name,
  last_name,
  MAX(height) AS height
FROM patients;

3. 다른 정답

SELECT
  first_name,
  last_name,
  height
FROM patients
WHERE height = (
  SELECT max(height)
  FROM patients
)

4. 결과

first_namelast_nameheight
RicardoAndrews177