Oracle Alter Table | Alter Table Oracle - oracle tutorial - sql tutorial



Oracle drop column of a table

Learn oracle - oracle tutorial - Oracle drop column of a table - oracle examples - oracle programs

What is Alter Table Statement in oracle ?

  • Alter Table Statement specifies how to add, modify, drop or delete columns in a table.
  • It is also used to rename a table.

Syntax:

ALTER TABLE TABLE_name  
ADD COLUMN_name column-definition;   
click below button to copy the code. By - oracle tutorial - team

Example:

  • Add a new column address into the table customers.
	Oracle alter table

Learn oracle - oracle tutorial - Oracle alter table - oracle examples - oracle programs

ALTER TABLE wikitechy_employee
ADD ADDRESS Varchar(30);  
click below button to copy the code. By - oracle tutorial - team
 add query in alter table
  1. Using the “Alter Query“ in this the table “wikitechy_employee” the new column “ADDRESS” has been added.
  2. Alter Query has been executed and the output is shown above.
oracle tutorial , sql tutorial , sql , pl sql tutorial , oracle , pl sql , plsql
Oracle alter table with modify not null

Learn oracle - oracle tutorial - Oracle alter table with modify not null - oracle examples - oracle programs

MODIFY COLUMN OF A TABLE:

  • To modify the column in a table, we have the syntax as follows:

Syntax:

Alter Table Table_Name  
                       Modify Column_Name Column_Type;   
click below button to copy the code. By - oracle tutorial - team

Example:

Alter Table Customers  
                     Modify Customer_Name Varchar2(100) Not Null; 
click below button to copy the code. By - oracle tutorial - team
 modify query in alter table
    • Alter Query is used to Change the name as a not null constraint in the “wikitechy_employee” table.

RENAME COLUMN OF A TABLE:

  • The RENAME COLUMN statement allows you to rename an existing column in an existing table (ie)old name to new name in the table.
	Oracle alter table rename column

Learn oracle - oracle tutorial - Oracle alter table rename column - oracle examples - oracle programs

Syntax:

ALTER TABLE table_name  
                        RENAME COLUMN old_name to new_name;  
click below button to copy the code. By - oracle tutorial - team

Example:

ALTER TABLE customers  
                        RENAME COLUMN customer_name to cname;  
click below button to copy the code. By - oracle tutorial - team
 rename query in alter table
    1. By Using Rename Statement the column name has been changed from old name(“City”) to new name as(“place”) in the Wikitechy_employee table .
 rename output in alter table
    1. Since the Output of Rename statement as been changed from old name to new name column in the “wikitechy_employee” table, so we have executed the select statement to view the table.
oracle tutorial , sql tutorial , sql , pl sql tutorial , oracle , pl sql , plsql

DROP COLUMN OF A TABLE:

  • It is used to drop a column in an existing table.

Syntax:

                             ALTER TABLE table_name  
                             DROP COLUMN column_name;  
click below button to copy the code. By - oracle tutorial - team

Example:

ALTER TABLE Wikitechy_employee  
                          DROP COLUMN Position;  
click below button to copy the code. By - oracle tutorial - team
 drop query in alter table
    • By Using Drop Statement the column “Position” will be deleted from the “wikitechy_employee” table.
 drop output in alter table
    1. Since the Output of Drop Statement has been deleted from “wikitechy_employee” table.

This tutorial provides an indepth knowledge on the following items such as oracle tutorial , sql tutorial , sql , pl sql tutorial , oracle , pl sql , mysql tutorial , sql tutorial for beginners , learn sql , oracle database tutorial , sql query tutorial , oracle dba tutorial , plsql tutorial , oracle tutorial pdf , oracle pl sql tutorial , oracle sql tutorial , sql tutorial point , oracle tutorial for beginners , learn oracle online free , learn oracle online , learning pl sql programming , learn sql online for free , sql learning online , dba oracle tutorial , oracle sql tutorial advanced , oracle 11g dba tutorial with examples , oracle online learning , oracle learning online , how to learn pl sql , sql coding tutorial , sql learning websites , sql basic learning

Related Searches to Oracle Alter Table | Alter Table Oracle