Changes between Version 2 and Version 3 of Напредни извештаи од базата (SQL и складирани процедури)
- Timestamp:
- 02/06/25 14:07:59 (2 weeks ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Напредни извештаи од базата (SQL и складирани процедури)
v2 v3 223 223 {{{ 224 224 WITH MonthlyBookings AS ( 225 -- Count bookings for each destination per month226 225 SELECT 227 226 DATE_TRUNC('month', b.bookingDate) AS month, … … 237 236 238 237 MonthlyFlights AS ( 239 -- Count bookings for each flight per month240 238 SELECT 241 239 DATE_TRUNC('month', b.bookingDate) AS month, … … 249 247 250 248 MonthlyAirports AS ( 251 -- Count departures from each airport per month252 249 SELECT 253 250 DATE_TRUNC('month', b.bookingDate) AS month, … … 261 258 ) 262 259 263 -- Retrieve the top 3 destinations, flights, and airports for each month264 260 SELECT month, 'Destination' AS category, destination_name AS name, bookings_count AS count FROM MonthlyBookings WHERE rank <= 3 265 261 UNION ALL