When you want to practice some SQLs every time you end up creating physical tables in your database. This might not be possible every time to create tables and it might be cumbersome also.
What you can do is create CTEs for all the tables which your query need and use them in the query. Watch the video for some more tips on the same.
Playlist for complex SQL interview questions:
https://youtube.com/playlist?list=PLBTZqjSKn0IeKBQDjLmzisazhqQy4iGkb
Continue this lesson in the app
Install CourseHive on Android or iOS to keep learning while you move.