Skip to content

SQL Practice 1

1. 문제 [[object Object]]

다음 환자 테이블에서 알레르기가 없는 환자의 이름과 성을 표시하는 SQL 구문을 작성하시오.

patient_idfirst_namelast_namegenderbirth_datecityprovince_idallergiesheightweight
1DonaldWaterfieldM1963-02-12BarrieONNULL15665
2MickeyBaashaM1981-05-28DundasONSulfa18576
3JijiSharmaM1957-09-05HamiltonONPenicillin194106
4BlairDiazM1967-01-07HamiltonONNULL191104
5CharlesWolfeM2017-11-19OrilliaONPenicillin4710
6SueFalconF2017-09-30AjaxONPenicillin435

2. 정답

SELECT
  first_name,
  last_name
FROM patients
WHERE allergies IS NULL;

3. 결과

first_namelast_name
DonaldWaterfield
BlairDiaz