Union 4

[Leet Code] 1965. Employees With Missing Information

📢 본 포스팅에 활용되는 기본 문제 및 자료 출처는 리트코드 Problems, https://leetcode.com/problemset/all/임을 밝힙니다. ✔ 문제 https://leetcode.com/problems/employees-with-missing-information/description/ Employees With Missing Information - LeetCode Can you solve this real interview question? Employees With Missing Information - Table: Employees +-------------+---------+ | Column Name | Type | +-------------+---------+ | emplo..

[Leet code] 1164. Product Price at a Given Date

📢 본 포스팅에 활용되는 기본 문제 및 자료 출처는 리트코드 Problems, https://leetcode.com/problemset/all/임을 밝힙니다. ✔ 문제 https://leetcode.com/problems/product-price-at-a-given-date/ Product Price at a Given Date - LeetCode Can you solve this real interview question? Product Price at a Given Date - Table: Products +---------------+---------+ | Column Name | Type | +---------------+---------+ | product_id | int | | new_pric..

[프로그래머스] 오프라인/온라인 판매 데이터 통합하기 (2차 풀이)

📢 본 포스팅은 Growth/Practice 게시글 (https://sy038680.tistory.com/232) 문제에 대한 2차 풀이입니다. 기존에는 UNION을 활용하긴 했는데 WITH절을 사용해서 임시테이블 T1을 생성해서 WHERE조건(3월 판매), 정렬조건만 나중으로 빼주었다. 재풀이에서는 아예 3월 조건까지 온/오프라인 테이블에 각각 적용해주고 난 뒤에 UNION을 적용했다. SELECT DATE_FORMAT(SALES_DATE,'%Y-%m-%d') AS SALES_DATE, PRODUCT_ID, USER_ID, SALES_AMOUNT FROM ONLINE_SALE WHERE SALES_DATE BETWEEN '2022-03-01 00:00:00' AND '2022-03-31 23:59:59..

[프로그래머스] 오프라인/온라인 판매 데이터 통합하기

📢 본 포스팅에 활용되는 기본 문제 및 자료 출처는 프로그래머스 코딩테스트 연습, https://school.programmers.co.kr/learn/challenges?page=1&languages=mysql%2Coracle임을 밝힙니다. ■ 문제 문제설명 다음은 어느 의류 쇼핑몰의 온라인 상품 판매 정보를 담은 ONLINE_SALE 테이블과 오프라인 상품 판매 정보를 담은 OFFLINE_SALE 테이블 입니다. ONLINE_SALE 테이블은 아래와 같은 구조로 되어있으며 ONLINE_SALE_ID, USER_ID, PRODUCT_ID, SALES_AMOUNT, SALES_DATE는 각각 온라인 상품 판매 ID, 회원 ID, 상품 ID, 판매량, 판매일을 나타냅니다. Column name Type N..