From the course: Advanced MySQL Database Administration

Unlock this course with a free trial

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

Solution: Adding a product to order items

Solution: Adding a product to order items - MySQL Tutorial

From the course: Advanced MySQL Database Administration

Solution: Adding a product to order items

- [Instructor] Alright, this is the solution video for your assignment on adding product to the order items table. This is a pretty simple assignment. Sally's asking for you to add the product id column into the order items table. We're not worrying about back populating in this exercise. All we're doing is just adding a column. So let's jump into workbench and I'll show you how to get that added. Alright, so we have our order items table, and up until this point for the business, there's only been one product, so it's been very easy to track. So we don't have the concept of a product ID in this order items table. We're going to want to add that and we'll be using an alter table statement. So we'll say add column and we'll be calling that product id. We could specify that it's going to come after or before a certain column. If we don't specify, it's just going to go onto the end and that's fine for what we want. And that's pretty much it. So let's go ahead and run that alter. When we…

Contents