Programming Assignment: Deeper Analysis of the Movie Data with SQL

The notebook needed some correction like missing images:

For some strange reason(s), I got my answers matched but failed…
Must the SQL query match exactly word for word??

The second last cell has error key:

Correct code is:

print(“Movies with no reviews represent the”,
(df_no_ratings[“num_no_reviews”]/df_unique_movies[“num_unique_movies”]*100).values[0],
“% of the movies in the database.”)

Updates:

I fixed most of the grader problems by making sure all SQL keywords were capitalized and all the statements had a semicolon at the end. This has no effect on the query results, it’s just enforcing style.

I still have grader failures on Ex 2 “query_num_rows doesn’t match the expected query” and Ex 4 “query_high_rated_recent doesn’t match the expected query.” I passed though so I’m not going to try anything more.

The hint section for Ex 1 has mistakes. It mentions UNIQUE when it meant DISTINCT, and it says to put aliases in quotes but SQL column names and aliases in are never quoted.


I’m having a similar problem with all the Exercises in the notebook except Ex 6. The grader errors are all “<query> doesn’t match expected query”. For all except Ex 3, my results match the expected output. For Ex 3, my workspace doesn’t have the image file for the expected output so I can’t check my results.

There are also a couple of incorrect code comments.

  • Ex 4 directions say “between 4.5 and 4.99”, but the comments say “lower than 4.9” which is incorrect since the expected output includes a 4.9-rated movie.
  • Ex 8 directions say to return a count, but the incorrect code comment says to return the movie names.

BTW the DB file used in the notebook doesn’t match the one on Kaggle (link in first cell of notebook). The Kaggle DB has a different name, and its ‘movies’ table doesn’t have a ‘rating’ column.

1 Like

I’m having the same problem, but I can’t seem to figure it out. Were you able to fix it?

I have the similar problem!

To get a full score, you need to strictly follow all the recommendations the instructor gave during the lessons (including using ; at the end of the prompt, for example).
You might still match the expect output, even though you didn’t write the “correct prompt”.

Hi, and thank you for the feedback! We’ll review this and the team will update as needed.

I have a similar problem with exercises 1 and 3.

Hi, I completed the current SQL assignment using the same format, logic, and structure that earned me 100% on the previous assignment.
My queries are correct, return the expected output, and follow all listed instructions including casing, aliases, and variable names.
Despite this, I’m receiving 33/80 or partial credit.
I believe the issue may be with the autograder’s strict string-matching or configuration on this assignment.
Can someone manually review my notebook or confirm if there’s a known issue?

Hi Rick, and welcome to the Forum! Can you open a new topic for this here? Please include the title of the lab and also the error messages you’re getting from the autograder. That will help in troubleshooting. Thank you!

hi, I have tried all possibilities, followed all instructions, put semi colon at the end of each SQL statement, but to no avail.


I have tried all possibilities, followed all instructions, put semi colon at the end of each SQL statement, but to no avail.

Following are the error messages that I am getting:
Exercise 1:
Failed test case: query_num_rows doesn’t match the expected query. Please check you didn’t skip any instruction.
Exercise 3:
Failed test case: query_rating_binning doesn’t match the expected query. Please check you didn’t skip any instruction.
Exercise 4:
Failed test case: query_high_rated_recent doesn’t match the expected query. Please check you didn’t skip any instruction.
Exercise 6:
Failed test case: query_avg_rating_year doesn’t match the expected query. Please check you didn’t skip any instruction.
Exercise 7:
Failed test case: query_top_critiques doesn’t match the expected query. Please check you didn’t skip any instruction.

Hi Chris, I have the same issues as mentioned here.

Is the issue with the grader resolved ?

Hi. We’re looking at this today. Thanks.

Hi everyone. We made some updates to the grader. Please try submitting your work again. Take note that it will accept the notebook named C4M4_Assignment.ipynb. Thanks!

Hello @chris.favila , this is my first try on the revised notebook. I will wait for the rest to comment once they have done the work.

Hi. Please check that your outputs match the screenshots in the expected output. If so, please send me your notebook via direct message. You can click my name then the blue Message button. Thanks.

Same issue as reported by Lam with the new notebook

On 24 & 26 May 2025, Exercise 4 - still had conflicting instructions for ratings:
a) Exercise 4: Analyzing Highly-Rated Recent Movies. "You’ll focus on movies with scores above 4.5, .. ",
b) Directions : "Have a rating between 4.5 and 4.9" and
c) # GRADED CELL: Exercise 4 “# with a rating higher than 4.5 and lower than 4.9”.
So we have 3 conflicting criteria for rating in this exercise 4 instructions. Initially I used the one suggested in the grade cell- “…rating > 4.5 AND rating < 4.9” but got 0 score. Then I used " …“BETWEEN 4.5 and 4.9” and got full score for this exercise. Hope that helps.