Analyzing heart disease


#1

https://www.codecademy.com/paths/data-science/tracks/sql-intermediate/modules/dspath-sql-cumulative-project/projects/cadcademy-milestone

There is the link to the lesson.

I was wondering why the “hint” for step 2 used

DELETE FROM panels
WHERE Cholesterol IN
(SELECT Cholesterol FROM panels LIMIT 1);

Instead of

DELETE FROM panels
WHERE Cholesterol IS ‘Cholesterol’;

Is there a reason or is it preference?

Is it a matter of flexibility since I can change the limit to extend how much is deleted from the table?


#2

Hi,

I was wondering the same as you about the hint. However, I’ve looked up the reference in SQLite and this kind of form of sub-query is allowed and I think very practical.
My problem is that their code doesn’t work in the course interface. I’ve sent them a bug report… nor reply yet.

If I get any answer, I’ll post it here.


#3

Hi remitropcuit,

I have encountered a similar problem where code from the hint of task 4 is not working. I am assuming this is a problem of their server. Here is a link to my issue (which I think is quite similar).

Cheers!


#4

I used

DELETE FROM panels 
WHERE ID = 'ID';

And that worked to delete the duplicate row.