- Create Table
- Alter Table
2. Alter Table
Here there are many way to manage created table.
Using this statement you can change the table's column, name of column as well as table,
change the constraint, datatype, etc.
The table must be in your own schema, or you must have
ALTER
object privilege on the table, or you must have ALTER
ANY
TABLE
system privilege.Syntax :
ALTER TABLE | table_nm [ | ADD | (column1 datatype constraint,..,columnn datatype constraint) | | |
MODIFY | (column1 datatype constraint,..,columnn datatype ) | | | ||
DROP | COLUMN column_name | | | ||
RENAME | COLUMN column_name TO new_name | ] ; |
- ADD
You can add one or more then one column add in your created table.
The example is given below
Add Column |
- MODIFY
setting [ Constraint ].
This example is given below,
Modify Column |
- DROP
Before you delete the a particular column in your table to check doesn't have primary or
foreign key [ referential integrity] on this column.
This example is given below,
Drop Column |
- RENAME
The Syntax of change the name of table as given below,
ALTER TABLE table_name RENAME TO new_name;
No comments:
Post a Comment
Thank you for give me feedback : )