The sale ledger
Boss exercise. The owner wants the raw sale ledger — every line sold, newest first. Start from invoice_lines and join in everything you need: the invoice date, the customer's full name, the track title, its album, the quantity, and the line total (quantity * unit_price). Sort newest first; when two lines share a date, the higher line id comes first. Show only the ten most recent lines.
Tables in this exercise
albums
id title artist_id release_year
tracks
id title album_id genre_id duration_sec unit_price
customers
id first_name last_name email city country joined_date support_rep_id
invoices
id customer_id invoice_date billing_city billing_country total
invoice_lines
id invoice_id track_id quantity unit_price