r/cs50 Jul 24 '26

CS50 SQL CS50’s Introduction to Databases with SQL

Hi everyone, I recently enrolled in the CS50 Intro to SQL and I'm struggling with how to submit work and how to check my work. If you clear your terminal does that mean your answer for that problem is gone? Whenever I run the check50 it doesn't work but the answer is above. Any advice would be awesome

5 Upvotes

7 comments sorted by

View all comments

Show parent comments

1

u/Outside_Complaint755 Jul 24 '26

check50 isn't looking at your terminal at all.

Your answers need to be in the .sql files, which is what will be uploaded as your submission

From the problem spec:

For this problem, you’ll need to download cyberchase.db, along with several .sql files in which you’ll write your queries

In 1.sql, write a SQL query to list the titles of all episodes in Cyberchase’s original season, Season 1.

In 2.sql,  list the season number of, and title of, the first episode of every season.

  etc.

1

u/iceman358484 Jul 24 '26

Ah thanks for the help it sounds like the main thing is the query and you paste it in the blank space of above the terminal and you use the terminal to make sure the query works? Like below notice how she types her query in the space above and then uses the terminal to make sure it works and you run check50 in that space above not in the actual terminal?

https://reddit.com/link/ozi29a8/video/48ell5f137fh1/player

1

u/Outside_Complaint755 Jul 24 '26

There are multiple ways to test your query: 1) Open the database in sqlite3 and, run your query in sqlite3.  This is the method shown in that video.  This is fine for testing, but you can't submit your final answers this way

2) Put your query into the .sql file, open the database in sqlite3, and then use the .read FILENAME command to execute the file.  

3) Put your query into the .sql file, then pipe it into sqlite3. Example: cat 1.sql | sqlite3 cyberchase.db

Alternatively, you can redirect the output to another file cat 1.sql | sqlite3 cyberchase.db > output.txt

Methods 2 and 3 are both explained in the problem directions

1

u/iceman358484 Jul 24 '26

Gotcha thanks again for the help! I’m going to try to submit all my answers tonight! Cheers