Professional Documents
Culture Documents
Enter password:
Connected.
2 (empno number(5)
3 ,empname varchar(5)
4 ,DOB date
5 ,sal number(7,2));
Table created.
SQL> commit;
Commit complete.
Table created.
SQL> commit;
Commit complete.
Table created.
SQL> commit;
Commit complete.
Table created.
SQL> commit;
Commit complete.
Table created.
SQL> commit
Commit complete.
Table renamed.
SQL> commit;
Commit complete.
Table altered.
SQL> commit
SQL> commit;
Commit complete.
Table altered.
SQL> commit
2
SQL> commit;
Commit complete.
Table altered.
SQL> commit;
Commit complete.
Table altered.
SQL> commit;
Commit complete.
Table altered.
SQL> commit;
Commit complete.
Table dropped.
SQL> commit;
Commit complete.
Flashback complete.
SQL> commit;
Commit complete.
Table dropped.
SQL> commit;
Commit complete.
Flashback complete.
SQL> commit;
Commit complete.
*
ERROR at line 1:
Table dropped.
SQL> commit;
Commit complete.
Table purged.
SQL> commit;
Commit complete.
1 row created.
SQL> commit;
Commit complete.
ERROR at line 1:
1 row created.
SQL> commit;
Commit complete.
ERROR at line 1:
ORA-01722: invalid number
SQL>
1 row created.
SQL> commit;
Commit complete.
1 row created.
SQL> commit;
Commit complete.
1 row created.
SQL> commit;
Commit complete.
Table created.
SQL> commit;
Commit complete.
How to Alter
Alter:- By using Alter we can Add ,Modify ,Drop ,Rename,Set unused,enable ,disable the object or table
, column
Table created.
SQL> commit;
Commit complete.
Comment created.
SQL> commit;
Commit complete.
Table altered.
SQL> commit;
Commit complete.
*
ERROR at line 1:
ORA-01438: value larger than specified precision allowed for this column
new 1: insert into emp( empno ,empname ,DOB ,sal ) values('123456','rani','12 dec1990','7000')
ERROR at line 1:
ORA-01438: value larger than specified precision allowed for this column
new 1: insert into emp( empno ,empname ,DOB ,sal ) values('1234','rani','12 dec1990','7000')
1 row created.
Table altered.
SQL> commit;
Commit complete.
new 1: insert into emp( empno ,empname ,DOB ,sal ) values('123455','rani','12 dec1990','7000')
1 row created.
SQL> commitl;
SQL> commit;
Commit complete.
SQL> slect * from emp;
7 rows selected.
ERROR at line 1:
ERROR at line 1:
ERROR at line 1:
ERROR at line 1:
ERROR at line 1:
ERROR at line 1:
ERROR at line 1:
ERROR at line 1:
ERROR at line 1:
EMPNO DOB
---------- ---------
121 12-AUG-92
122 25-NOV-92
123 11-AUG-91
124 12-AUG-92
125 13-NOV-92
1234 12-DEC-90
123455 12-DEC-90
7 rows selected.
ERROR at line 1:
ERROR at line 1:
SAL*2
----------
14000
14000
14000
EMPNO EMPNA
---------- -----
121 ajay
122 babu
123 raja
124 raju
125 siva
1234 rani
127 rani
7 rows selected.
1 row updated.
EMPNO EMPNA
---------- -----
121 ajay
122 babu
123 raja
124 raju
125 siva
126 venki
127 rani
7 rows selected.
ERROR at line 1:
Table altered.
SQL> commit;
Commit complete.
SQL> select empno ,empname from emp;
EMPNO EMPNAME
---------- -------------------------
121 ajay
122 babu
123 raja
124 raju
125 siva
126 venki
127 rani
7 rows selected
ERROR at line 1:
Table altered.
SQL> commit;
Commit complete.
EMPNO EMPNAME
---------- -------------------------
121 ajay
122 babu
123 raja
124 raju
125 siva
126 venki
127 rani
7 rows selected.
SQL> commit;
Commit complete.
8 rows selected.
1 row deleted.
SQL> delete emp where empno='122';
0 rows deleted.
7 rows selected.
=====================================================================================
Enter password:
Connected.
Connected.
Connected.
SQL> select * from user_sys_privs;
USERNAME PRIVILEGE
ADM COM
-------------------------------------------------------------------------------------------------------------------------------- ----------
------------------------------ --- ---
Connected.
USERNAME PRIVILEGE
ADM COM
-------------------------------------------------------------------------------------------------------------------------------- ----------
------------------------------ --- ---
INSTANCE
--------------------------------------------------------------------------------
orcl
Connected.
INSTANCE
--------------------------------------------------------------------------------
orcl
Connected.
ERROR at line 1:
Grant succeeded.
ERROR at line 1:
Connected.
Grant succeeded.
USER is "AJAY"
7 rows selected.