Complex SQL Interview Question | Find Start date and End date of Project | Project Planning

  Рет қаралды 357

Data Project Hub

Data Project Hub

Күн бұрын

Пікірлер
@kapur.betzy2023
@kapur.betzy2023 9 ай бұрын
Nice series on SQL. It would be more helpful if you provide the script along with the description
@dataprojecthub
@dataprojecthub 8 ай бұрын
Hi, Glad you liked it😊. Added table script in description.
@VijayKumar-ho2fj
@VijayKumar-ho2fj 9 ай бұрын
Hi, with cte as( select start_date, end_date, day(end_date) - row_number() over(order by end_date asc) as group_split from tasks ) select min(start_date) as start_date, max(end_date) as end_date, datediff(day, min(start_date), max(end_date)) as no_of_days from cte group by group_split;
@HARSHRAJ-gp6ve
@HARSHRAJ-gp6ve 2 ай бұрын
with cte as( select tasks.*,DAY(end_date) as date1 FROM tasks ),cte1 as( select start_date,end_date,(date1-task_id) as date2 FROM cte ) select date2,COUNT(*) AS no_of_days,MIN(start_date) as start_date,MAX(end_date) as end_date FROM cte1 GROUP BY date2;
@HARSHRAJ-gp6ve
@HARSHRAJ-gp6ve 2 ай бұрын
with cte as( select tasks.*,DAY(end_date) as date1,ROW_NUMBER()OVER() as date2 FROM tasks ),cte1 as( select task_id,start_date,end_date,(date1-date2) as d1 FROM cte ),cte2 as( select d1,COUNT(*) AS no_of_days,MIN(start_date) as start_date,MAX(end_date) as end_date FROM cte1 GROUP BY d1 ) select start_date,ROW_NUMBER()OVER() as row_1,end_date,no_of_days FROM cte2;
ВЛОГ ДИАНА В ТУРЦИИ
1:31:22
Lady Diana VLOG
Рет қаралды 1,2 МЛН
Жездуха 41-серия
36:26
Million Show
Рет қаралды 5 МЛН
진짜✅ 아님 가짜❌???
0:21
승비니 Seungbini
Рет қаралды 10 МЛН
Learn SQL In 60 Minutes
56:24
Web Dev Simplified
Рет қаралды 2,2 МЛН
SQL Portfolio Project | Data Analytics | Danny's Diner SQL Challenge
1:18:13
7 Database Design Mistakes to Avoid (With Solutions)
11:29
Database Star
Рет қаралды 94 М.
Solving one of PostgreSQL's biggest weaknesses.
17:12
Dreams of Code
Рет қаралды 222 М.