Question

19:31 P B . Ch. 6 HW Assignment 4 - Saved SG 59% Make db_pvfc11_big as your default database when you log into SQL Assistant:

SGJ59% 19:31 P OP following questions: 1. For each customer, list the CustomerID and the total number of orders placed in 20

I can provide my log in to my teradata database if necessary.
Thanks

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

Answer :

I am not having the table structure here however the below queries will give idea on how they can be formed. I have assumed some tables fom my side shouls be in the database as orders, sales,customers, etc.

1. select customer_ID, count(order_ID) from Customer where EXTRACT(YEAR FROM (date)) = 2009 group by customer_ID;

2. select salesman_ID, count(order_ID) from Sales group by salesman_ID ;

3. select customer_ID, count(order_ID) from Order where count(order_ID) > 2 group by customer_ID;

4. select territory_ID, count(salesman_ID) as NumSalesPersons from Sales where NumSalesPersons > 1 group by territory_ID;

5. SELECT * FROM Order group by ProductID order by count(ProductID) desc;

Add a comment
Know the answer?
Add Answer to:
I can provide my log in to my teradata database if necessary. Thanks 19:31 P B...
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
  • There are 7 problems that require using joins. Each problem has 10 points. 1. Write an...

    There are 7 problems that require using joins. Each problem has 10 points. 1. Write an SQL command that will find any customers who have not placed orders and sort them out by CustomerID in ascending order. 2. List the employees and supervisors names for each supervisor who supervises more than two employees. 3. List the name of each employee, his or her birth date, the name of his or her manager, and the manager’s birth date for those employees...

  • Database Exercise I (50 pts): This exercise deals with a database that stores information about Hotel...

    Database Exercise I (50 pts): This exercise deals with a database that stores information about Hotel Management System. Customer (C email, name, country) Payment (Invoice id, C email, payment method, date) invoice (Invoice id, starus, invoice description) Has (Bill id. Invoice id) 9a Bill (Invoice id, Bill id, amount, Bname, type, date, reservation id) Reservation (Hotel id, room id, C email, date, period, reservation id) Rooms(Hotel id. room id, price, category) Hotel (Hotel id. H name. country) Own (room id,...

  • Plz someone answer my database questions post Exercise I (50 pts): This exercise deals with a...

    Plz someone answer my database questions post Exercise I (50 pts): This exercise deals with a database that stores information abhout Hotel Management System. Customer (C email, name, country) Payment (Invoice id. C email, payment method, date) Invoice (Invoice id, starus, invoice description) Has (Bill id, Invoice id) Bill (Invoice id, Bill id, amount, Bname, type, date, reservation id) Reservation (Hotel id., room id. C email, date, period, reservation id) Rooms(Hotel id, room id. price, category) lotel (Hotel id, H...

  • Plz someone answer my database questions post Exercise I (50 pts): This exercise deals with a...

    Plz someone answer my database questions post Exercise I (50 pts): This exercise deals with a database that stores information abhout Hotel Management System. Customer (C email, name, country) Payment (Invoice id. C email, payment method, date) Invoice (Invoice id, starus, invoice description) Has (Bill id, Invoice id) Bill (Invoice id, Bill id, amount, Bname, type, date, reservation id) Reservation (Hotel id., room id. C email, date, period, reservation id) Rooms(Hotel id, room id. price, category) lotel (Hotel id, H...

  • Hello, I need help answering all 8 of these questions for my BIS 422 class. I...

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

  • EXERCISE Provide working SQL DML statements for the following database schema and queries CUSTOMER (ID, Type,...

    EXERCISE Provide working SQL DML statements for the following database schema and queries CUSTOMER (ID, Type, Firstname, Lastname, Address, City) INVENTORY(ID, ItemName, Type, MadeInStore, SupplierName, DailyAverageSold, Price) ORDERS(ID, Customer_FK, Item_FK, Quantity, DeliveryDate) 16. Find the total amount due for each order, where the total is at least $70 . Show: order id, lastname, and total-amount . Hint: variation of previous query 17. Find the total amount due for each order placed by a customer that is a restaurant owner, total...

  • A database used for a toy store that keeps track of the inventory and purchase orders...

    A database used for a toy store that keeps track of the inventory and purchase orders from the store. All clients will have their membership ID card to shop. This database will help the store to keep track of their orders. It will also help the store to know how many products are available in the inventory. It is necessary to have a membership to purchase a product. The customer can also bring coupons to get discount. Key attributes: Salesman:...

  • A database used for a toy store that keeps track of the inventory and purchase orders...

    A database used for a toy store that keeps track of the inventory and purchase orders from the store. All clients will have their membership ID card to shop. This database will help the store to keep track of their orders. It will also help the store to know how many products are available in the inventory. It is necessary to have a membership to purchase a product. The customer can also bring coupons to get discount. Key attributes: Salesman:...

  • Exercise 3 [12.5 marks] Given the Restaurant management system database that contains the following tables (primary...

    Exercise 3 [12.5 marks] Given the Restaurant management system database that contains the following tables (primary keys are underlined and foreign keys are preceded with #): Customer (customerID,customerFirstName,customerLastName,customerAddress) Oreder (orderID,orderDate, #customerID,#menuItemID,#staffID) MenuItem(menuItemID, menuItemName,ingredients,type,availability) Staff(staffID, staffName, staffPhoneNumber, staffRole ) OrderPayment(paymentID,paymentAmount,#orderID,#staffID) 1) Without using DISTINCT, write the SQL query equivalent to the following one:[1.5 marks] SELECT DISTINCT menuItemName FROM MenuItem WHERE type = ‘Vegetarian’ OR availability= ‘Yes’; 2) Express the following queries in SQL: a) Find the number of orders placed by...

  • The Northwind database created by Microsoft contains the sales data for a fictitious company called Northwind...

    The Northwind database created by Microsoft contains the sales data for a fictitious company called Northwind Traders, which imports and exports specialty foods from around the world. Here is the schema of the database: Products (ProductID, ProductName, SupplierID, CategoryID, QuantityPerUnit, UnitPrice, UnitsInStock, UnitsOnOrder, ReorderLevel, Discontinued); Suppliers (SupplierID, CompanyName, ContactName , ContactTitle, Address, City, Region, PostalCode, Country, Phone, Fax, HomePage); Categories (CategoryID, CategoryName, Description, Picture); Orders (OrderID, CustomerID, EmployeeID, OrderDate, RequiredDate, ShippedDate, ShipVia,  Freight, ShipName,ShipAddress, ShipCity, ShipRegion, ShipPostalCode, ShipCountry); Order_details (ID, OrderID,...

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