136k views
1 vote
Write a SELECT statement that returns these columns from the Products table: product_name The product_name column list_price The list_price column date_added The date_added column Return only the rows with a list price that’s greater than 500 and less than 2000. Sort the result set by the date_added column in descending sequence.

1 Answer

5 votes

Answer:

Following are the SELECT statement.

/*SELECT statement to select columns*/

SELECT ProductName, ListPrice, DateAdded

/*FROM statement to select table*/

FROM Products

/*WHERE statement to apply condition*/

WHERE ListPrice > 500 AND ListPrice < 2000

/*For sorting the selected table*/

ORDER BY DateAdded DESC

Step-by-step explanation:

Select statement is used in the SQL query to retrieve the record from the database. In this query, it select ProductName, ListPrice, DateAddeed attribute from the product table where the list price is greater than 500 and also list price is less 2000 the record which satisfies these two condition are retrieved in descending order of DataeAdded.

User Mihai Ionescu
by
8.3k points