From the course: MySQL Database Administration

Unlock this course with a free trial

Join today to access over 24,500 courses taught by industry experts.

Solution: Adding and removing columns

Solution: Adding and removing columns - MySQL Tutorial

From the course: MySQL Database Administration

Solution: Adding and removing columns

- [Instructor] All right, this is the solution video for your assignment on altering tables. As a reminder, you're going to be trying to help Amy, the owner of the candy store to remove the hourly_wage column from her employees table, and add an avg_customer_rating column. Let's jump into Workbench and walk through the solution. So the first thing we'll do here is run the USE candystore statement. This selects the candystore schema. You'll also see candystore_old as another schema. Don't worry about that one for now. So before we do anything, and I would recommend taking this approach to any problem, just get to know the schema that you're working with a little bit. So take a look within candystore. See what tables are in there. So we've got candy_products, customer_reviews, and employees, which is the table that we've been asked to work on. So let's take a look at each of those. We can look at employees last. So we've got candy_products, which has a candy_product_id, the name of the…

Contents