Learn how the ALTER TABLE statement allows a schema to be changed after the table is defined and populated with data.
- [Instructor] Sometimes you may need to change…a table's schema after it's already been defined…and populated with data.…You can do this with the ALTER TABLE statement.…Here I've selected the test.db database…and I've pasted in some SQL already.…We're creating a simple table with three text columns…and populating it with three rows of data…and running a SELECT statement and so when I say Go…you see there's our table with three rows and three columns.…
Now suppose some time has passed…and I need to create a new column.…I can use the ALTER TABLE statement like this:…ALTER TABLE and I specify the table name test…and I say ADD and I give it a column specification.…We'll name it d and I'll make it a TEXT column.…And now when I run this ALTER TABLE and the SELECT,…you'll see I have a fourth column, d,…and it has NULL values in it.…If I didn't want NULL values, let's add a column e here,…I can say DEFAULT and give it a default value, say panda,…and now when I run it you see I have a fifth column e,…and the value is panda in all the rows.…
- Understanding SQL terminology and syntax
- Creating new tables
- Inserting and updating data
- Writing basic SQL queries
- 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
- Defining functions in PHP
Skill Level Beginner
2. SQL Overview
3. Fundamental Concepts
7. Dates and Times
Dates and times1m 52s
11. Views and Subselects
12. Defined Functions
13. 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.