Questions tagged [sqlite3]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
1answer
13 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 ...
0
votes
1answer
19 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 ...
0
votes
1answer
436 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)...
0
votes
0answers
14 views

Same SQL query works in IDE but not in pythonanywhere?

In my web application I have an sqlitequery that works perfectly as desired in my IDE, but always raises an SErver Error 500 in my pythonanywhere hosting. It is the exact same code: else: # ...
0
votes
3answers
96 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 ...
1
vote
1answer
142 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, ...
0
votes
1answer
81 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 ...
0
votes
0answers
84 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. ...
0
votes
1answer
72 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 && ...
0
votes
1answer
238 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 ...
0
votes
0answers
22 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, ...