Mysql – Maximum Rented car name
This is my query SELECT c.car_name, MAX(DATEDIFF(r.return_date, r.pickup_date)) + 1 AS No_of_Days, DENSE_RANK() OVER (ORDER BY MAX(DATEDIFF(r.return_date, r.pickup_date)) + 1 DESC) as Dense_Rank FROM cars AS c JOIN rentals AS r ON c.car_id = r.car_id WHERE MONTH(pickup_date) = 5 GROUP…