Works That Have Never Been Checked Out
A librarian is reviewing the catalog for works nobody has borrowed. Find works that have never been checked out, meaning they have no records in checkouts. Return all columns for those works.
Build confidence writing queries with MySQL practice problems designed for MySQL 8.4. Start with selecting and filtering records, then explore joins, aggregate functions, and other SQL features. Your queries execute in a real MySQL database, and the trainer automatically checks the output against expected results using hidden data. Problems in this set: 324, free: 106.
Problems in this set: 324, free: 106
Start with a free problemA librarian is reviewing the catalog for works nobody has borrowed. Find works that have never been checked out, meaning they have no records in checkouts. Return all columns for those works.
A social media team is building a leaderboard of pages ranked by their number of likes. Count the likes (like_count) for each page. Include pages with no likes, showing a count of zero.
A library wants to identify popular works. Find works that have been checked out more than 5 times. Return title and checkout_count. Sort the result by checkout count in descending order.
Prevent duplicate values in the name field across all employees. Create a unique index named uq_employees_name on the name column of the employees table.
MTS is analyzing which dates have a high number of iPhone owners recorded in its device database.
The content team is standardizing user-generated text before displaying it in the interface. For each row in user_content, return content_id and the transformed text in a column named converted_text.
An analyst wants to identify categories that appeal to the same customers to improve cross-selling and recommendations.
A technical audit requires a table that automatically sets each record's creation timestamp and initial status.
The finance department tracks drivers' cumulative earnings. For each ride, return the driver's name (name), the ride date (ride_date — cast started_at to a date), and the total income from all of…
The orders table must reject zero and negative amounts to keep invalid financial data out of the database.
The payroll department is calculating employees' net salaries.
A ride-hailing service is preparing a trip quality report for October 1 through October 3, 2013.
MySQL 8.4 does not support FULL OUTER JOIN directly. Copying a query that uses this operator from another SQL dialect will fail. Before choosing an alternative, decide whether you need matching rows, all records from one table, or unmatched records from both sides.
GROUP_CONCAT combines values into a string, but their order is not guaranteed unless you specify it. Two results can contain the same elements in different sequences. If order matters, define it inside the aggregate function and test groups containing several distinct values.
IFNULL replaces a NULL value with a chosen alternative. However, zero, an empty string, and missing data do not always mean the same thing. Replacing missing values before calculating an aggregate can change the metric. Decide when the substitution should happen and why.
LIMIT controls how many records are returned, not which ones rank highest or lowest. Without ORDER BY, MySQL does not guarantee a particular row order. Specify the sorting criteria first, and consider what should happen when multiple records have equal values.
The exercises in this collection support MySQL 8.4. Queries run in a real database, and results are automatically checked against expected output using hidden data. When adapting SQL from another database system, pay attention to differences in functions, joins, and date handling.
Yes. Free MySQL problems: 106. After signing in, you can solve up to 3 new problems per day on the free plan. Premium exercises are visible in the list but require a subscription. Reference SQL solutions are not published.
Yes. MySQL has supported window functions since version 8.0, so they are available in MySQL 8.4. They let you calculate ranks, running values, and other metrics across related rows without necessarily reducing each group to a single result row.
IFNULL changes the value returned by an expression when that value is NULL. WHERE determines which rows belong in the result. Use a replacement when you want to keep the record with a fallback value, and a filter when records should be excluded.
MySQL 8.4 has no native FULL OUTER JOIN operator. If you need matching and unmatched records from both tables, you must combine supported SQL operations to produce that result. Be careful with duplicates and determine whether each matching pair should appear once.