Question 5 (SQL Project Planning)

 avatar
user_6227789376
mysql
2 years ago
398 B
0
Indexable
Never
-- Medium
-- Question 5 (SQL Project Planning):

SELECT Start_Date, min(End_Date) FROM 

 (SELECT Start_Date FROM Projects WHERE Start_Date NOT IN (SELECT End_Date FROM Projects)) temp1 ,
 (SELECT End_Date FROM Projects WHERE End_Date NOT IN (SELECT Start_Date FROM Projects)) temp2

WHERE Start_Date < End_Date GROUP BY Start_Date

ORDER BY DATEDIFF(min(End_Date), Start_Date) ASC, Start_Date ASC;