Professional Documents
Culture Documents
DCODE DNAME
---------- ------------------------------
cse computer science and engg.
it information technology.
ec electronics engg.
cv civil engg.
mech mechanical engg.
EEE electronics and elec engg.
6 rows selected.
15 rows selected.
70 easwar it ezhil
9845690089
75 fazil it farooq
9078967890
85 hari ec harish
9879780679
90 parthi ec puraj
9077789660
16 rows selected.
SQL> commit;
Commit complete.
SUM(SALARY)
-----------
6000
SUM(SALARY)
-----------
33000
6000
15000
24000
42000
MAX(SALARY)
--------------------
9000
MIN(SALARY)
--------------------
1000
AVG(SALARY)
-----------
8000
SQL> ed;
Wrote file afiedt.buf
MIN(SALARY)
--------------------
10000
1000
4000
7000
13000
AVG(SALARY)
-----------
11000
2000
5000
8000
14000
SQL> ed;
Wrote file afiedt.buf
COUNT(ROLLNO)
-------------
4
SQL> select count(mobile)from stu;
COUNT(MOBILE)
-------------
16
SQL> ed;
Wrote file afiedt.buf
65 dana it damu
9898980007
70 easwar it ezhil
9845690089
ROLLNO SNAME DEPT FNAME
---------- ------------------------- ---------- -------------------------
MOBILE
----------
75 fazil it farooq
9078967890
80 gopal ec guna
9023456789
85 hari ec harish
9879780679
90 parthi ec puraj
9077789660
95 ram cv raja
9088900112
16 rows selected.
SQL> commit;
Commit complete.
SQL> create view tccsesel as select rollno,sname,dept from stu where dept='cse';
View created.
SQL> create view tccsesel as select rollno,sname from stu where dept='cse';
create view tccsesel as select rollno,sname from stu where dept='cse'
*
ERROR at line 1:
ORA-00955: name is already used by an existing object
SQL> ed;
Wrote file afiedt.buf
SQL> ed;
Wrote file afiedt.buf
SQL> ed;
Wrote file afiedt.buf
SQL> ed;
Wrote file afiedt.buf
View created.
View created.
6 rows selected.
View dropped.
SQL> ed;
Wrote file afiedt.buf
ERROR at line 1:
ORA-00904: "C"."SODE": invalid identifier
SQL> commit;
Commit complete.
SQL> ed;
Wrote file afiedt.buf
1* commit
SQL> create view join view as select rollno,a.sname,dname,counid,c.sname as staffname
from stu a,dep
art b,staffss c where a.depart=b.dcode and a.counid=c.scode;
create view join view as select rollno,a.sname,dname,counid,c.sname as staffname from
stu a,depart b
*
ERROR at line 1:
ORA-00905: missing keyword
SQL> ed;
Wrote file afiedt.buf
ERROR at line 1:
ORA-00904: "A"."COUNID": invalid identifier
SQL> ed;
Wrote file afiedt.buf
ERROR at line 1:
ORA-00904: "A"."COUNID": invalid identifier
SQL> ed;
Wrote file afiedt.buf
View created.
View created.
SQL> ed;
Wrote file afiedt.buf
1 row created.
DCODE DNAME
---------- ------------------------------
cse computer science and engg.
it information technology.
ec electronics engg.
cv civil engg.
mech mechanical engg.
EEE electronics and elec engg.
6 rows selected.
DCODE DNAME
---------- ------------------------------
cse computer science and engg.
it information technology.
ec electronics engg.
cv civil engg.
mech mechanical engg.
EEE electronics and elec engg.
6 rows selected.
SQL> create table voter(vid number(5) primary key,vname varchar2(20) not null,age
number(3)check(age
>=18),mobile varchar2(10);
create table voter(vid number(5) primary key,vname varchar2(20) not null,age
number(3)check(age>=18)
ERROR at line 1:
ORA-00907: missing right parenthesis
SQL> ed;
Wrote file afiedt.buf
Table created.
View created.
SQL> ed;
Wrote file afiedt.buf
1 row created.
SQL> select * from voter;
SQL> ed;
Wrote file afiedt.buf
SQL> ed;
Wrote file afiedt.buf
View created.
SQL> create view voterairtel values as select * from voter where mobile like '9894%;
create view voterairtel values as select * from voter where mobile like '9894%
*
ERROR at line 1:
ORA-00905: missing keyword
SQL> ed;
Wrote file afiedt.buf
1* create view voterairtel values as select * from voter where mobile like '9894009009';
SQL> /
create view voterairtel values as select * from voter where mobile like '9894009009';
*
ERROR at line 1:
ORA-00905: missing keyword
SQL> ed;
Wrote file afiedt.buf
1* create view voterairtel values as select * from voter where mobile like
'9894009009%';
SQL> /
create view voterairtel values as select * from voter where mobile like '9894009009%';
*
ERROR at line 1:
ORA-00905: missing keyword
SQL> ed;
Wrote file afiedt.buf
SQL> ed;
Wrote file afiedt.buf
SQL> ed;
Wrote file afiedt.buf
1* create view voterairtel values as select * from voter where mobile like '9566789089';
SQL> /
create view voterairtel values as select * from voter where mobile like '9566789089';
*
ERROR at line 1:
ORA-00905: missing keyword
SQL> ed;
Wrote file afiedt.buf
1* create view voterairtel values as select * from voter where mobile like '9844%'with
check optio
SQL> /
create view voterairtel values as select * from voter where mobile like '9844%'with check
option;
*
ERROR at line 1:
ORA-00905: missing keyword
SQL> ed;
Wrote file afiedt.buf
1* create view voterairtel values as select * from voter where mobile like '9844%' with
check opti
SQL> /
create view voterairtel values as select * from voter where mobile like '9844%' with
check option;
*
ERROR at line 1:
ORA-00905: missing keyword
SQL> ed;
Wrote file afiedt.buf
1* create view voterairtel values as select * from voter where mobile like
'9844567890%' with chec
SQL> /
create view voterairtel values as select * from voter where mobile like '9844567890%'
with check opt
*
ERROR at line 1:
ORA-00905: missing keyword
SQL> ed;
Wrote file afiedt.buf
1* create view voterairtel values as select * from voter where mobile like '9844567890'
with check
SQL> /
create view voterairtel values as select * from voter where mobile like '9844567890' with
check opti
*
ERROR at line 1:
ORA-00905: missing keyword
SQL> create view voteratcheck as select * from voter where mobile like '9894%'with
check option;
View created.
SQL> ed;
Wrote file afiedt.buf
View created.
1 row created.
SQL> commit;
Commit complete.
SQL>