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:
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...
-
A two-dimensional rectangular plate is subjected to the boundary conditions shown. Derive an expression for the steady-state temperature distribution T(x, y). T= Ax b. T = 0 T = 0 T= 0 a
-
Cardinal Company is considering a project that would require a $2,800,000 investment in equipment with a useful life of five years. At the end of five years, the project would terminate and the...
-
Determine whether the following can be probability distributions of a random variable which can take on only the values \(1,2,3\), and 4 . (a) \(f(1)=0.19, \quad f(2)=0.27, \quad f(3)=0.27\), and...
-
1. Identify any potential threats to judgment you think could exist based on the facts of the case? 2. Thinking back to the biases discussed in Chapter 2, what biases might the identified threat(s)...
-
What is a firm's "corporate culture?" List and explain several behaviors that may be attributed to a firm's corporate culture and values system. How can the corporate culture help efforts to promote...
-
Answer the following questions related to the Docks Creek Land Company case presented in the chapter: 1. How does Robertsons role differ from Wisemans? 2. Are the professional standards applied...
-
Find a closed form for each of the following sums:
-
Suppose you are given two urns, numbered Urn I and Urn II. Contents of Urn I: 5 red, 6 blue, and 10 green marbles Contents of Urn II: 30 red, 20 blue, and 10 green marbles The probability of...
-
In the game of Problem 57, what is the probability that there will be an odd man out in a particular play if there are five players? Data from Problem 57 In a certain office, three men determine who...
-
Find the probability of obtaining exactly three heads on five tosses of a fair coin.
-
What is a binomial random variable?
-
Suppose a jar contains 3 pens: 1 red, 1 blue, and 1 green. Three people sign a document, one at a time. Each person selects a pen, signs the document, and then replaces the pen before the next person...
-
Please use BREAKEVEN and SHOW FORMULAS - thank you! BREAKEVEN PROBLEM 26.A bakery sells its pies for $6.00 each. The bakery incurs a daily fixed cost of $500 which includes salaries and rental. The...
-
Draw two scatterplots, one for which r = 1 and a second for which r = 21.
-
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,...
-
The following data from Lyre Ltd's accounts relates to two assets at 30 June 2023. At 30 June 2023 Lyre Ltd decides to adopt the revaluation model for both these assets. On this date land has a fair...
-
On 1 January 2023, Blue Jay Ltd revalued land from \(\$ 300000\) to \(\$ 500000\). On 1 January 2024, the company subsequently revalued the land to \(\$ 420000\). And on 1 January 2025 , the company...
-
Seagull Ltd purchased land for use as its corporate headquarters. A small factory that was on the land when it was purchased was torn down before construction of the office building began....
Study smarter with the SolutionInn App