Using DBeaver, Choosing SQL sever Tpying the information to log in the database. Connection values: Server Type
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
/* Bill of Materials - Recursive */ /* The following code retrieves the components required for manufacturing the "Mountain-500 Black, 48" (Product 992). Modify the code to retrieve the most expensive component(s) that cannot be manufactured internally. Use the list price of a component to determine the most expensive component. If there is a tie, your solutions must retrieve it. */ -Starter code WITH Parts(AssemblyID, Component ID, PerAssemblyQty, EndDate, Component Level) AS SELECT b. ProductAssemblyID, b. ComponentID, b. PerAssemblyQty, b. EndDate, AS Component Level FROM Production. Bill0fMaterials AS b WHERE b. ProductAssemblyID= 992 AND b. EndDate IS NULL UNION ALL SELECT bom. ProductAssembly ID, bom. Component ID, bom. PerAssemblyQty, bom. EndDate, Component Level + 1 FROM Production.BillofMaterials AS bom INNER JOIN Parts AS p ON bom. ProductAssemblyID = p. ComponentID AND bom. EndDate IS NULL SELECT AssemblyID, ComponentID, Name, PerAssemblyQty, Component Level FROM Parts AS p INNER JOIN Production. Product AS pr ON p.Component ID pr. Product ID ORDER BY Component Level, AssemblyID, ComponentID; /* Bill of Materials - Recursive */ /* The following code retrieves the components required for manufacturing the "Mountain-500 Black, 48" (Product 992). Modify the code to retrieve the most expensive component(s) that cannot be manufactured internally. Use the list price of a component to determine the most expensive component. If there is a tie, your solutions must retrieve it. */ -Starter code WITH Parts(AssemblyID, Component ID, PerAssemblyQty, EndDate, Component Level) AS SELECT b. ProductAssemblyID, b. ComponentID, b. PerAssemblyQty, b. EndDate, AS Component Level FROM Production. Bill0fMaterials AS b WHERE b. ProductAssemblyID= 992 AND b. EndDate IS NULL UNION ALL SELECT bom. ProductAssembly ID, bom. Component ID, bom. PerAssemblyQty, bom. EndDate, Component Level + 1 FROM Production.BillofMaterials AS bom INNER JOIN Parts AS p ON bom. ProductAssemblyID = p. ComponentID AND bom. EndDate IS NULL SELECT AssemblyID, ComponentID, Name, PerAssemblyQty, Component Level FROM Parts AS p INNER JOIN Production. Product AS pr ON p.Component ID pr. Product ID ORDER BY Component Level, AssemblyID, ComponentID;
Expert Answer:
Related Book For
Concepts of Database Management
ISBN: 978-1285427102
8th edition
Authors: Philip J. Pratt, Mary Z. Last
Posted Date:
Students also viewed these databases questions
-
answer the question clearly You are building a flight-control system for which a convincing safety case must be made. Would you assign the tasks of safety requirements engineering, test case...
-
SOLEX ENGINEERING ENTERPRISE (SEE) The company: Solex Engineering Enterprise (SEE) is a Sri Lankan organization formed as a partnership by two brothers in 1980. They had a keen interest to explore...
-
Allison is paid $1,520 per week. What is the amount of federal income tax withheld from Allisons paycheck under the following conditions? Use the percentage method table in the Appendix to this...
-
The numbers of millions of Social Security beneficiaries for selected years and projected into the future are given in the table. (a) Find the cubic function that models these data, with x equal to...
-
What is payback analysis, and what does it measure? What is a payback period, and what is the formula to calculate the payback period?
-
The number of units to be sold to reach a certain target profit is calculated as a. target profit unit contribution margin b. target profit contribution margin ratio c. (fixed expenses + target...
-
Financial Statement Effects of FIFO and LIFO the management of Tritt Company has asked its accounting department to describe the effect upon the company?s financial position and its income statements...
-
(a) Identify and explain the various ways through which government can intervene and assist upcoming Small entrepreneurs to grow and sustain their enterprises. (b) Explain the rationale behind SWOT...
-
Amy Lloyd is interested in leasing a new Honda and has contacted three automobile dealers for pricing information. Each dealer offered Amy a closed-end 36-month lease with no down payment due at the...
-
January 4 Yang Welch president of Welch Manufacturing Corporation loaned the company 25000 He obtained these funds on July 15 by borrowing against a personal life insurance policy The loan from Welch...
-
1. (10) A $10 000 bond was issued on January 1st 2015 with a coupon rate of 9.7% and a redemption date of January 1st 2025. What is the purchase price of the bond on January 1st, 2022 when the yield...
-
b. You are given an application that matches words from song lyrics to song titles. The current system uses a hash table implementation. Each song title is hashed to an entry in the table and each...
-
***response should only be 250-300 words** Using either your current employer or a company with which you are quite familiar, identify one particular type of queue in that company in which customers...
-
A monopoly water slide has demand of p(Q) = a - bQ, where p is the price per slide ("ride"), Q is the quantity of slides demanded, and a, b > 0. Fixed costs are F = 0 and constant marginal costs are...
-
The bulls and cows game is a code-breaking game designed for two or more players. Each player chooses a secret code of 4 digits from 0-9. The digits must be all different. The goal of the game is for...
-
A 46 cm long high-resistance wire with rectangular cross section 7 mm by 3 mm is connected to a 12 volt battery through an ammeter, as shown in the figure. The resistance of the wire is 59 ohms. The...
-
To balance the chemical equation SiH3 + O2 SiO2 + HO, you could introduce coefficients a, b, c, d and write aSiH3 + bO2 cSiO + dHO then write linear equations for each element. The equation for Si...
-
What additional factors must you consider during the information-level design of a distributed database?
-
What additional factors must you consider during the physical-level design of a distributed database?
-
Complete the following tasks. In each exercise, represent your answer in both DBDL and with a diagram. You may use any of the styles presented in this chapter for the diagram. 1. Design a database to...
-
Can you create a graphic that highlights each incidence where Fairmont was not in compliance with company policy that requires explicit approval of all hours of eighty hours or more?
-
In addition to financial reporting fraud, what other types of asset misappropriation schemes were perpetrated by the Rigas family members?
-
Why was Adelphia cable company formed?
Study smarter with the SolutionInn App