Oracle Alter Table | Alter Table Oracle - oracle tutorial - sql tutorial
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:
Example:
- Add a new column address into the table customers.
Learn oracle - oracle tutorial - Oracle alter table - oracle examples - oracle programs
- Using the “Alter Query“ in this the table “wikitechy_employee” the new column “ADDRESS” has been added.
- Alter Query has been executed and the output is shown above.
oracle tutorial , sql tutorial , sql , pl sql tutorial , oracle , pl sql , plsql
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:
Example:
- 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.
Learn oracle - oracle tutorial - Oracle alter table rename column - oracle examples - oracle programs
Syntax:
Example:
- By Using Rename Statement the column name has been changed from old name(“City”) to new name as(“place”) in the Wikitechy_employee table .
- 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:
Example:
- By Using Drop Statement the column “Position” will be deleted from the “wikitechy_employee” table.
- Since the Output of Drop Statement has been deleted from “wikitechy_employee” table.