w3resource
SQL exercises

SQL: Display the name and price of all the items with a price is equal or more than Rs.250, and make a list that contain the larger price first and then by name in ascending order

SQL Basic Select Statement : Exercise-28 with Solution.

Write a SQL query to display the name and price of all the items with a price is equal or more than Rs.250, and the list contain the larger price first and then by name in ascending order.

Sample table: item_mast

 

Sample Solution :

SELECT pro_name, pro_price 
     FROM item_mast
    WHERE pro_price >= 250
 ORDER BY pro_price DESC, pro_name;

Output:

SQL exercises

Query Visualization:

Duration:

Query visualization of Display the name and price of all the items with a price is equal or more than Rs.250, and make a list that contain the larger price first and then by name in ascending order - Duration

Rows:

Query visualization of Display the name and price of all the items with a price is equal or more than Rs.250, and make a list that contain the larger price first and then by name in ascending order - Rows

Cost:

Query visualization of Display the name and price of all the items with a price is equal or more than Rs.250, and make a list that contain the larger price first and then by name in ascending order - Cost

Practice Online


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

Previous: Write a SQL query to find the item name and price in Rs.
Next: Write a SQL query to display the average price of the items for each company, showing only the company code.

What is the difficulty level of this exercise?



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