Skip to content

Commit 10d1bfa

Browse files
committed
Upload 152
1 parent fe12460 commit 10d1bfa

File tree

2 files changed

+46
-0
lines changed

2 files changed

+46
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff 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)
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
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)

0 commit comments

Comments
 (0)