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
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;
You have been asked to create a query that will join the Production.Products table with the...
j. Create a SQL query based on tblTransaction and tblEmployees that will display all the fields from tblTransaction and the FirstName and LastName fields from tblEmployees. Use a join to include all employees, regardless if they have sold any products. Sort in ascending order by the employee’s first name and last name. Save your query as qryEmpTransaction_initialLastname, and then close the query. Feilds from tbl Transaction are TransactionID, CustomerID, EMployeeID, TransactionDate, MethodOfPayment Feilds from tbl Employees are EmployeeID, FirstName, LastName,...
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...
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 Write a SQL query that shows all the columns in the country table for the North America region. The results need to be sorted in ascending order by population. Write a SQL query that shows the unique regions in the country table except for the regions from the continent of Oceania. The results need to be sorted in ascending...
(#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 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 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 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 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 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 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.