[프로그래머스 - ORACLE] 저자 별 카테고리 별 매출액 집계하기
CREATE 문 CREATE TABLE BOOK ( BOOK_IDNUMBER NOT NULL, CATEGORYVARCHAR(10)NOT NULL, AUTHOR_IDNUMBERNOT NULL, PRICENUMBERNOT NULL, PUBLISHED_DATEDATENOT NULL ); CREATE TABLE AUTHOR( AUTHOR_IDNUMBERNOT NULL, AUTHOR_NAMEVARCHAR(20)NOT NULL ); CREATE TABLE BOOK_SALES ( BOOK_IDNUMBERNOT NULL, SALES_DATEDATENOT NULL, SALESNUMBERNOT NULL ); 내 풀이 SELECT A.AUTHOR_ID, A.AUTHOR_NAME, B.CATEGORY, SUM(S.SALES ..
2023. 3. 24.
[프로그래머스 - ORACLE] 취소되지 않은 진료 예약 조회하기
CREATE 문 CREATE TABLE PATIENT ( PT_NOVARCHAR(30)NOT NULL, PT_NAMEVARCHAR(30)NOT NULL, GEND_CDVARCHAR(30)NOT NULL, AGENUMBERNOT NULL, TLNOVARCHAR(30)NULL ) CREATE TABLE DOCTOR ( DR_NAMEVARCHAR(30)NOT NULL, DR_IDVARCHAR(30)NOT NULL, LCNS_NOVARCHAR(30)NOT NULL, HIRE_YMDDATENOT NULL, MCDP_CDVARCHAR(30)NULL, TLNOVARCHAR(30)NULL ) CREATE TABLE APPOINTMENT ( APNT_YMDTIMESTAMPNOT NULL, APNT_NOINTEGERNOT..
2023. 3. 23.
[프로그래머스 - ORACLE] 년, 월, 성별 별 상품 구매 회원 수 구하기
CREATE 문 CREATE TABLE USER_INFO ( USER_IDNUMBER NOT NULL, GENDERNUMBER NULL, AGENUMBER NULL, JOINEDDATENOT NULL ) CREATE TABLE ONLINE_SALE ( ONLINE_SALE_IDNUMBER NOT NULL, USER_IDNUMBER NOT NULL, PRODUCT_IDNUMBER NOT NULL, SALES_AMOUNTNUMBER NOT NULL, SALES_DATEDATENOT NULL ) 내 풀이 SELECT TO_NUMBER(TO_CHAR(S.SALES_DATE, 'YYYY'))AS YEAR, TO_NUMBER(TO_CHAR(S.SALES_DATE, 'MM'))AS MONTH, I.GENDER AS ..
2023. 3. 23.
[프로그래머스 - ORACLE] 그룹별 조건에 맞는 식당 목록 출력하기
CREATE 문 CREATE TABLE MEMBER_PROFILE ( MEMBER_IDVARCHAR(100)NOT NULL, MEMBER_NAMEVARCHAR(50)NOT NULL, TLNOVARCHAR(50)NULL, GENDERVARCHAR(1)NULL, DATE_OF_BIRTHDATENULL ) CREATE TABLE REST_REVIEW ( REVIEW_IDVARCHAR(10)NOT NULL, REST_IDVARCHAR(10)NULL, MEMBER_IDVARCHAR(100)NULL, REVIEW_SCORENUMBERNULL, REVIEW_TEXTVARCHAR(1000)NULL, REVIEW_DATEDATENULL ) 내 풀이 SELECT P.MEMBER_NAME, R.REVIEW_TEXT, TO_..
2023. 3. 23.
[프로그래머스 - ORACLE] 서울에 위치한 식당 목록 출력하기
CREATE 문 CREATE TABLE REST_INFO ( REST_IDVARCHAR(5)NOT NULL, REST_NAMEVARCHAR(50)NOT NULL, FOOD_TYPEVARCHAR(20)NULL, VIEWSNUMBERNULL, FAVORITESNUMBERNULL, PARKING_LOTVARCHAR(1)NULL, ADDRESSVARCHAR(100)NULL, TELVARCHAR(100)NULL ) CREATE TABLE REST_REVIEW ( REVIEW_IDVARCHAR(10)NOT NULL, REST_IDVARCHAR(10)NULL, MEMBER_IDVARCHAR(100)NULL, REVIEW_SCORENUMBERNULL, REVIEW_TEXTVARCHAR(1000)NULL, REVIEW_..
2023. 3. 23.