DATA CONTROL COMMANDS
CREATE TABLE
SYNTAX
CREATE TABLE (column definition1, column definition2);
Example
SQL> create table gemployee(name varchar2(10),id varchar2(10),address varchar2(19),post varchar2(20),salary number(6,2));
Table created.
SQL> DESC GEMPLOYEE;
Name Null? Type
----------------------------------------- -------- ----------------------------
NAME VARCHAR2(10)
ID VARCHAR2(10)
ADDRESS VARCHAR2(19)
POST VARCHAR2(20)
SALARY NUMBER(5)
INSERT VALUES
SYNTAX
INSERT INTO table_name(column1,column2….)VALUES (value1,value2..);
Example
SQL> insert into gemployee values('&name','&id','&address','&post','&salary');
Enter value for name: siva
Enter value for id: 5
Enter value for address: mainroad
Enter value for post: manager
Enter value for salary: 2000
old 1: insert into gemployee values('&name','&id','&address','&post','&salary')
new 1: insert into gemployee values('siva','5','mainroad','manager','2000')
1 row created.
SQL> insert into gemployee values('&name','&id','&address','&post','&salary');
Enter value for name: rose
Enter value for id: 67
Enter value for address: weststreet
Enter value for post: clerk
Enter value for salary: 500
old 1: insert into gemployee values('&name','&id','&address','&post','&salary')
new 1: insert into gemployee values('rose','67','weststreet','clerk','500')
1 row created.
SQL> insert into gemployee values('&name','&id','&address','&post','&salary');
Enter value for name: anvitha
Enter value for id: 56
Enter value for address: eaststreet
Enter value for post: assistant
Enter value for salary: 200
old 1: insert into gemployee values('&name','&id','&address','&post','&salary')
new 1: insert into gemployee values('anvitha','56','eaststreet','assistant','200')
1 row created.
SQL> SELECT * FROM GEMPLOYEE;
NAME ID ADDRESS POST SALARY
--------- - ---------- ------------------- -------------------- ---------- ----------
siva 5 mainroad manager 2000
rose 67 weststreet clerk 500
anvitha 56 eaststreet assistant 200
GRANT
SYNTAX
GRANT privilege_name ON object_name TO {user_namepublicrole_name};
Example
SQL> grant all on gemployee to system;
Grant succeeded.
REVOKE
SYNTAX
REVOKE privilege_name ON object_name FROM {user_namepublicrole_name};
Example
SQL> revoke select on gemployee from system;
Revoke succeeded.