전체 글
-
프로그래머스 - 자동차 평균 대여 기간 구하기SQL 문제 2024. 1. 5. 15:55
자동차 평균 대여 기간 구하기 CAR_RENTAL_COMPANY_RENTAL_HISTORY 테이블에서 평균 대여 기간이 7일 이상인 자동차들의 자동차 ID와 평균 대여 기간(컬럼명: AVERAGE_DURATION) 리스트를 출력하는 SQL문을 작성해주세요. 평균 대여 기간은 소수점 두번째 자리에서 반올림하고, 결과는 평균 대여 기간을 기준으로 내림차순 정렬해주시고, 평균 대여 기간이 같으면 자동차 ID를 기준으로 내림차순 정렬해주세요. -- 코드를 입력하세요 SELECT CAR_ID, ROUND(AVG(DATEDIFF(END_DATE,START_DATE))+1,1) AS AVERAGE_DURATION FROM CAR_RENTAL_COMPANY_RENTAL_HISTORY GROUP BY CAR_ID HAV..
-
프로그래머스 - 서울에 위치한 식당 목록 출력하기SQL 문제 2024. 1. 5. 15:34
서울에 위치한 식당 목록 출력하기 REST_INFO와 REST_REVIEW 테이블에서 서울에 위치한 식당들의 식당 ID, 식당 이름, 음식 종류, 즐겨찾기수, 주소, 리뷰 평균 점수를 조회하는 SQL문을 작성해주세요. 이때 리뷰 평균점수는 소수점 세 번째 자리에서 반올림 해주시고 결과는 평균점수를 기준으로 내림차순 정렬해주시고, 평균점수가 같다면 즐겨찾기수를 기준으로 내림차순 정렬해주세요 -- 코드를 입력하세요 SELECT INFO.REST_ID, INFO.REST_NAME, INFO.FOOD_TYPE, INFO.FAVORITES, INFO.ADDRESS, ROUND(AVG(REVIEW.REVIEW_SCORE),2) AS SCORE FROM REST_INFO as INFO left join REST_RE..
-
프로그래머스 - 년, 월, 성별 별 상품 구매 회원 수 구하기SQL 문제 2024. 1. 5. 15:10
년, 월, 성별 별 상품 구매 회원 수 구하기 USER_INFO 테이블과 ONLINE_SALE 테이블에서 년, 월, 성별 별로 상품을 구매한 회원수를 집계하는 SQL문을 작성해주세요. 결과는 년, 월, 성별을 기준으로 오름차순 정렬해주세요. 이때, 성별 정보가 없는 경우 결과에서 제외해주세요. -- 년, 월, 성별 별로 상품을 구매한 회원수를 집계하는 SQL문을 작성해주세요. -- 결과는 년, 월, 성별을 기준으로 오름차순 정렬해주세요. 이때, 성별 정보가 없는 경우 결과에서 제외해주세요. with sales_info as( SELECT year(sale.sales_date) as Year_date, month(sale.sales_date) as Month_date, info.gender as Gende..
-
1/5스파르타/TIL(Today I Learned) 2024. 1. 5. 11:20
SQL 처음부터 끝까지라는 특강을 듣는 중 기억에 남으면 좋겠다 라는 내용을 정리하려고 한다. 1. 형변환시 (ALTER) 조심해야 할 점은 담기는 COLUMN의 사이즈가 커지면 상관이 없지만 작아지면 대부분은 문제가 생길 가능성이 높다. CREATE TABLE Employees ( EmployeeID INT PRIMARY KEY, Name VARCHAR(50), Position VARCHAR(50), Salary DECIMAL(10, 2) ); ALTER TABLE Employees Name VARCHAR(10); DROP TABLE Employees; 위 쿼리는 TABLE을 생성하는 쿼리이고, ALTER를 통해 NAME이라는 COLUMN을 형변환 하는 쿼리이다. 기존 NAME은 VARCHAR(50)이..
-
1/4카테고리 없음 2024. 1. 4. 18:30
오늘은 지급해준 파이썬 기본 문법 강의를 들었다. 기본을 확실하게 체크함과 동시에 복습하는 기회였다. 무엇보다 좋았던 점은 강의들의 길이가 짧아서 나는 좋았다. 오전에 강의를 다 듣고 오후에는 파이썬 과제를 시도했다. 문제 자체는 어렵지 않은것 같았다. 고민을 많이 했지만 다 풀었다. 문제를 풀면서 반복문에 break와 continue를 써야하고 if문에서는 쓸 수 가 없다. 계속 혼자 if문에 넣을려고 해서 오류가 떴고, if문에서 넘어가려고 하면 return 1이나 return True를 하면 된다 문제를 풀면서 리스트에 대해 많이 알 수 있어서 좋았다.
-
1/03스파르타/TIL(Today I Learned) 2024. 1. 3. 20:47
데이터 리터러시 강의가 지급되어서 강의를 들었다. 데이터 분석가라는 직업이라면 가져야 할 생각을 배울 수 있었다. 데이터를 읽고, 해석해서 의사소통에 활용할 수 있는 능력이라는 것을 리터러시라고 한다. 상관관계와 인과 관계의 차이점에서도 알 수 있었고, 문제를 정의하는 방법도 배웠다. 특히 문제정의를 하면서도 왜라는 질문을 끊임없이 던져야 한다. 문제 정의의 방법론에 대해서도 배웠는데 MECE, 로직 트리등 처음 보는 방법들이 신기하였으며 흥미로웠다. 지표에 대해서도 배웠는데 '어떤 결과를 기대하는가'에 해당하는 것이 지표이다 이번 강의는 정말 알찬 강의였다. 데이터 분석가의 사고방식을 바꿔준 강의이며, 두고두고 봐야 할 강의라고 생각한다. 오늘 오전에 있었던 과제 해설도 튜터님께서 자세히 설명해줘서 이..
-
12/30 WIL스파르타/TIL(Today I Learned) 2023. 12. 30. 13:34
이번 주는 새로운 팀원들과 조를 이루며 시작되었다. 아직 프로젝트 일정은 없어서 개인 강의를 들으며 한 주를 보냈다. 팀 스크럼을 통해 각자 오늘의 할 일을 정하고 저녁 회의를 통해 얼만큼 진행되었는지 확인하는 시간을 가지고 있다. 이를 통해 공동의 목적을 확인할 수 있으며, 서로가 서로를 확인하고 도움을 주는 좋은 방식인 것 같다. 나의 경우 계획을 잘 지키지 못하고, 세우지도 않는 편이라서 팀 스크럼은 나에게 좋은 영향을 주는 것 같다. 이번 주의 강의는 sql 주어진 강의를 다 듣고, sqld 강의를 듣고 있었다. SQLD 강의는 소리가 작아서 좀 아쉬웠지만 그래도 설명 자체는 꼼꼼하게 해주었다. 하지만 작은 소리 + 강사의 좋은 목소리 덕에 좀 졸리고 집중이 힘들었다. 이번 주 가장 큰 수확은 팀..