Skip to content
Advertisement

Tag: mysql

How do I do NOT CONTAINS?

I’m having difficulties with a question on an assignment and writing the correct query. I’ve been at it for days, and it’s due soon. I’m trying to show all project numbers that do not contain employee id’s of 114 and 113 (the application designers). Looking at the table data, I can see without writing code that the project numbers are

How can I add an object to my table with multiple values?

We have a postgres setup, and I’ll be honest straight away I know very little about database manipulations, my goal is to add an object to the pre-existing table called websites and then have the following object with properties as below: I know it’s quite easy to just add supportDesktop as a boolean property like so: I’m not sure if

SQL – Divide One Query by Another

I am trying to create a query which returns the workout percentage completion… Workout Percentage Completion = ((Sum of LogEntries WHERE date = IN list of dates and WorkoutID =1 ) / (Sum of all set numbers WHERE WorkoutID = 1)) x 100 Below is what I currently have, at the moment it is only returning the result of the

How to update specific column with values from another table

I have a table called “bug_table” that looks like this: and a table called “bug_revision_table” that looks like this: Now comes the question: How can I modify the timestamp of each id from the first table with the latest/most recent one from the second table? As you can see, each bug_id can have multiple revisions with different timestamps. I’m only

How to use WHERE EXISTS in a SQL subquery?

I need to find the distinct drinkers who have ordered drinks at a pub on VICTORIA AVE. in March 2020. Here are the tables I am trying to retrieve data from: Here is my SELECT statement so far: Answer The subquery needs to be correlated to the main query in its WHERE clause.

SQL query is causing problem while inserting into table

I tried to insert dataframe using pymysql library. It’s giving this error: pymysql.err.ProgrammingError: (1064, “You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ”bestwebsites’ (‘Rank’,’Score’,’Category’,’Audience’,’URL’,’Links’,’Desc’) VALUE’ at line 1″) I tried using sqlalchemy It’s working Answer Column names (and table names) should not be

Advertisement