Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

4 . In your lab 3 branch, add a new folder called lab 3 . You ll put screenshots or copied commands from this lab

4. In your lab3 branch, add a new folder called lab3. Youll put screenshots or copied commands from this lab here so you can submit this lab.
5. Create a database called bookstore. You can use the command line interface or a database management program for this and all the rest of the steps in this lab.
a. Run the following command to make sure you perform the rest of the commands on your new database.
b. Take a screenshot of the command add it to the lab3 folder.
6. Create a new user called webapp and give it a password. Well use this account to connect your PHP site to this database later.
a. Grant webapp all permissions on the bookstore database.
b. Take a screenshot of the commands add it to the lab3 folder.
7. Create a table for storing book data. Use the Books sheet in the lab3 tables spreadsheet found with this lab.
a. The columns should be as follows.
i. BookID - this should auto increment. Make this the primary key for this table
ii. Title
iii. Author
iv. Description
v. Image Path
vi. Price make sure you use a number type that can include decimals
b. Run a DESCRIBE command on your new table and take a screenshot of the result. Add it to the lab3 folder.
8. Populate the books table with the data found in the attached spreadsheet. Use INSERT statements.
a. Remember to not try to enter any data for an auto incrementing field, MySQL will do this for you.
b. Run a SELECT * command on the table and take a screenshot of the result. Add it to the lab3 folder.
9. Create a table for storing customer data. Use the Customers sheet in the lab3 tables spreadsheet.
a. The columns should be as follows
i. CustomerID this should auto increment. Make this the primary key for this table
ii. FirstName
iii. LastName
iv. Address
v. City
vi. State
vii. Zip
viii. PhoneNumber this field is optional (can be null)
ix. Email
b. Run a DESCRIBE command on your new table and take a screenshot of the result. Add it to the lab3 folder.
10. Populate the customer table with the data found in the attached spreadsheet. Use INSERT statements.
a. Run a SELECT * command on the table and take a screenshot of the result. Add it to the lab3 folder.
11. Create a table for storing purchase data. Use the Purchases sheet in the lab3 tables spreadsheet.
a. The columns should be as follows
i. PurchaseID this should auto increment. Make this the primary key for this table
ii. BookID this references the book table
iii. CustomerID this references the customer table
iv. OrderDate the date the user placed the order
b. Remember that a column which references a column in another table should always have the same data type as the column in that other table.
c. Run a DESCRIBE command on your new table and take a screenshot of the result. Add it to the lab3 folder.
12. Populate the purchases table with the data found in the attached spreadsheet. Use INSERT statements.
a. Run a SELECT * command on the table and take a screenshot of the result. Add it to the lab3 folder.
13. Create a table for storing review data. Use the Reviews sheet in the lab3 tables spreadsheet.
a. The columns should be as follows
i. ReviewID this should auto increment. Make this the primary key for this table
ii. BookID this references the book table
iii. CustomerID this references the customer table and should be optional (null) so the user can choose to leave the review anonymously
iv. Rating number of stars 1-5
v. Review this should be a long field to allow longer reviews. It should be optional (null) in case the user just wants to leave a rating
b. Run a DESCRIBE command on your new table and take a screenshot of the result. Add it to the lab3 folder.
14. Populate the reviews table with the data found in the attached spreadsheet. Use INSERT statements.
a. Run a SELECT * command on the table and take a screenshot of the result. Add it to the lab3 folder.

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

More Books

Students also viewed these Databases questions