SOLUTION
, Question 1
First things first, before you start with your assignment, make sure that your MySQL
server and MySQL Workbench are installed and working. The prescribed book provides
the procedures for doing this in appendix A (Windows) and B (macOS). The appendices
were uploaded to Additional Resources on myUnisa. Secondly, on myUnisa, under
Additional Resources, download the folder mgs_ex_starts, it contains some script files
that you need for this assignment and other assignments, 2, 3 and 4. In the
mgs_ex_starts folder, use the script file create_my_guitar_shop.sql to create the My
Guitar Shop database. After running the scripts, the Output window displays messages
that indicate whether the script was executed successfully. Take the screenshot, and
paste it on your answer sheet to show that the database is installed correctly. The
screenshot should show the My Guitar Shop database schema on your Workbench. (10
marks)
Explanation of what the script does:
This script creates the my_guitar_shop database in these steps:
1. Database Initialization
Drops any existing database named my_guitar_shop to start fresh.
Creates a new database my_guitar_shop and selects it for use.
2. Table Creation with the following tables:
Categories: Stores product categories (e.g., Guitars, Basses).
Products: Lists items for sale, linked to categories via category_id.
Customers: Contains customer details, including email and passwords (hashed).
Addresses: Stores customer addresses, linked to customers.