Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Assignment Description: In this assignment, a script file should be created to contain a set a SQL statements for the Pretty Prints Company to better

Assignment Description: In this assignment, a script file should be created to contain a set a SQL statements for the Pretty Prints Company to better manage their business. Use the database created for Pretty Prints in Assignment 2. Include the SQL statements to satisfy the following queries. The following queries should be included in the script:

1. Create a view named Under_100. It consists of the item_id, title, artist, unit_price and order_qty for every print with a unit_price under 100 dollars.

2. Create a view named Allen. It consists of the customer_id, customer_name, customer_phone, title, and artist of each print ordered.

3. Create a view named orders. It consists of the item_id, title, artist, unit_price and order_qty for every print ordered in the range of 2014-01-01 and 2014-02-28.

4. Create a view named zip_27. It consists of the customer_name, customer_phone, title, artist and date_shipped of each print ordered by a customer whose zip code begins with 27.

5. Create the following indexes. Use the indicated index name. a. Create an index named customer_id on the customer_id field in the customers table. b. Create an index named name on the customer_name field in the customers table. c. Create an index named shipped on the customer_id and ship_date in the orders table.

6. Drop the name index.

7. Specify the integrity constraint that the unit_price of any print must be more than $35.

8. Create the following foreign keys within the prints database. a. customer_id is a foreign key in the orders table. b. Item_id is a foreign key in the orderline table.

9. Add to the items table a new character field named type that is one character in length.

10. Change the type field in the items table to M for the print titled Skies Above.

11. Change the length of the artist field in the items table to 30.

12. What command would you use to delete the orders table from the prints database? (Do not delete the orders table.)

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

Master The Art Of Data Storytelling With Visualizations

Authors: Alexander N Donovan

1st Edition

B0CNMD9QRD, 979-8867864248

More Books

Students also viewed these Databases questions