Changes between Version 6 and Version 7 of izvestai
- Timestamp:
- 01/29/25 20:47:40 (27 hours ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
izvestai
v6 v7 14 14 15 15 COUNT(CASE WHEN rh.cancellation_reason = '/' THEN 1 END) AS succesfull_by_user_per_restaurant, 16 17 COUNT(CASE WHEN rh.cancellation_reason = 'Canceled by restaurant' THEN 1 END) AS canceled_by_restaurant,18 16 19 17 COUNT(rh.cancellation_reason) AS total_cancellations_per_restaurant … … 37 35 38 36 {{{ 39 SELECT r.restaurantId, r."name", COUNT(res.reservationId) AS totalReservations 37 SELECT 38 r.restaurantId, 39 r."name", 40 COUNT(res.reservationId) AS totalReservations 40 41 FROM restaurants r 41 42 JOIN reservations res ON r.restaurantId = res.restaurantId … … 43 44 ORDER BY totalReservations desc 44 45 }}} 46 47 == Извештај за просечна големина на група, максимална и број на резервации за во последниот месец 48 {{{ 49 SELECT 50 r."name" AS restaurant_name, 51 ROUND(AVG(rh.party_size), 1) AS average_party_size, 52 MAX(rh.party_size) AS max_party_size, 53 COUNT(*) AS number_of_reservations 54 FROM reservation_history rh 55 JOIN "tables" t ON t.tableid = rh.table_id 56 JOIN restaurants r ON r.restaurantid = rh.restaurant_id 57 WHERE rh.reservation_datetime >= (CURRENT_DATE - INTERVAL '1 month') 58 GROUP BY r."name" 59 ORDER BY average_party_size DESC; 60 }}} 61