Question: Solve Query 1 again by writing another SELECT statement that uses LEFT() or RIGHT() functions without the LIKE operator. For the output of Query 2,

Solve Query 1 again by writing another SELECT statement that uses LEFT() or RIGHT() functions without the LIKE operator. For the output of Query 2, an extra column of CategoryID is wanted and only products with the smallest CategoryID value are desired.

Hint 1: different sorting from Query 1

Hint 2: TOP x WITH TIES

Hint 3: correct output has three products

/* Query 1. (10 points) Which products whose ProductName is ended with 't' and has a UnitPrice higher than $30? Display their ProductID, ProductName, and UnitPrice in the order of UnitPrice from highest to lowest. Solve this query by writing a SELECT statement with the LIKE operator.

Hint: correct output has 5 products. */

SELECT ProductID, ProductName, UnitPrice FROM Products WHERE ProductName LIKE '%t' AND UnitPrice > '$30' ORDER BY UnitPrice DESC;

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!