Skip to content

Commit 646a764

Browse files
committed
feat:adds query to show all guests with checkout items
1 parent afd0d4e commit 646a764

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed
Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,16 @@
1-
- database: ../../sqlite/data.db
1+
-- database: ../../sqlite/data.db
22
SELECT COUNT(type) FROM media_items;
33

44

55
SELECT SUM(pages) FROM
6-
checkout_items
7-
INNER JOIN guests ON checkout_items.email = guest.email
8-
INNER JOIN media_items ON media_items.item_id = checkout_items.item_id
6+
checked_out_items
7+
INNER JOIN guests ON checked_out_items.email = guests.email
8+
INNER JOIN media_items ON media_items.id = checked_out_items.item_id
99
where pages is NOT NULL
1010

1111

12+
13+
SELECT
14+
guests.name,checked_out_items.*
15+
FROM
16+
guests LEFT JOIN checked_out_items on guests.email = checked_out_items.email;

0 commit comments

Comments
 (0)