# Programming Assignment: Deeper Analysis of the Movie Data with SQL

**URL:** <https://community.deeplearning.ai/t/programming-assignment-deeper-analysis-of-the-movie-data-with-sql/816638>\
**Category:** Data I/O and Processing with Python and SQL\
**Tags:** week-module-4, coursera-platform\
**Created:** [May 17, 2025, 5:07am UTC](https://community.deeplearning.ai/t/programming-assignment-deeper-analysis-of-the-movie-data-with-sql/816638 "2025-05-17T05:07:58Z")\
**Posts on this page:** 18\
**Page:** 1

<div class="post-metadata">

**Author:** ![Lam\_Chou\_Vun\_Dennis](https://avatars.discourse-cdn.com/v4/letter/l/848f3c/32.png) [@Lam\_Chou\_Vun\_Dennis](https://community.deeplearning.ai/u/Lam_Chou_Vun_Dennis)\
**Post date:** [May 17, 2025, 5:07am UTC](https://community.deeplearning.ai/t/programming-assignment-deeper-analysis-of-the-movie-data-with-sql/816638/1 "2025-05-17T05:07:58Z")

</div>

The notebook needed some correction like missing images:

 ![1](https://global.discourse-cdn.com/dlai/original/3X/9/9/992d70216db5f6a516d7c125e9ed5b34a4dea233.png)

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

 ![2](https://global.discourse-cdn.com/dlai/original/3X/8/8/88d2f285ebecf331534c33a7e33d686b3589c970.png)

The second last cell has error key:

 ![3](https://global.discourse-cdn.com/dlai/original/3X/4/5/45a154b066edc59d1d85d4a1488cba87d423ba21.png)

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.”)

---

<div class="post-metadata">

**Author:** ![lloydm999](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/lloydm999/32/127640_2.png) [@lloydm999](https://community.deeplearning.ai/u/lloydm999)\
**Post date:** [May 17, 2025, 6:35pm UTC](https://community.deeplearning.ai/t/programming-assignment-deeper-analysis-of-the-movie-data-with-sql/816638/2 "2025-05-17T18:35:48Z")

</div>

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](https://www.kaggle.com/datasets/clementmsika/mubi-sqlite-database-for-movie-lovers) in first cell of notebook). The Kaggle DB has a different name, and its ‘movies’ table doesn’t have a ‘rating’ column.

---

<div class="post-metadata">

**Author:** ![Clara1](https://avatars.discourse-cdn.com/v4/letter/c/e9c0ed/32.png) [@Clara1](https://community.deeplearning.ai/u/Clara1)\
**Post date:** [May 18, 2025, 8:59pm UTC](https://community.deeplearning.ai/t/programming-assignment-deeper-analysis-of-the-movie-data-with-sql/816638/3 "2025-05-18T20:59:28Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Kashif\_Munir](https://avatars.discourse-cdn.com/v4/letter/k/a183cd/32.png) [@Kashif\_Munir](https://community.deeplearning.ai/u/Kashif_Munir)\
**Post date:** [May 19, 2025, 4:02am UTC](https://community.deeplearning.ai/t/programming-assignment-deeper-analysis-of-the-movie-data-with-sql/816638/4 "2025-05-19T04:02:40Z")

</div>

I have the similar problem!

---

<div class="post-metadata">

**Author:** ![imgabidotcom](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/imgabidotcom/32/138825_2.png) [@imgabidotcom](https://community.deeplearning.ai/u/imgabidotcom)\
**Post date:** [May 19, 2025, 10:10am UTC](https://community.deeplearning.ai/t/programming-assignment-deeper-analysis-of-the-movie-data-with-sql/816638/5 "2025-05-19T10:10:12Z")

</div>

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”.

---

<div class="post-metadata">

**Author:** ![chris.favila](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/chris.favila/32/126338_2.png) [@chris.favila](https://community.deeplearning.ai/u/chris.favila)\
**Post date:** [May 19, 2025, 2:25pm UTC](https://community.deeplearning.ai/t/programming-assignment-deeper-analysis-of-the-movie-data-with-sql/816638/7 "2025-05-19T14:25:04Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Vishwajith\_Somarampe](https://avatars.discourse-cdn.com/v4/letter/v/ed8c4c/32.png) [@Vishwajith\_Somarampe](https://community.deeplearning.ai/u/Vishwajith_Somarampe)\
**Post date:** [May 20, 2025, 2:36pm UTC](https://community.deeplearning.ai/t/programming-assignment-deeper-analysis-of-the-movie-data-with-sql/816638/8 "2025-05-20T14:36:27Z")

</div>

I have a similar problem with exercises 1 and 3.

---

<div class="post-metadata">

**Author:** ![rangerick555](https://avatars.discourse-cdn.com/v4/letter/r/ccd318/32.png) [@rangerick555](https://community.deeplearning.ai/u/rangerick555)\
**Post date:** [May 20, 2025, 11:34pm UTC](https://community.deeplearning.ai/t/programming-assignment-deeper-analysis-of-the-movie-data-with-sql/816638/9 "2025-05-20T23:34:14Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![chris.favila](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/chris.favila/32/126338_2.png) [@chris.favila](https://community.deeplearning.ai/u/chris.favila)\
**Post date:** [May 20, 2025, 11:40pm UTC](https://community.deeplearning.ai/t/programming-assignment-deeper-analysis-of-the-movie-data-with-sql/816638/10 "2025-05-20T23:40:06Z")

</div>

Hi Rick, and welcome to the Forum! Can you open a new topic for [this here](https://community.deeplearning.ai/c/course-q-a/data-analytics-professional-certificate/dag-course-4/510)? 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!

---

<div class="post-metadata">

**Author:** ![Kashif\_Munir](https://avatars.discourse-cdn.com/v4/letter/k/a183cd/32.png) [@Kashif\_Munir](https://community.deeplearning.ai/u/Kashif_Munir)\
**Post date:** [May 21, 2025, 5:25am UTC](https://community.deeplearning.ai/t/programming-assignment-deeper-analysis-of-the-movie-data-with-sql/816638/11 "2025-05-21T05:25:59Z")

</div>

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

 ![grade-course-4-assignment](https://global.discourse-cdn.com/dlai/original/3X/7/0/70b08210749c877e8c261c07c8e16e50195da253.png)

---

<div class="post-metadata">

**Author:** ![Kashif\_Munir](https://avatars.discourse-cdn.com/v4/letter/k/a183cd/32.png) [@Kashif\_Munir](https://community.deeplearning.ai/u/Kashif_Munir)\
**Post date:** [May 21, 2025, 5:30am UTC](https://community.deeplearning.ai/t/programming-assignment-deeper-analysis-of-the-movie-data-with-sql/816638/12 "2025-05-21T05:30:44Z")

</div>

![grade-course-4-assignment](https://global.discourse-cdn.com/dlai/original/3X/7/0/70b08210749c877e8c261c07c8e16e50195da253.png)  
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.

---

<div class="post-metadata">

**Author:** ![russelcrasto](https://avatars.discourse-cdn.com/v4/letter/r/a587f6/32.png) [@russelcrasto](https://community.deeplearning.ai/u/russelcrasto)\
**Post date:** [May 21, 2025, 7:09pm UTC](https://community.deeplearning.ai/t/programming-assignment-deeper-analysis-of-the-movie-data-with-sql/816638/13 "2025-05-21T19:09:07Z")

</div>

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

Is the issue with the grader resolved ?

---

<div class="post-metadata">

**Author:** ![chris.favila](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/chris.favila/32/126338_2.png) [@chris.favila](https://community.deeplearning.ai/u/chris.favila)\
**Post date:** [May 21, 2025, 9:32pm UTC](https://community.deeplearning.ai/t/programming-assignment-deeper-analysis-of-the-movie-data-with-sql/816638/14 "2025-05-21T21:32:55Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![chris.favila](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/chris.favila/32/126338_2.png) [@chris.favila](https://community.deeplearning.ai/u/chris.favila)\
**Post date:** [May 22, 2025, 5:10am UTC](https://community.deeplearning.ai/t/programming-assignment-deeper-analysis-of-the-movie-data-with-sql/816638/15 "2025-05-22T05:10:58Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![Lam\_Chou\_Vun\_Dennis](https://avatars.discourse-cdn.com/v4/letter/l/848f3c/32.png) [@Lam\_Chou\_Vun\_Dennis](https://community.deeplearning.ai/u/Lam_Chou_Vun_Dennis)\
**Post date:** [May 22, 2025, 7:22am UTC](https://community.deeplearning.ai/t/programming-assignment-deeper-analysis-of-the-movie-data-with-sql/816638/16 "2025-05-22T07:22:27Z")

</div>

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.

 ![2025-05-22_15-14-08](https://global.discourse-cdn.com/dlai/original/3X/5/6/56f26fd52f4cddf4a4190caf0e700aa34b97fb2b.png)

---

<div class="post-metadata">

**Author:** ![chris.favila](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/chris.favila/32/126338_2.png) [@chris.favila](https://community.deeplearning.ai/u/chris.favila)\
**Post date:** [May 22, 2025, 9:48am UTC](https://community.deeplearning.ai/t/programming-assignment-deeper-analysis-of-the-movie-data-with-sql/816638/17 "2025-05-22T09:48:16Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![russelcrasto](https://avatars.discourse-cdn.com/v4/letter/r/a587f6/32.png) [@russelcrasto](https://community.deeplearning.ai/u/russelcrasto)\
**Post date:** [May 22, 2025, 5:23pm UTC](https://community.deeplearning.ai/t/programming-assignment-deeper-analysis-of-the-movie-data-with-sql/816638/18 "2025-05-22T17:23:51Z")

</div>

Same issue as reported by Lam with the new notebook

---

<div class="post-metadata">

**Author:** ![Aldir](https://avatars.discourse-cdn.com/v4/letter/a/a87d85/32.png) [@Aldir](https://community.deeplearning.ai/u/Aldir)\
**Post date:** [May 26, 2025, 6:35am UTC](https://community.deeplearning.ai/t/programming-assignment-deeper-analysis-of-the-movie-data-with-sql/816638/19 "2025-05-26T06:35:39Z")

</div>

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.
