Write select queries for the following questions, post your SQL codes on discussion board for credit....
Fantastic news! We've Found the answer you've been seeking!
Question:
![](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2023/09/65058af45e908_1694862067307.jpg)
![](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2023/09/65058afcbbd86_1694862076163.jpg)
Transcribed Image Text:
Write select queries for the following questions, post your SQL codes on discussion board for credit. The E_R diagram of the database is shown below: order_tv Order ID Order_Date Customer_ID Indexes HH employee_t ▼ Employee_ID Employee_Name Employee Address >Employee_City Employee_State Employee_Zipcode Employee Supervisor Date Hired Indexes + customer_t V Customer_ID Customer_Name Customer_Address Customer_City Customer_State Postal Code Indexes order_line_t v Order_ID KProduct_ID Ordered Quantity Indexes ▶ product_t ▼ Product ID Product Description HH Product Finish Standard Price Product Line_ID Indexes 1. What are the name and address of the customer who placed order number 1006? Hint: Use table customer_t and table order_t 2. Assemble all information(All customer information, order ID, order date, order quantity, product description, standard price ) necessary to create an invoice for order number 1006. Hint: Use table customer_t, table order_t, order_line_t, product_t 3. Get the customer's ID and name along with the order ID of orders placed by the customer. List the results by customer name and then order id. Show only customers who made an order. 3.1 Show all customers including customers who did not place any orders. Hint: Use table customer_t and table order_t 4. Get the customer's ID and name of customers who has ordered any desk products. Hint: Use tab customer_t, table order_t, order_line_t, product_t 5. Get the ID and name of customers who have made more than two orders. Hint: Use table customer_t and table order_t 6. Get the order ID, product ID, name, standard price and ordered quantity, and the total value of each order. List the results by order id and then product id. Hint: total value of an order is equal to the standard price* ordered quantity 7. Get the customer name, and the total value of orders placed by this customer Hint: group the orders based on customer, then use the SUM() to sum up the total value for each group. Write select queries for the following questions, post your SQL codes on discussion board for credit. The E_R diagram of the database is shown below: order_tv Order ID Order_Date Customer_ID Indexes HH employee_t ▼ Employee_ID Employee_Name Employee Address >Employee_City Employee_State Employee_Zipcode Employee Supervisor Date Hired Indexes + customer_t V Customer_ID Customer_Name Customer_Address Customer_City Customer_State Postal Code Indexes order_line_t v Order_ID KProduct_ID Ordered Quantity Indexes ▶ product_t ▼ Product ID Product Description HH Product Finish Standard Price Product Line_ID Indexes 1. What are the name and address of the customer who placed order number 1006? Hint: Use table customer_t and table order_t 2. Assemble all information(All customer information, order ID, order date, order quantity, product description, standard price ) necessary to create an invoice for order number 1006. Hint: Use table customer_t, table order_t, order_line_t, product_t 3. Get the customer's ID and name along with the order ID of orders placed by the customer. List the results by customer name and then order id. Show only customers who made an order. 3.1 Show all customers including customers who did not place any orders. Hint: Use table customer_t and table order_t 4. Get the customer's ID and name of customers who has ordered any desk products. Hint: Use tab customer_t, table order_t, order_line_t, product_t 5. Get the ID and name of customers who have made more than two orders. Hint: Use table customer_t and table order_t 6. Get the order ID, product ID, name, standard price and ordered quantity, and the total value of each order. List the results by order id and then product id. Hint: total value of an order is equal to the standard price* ordered quantity 7. Get the customer name, and the total value of orders placed by this customer Hint: group the orders based on customer, then use the SUM() to sum up the total value for each group.
Expert Answer:
Answer rating: 100% (QA)
1 What are the name and address of the customer who placed order number 1006 SELECT cCustomerName cC... View the full answer
Related Book For
Posted Date:
Students also viewed these databases questions
-
Sales (33,000 units @ $16) Sales discounts Purchases Purchase discounts Freight-in Freight-out $ 528,000 7,500 380,600 18,000 5,000 11,000 York Company's inventory purchases during 2024 were as...
-
Planning is one of the most important management functions in any business. A front office managers first step in planning should involve determine the departments goals. Planning also includes...
-
The following additional information is available for the Dr. Ivan and Irene Incisor family from Chapters 1-5. Ivan's grandfather died and left a portfolio of municipal bonds. In 2012, they pay Ivan...
-
According to data released by the World Bank, the mean PM10 (particulate matter) concentration for the city of Kabul, Afghanistan, in 1999 was 46. Suppose that because of efforts to improve air...
-
What determines the demand for loanable funds and what makes it change?
-
Assume now that a new firm (firm N) discovers and patents a more efficient technology, summarized by thetotal cost function C = 10q. The new technology can be used only by the new firm, which enters...
-
Chosen at random, 500 rural and 500 urban persons age 65 or older are asked about their health and their experience with prescription drugs.
-
The price elasticity of demand for air travel differs radically from first-class (1.3) to unrestricted coach (1.4) to restricted discount coach (1.9). What do these elasticities mean for optimal...
-
Direct materials and direct labour usage and costs rarely match budgeted estimates. How does comparing actuals to estimates help management?
-
The Tumbling Domino Superannuation Fund, a complying fund, had the following payments and receipts for the 2021/22 tax year: RECEIPTS Contributions from employers Contributions from members...
-
(a) A ceiling fan has 91 Ohms of resistance. Suppose 340 meters of copper wire were added to the circuit to carry current from the fuse box of your house to a celling fan on the necond floor. The...
-
Answer the following problems with solution: Use the following information for the next two questions: The statement of financial position of the partnership of A and B as of December 31, 20x1 is...
-
Complete the following budgets 1 Production Budget Planned Sales Desired Ending Inventory of Finished Goods (roundup to the next unit) Total Needed Less: Beginning Inventory Total Production {7.01}
-
Solution needs urgently. Question 1 (5 points) In times of prosperity (with high incomes and employment), governments at all levels have resources for high cost infrastructure such as roads,...
-
Write a program (called assignment-1.cxx)-- (40 points) Write down the C++ program based on the following tasks. Creates an Array (1D array) and randomly assign values. Show the array with assigned...
-
on 17:03 Sat 11 May < 00 194843... 19871 II B itsSUNPI is live! + Hi mates im Alive chating and all the fun stuf that we do O COME & GET ME! -- Sunpi FE now Untitled... HYPE RESULTS T Potential...
-
Explain whether managers are included as users of financial statements.
-
On 1 July 2021, Croydon Ltd leased ten excavators for five years from Machines4U Ltd. The excavators are expected to have an economic life of 6 years, after which time they will have an expected...
-
In your own words, describe the nature and purpose of the normalization process.
-
Summarize the types of reports described in this chapter.
-
Consider a table named ORDER_ITEM, with data as shown in Figure 2-26. The schema for ORDER_ITEM is: ORDER_ITEM ( OrderNumber , SKU , Quantity, Price) Where SKU is a ?Stocking Keeping Unit? number,...
-
What are some of the ways in which a firm can attain a successful retrenchment strategy?
-
In the Learning from Mistakes at the opening of the chapter, we discussed the struggles of LG in the mobile phone market. Choose a competing firm in this market (e.g., Apple, Samsung, Xiaomi, Huawei,...
-
Think of a firm that has attained a differentiation focus or cost focus strategy. Are its advantages sustainable? Why? Why not? (Hint: Consider its position vis--vis Porters five forces.)
![Mobile App Logo](https://dsd5zvtm8ll6.cloudfront.net/includes/images/mobile/finalLogo.png)
Study smarter with the SolutionInn App