Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Create the tables customers and orders with the following columns. (Do not declare the corresponding primary and foreign keys.) customers customerid char(5) not null companyname

image text in transcribedimage text in transcribedimage text in transcribed

Create the tables customers and orders with the following columns. (Do not declare the corresponding primary and foreign keys.) customers customerid char(5) not null companyname varchar(40) not null contactname char(30) null address varchar(60) null city char(15) null phone char(24) null fax char(24) null orders orderid integer not null customerid char(5) not null orderdate date null shippeddate date null freight money null shipname varchar(40) null shipaddress varchar(60) null quantity integer null 1. Using the ALTER TABLE statement, add a new column named shipregion to the orders table. The fields should be nullable and contain integers. 2. Using the ALTER TABLE statement, change the data type of the column shipregion from INTEGER to CHARACTER with length 8. The fields may contain NULL values. 3. Describe exactly what happens if a table is deleted with the DROP TABLE statement. 4. Re-create the tables customers and orders, enhancing their definition with all primary and foreign keys constraints. 5. Using SQL Server Management Studio, try to insert a new row into the orders table with the following values: (10, 'ordoi', getdate(), getdate(), 100.0, 'Windstar', 'Ocean', 1) If it is not working, describe why? 6. Using the ALTER TABLE statement, add the current system date and time as the default value to the orderdate column of the orders table. 7. Using the ALTER TABLE statement, create an integrity constraint that limits the possible values of the quantity column in the orders table to values between 1 and 30. 8. Delete the primary key of the customers table. 9. Rename the city column of the customers table. The new name is town

Step by Step Solution

There are 3 Steps involved in it

Step: 1

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

Databases Illuminated

Authors: Catherine Ricardo

2nd Edition

1449606008, 978-1449606008

More Books

Students also viewed these Databases questions

Question

1. What is your religious upbringing?

Answered: 1 week ago

Question

Provide examples of Dimensional Tables.

Answered: 1 week ago