Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Graph Databases In Action

Authors: Dave Bechberger, Josh Perryman

1st Edition

1617296376, 978-1617296376

More Books

Students also viewed these Databases questions