This week's MySQL was a great one for novices looking to level up from beginner level SQL development to a higher level.
The problem: Find the customers with more
than one unreturned rented movies that are past their return due
date. You might to look at this for the example of finding an overdue
rentals.
The answer:
First we need to get the customer_id from the customer table. Then it takes a bit of struggle to get the information on the rental. It is often easier to write queries by determining the needed output columns, then the 'qualifiers' or stuff on the right of the WHERE clause before determining what has to be joined to get between the two.
The part of the query to find the overdue entries requires the rental date where it …
[Read more]