Professional Documents
Culture Documents
DBMS Edp
DBMS Edp
DBMS Edp
Prg EDP
SQL> create table edp(no int,in varchar(15),cop int,quantity int,dop date,warrnty int,oprl
int));
create table edp(no int,in varchar(15),cop int,quantity int,dop date,warrnty int,oprl int))
*
ERROR at line 1:
ORA-00904: : invalid identifier
Table created.
1 row created.
1 row created.
1 row created.
1 row created.
ERROR at line 1:
ORA-00904: "OCT": invalid identifier
I_NAME
---------------
sca
cam
ups
ERROR at line 1:
ORA-00904: "QUANTITY": invalid identifier
com 9 2.6
pri 3 4.6
sca 1 3.6
cam 2 1.6
ups 5 1.6
com 9 2.6
pri 3 4.6
sca 1 3.6
cam 2 1.6
ups 5 1.6
SQL> select i_name,dop from edp where quantity>3 order by dop asc;
I_NAME DOP
--------------- ---------
com 21-MAY-07
ups 21-MAY-08
ERROR at line 1:
ORA-00904: "NUM": invalid identifier
SQL> select count(num) as total_items, avg(cop) as average_items from edp where
dop<'1/jun/08';
select count(num) as total_items, avg(cop) as average_items from edp where
dop<'1/jun/08'
*
ERROR at line 1:
ORA-00904: "NUM": invalid identifier
SQL> select count (num) as total_items, avg(cop) as average_cost from edp where
dop<'1/jun/08';
select count (num) as total_items, avg(cop) as average_cost from edp where dop<'1/jun/08'
*
ERROR at line 1:
ORA-00904: "NUM": invalid identifier
SQL> select count ('num') as total_items, avg(cop) as average_cost from edp where
dop<'1/jun/08';
TOTAL_ITEMS AVERAGE_COST
----------- ------------
3 16666.6667
ERROR at line 1:
ORA-00904: "WARRANTY": invalid identifier
*
ERROR at line 1:
ORA-00904: "WARRANTY": invalid identifier
MINIMUM_WARRANTY MAXIMUM_WARRANTY
---------------- ----------------
1 4
ERROR at line 1:
ORA-00939: too many arguments for function
SQL> select i_name,to_char(dop,'day','month','year') as purchase_date from edp;
I_NAME PURCHASE_DATE
--------------- --------------------------------------------------------------
com monday may two thousand seven
pri sunday may two thousand six
sca friday august two thousand eight
ERROR at line 1:
ORA-00907: missing right parenthesis
SQL> select i_name,rount((add_months(dop,warrnty),'month')) as round_month,
round((add_months(dop,warranty),'year')as round_year from edp;
select i_name,rount((add_months(dop,warrnty),'month')) as round_month,
round((add_months(dop,warranty),'year')as round_year from edp
*
ERROR at line 1:
ORA-00907: missing right parenthesis
ERROR at line 1:
ORA-00907: missing right parenthesis
*
ERROR at line 1:
ORA-00904: "WARRANTY": invalid identifier
NEXT_DAY(
---------
09-JUN-96
09-JUN-96
09-JUN-96
09-JUN-96
09-JUN-96
NEXT_SUND
---------
09-JUN-96
09-JUN-96
09-JUN-96
09-JUN-96
09-JUN-96
*
ERROR at line 1:
ORA-00911: invalid character
ERROR at line 1:
ORA-00907: missing right parenthesis
*
ERROR at line 1:
ORA-00907: missing right parenthesis
SQL> select count ('num') as total_items, avg(dop) as average_cost from edp where
dop<'1/jun/08';
SQL> select count ('num') as total_items, avg(cop) as average_cost from edp where
dop<'1/jun/08';
TOTAL_ITEMS AVERAGE_COST
----------- ------------
3 16666.6667
no rows selected
0 rows updated.
1 row updated.
no rows selected
SQL> Z
Employee
SQL*Plus: Release 10.2.0.1.0 - Production on Thu Feb 23 09:14:54 2023
Table created.
ERROR at line 1:
ORA-00925: missing INTO keyword
1 row created.
1 row created.
1 row created.
SQL> select*from emp;
FN LN ADDRESS CITY
---------- ---------- --------------- ---------------
george smith 83 f s paries
sam tones 33 e s paries
*
ERROR at line 1:
ORA-00933: SQL command not properly ended
Table created.
1 row created.
1 row created.
SQL> select fn,slr from emp e,slr s where e.emp=slr.s and dsn='salesman';
select fn,slr from emp e,slr s where e.emp=slr.s and dsn='salesman'
*
ERROR at line 1:
ORA-00904: "DSN": invalid identifier
SQL> select fn,slr from emp e,slr s where e.emp=slr.s and dsg='salesman';
select fn,slr from emp e,slr s where e.emp=slr.s and dsg='salesman'
*
ERROR at line 1:
ORA-00904: "SLR"."S": invalid identifier
SQL> select fn,slr from emp e,slr s where e.emp=s.slr and dsg='salesman';
select fn,slr from emp e,slr s where e.emp=s.slr and dsg='salesman'
*
ERROR at line 1:
ORA-00904: "E"."EMP": invalid identifier
SQL> select fn,slr from emp e,slr s where e.emp_id=s.emp_id and dsg='salesman';
FN SLR
---------- ----------
mary 8000
FN LN TOTAL_SALARY
---------- ---------- ------------
george smith 13000
FN EXPERIENCE
---------- ----------
george .023894086
mary .023584619
sam .023999694
ERROR at line 1:
ORA-00904: "DISTINCT_DESIGNATION": invalid identifier
*
ERROR at line 1:
ORA-00904: "DESIGNATION": invalid identifier
COUNT(DISTINCTDSG)
------------------
3
no rows selected
no rows selected
FN
----------
sam
Table altered.
1 row updated.
1 row updated.
1 row updated.
no rows selected
SQL>
library
Table created.
*
ERROR at line 1:
ORA-12899: value too large for column "SYSTEM"."BOOKS"."TYPE" (actual: 5,
maximum: 1)
SQL> create table books1(book_id varchar(10)primary key,bn varchar(10),an varchar(20),pbl
varchar(10),price int,type varchar(10),quantity int);
Table created.
ERROR at line 1:
ORA-12899: value too large for column "SYSTEM"."BOOKS"."TYPE" (actual: 5,
maximum: 1)
Table created.
1 row created.
1 row created.
1 row created.
no rows selected
Table created.
ERROR at line 1:
ORA-00955: name is already used by an existing object
ERROR at line 1:
ORA-00955: name is already used by an existing object
Table created.
1 row created.
1 row created.
SQL> insert into issued2 values('f0001','2');
1 row created.
BOOK_ID QI
---------- ----------
t0001 4
c0001 5
f0001 2
no rows selected
BN AN PRICE
---------- -------------------- ----------
tt wh 650
no rows selected
BOOK_ID BN PBL
---------- ---------- ----------
c0001 tkai epp
t0001 mfc erp
SQL> select book_id,bn,an, from books2 where pbl!='erp'and price>300 and price<700;
select book_id,bn,an, from books2 where pbl!='erp'and price>300 and price<700
*
ERROR at line 1:
SQL> select book_id,bn,an from books2 where pbl!='erp'and price>300 and price<700;
BOOK_ID BN AN
---------- ---------- --------------------
c0001 tkai lata
f0001 tt wh
10
ERROR at line 1:
ORA-00936: missing expression
BOOK_ID BN
---------- ----------
c0001 tkai
20
ERROR at line 1:
ORA-00904: "BOOKS_ID": invalid identifier
*
ERROR at line 1:
ORA-00904: "BOOK2"."BOOK_ID": invalid identifier
*
ERROR at line 1:
ORA-00942: table or view does not exist
*
ERROR at line 1:
ORA-00903: invalid table name
ERROR at line 1:
ORA-00904: "ISSUED"."BOOK_ID": invalid identifier
ERROR at line 1:
ORA-00904: "ISSUED"."BOOK_ID": invalid identifier
*
ERROR at line 1:
ORA-00904: "BOOK2"."BOOK_ID": invalid identifier
BOOK_ID BN AN QI
---------- ---------- -------------------- ----------
t0001 mfc bb 4
c0001 tkai lata 5
f0001 tt wh 2
ERROR at line 1:
ORA-00903: invalid table name
BN AN QI
---------- -------------------- ----------
mfc bb 4
tkai lata 5
tt wh 2
BOOK_ID BN AN QI
ERROR at line 1:
ORA-00936: missing expression
BN AN PRICE
---------- -------------------- ----------
mfc bb 350
tkai lata 355
tt wh 650
SQL>books
View
dropped.
Table created.
1 row created.
1 row created.
1 row created.
Table dropped.
Table created.
1 row created.
1 row created.
SQL> create view sleeper as select train_no,sp,dst from avl where class='sc';
create view sleeper as select train_no,sp,dst from avl where class='sc'
*
ERROR at line 1:
ORA-00955: name is already used by an existing object
View dropped.
SQL> create view sleeper as select train_no,sp,dst from avl where class='sc';
View created.
found
*
ERROR at line 1:
ORA-00913: too many values
SQL>
SQL> insert into td values('mn3','m exp','hassan','banglore');
1 row created.
TRAIN_NO TN SP DST
---------- --------------- ---------- ---------------
rjd16 raj_ex banglore mumbai
ude04 udy_ex chennai hyderabad
kke55 krn_ex banglore chennai
mn3 m exp hassan banglore
TRAIN_NO SP DST
---------- ---------- ----------
rjd16 banglore mumbai
0 rows updated.
1 row created.
SQL> select * from sleeper;
TRAIN_NO SP DST
1 row updated.
TRAIN_NO SP DST
1 row updated.
TRAIN_NO SP DST
1 row updated.
TRAIN_NO SP DST
1 row created.
TRAIN_NO TN SP DST
---------- --------------- ---------- ---------------
rjd16 raj_ex banglore mumbai
ude04 udy_ex chennai hyderabad
kke55 krn_ex banglore chennai
mn3 m exp hassan banglore
kkl n exp hsn bang
1 row created.
1 row updated.
TRAIN_NO SP DST
---------- ---------- ----------
rjd16 banglore mng
mn3 hassan banglore
1 row created.
SQL> insert into sleeper values('mn4','hass','lore');
1 row created.
TRAIN_NO SP DST
---------- ---------- ----------
1 row updated.
TRAIN_NO SP DST
---------- ---------- ----------
rjd16 banglore mng
mn3 hassan banglore
kkl hsn bang
SQL> create view details as select td.train_no,td.tn,avl.class from td inner join avl where
avl.train_no=td.train_no;
create view details as select td.train_no,td.tn,avl.class from td inner join avl where
avl.train_no=td.train_no
*
ERROR at line 1:
ORA-00905: missing keyword
SQL> create view details as select td.train_no,td.tn,avl.class from td inner join avl where
avl.train_no=td.train_no;
create view details as select td.train_no,td.tn,avl.class from td inner join avl where
avl.train_no=td.train_no
*
ERROR at line 1:
ORA-00905: missing keyword
TRAIN_NO TN SP DST
6 rows selected.
SQL> create view kew as select td.train_no,td.tn,avl.class from td inner join avl where
avl.train_no=td.train_no;
create view kew as select td.train_no,td.tn,avl.class from td inner join avl where
avl.train_no=td.train_no
*
ERROR at line 1:
ORA-00905: missing keyword
SQL> create view details as select td.train_no,td.tn,avl.class from td inner join avl where
avl.train_no=td.train_no;
create view details as select td.train_no,td.tn,avl.class from td inner join avl where
avl.train_no=td.train_no
*
ERROR at line 1:
ORA-00905: missing keyword
6 rows selected.
View created.
SQL> select * from details;
TRAIN_NO TN CLASS
---------- --------------- ---------------
rjd16 raj_ex sc
ude04 udy_ex fc
kke55 krn_ex fc ac
mn3 m exp sc
kkl n exp sc
mn4 k exp sc
6 rows selected.
View created.
SP COUNT(NOS)
---------- ----------
hass 0
hsn 0
chennai 1
banglore 2
hassan 0
ERROR:
ORA-01756: quoted string not properly terminated
1 row created.
*
ERROR at line 1:
ORA-02291: integrity constraint (SYSTEM.SYS_C004033) violated - parent key not
found
1 row created.
rjd16 banglore 15
ude04 chennai 22
kke55 banglore 15
mn3 hassan
kkl hsn
mn4 hass
klm2 bnglore mysore
7 rows selected.
1 row updated.
TRAIN_NO SP NOS
---------- ---------- ----------
rjd16 banglore 15
ude04 chennai 22
kke55 banglore 15
mn3 hassan
kkl hsn
mn4 hass
klm2 hubli mysore
7 rows selected.
1 row deleted.
TRAIN_NO SP NOS
---------- ---------- ----------
rjd16 banglore 15
ude04 chennai 22
kke55 banglore 15
mn3 hassan
kkl hsn
mn4 hass
6 rows selected.
Table renamed.
SQL>