https://programmers.co.kr/learn/courses/30/lessons/59042
SELECT I.ANIMAL_ID, I.NAME
FROM ANIMAL_OUTS I
LEFT JOIN ANIMAL_INS O
ON I.ANIMAL_ID=O.ANIMAL_ID
WHERE O.ANIMAL_ID IS NULL
ORDER BY O.ANIMAL_ID;
https://programmers.co.kr/learn/courses/30/lessons/59043
SELECT INS.ANIMAL_ID, INS.NAME
FROM ANIMAL_INS AS INS
LEFT JOIN ANIMAL_OUTS AS OUTS
ON INS.ANIMAL_ID = OUTS.ANIMAL_ID
WHERE INS.DATETIME > OUTS.DATETIME ORDER BY INS.DATETIME;
https://programmers.co.kr/learn/courses/30/lessons/59044
SELECT INS.NAME, INS.DATETIME
FROM ANIMAL_INS INS
LEFT JOIN ANIMAL_OUTS OUTS
ON INS.ANIMAL_ID=OUTS.ANIMAL_ID
WHERE OUTS.ANIMAL_ID IS NULL
ORDER BY INS.DATETIME
LIMIT 3;
https://programmers.co.kr/learn/courses/30/lessons/59045
SELECT OUTS.ANIMAL_ID, OUTS.ANIMAL_TYPE, OUTS.NAME
FROM ANIMAL_OUTS OUTS
LEFT JOIN ANIMAL_INS INS
ON OUTS.ANIMAL_ID=INS.ANIMAL_ID
WHERE (OUTS.SEX_UPON_OUTCOME LIKE "Spayed%" OR OUTS.SEX_UPON_OUTCOME LIKE "Neutered%")
AND INS.SEX_UPON_INTAKE LIKE "Intact%"
ORDER BY OUTS.ANIMAL_ID;
WHERE ~ LIKE "찾고싶은 문자열" 을 기억하자
'Develop > SQL' 카테고리의 다른 글
[프로그래머스] SQL 고득점 키트 (MySQL) - String, Date (0) | 2021.09.15 |
---|---|
[프로그래머스] SQL 고득점 키트 (MySQL) - NOT NULL, CASE (0) | 2021.09.15 |
[프로그래머스] SQL 고득점 키트 (MySQL) - GROUP BY (0) | 2021.09.14 |
[프로그래머스] SQL 고득점 키트 (MySQL) - SUM,MAX,MIN (0) | 2021.09.14 |
[프로그래머스] SQL고득점 키트 (MySQL) - SELECT (0) | 2021.09.14 |
댓글