| 1 | = Напредни извештаи од базата (SQL и складирани процедури) |
| 2 | |
| 3 | == Извештај за откжани резервации по ресторан. |
| 4 | |
| 5 | {{{ |
| 6 | select |
| 7 | count(rh.cancellation_reason), |
| 8 | au.first_name, |
| 9 | au.last_name, |
| 10 | au.membership_level, |
| 11 | au."role", |
| 12 | rh.cancellation_reason, |
| 13 | rh.restaurant_id |
| 14 | from reservation_history rh |
| 15 | inner join app_user au on rh.customer_id = au.id |
| 16 | where rh.cancellation_reason = 'Canceled by user' |
| 17 | group by au.first_name, |
| 18 | au.last_name, |
| 19 | au.membership_level, |
| 20 | au."role", |
| 21 | rh.cancellation_reason, |
| 22 | rh.restaurant_id |
| 23 | order by rh.cancellation_reason |
| 24 | |
| 25 | select count(r.table_number), r.userid from reservations r |
| 26 | group by r.userid |
| 27 | }}} |