Question: The Rating table has the numVotes and the averageRating for each title. A movie is consider a big hit if there were more than

The Rating table has the numVotes and the averageRating for each title. A movie is consider a "big hit" if there were more than 100,000 votes for the movie. Which movie titles were "big hits"? Construct a query that generates the following result:

 isBigHittotal
0no????
1yes????

Where ???? is replaced with the correct values. The row with no should have the count for how many movies are not big hits, and the row with yes should have the count of how many movies are big hits.

Hints:

  • While SQL sometimes cast data automatically, it is still best practice to cast string data to numerical data type manually before performing arithmetic operation for the purposes of readability and reproducibility.
  • You will need to use some type of JOIN.
  • You may also consider using a CASE statement:CASE statements are the SQL-equivalent of Python if... elif... else statements. To read up on CASE, take a look at the following links:
    • https://mode.com/sql-tutorial/sql-case/
    • https://www.w3schools.com/sql/sql_ref_case.asp
CASE     WHEN ... THEN ...    ELSE ... END

 

 

 

query_q3 = """

"""

res_q3 = pd.read_sql(query_q3, engine)res_q3

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Solution To find the movie titles that are big hits more than 100000 votes you can use the follo... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!