Skip to main content
Search type Search syntax
Tags [tag]
Exact "words here"
Author user:1234
user:me (yours)
Score score:3 (3+)
score:0 (none)
Answers answers:3 (3+)
answers:0 (none)
isaccepted:yes
hasaccepted:no
inquestion:1234
Views views:250
Code code:"if (foo != bar)"
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Saves in:saves
Status closed:yes
duplicate:no
migrated:no
wiki:no
Types is:question
is:answer
Exclude -[tag]
-apples
For more details on advanced search visit our help page
Results tagged with
Search options answers only not deleted user 4847
2 votes

PSET7 Movies - Q13.SQL How to NOT include 'Kevin Bacon' in List of Actors that have starred ...

Have you tried this. First do a select to get the ID or IDs of the one and only Kevin Bacon, then do the main select while excluding the very short list of IDs that are KB. SELECT DISTINCT(name) FR …
Cliff B's user avatar
  • 69.3k
1 vote
Accepted

pset7 why doesn't my SQL table update?

Exactly as predicted. There is a primary key on the ID column and it is ONLY on the ID column. This means that there can be only one row in the table with that ID. The result is each ID can only own …
Cliff B's user avatar
  • 69.3k
0 votes

Deducing shares from SQL rows until all sold shares are exhausted PSET7 FINANCE

It sounds like you are keeping multiple rows for multiple purchases of the same user and stock symbol combinations in the portfolio table. This requires searching all of those rows and subtracting fr …
Cliff B's user avatar
  • 69.3k
0 votes

On duplicate key update doesn't work correctly

Shouldn't ON DUPLICATE KEY UPDATE shares = shares + newshares use VALUES for newshares?
Cliff B's user avatar
  • 69.3k
1 vote
Accepted

Why won't DELETE * FROM in sql work? i Guess I could delete each column individually. Furthe...

Before I answer, here's a pillow for your forehead so that you don't hurt yourself when you slap it! ;-) It's DELETE FROM, not DELETE * FROM. Just remove the *. And, no, deleting each column indiv …
Cliff B's user avatar
  • 69.3k
0 votes

Check if added value corresponds to value/id from another table - SQL Final Project

Yes, you will need to check that the info to be inserted qualifies before inserting. Do that with a select on the appropriate tables combined with some logic in your code before attempting the insert …
Cliff B's user avatar
  • 69.3k
0 votes
Accepted

Pset8 search.php (still) not working

Instead, try AGAINST (?)", Also, you must have a FULLTEXT index across all the columns in your query and include no other columns in that index. This index is created in the database, not coded in a …
Cliff B's user avatar
  • 69.3k
0 votes
Accepted

Final Project: Trying to access phpmyadmin through CS50 ID (similar to Pset7) but find "This...

It looks like you're working from the IDE and not the appliance. I had a similar problem. It seemed like the URL to use that was returned by the server when I started it was wrong. I went back and re …
Cliff B's user avatar
  • 69.3k
0 votes
Accepted

pset7 - How to remove the primary key in my table

Or you could create and run an SQL command to "ALTER TABLE tablename DROP PRIMARY KEY;" Or you could just delete the table through the interface or via SQL command and recreate it the way you want it … Hint: You might want to generate the SQL command to create the current table using the interface first. …
Cliff B's user avatar
  • 69.3k
0 votes
Accepted

PSET7 - Register returns 'RuntimeError: no such table...'

Is the table name spelled correctly? Most people spell it with a T in the middle, portfolio, not porfolio. Check the actual spelling of the table name in the database. If this answers your questio …
Cliff B's user avatar
  • 69.3k
0 votes
Accepted

pset7: one "history" table for each user?

There may be, but it would be extremely complicated and you simply don't want to. It would require dynamically creating a table with every user. Imagine the nightmare with thousands or millions of us …
Cliff B's user avatar
  • 69.3k
1 vote
Accepted

pset7 finance/index problem updating values in table

;-) db.execute("UPDATE test SET price=:price, total=:total WHERE symbol=:symbol", price=price, total=total, symbol=quote['symbol']) This SQL code says to update the price and total for EVERY row in the …
Cliff B's user avatar
  • 69.3k
1 vote
Accepted

Final project question and Hardware for a SQL server

If you're building a "sandbox" environment, with 10 users, just about any two modern computers with decent memory (not minimal) will work. Just make sure they meet the minimum requirements of the sof …
Cliff B's user avatar
  • 69.3k
3 votes
Accepted

PSET 7 Movies SQL Q9

The issue here was in the syntax of the SQL query. When looking for multiple elements from a subquery, it's necessary to use "IN" in the query. …
Cliff B's user avatar
  • 69.3k
1 vote

PSET8 Finance Buy. SQL query not executing

Did you test the query directly on the database? My gut says that the "/" in the buy/sell column name is causing problems. Try changing the column name in the table to something without any special ch …
Cliff B's user avatar
  • 69.3k

15 30 50 per page