In the following SQL statements, some tables are created with different constraints. Give one primary key...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
In the following SQL statements, some tables are created with different constraints. Give one primary key constraint and one foreign key constraint and specify in which table each is given? CREATE TABLE Customer_T (CustomerID CustomerName CustomerAddress Customer City Customer State CREATE TABLE Order T (OrderID Order Date CustomerID CustomerPostalCode CONSTRAINT Customer_PK PRIMARY KEY (CustomerID)); NUMBER(11,0) NOT NULL. VARCHAR2(25) NOT NULL. VARCHAR2(30), VARCHAR2(20), CREATE TABLE Product T (ProductID Product Description ProductFinish Product Standard Price CHAR(2), VARCHAR2(9), CREATE TABLE OrderLine_T (OrderID ProductID NUMBER(11,0) DATE DEFAULT SYSDATE, NUMBER(11,0). CONSTRAINT Order_PK PRIMARY KEY (OrderID), CONSTRAINT Order_FK FOREIGN KEY (CustomerID) REFERENCES Customer_T (CustomerID)); NOT NULL, NUMBER(11,0) VARCHAR2(50), VARCHAR2(20), DECIMAL (6,2), NUMBER(11,0), ProductLineID CONSTRAINT Product PK PRIMARY KEY (ProductID)); NOT NULL, NUMBER(11,0) NUMBER(11,0) NUMBER(11,0), OrderedQuantity CONSTRAINT OrderLine PK PRIMARY KEY (OrderID, ProductID), CONSTRAINT OrderLine FK1 FOREIGN KEY (OrderID) REFERENCES Order_T (OrderID), CONSTRAINT OrderLine FK2 FOREIGN KEY (ProductID) REFERENCES Product_T (ProductID)); NOT NULL, NOT NULL, In the following SQL statements, some tables are created with different constraints. Give one primary key constraint and one foreign key constraint and specify in which table each is given? CREATE TABLE Customer_T (CustomerID CustomerName CustomerAddress Customer City Customer State CREATE TABLE Order T (OrderID Order Date CustomerID CustomerPostalCode CONSTRAINT Customer_PK PRIMARY KEY (CustomerID)); NUMBER(11,0) NOT NULL. VARCHAR2(25) NOT NULL. VARCHAR2(30), VARCHAR2(20), CREATE TABLE Product T (ProductID Product Description ProductFinish Product Standard Price CHAR(2), VARCHAR2(9), CREATE TABLE OrderLine_T (OrderID ProductID NUMBER(11,0) DATE DEFAULT SYSDATE, NUMBER(11,0). CONSTRAINT Order_PK PRIMARY KEY (OrderID), CONSTRAINT Order_FK FOREIGN KEY (CustomerID) REFERENCES Customer_T (CustomerID)); NOT NULL, NUMBER(11,0) VARCHAR2(50), VARCHAR2(20), DECIMAL (6,2), NUMBER(11,0), ProductLineID CONSTRAINT Product PK PRIMARY KEY (ProductID)); NOT NULL, NUMBER(11,0) NUMBER(11,0) NUMBER(11,0), OrderedQuantity CONSTRAINT OrderLine PK PRIMARY KEY (OrderID, ProductID), CONSTRAINT OrderLine FK1 FOREIGN KEY (OrderID) REFERENCES Order_T (OrderID), CONSTRAINT OrderLine FK2 FOREIGN KEY (ProductID) REFERENCES Product_T (ProductID)); NOT NULL, NOT NULL,
Expert Answer:
Related Book For
Posted Date:
Students also viewed these databases questions
-
1. What are common shares and preferred shares, and what are the key differences between the two? 2. What factors should investors consider when evaluating a company's shares for potential...
-
Find all mixed strategy Nash Equilibria of the game in table 4 by first eliminating any strictly dominated actions and then constructing the players' best response functions. Player 2 LMR T 2,2 0,3...
-
In the following exercises, you will use the data in the TAL Distributors database shown in Figure 2-1 in Chapter 2. (If you use a computer to complete these exercises, use a copy of the original TAL...
-
Given this expression, what can we say about the problem domain? tBoat (BoatSerialNo, BoatType, Manufacturer, Price, Customer, Date Of Sales Rep) SalesRep should not be in the expression at all...
-
The force acting on the man, caused by his pulling on the anchor cord, is F. If the length of the cord is L, determine the coordinates A(x, y, z) of the anchor. Given: F = (40 20 −50) N L = 25...
-
What are the three most critical personal characteristics to look for in hiring hourly staff for a catering company? What are the three most critical personal characteristics to look for in hiring...
-
Imagine you are working for a company that sells teleconferencing equipment. Draft a value proposition for selling your equipment to a sales manager who has ten salespeople traveling two weeks a...
-
On December 31, 2017, Ball Company leased a machine from Cook for a 10-year period, expiring December 30, 2027. Annual payments of $100,000 are due on December 31. The first payment was made on...
-
Happy Gilmore produces snackpacks. In 2023, its highest and lowest production levels occurred in July and January, respectively. In July, it produced 10,000 snackpacks at a total cost of $148,000. In...
-
Padini Concept Stores is a chain of clothing stores that caters to young adults. It publishes a quarterly catalog and operates a website that features attractively attired young males and females...
-
Use the Fermi distribution function to obtain the value of F(E) for E - EF - EF = 0.01 eV at 200K.
-
A system for recovering methanol from a solid product wet with methanol involves evaporation of the alcohol into a stream of inert gas, essentially nitrogen. In order to recover the methanol from the...
-
The annual return of a risky financial portfolio, denoted by \(R_{p}\), can be described by the following linear regression model: where \(F_{1}\) and \(F_{2}\) are mutually correlated risk factors...
-
Gonzales determined that Company A had an operating cycle of 100 days in 20X2, whereas Company D had an operating cycle of 145 days for the same fiscal year. This means that: A. Company Ds inventory...
-
The most likely tax environment in which Wilson Papers shareholders would prefer that Wilson repurchase its shares (share buybacks) instead of paying dividends is one in which: A. the tax rate on...
-
Consider the following estimated area response model for sugar cane (area of sugar cane planted in thousands of hectares in a region of Bangladesh), as a function of relative price (100 times the...
-
Why is it necessary to analyze and identify the resources required prior to implementing an operational plan? Select one: a. To be ahead of the competition. b. To ensure you are able to execute the...
-
One of the significant and relevant accounts for this cycle is equipment. For this account, what would typically be the most relevant assertions for the auditor to consider? Why is it important for...
-
Create two tables based on the E-R model shown in Figure 4-41 and the business rules in the following list for a work order tracking database. Include all the constraints in the CREATE TABLE...
-
What are the differences between the JOINUSING and JOINON approaches for joining tables?
-
A table can have a maximum of how many PRIMARY KEY constraints?
-
Draw a demand and supply graph for the federal funds market to show the demand and supply of reserves in the current ample-reserves regime. How can the Fed increase the federal funds rate? Show the...
-
What is the zero lower bound in monetary policy? What tools can the Fed use if it wants to implement an expansionary monetary policy at the zero lower bound?
-
How did the Fed hit its target for the federal funds rate in the pre-2008 scarce-reserves regime?
Study smarter with the SolutionInn App