File tree Expand file tree Collapse file tree 2 files changed +32
-0
lines changed
Expand file tree Collapse file tree 2 files changed +32
-0
lines changed Original file line number Diff line number Diff line change @@ -50,6 +50,7 @@ Have a good contributing!
5050 - [ 1068. Product Sales Analysis I] ( ./leetcode/easy/1068.%20Product%20Sales%20Analysis%20I.sql )
5151 - [ 1407. Top Travellers] ( ./leetcode/easy/1407.%20Top%20Travellers.sql )
5252 - [ 1484. Group Sold Products By The Date] ( ./leetcode/easy/1484.%20Group%20Sold%20Products%20By%20The%20Date.sql )
53+ - [ 1693. Daily Leads and Partners] ( ./leetcode/easy/1693.%20Daily%20Leads%20and%20Partners.sql )
5354 - [ 1729. Find Followers Count] ( ./leetcode/easy/1729.%20Find%20Followers%20Count.sql )
5455 - [ 1741. Find Total Time Spent by Each Employee] ( ./leetcode/easy/1741.%20Find%20Total%20Time%20Spent%20by%20Each%20Employee.sql )
55562 . [ Medium] ( ./leetcode/medium/ )
Original file line number Diff line number Diff line change 1+ /*
2+ Question 1693. Daily Leads and Partners
3+ Link: https://leetcode.com/problems/daily-leads-and-partners/description/
4+
5+ Table: DailySales
6+
7+ +-------------+---------+
8+ | Column Name | Type |
9+ +-------------+---------+
10+ | date_id | date |
11+ | make_name | varchar |
12+ | lead_id | int |
13+ | partner_id | int |
14+ +-------------+---------+
15+ There is no primary key (column with unique values) for this table. It may contain duplicates.
16+ This table contains the date and the name of the product sold and the IDs of the lead and partner it was sold to.
17+ The name consists of only lowercase English letters.
18+
19+
20+ For each date_id and make_name, find the number of distinct lead_id's and distinct partner_id's.
21+
22+ Return the result table in any order.
23+ */
24+
25+ SELECT
26+ date_id,
27+ make_name,
28+ COUNT (DISTINCT lead_id) AS unique_leads,
29+ COUNT (DISTINCT partner_id) AS unique_partners
30+ FROM DailySales
31+ GROUP BY date_id, make_name
You can’t perform that action at this time.
0 commit comments