سیف الله رستمی

You might also like

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

:‫سوال شش‬

:)‫الف‬
select count(distinct o.driver_id) from owns o ,
Participated p , Accident a where
o.car_id=p.car_id and
p.report_number=a.report_number
and date=1391 ;

:)‫ب‬
select count(distinct p.report_number) from owns o ,
Participated p , Person a where
o.car_id=p.car_id and a.driver_id=o.driver_id and
a.name=N'‫'احمدی‬
and date=1391 ;

:)‫د‬

select * from person where driver_id not in (select


driver_id from participated)
: ‫سوال هفتم‬

:) ‫الف‬
select sname from s where s# in (select s# from sp ,p
where sp.p#=p.p# and p.color=N'‫)'قرمز‬
and s# not in (select s# from sp ,p where sp.p#=p.p# and
p.color<>N'‫)'قرمز‬

:)‫ب‬

select p# from s, spj , J wjere s.s#=spj.s# and


spj.j#=J.j# and
j.city='c2' and s.city='c2'

:)‫ج‬

select s# , j# , count(*) from spj group by s#,j#


:‫سوال هشتم‬

:)‫الف‬
select STID , STNAME from STT st where not exists
((select count(*) from STCOT where STID=st.STID)
except (select count(*) from STCOT where STID=st.STID
and grade>=10))

:)‫ب‬
select sum(credit) from COT ,STCOT where
COT.COID=STCOT.COID and STCOT>STID='97121100'

:)‫ج‬

select STID ,STNAME , STDAEG from STT

:)‫د‬
select * from COT where COTYPE=N'‫ 'عملی‬and coid in (select coid
from STCOT ,STT where STCOT.STID=STT.STID and STT.STNAME='ali
ahmadi'
and TR=1 and YEAR='98-99')

You might also like