Construct a SQL Data Definition Language (DDL) for the following statement: a) Define the ORDERS relation...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Construct a SQL Data Definition Language (DDL) for the following statement: a) Define the ORDERS relation which has the following constraints. Data Type Constraints Attribute orderNo Integer of length 7 Primary Key ordDate custNo prodNo quantity Date Various characters of length 5 Foreign Key where the reference relation is Various characters of length 6 Integer CUSTOMER(custNo) Foreign Key where the reference PRODUCT(pCode) relation is b) Modify the ORDERS relation such that the attribute order No holds the same data type as prodNo in PRODUCT relation. c) Add a new attribute named totalPrice in the ORDERS relation that reflects the total sum of money to be paid for the order. d) Add a constraint to the totalPrice attribute in the ORDERS relation where the default value is set to NOT NULL. e) Create a new relation named NEWORDERS that has the same structure as ORDERS. f) Delete the ORDERS relation from your database. g) Recover the deleted ORDERS relation to your database and rename the relation to OLDORDERS. Construct a SQL Data Definition Language (DDL) for the following statement: a) Define the ORDERS relation which has the following constraints. Data Type Constraints Attribute orderNo Integer of length 7 Primary Key ordDate custNo prodNo quantity Date Various characters of length 5 Foreign Key where the reference relation is Various characters of length 6 Integer CUSTOMER(custNo) Foreign Key where the reference PRODUCT(pCode) relation is b) Modify the ORDERS relation such that the attribute order No holds the same data type as prodNo in PRODUCT relation. c) Add a new attribute named totalPrice in the ORDERS relation that reflects the total sum of money to be paid for the order. d) Add a constraint to the totalPrice attribute in the ORDERS relation where the default value is set to NOT NULL. e) Create a new relation named NEWORDERS that has the same structure as ORDERS. f) Delete the ORDERS relation from your database. g) Recover the deleted ORDERS relation to your database and rename the relation to OLDORDERS.
Expert Answer:
Answer rating: 100% (QA)
a Define the ORDERS relation CREATE TABLE ORDERS orderNo INT7 NOT NULL P... View the full answer
Related Book For
Data Modeling and Database Design
ISBN: 978-1285085258
2nd edition
Authors: Narayan S. Umanath, Richard W. Scammel
Posted Date:
Students also viewed these databases questions
-
Amidst the evolving landscape of global finance, what are the emerging trends and challenges pertaining to cross-border insolvency regimes, including the harmonization of legal frameworks,...
-
1) Create Oracle database tables using SQL Data Definition Language (DDL) for each table listed in the metadata of Project 2. You may need to use a combination of DROP TABLE, CREATE TABLE, and ALTER...
-
What might be a good government policy to solve the problem of the environmental externality that leads to high greenhouse gas emissions? Explain in detail.
-
Ebbers Corporation overstated its ending inventory balance by $15,000 in the current year. What impact will this error have on cost of goods sold and gross profit in the current year and following...
-
Why would the U.S. Internal Revenue Service be concerned about a change of control of the spun-off business such that it might revoke its ruling that the spin-off satisfied the requirements to be...
-
Using the facts in the previous problem, what is the minimum tax that Pedro should pay to make the tax structure vertically equitable with respect to the amount of tax paid? This would result in what...
-
You have been invited to give a talk on mass transfer at the local high school. You want to show a live demonstration. Brainstorm at least five different demonstrations that you can develop with very...
-
Anh Nguyen, a single 24 year old, recently completed her undergraduate degree in accounting at Vietnamese National University in Hanoi. She applied to and was accepted into Southern California...
-
Jamison Company had sales revenue and operating expenses of $4,000,000 and $3,450,000, respectively, for the year just ended. If invested capital amounted to $5,000,000, the firm's ROI was:
-
Activity-based budgeting, Balanced Scorecard, and strategy Sippican Corporation (B)12 Refer to Case 5-36, the Sippican Corporation (A) case, which required time-driven ABC analysis. Sippican's senior...
-
Given that a commercial airliner has a range of 6000 miles using 200 tonnes of JP4 fuel, estimate the range of the aircraft burning either gaseous or liquid hydrogen and a. The same mass of hydrogen...
-
Simplify: 4-63+728
-
Wexpro, Incorporated, produces several products from processing 1 ton of clypton, a rare mineral. Material and processing costs total $ 7 8 , 0 0 0 per ton, one - fourth of which is allocated to...
-
n May 20, Montero Company paid $276,000 to acquire 135 shares (4%) of ORD Corporation as a long-term investment. On ugust 5, Montero sold one-tenth of the ORD shares for $28,500. 1. Prepare entries...
-
Iguana, Incorporated, manufactures bamboo picture frames that sell for $25 each. Each frame requires 4 linear feet of bamboo, which costs $2.50 per foot. Each frame takes approximately 30 minutes to...
-
Bluestone Company had three intangible assets at the end of the current year: a. A patent purchased this year from Miller Company on January 1 for a cash cost of $6,400. When purchased, the patent...
-
1- WHAT DO YOU THINK OF THIS? I got two wrong; the first one was Borden's mascot, and it wasn't recognizable to me. Plus, I don't eat dairy very often. Second, the ICEE stumped me, and I didn't...
-
In Exercises discuss the continuity of each function. f(x) -3 1 x - 4 y 3 2 -1 -2 -3+ 3 X
-
What is the difference between total specialization and partial specialization and how is each reflected in an ER diagram?
-
What is the difference between an exclusive arc and an inclusive arc?
-
Under what circumstances in a specialization is it possible for both one superclass to be related to more than one subclasses and one subclass to be related to one or more superclasses?
-
The Forensic Accounting Box of this chapter noted that forensic accounting techniques are being used to help pick stocks for investing. How might identifying accounting concerns be useful for...
-
In the corporate social responsibility highlight regarding Starbucks on page 528 in this chapter, it was stated that Starbucks believes in measuring and monitoring the company's CSR progress. The...
-
The fiscal year 2017 annual report of General Mills, Inc. is available on this book's Website. Required a. How many shares of common stock is General Mills authorized to issue? How many common shares...
Study smarter with the SolutionInn App