Day 8
Day 8
Day 8
aname varchar(10),
city varchar(10),
b_date date);
***query***
ET_I MAX(SCORE)
---- ----------
e001 90
e002 95
2.
select t.et_id,count(a.aid) from applicant a, etest_details t
where a.aid=t.aid
group by t.et_id;
ET_I COUNT(A.AID)
---- ------------
e001 2
e002 2
3.
select count(t.aid)
from applicant a,etest_details t
where a.aid=t.aid
group by t.aid;
COUNT(T.AID)
------------
2
2
select min(t.aid)
from applicant a,etest_details t
where a.aid=t.aid
group by t.aid;
MIN(
----
a002
a001
4.
select city,count(aid) from applicant
group by city;
CITY COUNT(AID)
---------- ----------
baroda 1
surat 1
5.
select a.aid,t.* from applicant a, etest_details t
where a.aid=t.aid and a.aname='ohm patel';
*******tables*******
1 row created.
1 row created.
**query***
1.
SQL> select d.dname,t.itno,di.dno from distributor d,iteam t,dist_item di
2 where t.itno=di.itno and d.dno=di.dno and t.itno='t002';
2.
3.
select t.itname from distributor d,iteam t,dist_item di
where di.dno=d.dno and t.itno=di.itno and d.dname='dev shah';
ITNAME
----------
jence
4.
select t.itname,di.qty from iteam t,dist_item di
where to_char(ddate,'mon-yy')='jul-21' and t.itno=di.itno;
ITNAME QTY
---------- ----------
jence 10
jecket 9
5.
ITNAME
----------
jence