본문 바로가기

Study/SQL

(11)
[sql-practice] SQL 문제 풀이 (3) 개요SQL 문법 체득을 위해 sql-practice의 각 문제 풀이 과정을 기록함출처https://www.sql-practice.com/난이도 MEDIUM 스키마목차문제지문난이도출처현황풀이정답개선할 점문제지문Show unique birth years from patients and order them by ascending.현황 COMPLETED 풀이SELECT distinct(YEAR(birth_date))FROM patientsorder by birth_date;정답-- Solution (1/2)SELECT DISTINCT YEAR(birth_date) AS birth_yearFROM patientsORDER BY birth_year;-- Solution (2/2)SELECT year(birth_d..
[sql-practice] SQL 문제 풀이 (2) 개요SQL 문법 체득을 위해 sql-practice의 각 문제 풀이 과정을 기록함출처https://www.sql-practice.com/난이도 EASY 스키마목차문제지문난이도출처현황풀이정답개선할 점문제지문Show first name, last name of patients who does not have allergies. (null)현황 COMPLETED 풀이SELECT first_name, last_name, MAX(height)FROM patientsHAVING height = MAX(height);정답SELECT first_name, last_name, heightFROM patientsWHERE height = ( SELECT max(height) FROM patien..
[sql-practice] SQL 문제 풀이 (1) 개요SQL 문법 체득을 위해 sql-practice의 각 문제 풀이 과정을 기록함출처https://www.sql-practice.com/난이도 EASY 스키마목차문제 #1지문난이도현황풀이정답개선할 점문제 #2지문난이도현황풀이정답개선할 점분석문법실행 순서개선할 점기타문제 #1지문Show first name, last name, and gender of patients whose gender is 'M'현황 COMPLETED 풀이SELECT first_name, last_name, gender FROM patientsWHERE gender == 'M'정답SELECT first_name, last_name, genderFROM patientsWHERE gender = 'M';개선할 점= (eq..

반응형