Name

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 1

Name: Roque, Rey Daniel L.

1. Alphabetical list of books that were ordered on [particular date]


SELECT b.title, co.order_date
FROM book b JOIN cust_order co ON b.book_id
WHERE DATE(co.order_date) = '2023-02-15'
ORDER BY b.title ASC;

2. Alphabetical list of books that are not english


SELECT b.title, bl.language_name
FROM book b LEFT JOIN book_language bl ON b.language_id =
bl.language_id
WHERE bl.language_name NOT LIKE '%English%' ORDER BY b.title;

3. Total number of minutes


SELECT artists.name AS artist_name, albums.title AS album_title,
SEC_TO_TIME(SUM(TIME_TO_SEC(songs.duration)/60)) AS total_minutes
FROM Albums
INNER JOIN artists ON albums.artist = artists.id
INNER JOIN songs ON albums.id = songs.album WHERE artists.name =
'Homer'
GROUP BY artists.name, albums.title;

You might also like