w3resource
SQL exercises

SQL: Find the name and price of the cheapest item(s)

SQL Basic Select Statement : Exercise-30 with Solution.

Write a SQL query to find the name and price of the cheapest item(s).

Sample table: item_mast

 

Sample Solution :

SELECT pro_name, pro_price
   FROM item_mast
   WHERE pro_price = 
    (SELECT MIN(pro_price) FROM item_mast);

Output:

SQL exercises

Query Visualization:

Duration:

Query visualization of Find the name and price of the cheapest item - Duration

Rows:

Query visualization of Find the name and price of the cheapest item - Rows

Cost:

Query visualization of Find the name and price of the cheapest item - Cost

Practice Online


Have another way to solve this solution? Contribute your code (and comments) through Disqus.

Previous: Write a SQL query to display the average price of the items for each company, showing only the company code.
Next: Write a query in SQL to find the last name of all employees, without duplicates.

What is the difficulty level of this exercise?



New Content: Composer: Dependency manager for PHP, R Programming