Question

You have been asked to create a query that will join the Production.Products table with the...

You have been asked to create a query that will join the Production.Products table with the Production.Categories table. From the Products table show the product name and unit price. From the Categories table show the category name and description. For the query sort by two columns: first by category name in ascending order and then by unit price in descending order. Provide the full SQL statement for the answer. TSQLV4

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

Since you have not provided the schema containing the table and column names, I am providing the query by assuming them. Feel free to reach out for any clarifications.

Please find the query below.

QUERY

SELECT p.ProductName, p.UnitPrice, c.CategoryName, c.Description FROM Product p JOIN Category c ON p.CategoryID = c.CategoryID ORDER BY c.CategoryName, p.UnitPrice DESC;

Add a comment
Know the answer?
Add Answer to:
You have been asked to create a query that will join the Production.Products table with the...
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
  • More on JOINS Log in to your ApEX SQL account. Two Table Join Create a SQL...

    More on JOINS Log in to your ApEX SQL account. Two Table Join Create a SQL query that gets the order ID, order_mode, customer ID and product ID from the ORDERS and ORDER_ITEMS tables. You will have to join the tables on some common column. Two Table Join With Subquery Modify the previous query and add a subquery that looks for the existence of a customer ID in the CUSTOMERS table. This is a correlated sub-query so you will have...

  • (#3a){Screenshot.} Create a VIEW named ProductProfit that displays the Category Description, Product Description, and the Profit (SalePrice - Cost). Name the Category description column ‘Category’ an...

    (#3a){Screenshot.} Create a VIEW named ProductProfit that displays the Category Description, Product Description, and the Profit (SalePrice - Cost). Name the Category description column ‘Category’ and the Product description ‘Item’. The screenshot should show the SQL code to create the view and a SELECT statement displaying the records returned in descending order of the Profit column. (#3b){Screenshot.} Using the ProductProfit VIEW, display the records that are in the TOP 10 Percent of Profit. The screenshot should show the SELECT statement...

  • can someone solve these quick please and thank you! sql chapter 4 Query #1: List the...

    can someone solve these quick please and thank you! sql chapter 4 Query #1: List the company name, contact name, contact title and the phone number for customers who HAVE NOT put in an order. Use an outer join. Query #2: Create a listing displaying the employee first name, last name and the full name (First name space Last Name) of the person they report to (Supervisor). This is a self-join. If an employee does not report to anyone then...

  • I need to write an SQL statement to run this query: SALES has the following column...

    I need to write an SQL statement to run this query: SALES has the following column names: vendorid, name, upc, move, price, qty, year, store the table name is SALES... the sales is not a column in the SALES so it needs to be created in the query with the formula as well. QUESTION BELOW: Query 4: Return the vendor id, vendor name, product UPC code, move, and sales (price * move/qty) for each product sold by store 100 in...

  • #6 Write a SELECT statement that returns these columns: The count of the number of orders...

    #6 Write a SELECT statement that returns these columns: The count of the number of orders in the Orders table The sum of the tax_amount columns in the Orders table Write a SELECT statement that returns one row for each category that has products with these columns: The category_name column from the Categories table The count of the products in the Products table The list price of the most expensive product in the Products table Sort the result set so...

  • For each question, write a SQL query and save it as a "sql" file using a...

    For each question, write a SQL query and save it as a "sql" file using a different query 2, etc. Please execute these queries sequentially name, for example, query1.query product id (PK) category brand production_cost (Not Null) (FK) name (Not Null) Toothpaste Supermarket 1 Multivitami Supermarket 2 Shampoo acket T-shirt Supplements Supermarket Department4 Department5 Pharmacy Pharmacy 6 6 10 Query1. Update the Product table by adding another column as shown above ucts (name) with uery2. Retrieve all the uction cost...

  • WRITE A SQL QUERY SQL SERVER Write a SELECT statement that returns one column from the...

    WRITE A SQL QUERY SQL SERVER Write a SELECT statement that returns one column from the Customers table named FullName that joins the LastName and FirstName columns. --       Format this column with the last name, a comma, a space, and the first name like this: --       Doe, John --       Sort the result set by last name in ascending sequence. --       Return only the contacts whose last name begins with a letter from M to Z. --  ...

  • Create a query to find all records in the tblCompany table in which the City field...

    Create a query to find all records in the tblCompany table in which the City field value starts with the letter H. Displayn all fields in the query recordset, and sort in ascending order by CompanyName. Save the query as qryHSelectedCities, run the query, and then close it.

  • 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...

  • Deliverable 1. Simple SQL Statements Caution: Read the instructions carefully! Each question is based on a...

    Deliverable 1. Simple SQL Statements Caution: Read the instructions carefully! Each question is based on a single SQL statement, and the single SQL statement might contain sub-queries (additional SELECT statements) within the statement. Provide a list all of the Customer ID, Customer Names, and States and sort the list in alphabetical order by Customer Name. Provide a list of all of the Customer ID, Customer Names, and States, and sort the list by state with the Customer Names in alphabetical...

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