Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Modify the tables in the Reporting_Schema to prepare them for reporting. Create a script to do the following. Save your script with the name, Modify

Modify the tables in the Reporting_Schema to prepare them for reporting. Create a script to do the following. Save your script with the name, "Modify Warehouse". Include a screen snip of your completed script in your solution file.

 Alter the three tables to set up a primary key constraint for CustomerID in Customer, SalesOrderID in SalesOrderheader and a composite key of SalesOrderID and SalesOrderDetailID in the SalesOrderDetail table.

 Add a foreign key constraint to SalesOrderHeader on CustomerID referencing the CustomerID primary key column in Customers.

 Add a foreign key constraint to SalesOrderDetail on SalesorderID referencing SalesOrderID in the SalesOrderHeader table.

the script should look like the following....

Buse FVTCSalesDB. EIF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N' [reporting_schema]. Please answer in SQL.

Buse FVTCSalesDB. EIF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N' [reporting_schema]. [customer]') AND OBJECTPROPERTY ( id, N'IsUserTable') = 1) DROP TABLE [reporting_schema]. [customer] select into reporting schema.customer from saleslt.customer BIF EXISTS (SELECT FROM dbo.sysobjects WHERE id = OBJECT_ID (N' [reporting_schema]. [salesorderheader]') AND OBJECTPROPERTY (id, N'IsUser Table') = 1) DROP TABLE [reporting_schema]. [salesorderheader] select into reporting schema.salesorderheader from saleslt.salesorderheader EIF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N' [reporting_schema]. [salesorderdetail]') AND OBJECTPROPERTY (id, N'IsUserTable') = 1) DROP TABLE [reporting_schema].[salesorderdetail] select into reporting schema.salesorderdetail from saleslt.salesorderdetail

Step by Step Solution

3.41 Rating (151 Votes )

There are 3 Steps involved in it

Step: 1

ALTER TABLE Customer ADD PRIMARY KEY CustomerlD ALTER TABLE Sales OrderHea... blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Using Microsoft Excel and Access 2016 for Accounting

Authors: Glenn Owen

5th edition

1337109048, 1337109045, 1337342149, 9781337342148 , 978-1337109048

More Books

Students also viewed these Databases questions

Question

List three types of economic-political systems.

Answered: 1 week ago

Question

What additional argument is added for these depreciation functions?

Answered: 1 week ago

Question

What do profitability ratios represent?

Answered: 1 week ago