1. 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
2. Problem

3. Analysis
1. provides the following information for each person이므로 각각의 정보에 대해 SELECT 하고 LEFT JOIN을 한다.
4. Solution
<sql />
SELECT P.FirstName, P.LastName, A.City, A.State
FROM Person P
LEFT JOIN Address A ON A.PersonId = P.PersonId
'Algorithm > SQL' 카테고리의 다른 글
[SQL][Leetcode] 177. Nth Highest Salary (0) | 2020.06.19 |
---|---|
[SQL][Leetcode] 176. Second Highest Salary (0) | 2020.06.19 |
[SQL][프로그래머스] 보호소에서 중성화한 동물 (0) | 2020.06.17 |
[SQL][프로그래머스] 오랜 기간 보호한 동물(2) (0) | 2020.06.16 |
[SQL][프로그래머스] 오랜 기간 보호한 동물(1) (0) | 2020.06.16 |