ITCS 3160 Assignment 4 solved


Category: You will receive a download link of the .ZIP file upon Payment


5/5 - (1 vote)

In this assignment , a script file should be created to contain a set of queries that the Pretty Prints Company executes each month to better manage their business. Use the database created for Print Prints that was created in Assignment 2. The script file can be created within the MySQL Workbench. Include the SQL commands necessary to satisfy the follow queries in the script.

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. Ensure that the following are foreign keys (that is, specify referential integrity) 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.)

 Each student must work independently on this assignment. No group work is allowed.
 Submit completed work into Moodle2.
 Take a screenshot of the submission verification in the event you need proof of submission.