From 53f11e1a7bc7929d94eca992faac251b8251fa36 Mon Sep 17 00:00:00 2001 From: bytesparallel Date: Mon, 21 Feb 2022 15:53:22 -0600 Subject: [PATCH] Saving end of day changes --- invoice_totals.sql | 10 ++++++++++ total_invoices_{year}.sql | 6 ++++++ 2 files changed, 16 insertions(+) create mode 100644 invoice_totals.sql create mode 100644 total_invoices_{year}.sql diff --git a/invoice_totals.sql b/invoice_totals.sql new file mode 100644 index 0000000..ed0a5bd --- /dev/null +++ b/invoice_totals.sql @@ -0,0 +1,10 @@ +SELECT + INVOICE.Total, CUSTOMER.FirstName, CUSTOMER.LastName, EMPLOYEE.FirstName, Employee.LastName, Invoice.BillingCountry +FROM + ((Customer +INNER JOIN + Employee ON Employee.EmployeeId = Customer.SupportRepId) +INNER JOIN + INVOICE ON INVOICE.CustomerId = Customer.CustomerId) +ORDER BY + INVOICE.Total DESC; diff --git a/total_invoices_{year}.sql b/total_invoices_{year}.sql new file mode 100644 index 0000000..b09f841 --- /dev/null +++ b/total_invoices_{year}.sql @@ -0,0 +1,6 @@ +SELECT strftime('%Y', InvoiceDate) as Year, + COUNT(*) as InvoiceCount +FROM Invoice +WHERE strftime('%Y', InvoiceDate) = '2009' + OR strftime('%Y', InvoiceDate) = '2011' +GROUP BY strftime('%Y', InvoiceDate);