Use of alter constaints to modify the table structure in ORACLE, alterconstaints
1. Create a federated primary key
Alter table name add constraints end name primary key (column name, column name ..);
2. New Characters
Alter table name ADD (column datatype [default value] [NULL/not null]);
3. Delete Columns
Alter table Name DROP (COLUMN) J;
4. Modify Table characters
Alter table name MODIFY (column datatype [default value] [NULL/not null])
What table of oracle data needs to be changed using the alter command?
The alter command is used to change the table structure rather than data. DDL Data Definition Language
Change the table structure of the Oracle database in the program
Modify Table Name:
Alter table name rename to new name
Add field:
Alter table name add field Name field type
Delete field:
Alter table Name drop column field name
Modify Field:
Alter table name rename column Original Field name to new name;
Modify the field type (prerequisite: no data in the table)
Alter table name modify Field name new type;
Example: String deleteColumn = "alter table t_user drop column sname ";
Hope to help you!