Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Include in your answers all the queries and commands you use. Always verify that each step worked as you intended. If some command does not

Include in your answers all the queries and commands you use. Always verify that each step worked as you intended. If some command does not accomplish what you want, everything after it is likely to fail also.

1. Create a table called "Products" with columns called ItemNumber, ItemName, Price, and SupplierID. Give all of these columns appropriate data types. Use a float or real data type for the price, but be sure the format you use can accommodate 2 digits after the decimal point and can hold prices up to at least $999.99. Set ItemNumber as the primary key and define the column so that a unique item number is generated automatically. Insert five products with reasonable values for the other data fields (for example, one product might be called "Men's Running Shoes", cost $59.99, and come from Supplier # 1.) Make sure that at least two of the products have supplierID 1 and at least one has supplierID 2.

2. Create another table called "Suppliers" with the following columns: SupplierID, SupplierName, ContactPhone. Give the columns appropriate data types. Use a char or varchar for the ContactPhone. Choose the appropriate primary key and set it to generate an ID automatically. Insert three suppliers with reasonable values for the data fields (for example, SupplierName = "Bigfoot Shoes" and ContactPhone = '626-555-1313').

3. Write a query that shows the number of products supplied by each supplier, also showing the supplier name.

4. a) Add a new constraint to the Products table that requires the ItemName to be unique. b) Add a new column called "Description" to the Products table. Update the products to include descriptions. c) Rename the ItemNumber column in the Products table to ProductID.

5. a) Delete supplier 1 b) Do whatever is required to maintain consistency after execution of 5a.

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_2

Step: 3

blur-text-image_3

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

More Books

Students also viewed these Databases questions