From the course: SQL Queries Made Easy

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Alter tables

Alter tables - SQL Tutorial

From the course: SQL Queries Made Easy

Start my 1-month free trial

Alter tables

- [Instructor] In this video, we'll learn about the ALTER Statement. It is also a DDL statement, which means it is auto commit. They use the statement to add, modify, define a default value for a new column, or to drop columns from a table. If you want to add a new column to an existing table because we omitted that column at the time of table creation, or if you think that there is a need for a new column at a later point of time, then we can use this ALTER Statement to do so. Now this is the syntax. Now let's try to add a new column test_call to state's table, ALTER TABLE table name ADD this is the new column that I want to add. So I give VARCHAR2 size five, and I run this. It says, table has been altered. Now, how do we check that? We can use add data dictionary table like user_tab_columns to check for all the columns in that table. So I give this WHERE table_name=STATES and I run this. Using this data…

Contents