Write the following queries in SQL. 1. #prods whose name begins with a 'p' and are...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Write the following queries in SQL. 1. #prods whose name begins with a 'p' and are less than $300.00 2. Names of the products stocked in "d2", (a) without in/not in (b) with in/not in 3. #prod and names of the products that are out of stock (quantity0), (a) without in/not in (b) with in/not in 4. Addresses of the depots where the product "p1" is stocked. (a) without exists/not exists and without infnot in (b) with in/not in (c) with exists/not exists 5. #prods whose price is between $250.00 and $400.00 (a) using intersect. (b) without intersect. 6. Number of products that are out of stock (quantity <=0). 7. Average of the prices of the products stocked in the "d2" depot. 8. #deps of the depot(s) with the largest capacity (volume). 9. Sum of the stocked quantity of each product. 10. Products names stocked in at least 3 depots. (a) using count (b) without using count 11:#prod stocked in all depots. (a) using count (b) using exists/not exists We consider product, depot and stock of HWZ. #prod should be prodid #dep should be depid The primary key of product is pcosid. The primary kay of depot is dapid. The (composite) primary key of stock is prodid. depid prodid in stock is a foreign key referring the primary key prodid in product. depid in stock is a foreign key referring the primary key depid in depot. . ● . . ● Write the following queries in SQL. 1. #prods whose name begins with a 'p' and are less than $300.00 2. Names of the products stocked in "d2", (a) without in/not in (b) with in/not in 3. #prod and names of the products that are out of stock (quantity0), (a) without in/not in (b) with in/not in 4. Addresses of the depots where the product "p1" is stocked. (a) without exists/not exists and without infnot in (b) with in/not in (c) with exists/not exists 5. #prods whose price is between $250.00 and $400.00 (a) using intersect. (b) without intersect. 6. Number of products that are out of stock (quantity <=0). 7. Average of the prices of the products stocked in the "d2" depot. 8. #deps of the depot(s) with the largest capacity (volume). 9. Sum of the stocked quantity of each product. 10. Products names stocked in at least 3 depots. (a) using count (b) without using count 11:#prod stocked in all depots. (a) using count (b) using exists/not exists We consider product, depot and stock of HWZ. #prod should be prodid #dep should be depid The primary key of product is pcosid. The primary kay of depot is dapid. The (composite) primary key of stock is prodid. depid prodid in stock is a foreign key referring the primary key prodid in product. depid in stock is a foreign key referring the primary key depid in depot. . ● . . ●
Expert Answer:
Answer rating: 100% (QA)
1 prods whose name begins with a p and are less than 30000 SQL SELECT ... View the full answer
Related Book For
Posted Date:
Students also viewed these databases questions
-
4. A wire coil used to produce a magnetic field is made of copper wire of diameter 0.7 mm, and is wound so the coil has a diameter of 40 cm (see figure). The resistance of the coil is measured to be...
-
Consider the following relational schema: Staff ( staffNo , name, dept, skillCode) Skill ( skillCode , description, chargeOutRate) Project ( projectNo ,...
-
The following relations keep track of airline flight information: Flights (flno: integer, from: string, to: string, distance: integer, departs: time, arrives: time, price: real) Aircraft (aid:...
-
Yang Company purchased 2,000 widgets and has 400 widgets in its ending inventory at a cost of $90 each and a current replacement cost of $80 each. The net realizable value of each unit in the ending...
-
How do closing costs affect a person's ability to afford a home purchase?
-
Banking crises have occurred throughout the world, like the Finnish banking crisis of 1990s, the 2002 Uruguay banking crisis, and the 2003 Myanmar banking crisis. In this context, what similarity do...
-
Javier Cruz is contemplating the purchase of a machine that will automate the production of baseball bats in his factory. The following estimates are available: Required: Determine the net present...
-
A production process at Kenneth Day Manufacturing is shown in figure S7.9. The drilling operation occurs separately from, and simultaneously with, the sawing and sanding operations. A product needs...
-
Lauren purchased a house for $475,000. He made a down payment of 20.00% of the value of the house and received a mortgage for the rest of the amount at 3.52% compounded semi-annually amortized over...
-
List the people and groups of people who are likely to be interested in financial statements.
-
Mry Lou Inc designs and manufactures fleece quarter-zip jackets. It sells it's jackets to brand-name outdoor outfitters in lots of one dozen. Mary Lou's May 2017 static budget and actual results for...
-
Integration - Fundamental Theorem variable bounds: Problem 6 (1 point) G(x) = tant dt Find G(1) = = Find G'(4) =
-
Visit a retail business in WINNIPEG that you are not familiar with and describe (by observing and participating in) the shoppin experience that the business is trying to achieve. You should be able...
-
A nightclub, a cash basis taxpayer, desperately wanted to secure the singing services of Johnny Cash (also a cash basis taxpayer) for a December 20, 2021 performance. The nightclub offered Johnny...
-
Ethics is an important part of the Accounting Profession and can be very complex. Making ethical decisions based on a framework will be useful. Think of an ethical issue, apply the framework and come...
-
1. A company has estimated its economic order quantity for Part A at 2,400 units for the coming year. The ordering costs are P200 and carrying costs are P.50 per unit per year. What is the estimated...
-
13.7.8 ( X_{n} ) is an iid random sequence with ( mathrm{E}left[X_{n} ight]=0 ) and ( operatorname{Var}left[X_{n} ight]=3 ). Find the antocorrelation function ( mathrm{CY}_{gamma}[n, k] ) of the...
-
Study the pictures/images below. Obviously these was focus on LT sociology, anthropology and poltical science. Try to do some analysis by finding clues that are synonymous with the main concepts....
-
In this exercise, you modify the Monthly Payment application from this chapters Apply lesson. Use Windows to make a copy of the Payment Solution folder. Rename the copy Modified Payment Solution....
-
Open the Professor Juarez Solution.sln file contained in the VB2017\Chap08\Professor Juarez Solution folder. a. Open the Code Editor window and locate the btnDisplay_Click procedure. The procedure...
-
Which of the following statements assigns the string California to the element located in the fourth column, sixth row in the two-dimensional strStates array? a. strStates(3, 5) = "California" b....
-
Which fraud scheme did Sunbeam not do? a. Cookie-jar reserves b. Accelerated revenues from leasing equipment c. Channel stuffing d. Guaranteed sales e. Improper bill and hold
-
Which would be a corrective control? a. Process redesign b. Drug testing c. Using document control numbers d. Job rotation e. Event notifications
-
Which is not one of the three B's of fraud? a. Bucks b. Babes c. Booze d. Bets e. \(B\) and \(C\) above
Study smarter with the SolutionInn App