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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started