File tree Expand file tree Collapse file tree 2 files changed +46
-0
lines changed Expand file tree Collapse file tree 2 files changed +46
-0
lines changed Original file line number Diff line number Diff line change @@ -184,6 +184,7 @@ The problems and both submitted and site solutions are documented in individual
184184| 149 | [ Sales Person] ( https://leetcode.com/problems/sales-person/description/ ) | [ Solution] ( solutions/149_sales_person.md ) | LeetCode | Easy | |
185185| 150 | [ Reformat Department Table] ( https://leetcode.com/problems/reformat-department-table/description/ ) | [ Solution] ( solutions/150_reformat_department_table.md ) | LeetCode | Easy | |
186186| 151 | [ Capital Gain/Loss] ( https://leetcode.com/problems/capital-gainloss/description/ ) | [ Solution] ( solutions/151_capital_gainloss.md ) | LeetCode | Medium | |
187+ | 152 | [ Daily Leads and Partners] ( https://leetcode.com/problems/daily-leads-and-partners/description/ ) | [ Solution] ( solutions/152_daily_leads_and_partners.md ) | LeetCode | Easy | |
187188<!-- Index End - WARNING: Do not delete or modify this markdown comment. -->
188189
189190## Author(s)
Original file line number Diff line number Diff line change 1+ # SQL Everyday \# 152
2+
3+ ## Daily Leads and Partners
4+
5+ Site: LeetCode\
6+ Difficulty per Site: Easy
7+
8+ ## Problem
9+
10+ For each ` date_id ` and ` make_name ` , find the number of * distinct* ` lead_id ` 's and * distinct* ` partner_id ` 's.
11+
12+ Return the result table in * any order* . [[ Full Description] ( https://leetcode.com/problems/daily-leads-and-partners/description/ )]
13+
14+ ## Submitted Solution
15+
16+ ``` sql
17+ -- Submitted Solution
18+ SELECT
19+ date_id
20+ ,make_name
21+ ,COUNT (DISTINCT lead_id) AS unique_leads
22+ ,COUNT (DISTINCT partner_id) AS unique_partners
23+ FROM DailySales
24+ GROUP BY date_id, make_name
25+ ORDER BY date_id ASC , make_name ASC
26+ ;
27+ ```
28+
29+ ## Site Solution
30+
31+ ``` sql
32+ -- LeetCode Solution
33+ -- TBD
34+ ```
35+
36+ ## Notes
37+
38+ TBD
39+
40+ ## NB
41+
42+ TBD
43+
44+ Go to [ Index] ( ../?tab=readme-ov-file#index ) \
45+ Go to [ Overview] ( ../?tab=readme-ov-file )
You can’t perform that action at this time.
0 commit comments