From c9b6b9a5ca082fe7c1b6f58d7713f785a9eb6a5c Mon Sep 17 00:00:00 2001
From: Martial Simon <msimon_fr@hotmail.com>
Date: Mon, 15 Sep 2025 01:08:27 +0200
Subject: add: graphs et rushs

---
 graphs/sql/battle_plan/req03.sql | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)
 create mode 100644 graphs/sql/battle_plan/req03.sql

(limited to 'graphs/sql/battle_plan/req03.sql')

diff --git a/graphs/sql/battle_plan/req03.sql b/graphs/sql/battle_plan/req03.sql
new file mode 100644
index 0000000..5a3ba51
--- /dev/null
+++ b/graphs/sql/battle_plan/req03.sql
@@ -0,0 +1,17 @@
+SELECT
+    people.first_name,
+    people.last_name,
+    gusto_tables.number_of_seats AS guest_number,
+    round(reservations.bill_total::numeric, 2) AS bill_total
+FROM gusto_reservations AS reservations,
+    gusto_tables,
+    gusto_guests AS guests,
+    people
+WHERE reservations.table_id = gusto_tables.id
+    AND reservations.id = guests.reservation_id
+    AND reservations.cancelled = FALSE
+    AND guests.guest_id = people.id
+    AND people.last_name LIKE concat(reservations.reservation_name, '%')
+ORDER BY
+    gusto_tables.number_of_seats ASC, reservations.bill_total DESC NULLS LAST
+LIMIT 10;
-- 
cgit v1.2.3

