Createuserdraem0507identifiedbytest; -- creates a user and password grantconnect, resourcetodraem0507; -- authorizes conndraem0507test to connect to and process transactions; -- log on to * Create a new table ** using draem0507. The main function of the table created with as is to import table data * createtablet_testass
Create user draem0507 identified by test; -- create a user and password grant connect, resource to draem0507; -- authorize the connection and transaction processing permissions conn draem0507/test; -- Log On as A draem0507 user/* create a new table * // The table created with as is mainly used to import table data */create table t_test as s
Create user draem0507 identified by test; -- create a user and password
Grant connect, resource to draem0507; -- authorize the connection and transaction processing Permissions
Conn draem0507/test; -- Log On As A draem0507 user
/* Create a new table */
/* The main function of a table created with as is to import table data */
Create table t_test as select a. id, a. name new_name from t_test_old;
/* Tables created with like mainly import the table structure */
Select table t_test2 like t_test_old; -- oracle does not support like.
/* Drop table */
Drop table t_test; -- delete the entire table
Delete table t_test; -- only deletes data, and the truncate cannot be recovered.
Alter table t_test add (new_col type [, new_col2 type]) -- add a column
Alter table t_test drop drop_col; -- delete a column
Alter table t_test rename column old_name to new_col_name; -- change the field name
Alter table t_test modify change_type_col newtype; -- change the field type
Alter table t_test add primary key (nno); -- add a field primary key
Alter table t_test drop primary key (nno); -- delete the field primary key