Create user user name password is sqltrain
Create user Sqltrain identified by Sqltrain
Assigning permissions to user names
Grant resource,dba,connect to Sqltrain;
Change Password
alter user Sqltrain identified by Sqltrain
Lock user
alter user Sqltrain account lock
Unlock Users
alter user sqltrain account unlock
log in with Sqltrain
Student Table student (Sno), student name (sname),affiliation Unit (sdree) , Learner Age (Sage), student gender (ssex)
Create Table Student ( Sno numberprimarykey, sname VARCHAR2(), sdreevarchar2, Sage Number , ssex varchar2())
To modify a table add a field
alter table student Add (susername varchar2())
Modify a table modify a field gender length is 10
alter table Student Modify (ssex varchar2(ten))
Delete a table
DROP TABLE student
Renaming a table
Rename student to Stu
Delete data
Deleting a record does not release the block table space that is occupied in Oracle. It only marks those chunks of data that have been deleted as unused.
If you are sure you want to delete all the records from a large table, you can use the TRUNCATE command, which frees up the data block table space that is occupied
If the table automatically grows the DELETE key ID then automatically grows before
Truncate key starts from 1, truncate statement cannot be rolled back
DELETE from table name WHERE condition;
Delete from student
TRUNCATE table name;
TRUNCATE TABLE student
Oracle Database Basic Operations