Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Wondering if I could get a bit of help with this question: 2. Query “ Sales.Stor

ID: 3588852 • Letter: W

Question

Wondering if I could get a bit of help with this question:

2. Query “Sales.Store” table to obtain the list of “Name” and “SalesPersonID” where the store name starts with the letters “g” through “j” and the SalesPersonID is greater than 283. Make sure that the list is sorted by “SalesPersonID” and then by “Name” fields in a descending order. Be sure the query returns all the required rows.

Submit the SQL statement used to accomplish this task.

How many rows were affected?

Provide a screenshot of the result set.

Hint: Combine WHERE clause conditions and also have an ORDER BY clause in place.

Explanation / Answer

Ans:

With and logic operator we will get satisified with the two conditions of desired result Sales.Store with ORDERBY clause also

Select SalesPersonID,Name from Sales.Store WHERE SalesPersonID>283 and Name=g%J% ORDER BY SalesPersonID,Name DESC;

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote