From the course: Database Foundations: Intro to Databases
Unlock the full course today
Join today to access over 24,000 courses taught by industry experts.
Alter tables
From the course: Database Foundations: Intro to Databases
Alter tables
- [Instructor] It's not uncommon to set up a data table and then later realize that you would like to add an additional column to that table. When you want to make a change to an object that you've already created, you're going to use the ALTER command. We can see how this works by creating another table. And then when we created the product table inside of our two trees database, we added a column for the category ID. The intent is to store an integer value here and then link that value to another table that'll give us the full description of the category. So let's create that second table now. I'm going to right click on the two trees database and choose new query. Then we'll create a new table in the product schema called categories. I'll open up my parentheses and the first column that I want to add will be called category ID. It'll be an integer value and it will be the primary key for the table. Then we'll add a…
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)
Structured Query Language4m 9s
-
(Locked)
Organize a database with schemas6m 4s
-
(Locked)
Table columns3m 41s
-
(Locked)
Create tables8m 43s
-
(Locked)
Alter tables4m 16s
-
(Locked)
Reserved keywords3m 1s
-
(Locked)
Challenge: Create a table43s
-
(Locked)
Solution: Create a table4m 35s
-
(Locked)
Solution: Tables and data types2m 48s
-
(Locked)
-
-
-
-