Skip to content

Commit 06da90a

Browse files
add 1809
1 parent f47f491 commit 06da90a

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

Diff for: database/_1809.sql

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
-- Write your PostgreSQL query statement below
2+
-- my completely original solution
3+
with sessions_with_ads as (select p.customer_id, p.session_id, p.start_time, p.end_time, a.timestamp as ts, a.ad_id
4+
from Playback p
5+
inner join Ads a
6+
on p.customer_id = a.customer_id and
7+
a.timestamp between p.start_time and p.end_time)
8+
9+
select distinct(session_id)
10+
from (select distinct(session_id) from Playback)
11+
where session_id not in (select distinct(session_id) from sessions_with_ads)
12+
13+

Diff for: paginated_contents/database/README.md

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
| 2072 |[The Winner University](https://leetcode.com/problems/the-winner-university/)| [Solution](https://github.com/fishercoder1534/Leetcode/blob/master/database/_2072.sql) || Easy |
99
| 2026 |[Low-Quality Problems](https://leetcode.com/problems/low-quality-problems/)| [Solution](https://github.com/fishercoder1534/Leetcode/blob/master/database/_2026.sql) || Easy |
1010
| 1978 |[Employees Whose Manager Left the Company](https://leetcode.com/problems/employees-whose-manager-left-the-company/)| [Solution](https://github.com/fishercoder1534/Leetcode/blob/master/database/_1978.sql) || Easy |
11+
| 1809 |[Ad-Free Sessions](https://leetcode.com/problems/ad-free-sessions/)| [Solution](https://github.com/fishercoder1534/Leetcode/blob/master/database/_1809.sql) || Easy |
1112
| 1795 |[Rearrange Products Table](https://leetcode.com/problems/rearrange-products-table/)| [Solution](https://github.com/fishercoder1534/Leetcode/blob/master/database/_1795.sql) || Easy |
1213
| 1789 |[Primary Department for Each Employee](https://leetcode.com/problems/primary-department-for-each-employee/)| [Solution](https://github.com/fishercoder1534/Leetcode/blob/master/database/_1789.sql) || Easy |
1314
| 1757 |[Recyclable and Low Fat Products](https://leetcode.com/problems/recyclable-and-low-fat-products/)| [Solution](https://github.com/fishercoder1534/Leetcode/blob/master/database/_1757.sql) || Easy |

0 commit comments

Comments
 (0)