Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 1

3.

ANSWERS:
1. rcc=> select stcode1, stcode2 from track76 where distance<'20';
stcode1 | stcode2
---------+---------
cst | byc
cst | dr
cst | krl
byc | dr
byc | krl
grp | tna
(6rows)
2. rcc=> select train76.id from train76,station76,trainhalts76 where trainhalts7
6.id=train76.id and trainhalts76.stcode=station76.stcode and station76.name='tha
ne';
id
------
kp11
a65
(2rows)
3. rcc=> select train76.name from train76,station76,trainhalts76 where train76.
id=trainhalts76.id and station76.stcode=trainhalts76.stcode and station76.name='
mumbai';
name
---------------
cst-kyn
cst-amr_local
(2 rows)
4. rcc=> select station76.name from station76,train76,trainhalts76 where trainh
alts76.id=train76.id and train76.name=station76.name and train76.name='cst-amr-l
ocal';
name
------
(0 rows)

5.rcc=> select distinct train76.name from train76,station76,trainhalts76 where


trainhalts76.id=train76.id and station76.stcode=trainhalts76.stcode and trainhal
ts76.seqno<6 and station76.name='thane';
name
---------------
cst-amr_local
(1row)

You might also like