SQL Alter Table Add (,, - . - . - . - . - . .) Table Altered
SQL Alter Table Add (,, - . - . - . - . - . .) Table Altered
syntax:
Table altered.
Note:
(i) By default a new column will added only at the end of the exiting columns.
(ii) By default the new column contains NULL.
eg:
Table altered.
14 rows selected.
Eg:
1 row updated.
1 row created.
Table altered.
Eg:
Note:
(i) columns can be dropped from any position in any order.
(ii) If a column is dropped automatically the data in that column is also deleted.
Eg:
Table altered.
Table altered.
Table altered.
Table altered.
EMPNO
----------
7369
7499
7521
7566
7654
7698
7782
7788
7839
7844
7876
EMPNO
----------
7900
7902
7934
14 rows selected.
syntax:
sql> alter table <table name> rename column <column name> to <new column name>;
table altered.
Table altered.
NOTE:
Renaming the column name by using the select statement is possible from the version of
oracle 9i second release. If the column name is renamed the data type remains the same.
Table altered.
Table altered.
Note: increase in the size of the column is independent of the data existing in the column.
Table altered.
Note: to decrease the size of the column the column should not contain any existing data
which are exceeding the specified size.
14 rows selected.
note: to change the data type of a column the column must be empty.