문제) Leetcode - SQL - Combine Two Tables
https://leetcode.com/problems/combine-two-tables/
Combine Two Tables - LeetCode
Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview.
leetcode.com
Person 테이블과 Address 테이블 합치면 되는 문제였습니다. Address 테이블은 존재하지 null로 처리해야되므로 left join을 이용해서 테이블을 합쳤습니다.
풀이)
select firstName, lastName, city, state
from Person left join Address on Person.personid = Address.personId
반응형
'Develop > Database' 카테고리의 다른 글
[Leetcode] 183. Customers Who Never Order (MySQL) 문제 및 풀이 (0) | 2021.12.16 |
---|---|
[프로그래머스] SQL 고득점 Kit - 오랜 기간 보호한 동물(1) (MySQL) 문제 및 풀이 (0) | 2021.12.13 |
[프로그래머스] SQL 고득점 Kit - 있었는데요 없었습니다 (MySQL) 문제 및 풀이 (0) | 2021.12.12 |
[프로그래머스] SQL 고득점 Kit - 없어진 기록 찾기 (MySQL) 문제 및 풀이 (0) | 2021.12.12 |
[Leetcode] 182. Duplicate Emails (MySQL) 문제 및 풀이 (0) | 2021.12.12 |
댓글