The ALTER TABLE statement allows a schema to be changed after the table is defined and populated with data.
- [Male Narrator] Sometimes you may need to change … a tables schema after it's already been defined … and populated with data. … You can do this with the alter table statement. … Here we're using the test database again. … I've pasted in some statements … from the chapter three exercise file. … We create a table, dropping it first if it exists, … and inserting three rows of data into the table … and then we take a look at the select statement. … So, let's go ahead and execute all of this. … And you'll see we have a table with three columns … and three rows of data just as expected. … Now, suppose some time has passed … and you need to create a new column. … You can use the alter table statement like this, … alter table, and the name of the table, … followed by the add clause, … with a column definition like this. … Now go ahead and we'll execute this … and we've now added a column and when I select, … you'll see we now have this D column with no values in it. … So, we've added a column to the table and no values, …
This course was created by Bill Weinman. We are pleased to offer this training in our library.
- How databases are organized
- Selecting rows and columns
- Creating new tables
- Inserting and updating data
- Sorting and filtering
- Accessing related tables with JOIN
- Working with strings
- Understanding numeric types
- Using aggregate functions and transactions
- Automating data with triggers
- Creating views
- Using CRUD functions
Skill Level Beginner
2. SQL Overview
3. Fundamental Concepts
7. Dates and Times
Dates and times2m 6s
11. Views and Subselects
12. A Simple CRUD Application
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.