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 - 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…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
-
(Locked)
Overview of alter, update, and key relationships1m 29s
-
(Locked)
Review: Altering tables5m 24s
-
Review: Updating records7m 55s
-
(Locked)
Review: Table relationships and cardinality4m 55s
-
(Locked)
Challenge: Introducing a new product1m 8s
-
(Locked)
Solution: Introducing a new product4m 18s
-
(Locked)
Challenge: Adding a product to order items55s
-
(Locked)
Solution: Adding a product to order items1m 45s
-
(Locked)
Challenge: Updating product data in order items1m 19s
-
(Locked)
Solution: Updating product data in order items2m 20s
-
(Locked)
Challenge: Primary key to foreign key mapping1m 17s
-
(Locked)
Solution: Primary key to foreign key mapping4m 17s
-
(Locked)
Challenge: Import 2013 Q1 data37s
-
(Locked)
Solution: Import 2013 Q1 data3m 28s
-
(Locked)
-
-
-
-
-
-
-
-
-