분류 전체보기 299

[프로그래머스] 대여 기록이 존재하는 자동차 리스트 구하기

📢 본 포스팅에 활용되는 기본 문제 및 자료 출처는 프로그래머스 코딩테스트 연습, https://school.programmers.co.kr/learn/challenges?page=1&languages=mysql%2Coracle임을 밝힙니다. · 본 문제 https://school.programmers.co.kr/learn/courses/30/lessons/157341 ■ 문제 문제 설명 다음은 어느 자동차 대여 회사에서 대여 중인 자동차들의 정보를 담은 CAR_RENTAL_COMPANY_CAR 테이블과 자동차 대여 기록 정보를 담은 CAR_RENTAL_COMPANY_RENTAL_HISTORY 테이블입니다. CAR_RENTAL_COMPANY_CAR 테이블은 아래와 같은 구조로 되어있으며, CAR_ID, ..

[프로그래머스] 자동차 평균 대여 기간 구하기

📢 본 포스팅에 활용되는 기본 문제 및 자료 출처는 프로그래머스 코딩테스트 연습, https://school.programmers.co.kr/learn/challenges?page=1&languages=mysql%2Coracle임을 밝힙니다. ■ 문제 문제 설명 다음은 어느 자동차 대여 회사의 자동차 대여 기록 정보를 담은 CAR_RENTAL_COMPANY_RENTAL_HISTORY 테이블입니다. CAR_RENTAL_COMPANY_RENTAL_HISTORY 테이블은 아래와 같은 구조로 되어있으며, HISTORY_ID, CAR_ID, START_DATE, END_DATE 는 각각 자동차 대여 기록 ID, 자동차 ID, 대여 시작일, 대여 종료일을 나타냅니다. Column name Type Nullable ..

[프로그래머스] 특정 옵션이 포함된 자동차 리스트 구하기

📢 본 포스팅에 활용되는 기본 문제 및 자료 출처는 프로그래머스 코딩테스트 연습, https://school.programmers.co.kr/learn/courses/30/lessons/157343 임을 밝힙니다. ■ 문제 문제 설명 다음은 어느 자동차 대여 회사에서 대여중인 자동차들의 정보를 담은 CAR_RENTAL_COMPANY_CAR 테이블입니다. CAR_RENTAL_COMPANY_CAR 테이블은 아래와 같은 구조로 되어있으며, CAR_ID, CAR_TYPE, DAILY_FEE, OPTIONS 는 각각 자동차 ID, 자동차 종류, 일일 대여 요금(원), 자동차 옵션 리스트를 나타냅니다. Column name Type Nullable CAR_ID INTEGER FALSE CAR_TYPE VARCHAR..

[PostgreSQL] Set Returning Functions / Series Generating Functions (시리즈 생성 함수)

generate_series() 함수 를 이용하면 일련의 데이터셋을 만들 수 있다. 단계로 시작부터 끝까지 일련의 값을 생성한다. * 단계 기본값은 1이다. generate_series ( start integer, stop integer [, step integer ] ) → setof integer generate_series ( start bigint, stop bigint [, step bigint ] ) → setof bigint generate_series ( start numeric, stop numeric [, step numeric ] ) → setof numeric 예시) SELECT * FROM generate_series(2,10); SELECT * FROM genera..

Database/SQL 2023.02.17

[리트코드] 596. Classes More Than 5 Students

📢 본 포스팅에 활용되는 기본 문제 및 자료 출처는 리트코드 Problems / https://leetcode.com/problemset/all/ 임을 밝힙니다. ■ 문제 https://leetcode.com/problems/classes-more-than-5-students/description/ Classes More Than 5 Students - LeetCode Can you solve this real interview question? Classes More Than 5 Students - Table: Courses +-------------+---------+ | Column Name | Type | +-------------+---------+ | student | varchar | | c..

[프로그래머스] 자동차 대여 기록별 대여 금액 구하기 (23.06.14 재풀이)

📢 본 포스팅에 활용되는 기본 문제 및 자료 출처는 프로그래머스 코딩테스트 연습, https://school.programmers.co.kr/learn/challenges?page=1&languages=mysql%2Coracle임을 밝힙니다. ■ 문제 문제 설명 다음은 어느 자동차 대여 회사에서 대여 중인 자동차들의 정보를 담은 CAR_RENTAL_COMPANY_CAR 테이블과 자동차 대여 기록 정보를 담은 CAR_RENTAL_COMPANY_RENTAL_HISTORY 테이블과 자동차 종류 별 대여 기간 종류 별 할인 정책 정보를 담은 CAR_RENTAL_COMPANY_DISCOUNT_PLAN 테이블 입니다. CAR_RENTAL_COMPANY_CAR 테이블은 아래와 같은 구조로 되어있으며, CAR_ID, ..

[리트코드] 196. Delete Duplicate Emails

📢 본 포스팅에 활용되는 기본 문제 및 자료 출처는 리트코드 Problems / https://leetcode.com/problemset/all/ 임을 밝힙니다. ■ 문제 https://leetcode.com/problems/delete-duplicate-emails/description/ Delete Duplicate Emails - LeetCode Delete Duplicate Emails - Table: Person +-------------+---------+ | Column Name | Type | +-------------+---------+ | id | int | | email | varchar | +-------------+---------+ id is the primary key colu..

[해커랭크] The Report

📢 본 포스팅에 활용되는 기본 문제 및 자료 출처는 해커랭크 Prepare / https://www.hackerrank.com/dashboard 임을 밝힙니다. ■ 문제 https://www.hackerrank.com/challenges/the-report/problem?h_r=internal-search The Report | HackerRank Write a query to generate a report containing three columns: Name, Grade and Mark. www.hackerrank.com You are given two tables: Students and Grades. Students contains three columns ID, Name and Marks. G..

[해커랭크] Top Earners

📢 본 포스팅에 활용되는 기본 문제 및 자료 출처는 해커랭크 Prepare / https://www.hackerrank.com/dashboard 임을 밝힙니다. ■ 문제 We define an employee's total earnings to be their monthly salary x months worked, and the maximum total earnings to be the maximum total earnings for any employee in the Employee table. Write a query to find the maximum total earnings for all employees as well as the total number of employees who have..

[해커랭크] Weather Observation Station 16

📢 본 포스팅에 활용되는 기본 문제 및 자료 출처는 해커랭크 Prepare / https://www.hackerrank.com/dashboard 임을 밝힙니다. ■ 문제 Query the smallest Northern Latitude (LAT_N) from STATION that is greater than . Round your answer to decimal places. Input Format The STATION table is described as follows: where LAT_N is the northern latitude and LONG_W is the western longitude. ■ 풀이 문제 요구사항 38.7780 보다 높은 북부 위도중에 < WHERE 조건1 가장 낮은 위도..