5)
SELECT p.productName, c.customerName, e.firstName, e.lastName, o.orderNumber from Customers c, Employees e, Orders o, OrderDetails od, Products p where c.salesRepEmpoyeeNumber = e.employeeNumber and c.customerNumber = o.customerNumber and o.orderNumber = od.orderNumber and od.productCode = p.productCode order by e.lastName, e.firstName, c.customerName;
6)
select productCode, productName FROM Products where productCode not in (select productCode from OrderDetails od JOIN Orders o on od.orderNumber = o.orderNumber where o.orderDate >= "2005-05-10") order by productName;
uu Payments check Number paymentate amount customer Number Offices officeCode city phone addressLine1 addressLine2 state country...
Using this relations scheme:
write these queried in relational algebra
2.List productCode, productName, and productVendor for each
product that has never been ordered in June. Remember that we have
the month function that returns the number of the month component
of a data, and January is month number 1.
3.List the Customers that did not Order any products in
2015.
4.List all CustomerNames who have never had an order go to the
‘Shipped’ status.
1.. products FK product Code product...
Customer Product Manufacturer ManufacturerID ManufacturerName Addressi Address2 City State PostalCode Phone Fax Contact URL Sale Saleltem CustomerID FirstName LastName StreetAddress City State PostalCode Country Phone SalelD SaleDate CustomerID Tax Shipping SaleID ProductiD ItemSize Quantity SalePrice ProductID ProductName ManufacturerID Composition ListPrice Gender Category Color Description Employee EmployeelD o FirstName LastName Address City State ZIP Phone ManagerlD SSN EmailAddress HireDate SalaryEmployee EmployeelD o Salary WageEmployee EmployeelD o Wage MaxHours What are the dollar amounts of each Sale (add all SaleItem amounts) for...
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...
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...
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...
CUSTTYPE (TID, TypeDesc) CUSTOMER (CID, Lname, Fname, TID, Address, ZIPcode) CUSTORDER (OrderNo, OrderDate, PromiseDate, ShippedDate, ShippingTerm, SalesID, CID) SALESREP (SalesID, Name, Phone, Address, ZIPcode, RepType) ORDERLINE (OrderNo, PID, Qty, Qty_RETD) FTSALESREP (SalesID, MonthPay, Rank) PTSALESREP (SalesID, HourlyRate, WeekHours) ZIP_TABLE (ZIPcode, City, State) VENDOR (VID, Name, Phone ZIPcode) PRODUCT (PID, CateID, ProdName, ProdFinish, Price, Qty_on_Hand, Description, VID) CATEGORY (CateID, CateType) Local View #1: Use three base tables to develop a SQL statement that will list the following information for a customer,...
An online company sells hundreds of office supply products on
its e-Commerce store. It has asked you to design and implement a
sales order processing system which will be used by users in our
Operations department to process sales orders. Here is an overview
of the sales order process. Customers make purchases by placing
orders. Each customer has a customer number and profile (such as
name, shipping address). To simplify the matter, each time an order
is placed, only one...
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>...
Prepare an entity-relationship (ER) diagram using MySQL Workbench for the user requirements described below. Be sure that your ER diagram has the following elements: entities; relationships between entities; primary and foreign keys, and other necessary columns for each entity. Global Trading (GT) is a wholesale business that sells a variety of products; its customers are other businesses. Also GT's vendors are other businesses. GT has the following business rules for the database that the company wants you to design: -A...