22.6k views
0 votes
Using subquery only, List the ID number and name of the product

whose price is higher than the lowest product price from ColorMeg,
Inc.

User Miwako
by
8.0k points

1 Answer

4 votes

Final answer:

Using an SQL subquery, IDs and names of products with prices greater than ColorMeg, Inc.'s lowest-priced product can be retrieved.

Step-by-step explanation:

To find the products with a price higher than the lowest-priced product from ColorMeg, Inc. using only a subquery, you can use the following SQL command:

SELECT id, name FROM products WHERE price > (SELECT MIN(price) FROM products WHERE manufacturer = 'ColorMeg, Inc.')

This query checks for the products where the price is greater than the minimum price of products by ColorMeg, Inc. The subquery in the WHERE clause calculates the lowest price offered by this manufacturer, and the main query then retrieves the IDs and names of all products that have a price above this minimum.

User Dportman
by
7.9k points