r/learnSQL • u/idan_huji • Dec 24 '25
SQL basic question - practice opportunity
Please write queries on the IMDB database that extract the following
- All the movies whose rank is at least 9.
- The name “rank” is problematic. Explain why and explain how you cope with it.
(Hint: There are 49,573 movies whose rank is at least 5. )
- All the different role names that include the string ‘him’
- Take care of being case insensitive
- Note that the same role might appear in multiple movies, yet should only appear once in the results
(Hint: There are 46,686 roles that contain the string ‘her’.)
- Do you find the role name ‘Himself’ appropriate? To which problems it might lead? Explain why.
- Suggest a way to improve the returned list.
- All movies whose name is longer than 95 characters, ordered by length
- Explain the prevalence of names in each length. Why is certain length much more common than the others? - question is unclear
- Bonus: Suggest a way to identify some of the problematic names and implement it.
- Find at least 3 first names in the actors table that are most likely to be mistakes.
- Explain how you found each of the names
- Suggest a possible cause of the mistake
- Suggest a way that would prevent the problem in the first place or identify it afterwards. Bonus: Find mistakes where it is not easy to do so.
See IMDB data
14
Upvotes
View all comments
Show parent comment
1
u/idan_huji Dec 27 '25
u/Ultra-Ferric , I chnage the questions based on your feedback.
Are they clear now?
Please write queries on the IMDB database that extract the following
All the movies whose rank is at least 9.
(Hint: There are 49,573 movies whose rank is at least 5. Check your query by adapting it to this value and see that you get the same result.)
All the different role names that include the string ‘him’
(Hint: There are 46,686 roles that contain the string ‘her’. Check your query by adapting it to this value and see that you get the same result.)
All movies whose name is longer than 95 characters, ordered by length
Find at least 3 first names in the actors table that are most likely to be mistakes.