Skip to content

Instantly share code, notes, and snippets.

-- Part 1: Basic Queries
-- 1. Find the 10 longest books (by pages) in the database
-- SELECT title, pages FROM books ORDER BY pages DESC LIMIT 10;
-- 2. List all books published in 2020
-- SELECT * FROM books WHERE published_date = 2020;
-- 3. Find books with ratings between 4.5 and 5.0
-- SELECT title, average_rating FROM books WHERE average_rating BETWEEN 4.5 AND 5.0;