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 they should not appear in the result set.
Query #3: This query will need 6 tables. Display the following: Customer ID, customer company name, employee last name who wrote the order, order date, order product name, order product quantity, and the company name of the supplier who provides the product. This should only contain orders that Buchanan (employee last name) created for customer id SAVEA. It should only be for orders written (OrderDate) for the month of July regardless of year – use the Month(date field) function.
Query #4: List the product name and the supplier name distinctly for those products that meet the following criteria: there had to be at least a quantity of 100 placed on an order, the products should be within the following categories: Beverages, Meat/Poultry, Dairy Products, Seafood. Order the list by product name.
Query #5: Create a union that combines the following result sets: The first interim result set should display the literal ‘Discounted’, product ID, name, unit price, quantity, product sale amount which is a calculated field. (UnitPrice * Quantity) * (1 - Discount) AS ProductSale. This should be for discounted products (located in the OrderDetails table where discount>0) only where a quantity of 100 or more were placed for an order. The second interim result set should display the literal ‘No Discount’, product ID, name, unit price, quantity, product sale which should be setup as follows: (UnitPrice * Quantity) AS ProductSale. This should be for non discount products (discount=0) where a quantity of 100 or more were placed for an order.
Query #6: Create a query that will display an employee first name and last name uniquely for those employees that have sold at least one of the following products: Boston Crab Meat, Chai, and Sir Rodney's Scones. Make sure you bring in the correct number of tables to perform this query, a Cross Join SHOULD NOT BE USED.
Query #7: List the cities for an employee that is common to a customer city location. YOU MUST use the Intersect operator.
Query #8: This query will involve 7 tables. Make sure a CROSS JOIN is NOT used. Display the employee first name, last name, Territory description, unit price at the time of the order, quantity ordered, product name, region description for order quantities within the range of 10 and 25, territory of Atlanta, within the Southern region, unitprice of 10 dollars or less, and the product of Filo Mix.
1)
SELECT c.CompanyName, c.ContactName, , c.ContactTitle, c.Phone FROM Customers c LEFT OUTER JOIN Orders o ON c.CustomerID = o.CustomerID;
2)
SELECT e.FirstName, e.LastName, concat(s.FirstName, ' ', s.LastName) AS SupervisorName FROM Employees e JOIN Employees s ON e.ReportsTo = s.EmployeeID;
3)
SELECT c.CustomerID, c.CompanyName, e.LastName, o.OrderDate, p.ProductName, od.Quantity, s.CompanyName FROM Customers c, Employees e, Orders o, OrderDetails od, Products p, Suppliers s WHERE c.CustomerID = o.CustomerID and e.EmployeeID = o.EmployeeID and o.OrderID = od.OrderID AND od.ProductID = p.ProductID AND p.SupplierID = s.SupplierID AND e.LastName = 'Buchanan' AND c.CustomerID = 'SAVEA' AND month(o.OrderDate) = 7;
NOTE: As per HOMEWORKLIB POLICY I am allowed to answer specific number of questions (including sub-parts) on a single post. Kindly post the remaining questions separately and I will try to answer them. Sorry for the inconvenience caused.
can someone solve these quick please and thank you! sql chapter 4 Query #1: List the...
Create the following SQL Server queries that access the
Northwind database
Same as problem 3 but, limit the list to all customers who
placed 3 or more orders.
The product id, product name, last date that the product was
ordered for all items in the Grains/Cereals category. (Hint: Use
MAX)
The product ID, product name, and number of distinct customers
who ordered that product in 1996
Thank you.
Categories Customers Employees Order Details Orders Products Shippers 9 CategoryID CategoryName Description...
Question for SQL in MS SQL Server Management Studio (Please
don't use where clause for Joins use from clause)
Need to Create a Query to display products purchased by
customers in Germany that were not purchased by customers in the
US.
Customers PK Customer D CompanyName Contact Name Contact Title Address City State OrRegion PostalCode Country Phone char(5) varchar(40) varchar(30) varchar(30) varchar(60) varchar(15) varchar(15) varchar(10) varchar(15) varchar(24) varchar(24) Order Details Orders PK OrderID int FK CustomerlD char(5) FK Employeeld int...
Question for SQL in MS SQL Server Management Studio (Please
don't use where clause for Joins use from clause)
Need to Create a Query because Northwind Traders wants to make
sure that all orders are shipped within 10 days. Display any orders
that were not shipped within 10 days. Include the OrderID, the
OrderDate, and the number of days it took before the order was
shipped.
Customers PK Customer D CompanyName Contact Name Contact Title Address City State OrRegion PostalCode...
Question for SQL in MS SQL Server Management Studio (Please
don't use where clause for Joins use from clause)
Need to Create a Query because Northwind Traders has decided to
increase their retail prices. Write a query that shows the product
name, the current price, and the new price. Make sure the new price
is listed to 2 decimal points. Follow below guidelines on new
retail price:
a. If the
category is beverages or dairy products, increase the price by...
The business process we are
interested in is sales(i.e., selling products to customers).
Develop a logical star- or snowflake-schema dimensional model.
orders customers + PK FK orderdetails PK/EK OrderID PK/FK Products UnitPrice Quantity Discount PK OrderID Customer D FK Employeeld Order Date RequiredDate Shipped Date FK ShipVia Freight ShipName ShipAddress ShipCity ShipRegion ShipPostalCode Ship Country CustomerID CompanyName ContactName Contact Title Address City Region PostalCode Country Phone shipppers PK Shipperid CompanyName Phone Fax products PK ProductID + employees PK Employeeld LastName...
Questions are based on the Northwind database.
a. A data dictionary (Excel file) that describes each of the
tables. (Attached in question)
b. Write good, clean SQL that answers the
following questions.
c. Separate your queries as I have
done in the following example. End each query with a semicolon (;)
and insert the word "go" between each query. Queries can span
multiple lines if required.
Select CustomerID from Customers;
go
Select Count(*) from Employees;
go
Select max(productID) from Products;
18. Produce...
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>...
Hello, I need help answering all 8 of these questions for my BIS
422 class. I need the appropriate MySQL script to use for these
questions
Provide the SQL for the following data requests. Your SQL should
be written as a single script that can be pasted into MySQL and run
without edits. Make sure you use the proper notation for your
comments (see the practice solution for an example of the format).
There will be a 5% deduction for...
The Chinook team would like to
throw a promotional Music Festival for their top 10 customers who
have spent the most in a single invoice. Write a query that returns
the first name, last name, and invoice total for the top 10
invoices ordered by invoice total descending.
MediaType Artist Album Track Artistld Albumld MediaTypeld Trackld Title Name Name Name Artistld Albumld MediaTypeld Genreld Composer Genre Playlist Track Playlist Milliseconds Genreld Playlistld Playlistld Name Bytes Name Trackld UnitPrice InvoiceLine Employee...
Please help me on the SQL
queries, thank you so much.
Write a query to display the
title and publisher as well as the publisher contact for each book
using JOIN...USING clause.
Write a query to show the
first and last names of customers who have ordered cooking books.
Use the WHERE clause to join the tables.
Write a query to show the
title, cost and ISBN of each book in the books table. If the book
has been ordered,...