Skip to main content

Questions tagged [sqlite3]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
1 answer
10 views

Opening .db files in SQL

I am trying to open the shows.db file in CS50 Week 7. I have downloaded the file and it is present in the cs50.dev window. But, when I enter the following command, I am getting the following error: ...
Aniruddha Shirodkar's user avatar
-1 votes
1 answer
28 views

sqlite optional error message when inserting users input inti db

When I run flask, I get the following error meassage: sqlite3.OptionalError: near "years": syntax error the error mesasge is placed in "cursor.execute(query1)" However, I do not ...
user40089's user avatar
0 votes
2 answers
326 views

CS50 SQL problem set 3 Meteorite Cleaning: NULL values are not present in "meteorites" table

Problem link: https://cs50.harvard.edu/sql/2023/psets/3/meteorites/ As the problem mentioned, any empty values in meteorites.csv are represented by NULL in the meteorites table. When I run the sqlite3 ...
yzrtt22's user avatar
1 vote
0 answers
478 views

Failed to open database shows.db

I downloaded the shows.db (which was being explained in Week7)and tried to open in my local vs code after enabling sqlite3 extension. but I get an error "Failed to open database 'e:\CS50\SQLlite\...
Asif Dawood's user avatar
0 votes
1 answer
58 views

CS50 Problem set 9 - Finance - RuntimeError: foreign key mismatch - "holdings" referencing "users"

I'm facing a Runtime Error in /buy when I try to insert information about the stock into the holdings table. Here is my code for /buy: # Update holdings table db.execute("INSERT ...
Abhinav Vutukuri's user avatar
0 votes
1 answer
88 views

PSET9 FINANCE SQLITE "no such column exists" while multiplying two columns to update a third

In the Index function on APP.PY of my finance code, I'm getting "RuntimeError: no such column: total_per_share" even though I'm using "AS" to create this column -- please advise. @...
General Noob's user avatar
0 votes
1 answer
285 views

Lab9 -- Buttons to delete DB entries don't work

Can anyone please tell me why my "Remove Entry" from DB buttons don't work? I included the python.app code below the HTML: <!DOCTYPE html> <html lang="en"> ...
General Noob's user avatar
0 votes
1 answer
275 views

CS50 PSET7 Movies "query did not return results" 12.sql

First timer asking on Stack Exchange. I have a SQL query that returns 6 results in the terminal but does not work with check50 resulting in "Query did not return any results" I read in a ...
DavidLS7's user avatar
1 vote
1 answer
27 views

How do we delete existing flight in sqlite via Django?

In the notes for the SQLITE section, week 3, https://cs50.harvard.edu/web/2020/notes/4/#:~:text=delete%20your%20existing%20flight%20from%20New%20York%20to%20London It states: Every time we make ...
Katie Melosto's user avatar
0 votes
1 answer
230 views

Week 9 - I need a help about UNIQUE constraint

I am solving the week 9 problem using python. And I am interested in knowing how to deal with the error below using the if and elif? For example: rows = db.execute("SELECT username FROM users ...
Code Maker's user avatar
0 votes
1 answer
2k views

ModuleNotFoundError: No module named '_sqlite3'

Since today, after CS50 ide has changed, I am not being able to run Django applications. This is because of an error occuring with sqlite3: >>> import sqlite3 Traceback (most recent call last)...
Vsjain's user avatar
  • 1,016
0 votes
3 answers
173 views

accidentally imported data multiple times (pset7 houses)

I was testing the code out and ended up running "python import.py characters.csv" multiple times. Now when I go into sqlite3 and print out the data it's repeated itself 3 times over, once ...
starbvuks's user avatar
1 vote
1 answer
415 views

How do correct I correct the pylint(no-member) error I get in the Web Flight lesson

Class Flight(models.Model): origin = models.ForeignKey(Airport, on_delete=models.CASCADE, related_name="departure") destination = models.ForeignKey(Airport, on_delete=models.CASCADE, ...
nfanahotmailcom's user avatar
0 votes
1 answer
266 views

Finance Buy function: Error when trying to create shares table, 'unknown column "user_id" in foreign key definition'

I'm trying to create a shares table for the buy function and have tried multiple CREATE TABLE commands with no success. Most recently, I tried: CREATE TABLE IF NOT EXISTS 'shares' ('id' INTEGER ...
JackJack's user avatar
0 votes
0 answers
258 views

Passing parameters to sqlite3 throws incorrect number of bindings error

Trying to rewrite my query for the finance webapp to use sqlite3 module without relying on cs50 module, and running into this error: "sqlite3.ProgrammingError: Incorrect number of bindings supplied. ...
rajacs50's user avatar
0 votes
1 answer
111 views

SQL3 SUM troubles

Trying to create a portfolio by selecting all transactions of given stock symbol, summing the shares (negative for "sell" actions) and then displaying only positions where the user_id fits && ...
yehoshua zlotogorski's user avatar
0 votes
1 answer
275 views

Finance Pset, SQL DB, db.execute troubles

Implementing the Buy route and running into difficulty with updating the DB...I've tested the rest of my code which all works, but whenever I use the two db.execute lines at the end of the code, I get ...
yehoshua zlotogorski's user avatar
0 votes
0 answers
25 views

Finance pset, application.py, app.route("/buy"), Insert statement gives a runtime error [duplicate]

I don't know what's wrong with this Insert statement. Insert the transaction process into the transaction table. rows = db.execute("INSERT INTO transaction(cust_id, share_symbol, share_name, ...
shehabeldin.21's user avatar