Levels Tought:
Elementary,Middle School,High School,College,University,PHD
Teaching Since: | Apr 2017 |
Last Sign in: | 10 Weeks Ago, 6 Days Ago |
Questions Answered: | 4870 |
Tutorials Posted: | 4863 |
MBA IT, Mater in Science and Technology
Devry
Jul-1996 - Jul-2000
Professor
Devry University
Mar-2010 - Oct-2016
Extend the SQL script you developed for the Week Two individual assignment.
Populate the tables you created with appropriate sample data. Use at least 5 rows for each table. Some tables may require more than 5 rows to create a sensible data set. Take all of the INSERT commands you used to add this data and add them to your SQL script.
Write additional SQL commands in your script that demonstrate use of the following keywords and techniques (one separate command to demonstrate each bullet). These commands should interact with the tables you have been creating.
I have attaches my week two assignment below.Â
Â
CREATE TABLE CustomerStatusType(CustomerStatusTypeId INT PRIMARY KEY,Code INT,[Description] PAREKH(50));CREATE TABLE CreditStatus(CreditStatusTypeId INT PRIMARY KEY,Code INT,[Description] PAREKH(50));CREATE TABLE Customer(CustomerId INT PRIMARY KEY,CustomerStatusTypeId INT NOT NULL,CreditStatusId INT NOT NULL,[Name] PAREKH(30),[Address] 27 SCHERER CT(100),CONSTRAINT fk_CustStatus FOREIGN KEY(CustomerStatusTypeId)REFERENCES CustomerStatusType(CustomerStatusTypeId),CONSTRAINT fk_CustCredStatus FOREIGN KEY(CreditStatusId)REFERENCES CreditStatus(CreditStatusTypeId));CREATE TABLE InvoiceStatus(InvoiceStatusId INT PRIMARY KEY,Code INT,[Description] PAREKH(50));CREATE TABLE Invoice(InvoiceId INT PRIMARY KEY,CustomerId INT NOT NULL,InvoiceStatusId INT NOT NULL,CONSTRAINT fk_InvCust FOREIGN KEY(CustomerId)REFERENCES Customer(CustomerId),CONSTRAINT fk_InvInvStatus FOREIGN KEY(InvoiceStatusId)REFERENCES InvoiceStatus(InvoiceStatusId));CREATE TABLE BackOrderStatus(BackOrderStatusId INT PRIMARY KEY,Code INT,[Description] PAREKH(50));CREATE TABLE ShipViaCarrier(ShipViaCarrierId INT PRIMARY KEY,Code INT,[Description] PAREKH(50));CREATE TABLE InvoiceLineItem(InvoiceLineItemId INT PRIMARY KEY,InvoiceId INT NOT NULL,ShipViaCarrierId INT NOT NULL,BackOrderStatusId INT NOT NULL,ItemPrice INT,Quantity INT,ItemSoldId INT,CONSTRAINT fk_InvLineInv FOREIGN KEY(InvoiceId)REFERENCES Invoice(InvoiceId),CONSTRAINT fk_InvLineShip FOREIGN KEY(ShipViaCarrierId)REFERENCES ShipViaCarrier(ShipViaCarrierId),
Attachments: