Question

Query “Sales.Store” table to obtain the list of “Name” and “SalesPersonID” where the store name starts...

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.

0 0
Add a comment Improve this question Transcribed image text
Answer #1


Query:

SELECT Name , SalesPersonID
FROM Salses.Store
WHERE Name LIKE '[g-j]%'
AND SalesPersonID >283
ORDER BY SalesPersonID ,Name DESC;

Explanation :
The WHERE clause LIKE '[g-j]%' get names with in the range that starts with g through j
and % for any other characters in the Name and sales person id numbers are greater than 283 are returned.

The SELECT Name, SalesPersonID selects the Name and id
of the where clause

The ORDERBY clause first sorts the sales persons id numbers and the
sort by Name in desending order.

Add a comment
Know the answer?
Add Answer to:
Query “Sales.Store” table to obtain the list of “Name” and “SalesPersonID” where the store name starts...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • 1. Write a query to list the first name and last name of those pilots who...

    1. Write a query to list the first name and last name of those pilots who were hired after January 1, 2010. Sort your result by the ascending order of last name. Within matching last names, order by first name. 2. Write a query to list flight number, pilot number, pilot last name for all flights whose destinations are using the IN keyword. 3. Write a query to list the names and telephone numbers of the passengers who have reservations...

  • 1.If you do not have the world schema you can obtain the scripts to create the...

    1.If you do not have the world schema you can obtain the scripts to create the database schema from https://dev.mysql.com/doc/index-other.html Queries 1. Write a SQL subquery that shows the unique region names where the languages spoken are English, French or German. 2. Write a SQL query that shows the country name, region, language for the Caribbean region 3. Write a SQL query that shows the country name once and shows the number of cities in that country. The number of...

  • Write a query in SQL to list the following information of the artists in movie industry....

    Write a query in SQL to list the following information of the artists in movie industry. Limit this information to only 5 artists. Sort the information by age descending order.          Full name : first name and last name separated by space          Age: Current age          Address: State that he resides          Contact number: Phone number This is from an artist table, where first_name, last_name, contact_no, address, birth_date are the fields in the table. Birth date in the table...

  • 5. Write a SELECT statement that returns these columns from the Orders table: OrderID OrderDate ShipDate...

    5. Write a SELECT statement that returns these columns from the Orders table: OrderID OrderDate ShipDate Return only the rows where the ShipDate column contains a null value. 6. Write a SELECT statement that returns all columns from the Addresses table State is equal to CA 7. Write a SELECT statement that returns all columns from the Products table Product name has a "ru" in its name 8. Write a SELECT statement that returns these columns from the Customers table...

  • Write a query that lists the top 3 suppliers ordered by their contact name in descending...

    Write a query that lists the top 3 suppliers ordered by their contact name in descending order Write a query that list all the countries that start with the litter M. Make sure you don’t have any duplicates. List all product Name and unit price. Order the result by the unit price un descending order Customer > Customer int <p FirstName nvarchar(40) LastName nvarchar(40) City nvarchar(40) Country nvarchar(40) Phone nvarchar(20) 8 IndexCustomerName Supplier Supplier int spk Order Order int <pk>...

  • Can you please write the MySQL Query sentences for the following items below? For example: SELECT...

    Can you please write the MySQL Query sentences for the following items below? For example: SELECT * FROM employees; Generate a list of salespeople sorted descending by hire date. Show the ID, first name, last name, hire date, and salary for each salesperson. Generate a list of customers whose last name begins with the letter “M.” Show the first and last names of these customers. Sort the list of customers descending by last name. C. Generate a list of customers...

  • Which SQL statement retrieves the EmployeeName and City columns from the Employees table? O LIST EmployeeName,...

    Which SQL statement retrieves the EmployeeName and City columns from the Employees table? O LIST EmployeeName, City ON Employees; O FIND EmployeeName, City ON Employees; SELECT EmployeeName, City FROM Employees; O RETRIEVE EmployeeName, City FROM Employees; Which SQL statement finds the different cities in which national parks reside with no duplicate rows listed? SELECT DISTINCT city FROM natlpark ORDER BY city; O ORDER BY natlpark DISTINCT city; O ORDER BY city FROM natlpark; O SELECT city FROM natlpark ORDER BY...

  • Write a query to find all product names from Production.Product table. with the list price greater...

    Write a query to find all product names from Production.Product table. with the list price greater than $3,000. Use SQL select statement.

  • SQL query: Write a SQL statement using the employees table and retrieve employees whose monthly salary...

    SQL query: Write a SQL statement using the employees table and retrieve employees whose monthly salary (including their commission) is greater or equal to 5,000 but less than or equal to 17,000 (we are assuming the salary on the table is monthly). In other words, if their monthly salary was 1000 and their commission was .2, their total monthly salary would be 1200 and given the criteria above this instance would not be selected. Please display the full name of...

  • %20Capstone%20Project%20using%20Access.pdf t-content-rid-24664575-2/courses/209275/CIS%201 1 509620D Part 2 If your last name begins with the letter A-G: create...

    %20Capstone%20Project%20using%20Access.pdf t-content-rid-24664575-2/courses/209275/CIS%201 1 509620D Part 2 If your last name begins with the letter A-G: create a report that displays only the people who have paid at least $500 this year. Include the person's name, address, city, phone number, and YTD paid sorted by YTD paid (descending), then their last name. If your last name begins with the letter H-M: create a report that displays only the people who have a balance of more than $100. Include the person's name,...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT