Skip to content

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 c…

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 bool…

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…

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.