Uploaded by Osaid Faisal

02-134202-074-9536184389-17042022-094934pm

advertisement
CSL220:Dat
abaseManagementSy
st
em
Exer
ci
ses
Usi
ngSt
udent
I
nf
or
mat
i
ondat
abasesol
v
et
hef
ol
l
owi
ngpr
obl
ems.Youar
er
equi
r
edt
o
pul
l
i
nf
or
mat
i
onf
r
om mul
t
i
pl
et
abl
es
1.Sel
ectCour
seI
D,
Cour
seNameandPr
ogr
amNameusi
ngcour
seandpr
ogr
am t
abl
e
2.Sel
ectCour
seI
D,
Cour
seName,
Pr
ogr
amNameandsemest
ernameusi
ngcour
se,
pr
ogr
am andsemest
ert
abl
es
3.Sel
ectSt
dI
D,
St
dNamewhohav
ebeenst
udy
i
ngot
hert
hanBSCSpr
ogr
am usi
ng
St
udentandPr
ogr
am Tabl
e
4.Sel
ectal
l
v
i
si
t
i
ngf
acul
t
ynamesandcour
senamest
aughtbyt
hem usi
ngTeacher
,
Cour
seandSt
dCour
seTeacherTabl
es
5.Sel
ectal
l
cour
sest
hathav
ebeent
aughtbyDr
.I
mani
nFal
l
2020
6.Sel
ectal
l
cour
ses(
Cour
seI
D,
Cour
seName)al
ongwi
t
ht
hei
rt
eachernames.Al
l
Cour
ser
ecor
dsmustbedi
spl
ay
ed.
7.Sel
ectal
l
st
udentnamest
hathav
ebeent
aughtbyDrAhmedal
ongwi
t
ht
hecour
se
name
8.Sel
ectSt
dI
D,
St
dName,
Cour
seI
D,
Cour
seName,
Teacher
I
D,
Teacher
Name,
SemI
D
andSemest
er
Nameusi
ngSt
d,
Cour
se,
Teacher
,
Semest
erandSt
dCour
seTeacher
t
abl
es
9.Sel
ectDi
st
i
nctTeacher
I
D,
Teacher
Nameofal
l
t
eacher
swhohav
et
aughtanycour
se
i
nFal
l
2020usi
ngTeacherandSt
dCour
seTeachert
abl
es
10.
Sel
ectAl
l
Teacher
I
DandTeacher
Namewhohav
et
aughtanycour
sei
nanypr
ogr
am
usi
ngTeacherandSt
dCour
seTeacherTabl
es
11.
Sel
ectal
l
Teacher
I
D,
Teacher
Name,
Cour
seNamewhohav
et
aughtanycour
sei
nany
pr
ogr
am usi
ngTeacherandSt
dCour
seTeacherTabl
es.(
Not
e:
Al
l
t
eacherr
ecor
ds
mustber
et
ur
ned)
12.
Sel
ectAl
l
Teacher
I
DandTeacher
Name,
Cour
seI
D,
SemI
Dwhohav
eNOTt
aughtany
cour
sei
nanydepar
t
mentorpr
ogr
am.
13.
Sel
ectSemest
erI
D,
Semest
erNameandnumberofenr
ol
l
edst
udent
swher
eno
st
udenthasbeenenr
ol
l
edi
nanycour
se
14.
Wr
i
t
eaquer
yt
hatshowsCour
seName,
Teacher
Name,
Semest
er
Name,
Max,
Mi
nand
Av
er
agemar
kssecur
edbyst
udent
s(
BonusMar
ksQuer
y
.
)
Depar
t
emnentofComput
erSci
ences
CSL220:Dat
abaseManagementSy
st
em
2/
2
Semest
erSpr
i
ng2016
Lab05:Joi
ni
ngTabl
es
1. sel
ectc.
cour
sei
d,
c.
cour
sename,
p.
pr
ognamef
r
om cour
sec,
pr
ogp
2. sel
ectc.
cour
sei
d,
c.
cour
sename,
p.
pr
ogname,
semnamef
r
om semest
ers,
cour
sec,
pr
ogp
Depar
t
emnentofComput
erSci
ences
CSL220:Dat
abaseManagementSy
st
em
3/
3
Semest
erSpr
i
ng2016
Lab05:Joi
ni
ngTabl
es
3. sel
ects.
st
di
d,
s.
st
dnamef
r
om st
ds,
pr
ogpwher
es.
pr
ogi
d=p.
pr
ogi
dandp.
pr
ogname!
='
bscs'
4. sel
ectc.
cour
sename,
t
.
t
eacher
namef
r
om t
eachert
,
cour
sec,
st
dcour
set
eacherswher
e
t
.
t
eacher
i
d=s.
t
eacher
i
dandt
.
st
at
us='
v
i
si
t
i
ng'
andc.
cour
sei
d=s.
cour
sei
d
5. sel
ectt
.
t
eacher
name,
c.
cour
sename,
p.
semnamef
r
om t
eachert
,
cour
sec,
st
dcour
set
eachers,
semest
erp
wher
et
.
t
eacher
i
d=s.
t
eacher
i
dandt
.
t
eacher
name='
dr
.i
man'
ands.
cour
sei
d=c.
cour
sei
dand
p.
semname='
f
al
l
2020'
Depar
t
emnentofComput
erSci
ences
CSL220:Dat
abaseManagementSy
st
em
4/
4
Semest
erSpr
i
ng2016
Lab05:Joi
ni
ngTabl
es
6. sel
ectDI
STI
NCTs.
Cour
seI
D,
c.
Cour
seName,
s.
Teacher
I
D,
t
.
Teacher
Namef
r
om st
dcour
set
eachers,
cour
se
c,
t
eachertwher
es.
cour
sei
d=c.
cour
sei
dands.
t
eacher
i
d=t
.
t
eacher
i
d
7. sel
ects.
st
dname,
t
.
t
eacher
name,
c.
cour
senamef
r
om st
ds,
cour
sec,
t
eachert,
St
dCour
seTeacherstwher
e
t
.
t
eacher
i
d=st
.
t
eacher
i
dands.
St
dI
D=st
.
St
dI
Dandc.
Cour
seI
D=st
.
Cour
seI
Dandt
.
t
eacher
name='
Dr
.Ahmed'
Depar
t
emnentofComput
erSci
ences
CSL220:Dat
abaseManagementSy
st
em
5/
5
Semest
erSpr
i
ng2016
Lab05:Joi
ni
ngTabl
es
8. sel
ects.
St
dI
D,
s.
St
dName,
c.
Cour
seI
D,
c.
Cour
seName,
t
.
Teacher
I
D,
t
.
Teacher
Name,
se.
SemI
Df
r
om st
d
s,
cour
sec,
Teachert
,
St
dCour
seTeacherst
,
Semest
ersewher
es.
st
di
d=st
.
St
dI
Dandse.
SemI
D=st
.
SemI
Dand
c.
Cour
seI
D=st
.
Cour
seI
Dandt
.
Teacher
I
D=st
.
Teacher
I
D
9. sel
ectdi
st
i
nctt
.
Teacher
I
D,
t
.
Teacher
Namef
r
om Teachert
,
Semest
erswher
es.
SemName='
FALL2020'
10.sel
ectdi
st
i
ncts.
Teacher
I
D,
t
.
Teacher
Namef
r
om St
dCour
seTeachers,
t
eachertwher
e
t
.
Teacher
I
D=s.
Teacher
I
D
Depar
t
emnentofComput
erSci
ences
CSL220:Dat
abaseManagementSy
st
em
6/
6
Semest
erSpr
i
ng2016
Lab05:Joi
ni
ngTabl
es
11.sel
ectdi
st
i
ncts.
Teacher
I
D,
t
.
Teacher
Name,
c.
Cour
seNamef
r
om cour
sec,
St
dCour
seTeachers,
t
eachert
wher
et
.
Teacher
I
D=s.
Teacher
I
Dandc.
Cour
seI
D=s.
Cour
seI
D
12.sel
ectdi
st
i
nctt
.
Teacher
I
D,
t
.
Teacher
Name,
c.
Cour
sei
d,
sem.
SemI
Df
r
om semest
ersem,
cour
se
c,
St
dCour
seTeachers,
t
eachertwher
et
.
Teacher
I
Dnoti
n(
sel
ectt
eacher
i
df
r
om St
dCour
seTeacher)and
c.
Cour
seI
Dnoti
n(
sel
ectCour
seI
Df
r
om St
dCour
seTeacher
)andsem.
SemI
Dnoti
n(
sel
ectsemi
df
r
om
St
dCour
seTeacher
)
13.sel
ectSemI
D,
SemNamef
r
om Semest
erwher
esemi
dnoti
n(
sel
ectSemI
Df
r
om St
dCour
seTeacher
)
Depar
t
emnentofComput
erSci
ences
CSL220:Dat
abaseManagementSy
st
em
7/
7
Semest
erSpr
i
ng2016
Lab05:Joi
ni
ngTabl
es
14.sel
ectt
.
Teacher
Name,
c.
Cour
seName,
s.
SemName,
max(
e.
maxmar
ks)as'
MAXMARKS'
,
mi
n(
e.
maxmar
ks)
as'
MI
NMARKS'
,
Av
g(
e.
maxmar
ks)as'
AVERAGEMARKS'
f
r
om exam e,
Cour
sec,
Teachert
,
Semest
ers
gr
oupbyt
eacher
name,
Cour
seName,
SemName
Download