Skip to content
Snippets Groups Projects
Commit c3dc8998 authored by Sorrel Harriet's avatar Sorrel Harriet
Browse files

updating practice_queries

parent d74f8cd3
Branches
No related merge requests found
......@@ -67,3 +67,17 @@ VALUES
/* 4. Delete a track */
DELETE FROM Track WHERE album_upc='726517237627'; /* EXAMPLE */
/* ------------------------------------ */
/* 5. Retrieve details about an order
Include the customer_id, delivery method
and total order value in the result-set */
SELECT Transaction.customer_id, Transaction.delivery, SUM(Album.price*LineItem.quantity) AS order_total /* notice use of aggregate function! */
FROM Transaction
INNER JOIN LineItem
ON Transaction.id=LineItem.trans_id
INNER JOIN Album
ON Album.upc=LineItem.album_upc
WHERE Transaction.id=1; /* EXAMPLE */
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment