All Questions
12 questions
0
votes
1
answer
405
views
CS50 finance SELL - Cannot get the code to subtract the stock from the database or index
I have tried a number of versions of this code, except I cannot get it to subtract shares from my ("/") index page it does nothing and shows nothing in the shares column in the transaction ...
0
votes
1
answer
196
views
FINANCE: GROUP BY doesn't add up the numbers of shares of the same stock
So in index i'm trying to display a table with all the stocks that the user has bought, one row for each stock, displaying the total number of shares in the user's portfolio along with the total value ...
0
votes
1
answer
171
views
PSET8 Finance Buy. SQL query not executing
My buy function is crashing at the SQL query where I'm trying to insert data from the transaction into a transactions table. The types of each column are transaction_id(integer, primary key), user_id(...
0
votes
0
answers
205
views
PSET8 finance index giving internal server error, can't find a table that already exists
Whenever I go to the web server, and I log in, I get an internal server error. It says " no such table: transactions [SQL: 'SELECT stock, SUM(shares) as sumshares FROM transactions WHERE user_id = 1 ...
0
votes
1
answer
24
views
PSET8 invalid sw.
When I am trying to use the search bar, the autofill just gives me " , , " and when I click on that suggestion the console tells me "invalid sw".
After reasearching the problem a bit, everyone seems ...
0
votes
1
answer
75
views
Specify Multiple Search Conditions for SQL
this is a question about search() in pset8 Mashup.
How does one select rows given multiple characteristics(for example in pseudo code, SELECT * THAT CONTAIN KEYWORDS "New Haven" AND "Connecticut" AND ...
2
votes
1
answer
395
views
2017 pset8 mashup: Slow search - how to improve search performance?
I have successfully implemented search in application.py. Though ss I was testing through the app, I noticed that every search was really slow.
It's turns out that every search request was from 63KB ...
0
votes
0
answers
107
views
Pset8 no such column: postal_code
I am trying to perform simple search in mashup.db database
db.execute( "SELECT * FROM places WHERE postal_code = :q",q=request.args.get("q"))
However I am getting
RuntimeError: (sqlite3....
1
vote
1
answer
509
views
SQL search multiple columns with priority
I'm trying to implement the search in pset8 and want to find the most elegant and fast solution.
The way I have implemented it is to first of all check whether the search term is an int, and if so, ...
0
votes
1
answer
99
views
pset8, import. Only even row numbers from US.txt are being written to db
I managed to import file from US.txt to places table and all seems ok, except that only rows from even numbers in file are being imported. Instead of 40975 rows I have 20487.
I tried with while loop(...
0
votes
1
answer
36
views
help me understand GROUP BY in update.php
In update.php we have this query:
"SELECT * FROM places
WHERE
(? <= latitude AND latitude <= ?)
AND
(? <= longitude AND longitude <= ?)
GROUP BY
country_code, ...
0
votes
1
answer
923
views
Pset8 search.php (still) not working
I can't get sql's "match against" to work.
I thought I understood how to do this, except when I actually used sql's match (...) against (...) syntax, I got an error. This error doesn't say anything, ...