Question: Create and run SQL queries to complete the following : Create a CUSTOMER database. The purpose of the database is to store and retrieve customer

Create and run SQL queries to complete the following:

Create a CUSTOMER database. The purpose of the database is to store and retrieve customer personal information and customer purchase information. The personal information includes CUSTOMER ID, CID, last name, CLNAME, first name, CFNAME, address, CADDRESS, and phone, and CPHONE. The purchase information includes purchase date, CPDATE, product ID, PID, product name, PNAME, and product price, PPRICE.

1. Write down all the steps of developing this database.

2. Provide the hand drawn ER diagram.

3. Create the tables, keys, and indices.

4. Why did you chose these primary keys?

5. Add one more new attribute to each entity that is not mentioned above.

6. Run the following queries, a. Insert all information about 5 customers in the database.

b. Retrieve all customers who live in the same zip code.

c. Retrieve all customers whose last names are same.

d. Retrieve all customers who bought the same product and price of the products is above $100.

e. Retrieve all products that were purchased within last 14 days.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!