Stanford SQL Exercises #100daysofcode #100daysofDataScience #Day27 #unicornassembly #netflixandcode

While working on the fundamentals (stats) I haven’t forgotten about keeping my tech skills sharp. Last week on Sunday I decided to take a break from z-scores and t-scores to do a little SQL practice. I’ve already blogged about my humble beginnings with SQL on Khan Academy but it’s nice to have a place to just write some queries without overhead.

The Stanford SQL Movie Rating Query Exercises provide just that! These were suggested to me by a friend prepping for Data Science interviews. It’s a great way to get your brain in SQL mode and to test your speed. SO, start the timer and see how fast you can go through ‘em!

Here are the queries that I found the most difficult with my #netflixandcode solutions. Admittedly a little clunky but it gets the job done

Question 6: For all cases where the same reviewer rated the same movie twice and gave it a higher rating the second time, return the reviewer's name and the title of the movie.

Screen Shot 2019-08-07 at 7.32.10 PM.png

Question 9: Find the difference between the average rating of movies released before 1980 and the average rating of movies released after 1980. (Make sure to calculate the average rating for each movie, then the average of those averages for movies before 1980 and movies after. Don't just calculate the overall average rating before and after 1980.)

Screen Shot 2019-08-07 at 7.33.13 PM.png