Create SQL select statements for the questions below using the data base. CREATE TABLE CUSTOMER ( CustID
Fantastic news! We've Found the answer you've been seeking!
Question:
Create SQL select statements for the questions below using the data base.
Transcribed Image Text:
CREATE TABLE CUSTOMER ( CustID CustName Annual Revenue CustType ); CREATE TABLE TRUCK ( TruckNo TRUCK (TruckNo) ); CREATE TABLE PACKAGE ( DriverName VARCHAR (20) Supervisor INT CONSTRAINT Truck_Supervisor_FK INT PRIMARY KEY, VARCHAR (30), CONSTRAINT TRUCK (TruckNo) CONSTRAINT DECIMAL (10,0) CHAR (1) CREATE TABLE CITY ( CityID CityName VARCHAR (30), Population DECIMAL (10,0) CITY (CityID) INT PRIMARY KEY, Shipment No DECIMAL (4,0), CustID INT, Weight TruckNo CityID ShipDate DATE /*ON UPDATE NO ACTION ON DELETE NO ACTION */ NOT NULL, INT PRIMARY KEY, INT INT CHECK (Annual Revenue > 0), CHECK (CustType IN ('1', '2', '3')) DEFAULT 103, DECIMAL (6,2) NOT NULL, NOT NULL, /*CHECK (ShipDate > GETDATE ()-1))*/, CONSTRAINT Package_PK PRIMARY KEY (ShipmentNo, CustID), CONSTRAINT Package_Cust_FK FOREIGN KEY (CustID) REFERENCES CUSTOMER (CustID) FOREIGN KEY (Supervisor) REFERENCES CHECK (WEIGHT > 0), ON UPDATE CASCADE ON DELETE NO ACTION, Package_Truck_FK FOREIGN KEY (TruckNo) REFERENCES ON UPDATE CASCADE ON DELETE NO ACTION, Package_City_FK FOREIGN KEY (CityID) REFERENCES ON UPDATE CASCADE ON DELETE NO ACTION CREATE TABLE CUSTOMER ( CustID CustName Annual Revenue CustType ); CREATE TABLE TRUCK ( TruckNo TRUCK (TruckNo) ); CREATE TABLE PACKAGE ( DriverName VARCHAR (20) Supervisor INT CONSTRAINT Truck_Supervisor_FK INT PRIMARY KEY, VARCHAR (30), CONSTRAINT TRUCK (TruckNo) CONSTRAINT DECIMAL (10,0) CHAR (1) CREATE TABLE CITY ( CityID CityName VARCHAR (30), Population DECIMAL (10,0) CITY (CityID) INT PRIMARY KEY, Shipment No DECIMAL (4,0), CustID INT, Weight TruckNo CityID ShipDate DATE /*ON UPDATE NO ACTION ON DELETE NO ACTION */ NOT NULL, INT PRIMARY KEY, INT INT CHECK (Annual Revenue > 0), CHECK (CustType IN ('1', '2', '3')) DEFAULT 103, DECIMAL (6,2) NOT NULL, NOT NULL, /*CHECK (ShipDate > GETDATE ()-1))*/, CONSTRAINT Package_PK PRIMARY KEY (ShipmentNo, CustID), CONSTRAINT Package_Cust_FK FOREIGN KEY (CustID) REFERENCES CUSTOMER (CustID) FOREIGN KEY (Supervisor) REFERENCES CHECK (WEIGHT > 0), ON UPDATE CASCADE ON DELETE NO ACTION, Package_Truck_FK FOREIGN KEY (TruckNo) REFERENCES ON UPDATE CASCADE ON DELETE NO ACTION, Package_City_FK FOREIGN KEY (CityID) REFERENCES ON UPDATE CASCADE ON DELETE NO ACTION
Expert Answer:
Answer rating: 100% (QA)
The image provided contains SQL CREATE TABLE and INSERT INTO statements to set up and populate a dat... View the full answer
Related Book For
Income Tax Fundamentals 2013
ISBN: 9781285586618
31st Edition
Authors: Gerald E. Whittenburg, Martha Altus Buller, Steven L Gill
Posted Date:
Students also viewed these databases questions
-
Milligan's Backyard Storage Kits, a mail order company, sells a variety of backyard storage unit kits and landscaping decorations to its customers. Although the company makes a profit, David...
-
Managing Scope Changes Case Study Scope changes on a project can occur regardless of how well the project is planned or executed. Scope changes can be the result of something that was omitted during...
-
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...
-
1.think about the evolution of the food industry, What was it in the past, and what will it be in the future? How will the 4 p's of marketing evolve within the industry you selected? 2.What is one...
-
Explain how you would value a derivative that pays off 100R in five years where R is the one-year interest rate (annually compounded) observed in four years. What difference would it make if the...
-
David and Helen Zhang are saving to buy a boat at the end of five years. If the boat costs $20,000 and they can earn 10% a year on their savings, how much do they need to put aside at the end of...
-
What is meant by dual purpose testing?
-
After preparing the budget for the second quarter based on the parameters in Case 5-38, Kim Klandon was not satisfied with the projected results and began to investigate the following alternatives....
-
You have been assigned the task of designing the network of a new campus of your organization. The campus consists of 3 buildings. The first building is a one-story building with a reception area and...
-
Jan Martinelli, a junior in college, has been seeking ways to earn extra spending money. As an active sports enthusiast. Jan plays tennis regularly at the Naples Tennis Club, where her family has a...
-
The A ratio may indicate the firm is experiencing stock outs and lost sales. Average payment period B Inventory turnover D C Average collection period Quick
-
Which of the following activities results in work-in-process moving to finished goods inventory? a. Authorize production b. Inspect work c. Complete production d. Issue raw material e. None of these...
-
Which of the following is not an activity in the purchases and payments process? a. Request prices b. Receive items c. Pay for items d. Bill customers e. All are activities in the purchases and...
-
Which of these is not one of the three main internal control functions? a. Preventive controls b. Respective controls c. Corrective controls d. Detective controls e. All of these are main internal...
-
Which statement about enterprise systems is correct? a. Most enterprise systems are designed mainly for accounting and finance functions. b. SAP, Oracle, and Microsoft all offer products for...
-
Which of the following is a business rule implementing access control for the conversion process? a. Employee authorizing production cannot modify inventory records. b. System must provide control...
-
Pass journal entries for the given transactions. August 1. Board of directors declared a dividend of $10,000 to common stockholders. December 1. The amount of dividend was distributed to stockholders...
-
Integration is a vital concept when applied in one?s life. Integrating your life means making ideal choices. Perfect choices on the other go in line with quality decisions. Quality decisions lead to...
-
Jerry made the following contributions during 2012: His synagogue (by check).....................................................$680 The Democratic Party (by check)...
-
Diego, age 28, married Dolores, age 27, in 2012. Their salaries for the year amounted to $46,479 and they had interest income of $3,500. Diego and Dolores' deductions for adjusted gross income...
-
Linda and Richard are married and file a joint return for 2012. During the year, Linda, who works as an accountant for a national airline, used $2,100 worth of free passes for travel on the airline;...
-
A process has streams to be heated and cooled above its pinch temperatures as illustrated in Figure 11.62. Complete a design that satisfies MER targets with the minimum number of heat exchangers....
-
Consider the network of heat exchangers in Figure 11.60: (a) Determine \(N_{H X, \text { min }}\). (b) Identify the heat loop. (c) Show one way to break the heat loop using \(\Delta T_{\min...
-
To exchange heat between four streams with \(\Delta T_{\text {min }}=20^{\circ} \mathrm{C}\), the HEN in Figure 11.61 is proposed. Determine whether the network has the minimum utility requirements....
Study smarter with the SolutionInn App