728x90

https://leetcode.com/problems/not-boring-movies/

 

Not Boring Movies - 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

 

[problem]

1. 홀수인경우

2. description 에 boring이 들어간 경우 제외

3. order by DESC 적용

[analysis]

1.where 절을 통한 조건 적용

--> 홀수인경우 id % 2 !=0 으로 나타낼 수 있음 / boring문자 제외도 !를 이용함

[solution]

728x90
728x90

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

 

[problem]

두 테이블간의 join 필요

Write an SQL query to report the first name, last name, city, and state of each person in the Person table. If the address of a personId is not present in the Address table, report null instead.

Return the result table in any order.

[analysis]

1. address가 null인 경우도 정보를 보여줘야 하므로 person table 기준으로 left join 실행

2. 두 테이블에 공통 컬럼인 personId 기준으로 join

 

[solution]

728x90
728x90

https://leetcode.com/problems/duplicate-emails/submissions/

 

Duplicate Emails - 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

 

[problem]

email데이터 중복없이 정보 출력하기

[analysis]

1. 중복된 이메일 제외 위해서 email로 group by 해줌

2. having count email >1 (2이상이면 중복임)

* having은 group by에서 연산한 결과물에 조건을 줄 때 사용 where과는 다르다.

 

[solution]

728x90

+ Recent posts