목록Data Analyst/daily (76)
rubus0304 님의 블로그

1. 스파르타(주)의 글로벌 확장을 준비 중인 팀은 신규 시장에 진출하기 위한 전략을 수립하고 있습니다. 국가 타게팅를 통해 잠재적 고객층을 확대하고자 합니다. 이에 따라, 대상이 되는 국가의 수를 먼저 정확히 파악하기 위해 데이터를 활용해 보고서를 작성하고 있습니다.country 테이블을 기반으로, 전년도 국민총생산(GNP)이 없거나 전년 대비 GNP가 감소한 국가 중 인구가 1천만 명 이상인 국가의 수를 조회하는 쿼리를 작성하세요. (내 코드)#country 테이블을 기반으로, 전년도 국민총생산(GNP)이 없거나 전년 대비 GNP가 감소한 국가 중 인구가 1천만 명 이상인 국가의 수를 조회하는 쿼리 use world ; # world 테이블을 사용할 거니까!select count(Code) c..
101. Product Sales Analysis IIIhttps://leetcode.com/problems/product-sales-analysis-iii/description/ Write a solution to select the product id, year, quantity, and price for the first year of every product sold.Return the resulting table in any order. (오답) 첫 해에 판매해서 min 썼고, left join 했는데 왜 안 될까.select b.product_id, min(year) first_year, quantity, pricefrom Sales a lef..
100. User Activity for the Past 30 Days I Write a solution to find the daily active user count for a period of 30 days ending 2019-07-27 inclusively. A user was active on someday if they made at least one activity on that day.Return the result table in any order.https://leetcode.com/problems/user-activity-for-the-past-30-days-i/description/ 30일 동안 활성상태인 유저 수 구하기. 적어도 한 가지 이상 활동 한 유저는 활성상태 포함. (정..

99. Number of Unique Subjects Taught by Each Teacher https://leetcode.com/problems/number-of-unique-subjects-taught-by-each-teacher/description/ Write a solution to calculate the number of unique subjects each teacher teaches in the university.Return the result table in any order. 중복되지 않은 과목수 찾기. (정답) 엇..그냥 했는데 됐다select teacher_id, count(distinct subject_id) cntfrom Teachergroup by 1
98. Game Play Analysis IV https://leetcode.com/problems/game-play-analysis-iv/description/ Write a solution to report the fraction of players that logged in again on the day after the day they first logged in, rounded to 2 decimal places. In other words, you need to count the number of players that logged in for at least two consecutive days starting from their first login date, then divide that..

97. Immediate Food Delivery II https://leetcode.com/problems/immediate-food-delivery-ii/description/ If the customer's preferred delivery date is the same as the order date, then the order is called immediate; otherwise, it is called scheduled.The first order of a customer is the order with the earliest order date that the customer made. It is guaranteed that a customer has precisely one first o..
96. Monthly Transactions Ihttps://leetcode.com/problems/monthly-transactions-i/description/ Write an SQL query to find for each month and country, the number of transactions and their total amount, the number of approved transactions and their total amount.Return the result table in any order. (시도) 월별, 국가별로 뽑고, 거래횟수는 count로 뽑았는데, group by를 1로 해도 2로 해도 3개가 나오지 않는다. 그리고 나머지는 서브쿼리로 해야하는건가select d..

95. Queries Quality and Percentagehttps://leetcode.com/problems/queries-quality-and-percentage/ We define query quality as:The average of the ratio between query rating and its position.We also define poor query percentage as:The percentage of all queries with rating less than 3.Write a solution to find each query_name, the quality and poor_query_percentage.Both quality and poor_query_percentage..

https://leetcode.com/problems/percentage-of-users-attended-a-contest/description/ 94. Percentage of Users Attended a ContestWrite a solution to find the percentage of the users registered in each contest rounded to two decimals.Return the result table ordered by percentage in descending order. In case of a tie, order it by contest_id in ascending order.The result format is in the following examp..
보호되어 있는 글입니다.