Skip to content

Tag: sql

How to SELECT DISTINCT *

Is this a possible query? Currently, every product from my database is being listed on the home page of my website and a lot of them are duplicates since a product can belong to multiple categories. I am using “SELECT * FROM Books WHERE product_status = ‘1’”; Answer Then use group by a…

CUSTOMER and purchased CATEGORY count details in Oracle SQL

I am having the below require. if anyone provide the solution it would be thankful Requirements:- Transaction of the customer who purchased in the below category Customers and purchased Category Total Number of customer from category level category and customer count I want to display the output life below ou…

How to convert list of comma separated Ids into their name?

I have a table that contains: I have the table that has the names of this tasks: I want to generate the following output I know this structure isn’t ideal but this is legacy table which I will not change now. Is there easy way to get the output ? I’m using Presto but I think this can be solved

Script timeout passed error on MAMP phpmyadmin

I’m trying to upload this sql file that’s 225MB to phpmyadmin with MAMP. However, I keep getting this error Script timeout passed, if you want to finish import, please resubmit the same file and import will resume. I’ve changed the php.ini file in MAMP like so: I’ve also changed the se…

Select sum if and having count

I have 3 tables table artist with artist_id, name; table album with album_id, artist_id, name; table songs with song_id, artist_id, album_id, (few more things but I don’t think they are necessary for this problem); I want to select a table with the name of the artist, number of albums with equal or more…