Data Science | Cumulative SQL Project

Hi all,

following the Data Science Path I got stuck doing the Cumulative SQL Project at the end of the ‘SQL:Intermediate’ part. The problem occurs at task 4 with the following line of code:

CREATE TABLE inactive_patients
    FROM patients 
    WHERE Status = "inactive");

which throws a syntax error near the first parenthesis. This is very confusing since the code does obey SQL syntax. Moreover, this is the same syntax as in the hint given for this task. What’s wrong here?

Here is a screenshot:

I am using an early 2011 MacBook Pro with Mac OS High Sierra and Safari 12.0.

Thanks, everyone!

1 Like

Sorry I don’t have a solution, but chiming in to say I’m having the same issue. On a Windows 10 PC, using Google Chrome.

1 Like

I cannot seem to find any relative data on CREATE TABLE AS.
It looks like it depends on the database.
I could find the following, apparently it’s the preferred method?

SELECT * INTO newTable 
FROM (SELECT * from otherTable);

Maybe a moderator can help with the solution.

Well I found the solution - there should be no parentheses involved with the CREATE TABLE AS statement. If you copy the hint, you must remove the parentheses.


Thanks a lot! At first, it seemed a little odd to me, but I think you are right. I checked the SQLite documentation and it backs your solution.
As a reference: the version using parenthesis is documented here.

I hope someone will clear this up in the project.

Thank you. I just hit the same roadblock, and removing the parentheses worked for me.

Thanks for your solution - I had the same problem and it was driving me crazy. I finally googled it and got here. I am surprised that no moderator answered.

This happened to me too - it bugged me so much!! Thanks for the solution!

Holy Moly! I’ve been stuck on this for 4 days. I kept trying it and it wouldn’t work, so I’d come back the next day thinking I must have missed something obvious. Thanks to the person that posted the solution! Very frustrating.

I’m having same problem and have been trying to get someone to help, without success.

can anyone help me with final project calculating churn rates question #5 I just can’t seem to get it. please help