Tabela DOSIJE
INDEKS | IME | PREZIME | MESTORODJENJA | DATUPISA |
---|
Tabela PREDMET
IDPREDMETA | OZNAKA | NAZIV | ESPB |
---|
Tabela ISPITNIROK
SKGODINA | OZNAKAROKA | NAZIV |
---|
Tabela ISPIT
INDEKS | IDPREDMETA | SKGODINA | OZNAKAROKA | OCENA | DATPOLAGANJA | BODOVI |
---|
Rešiti na relacionoj algebri i relacionom računu
relaciona algebra
define alias i1 for ispit
define alias i2 for ispit
define alias i3 for ispit
((i1 times i2) where i1.indeks=i2.indeks and i1.idpredmeta=1001 and
i2.idpredmeta=1001 and i1.datpolaganja<>i2.datpolaganja)[i1.indeks]
minus
((i1 times i2 times i3) where i1.indeks=i2.indeks and i1.indeks=i3.indeks and
i1.idpredmeta=1001 and i2.idpredmeta=1001 and i3.idpredmeta=1001 and
i1.datpolaganja<>i2.datpolaganja and i1.datpolaganja<>i3.datpolaganja and
i2.datpolaganja<>i3.datpolaganja )[i1.indeks]
relacioni račun
range of dx is dosije
range of ix is ispit
range of iy is ispit
range of iz is ispit
dx.indeks
where exists ix(ix.indeks=dx.indeks and ix.idpredmeta=1001 and exists iy(
iy.indeks=dx.indeks and iy.idpredmeta=1001 and ix.datpolaganja<>iy.datpolaganja
and not exists iz(iz.indeks=dx.indeks and iz.idpredmeta=1001 and
ix.datpolaganja<>iz.datpolaganja and iy.datpolaganja<>iz.datpolaganja)))
relaciona algebra
define alias ispit1 for ispit
define alias dosije1 for dosije
(((ispit where ocena>5) join dosije) times ((ispit1 where ocena>5) join dosije1)
where ispit.idpredmeta=ispit1.idpredmeta and ispit.indeks<ispit1.indeks
and dosije.datupisa=dosije1.datupisa)[ispit.idpredmeta, dosije.datupisa]
join predmet)[datupisa, naziv]
relacioni račun
range of px is predmet
range of dx is dosije
range of dy is dosije
range of ix is ispit
range of iy is ispit
dx.datupisa, px.naziv
where exists ix(ix.indeks=dx.indeks and ix.idpredmeta=px.idpredmeta and ix.ocena>5 and
exists iy(iy.idpredmeta=px.idpredmeta and iy.ocena>5 and exists dy(dy.indeks<>dx.indeks
and dx.datupisa=dy.datupisa)))
relaciona algebra
(ispit where ocena>5)[indeks, idpredmeta]
divideby
(predmet where espb=6)[idpredmeta]
relacioni račun
range of px is predmet
range of dx is dosije
range of ix is ispit
dx.indeks
where forall px( if px.espb=6 then exists ix(ix.indeks=dx.indeks and
ix.idpredmeta=px.idpredmeta and ix.ocena>5))
relaciona algebra
((ispit where ocena>5) join (predmet where espb=6)[idpredmeta])[indeks]
minus
((ispit where ocena>5)[indeks, idpredmeta]
divideby
(predmet where espb=6)[idpredmeta])
relacioni račun
range of px is predmet
range of py is predmet
range of dx is dosije
range of ix is ispit
range of iy is ispit
dx.indeks
where exists px(px.espb=6 and not exists ix(ix.indeks=dx.indeks and
ix.idpredmeta=px.idpredmeta and ix.ocena>5))
and exists py(py.espb=6 and exists iy(iy.indeks=dx.indeks and
iy.idpredmeta=py.idpredmeta and iy.ocena>5))
relaciona algebra
dosije[indeks]
minus
((ispit where ocena>5)[indeks, idpredmeta]
divideby
(predmet where espb=6)[idpredmeta])
relacioni račun
range of px is predmet
range of py is predmet
range of dx is dosije
range of ix is ispit
range of iy is ispit
dx.indeks
where exists px(px.espb=6 and not exists ix(ix.indeks=dx.indeks and
ix.idpredmeta=px.idpredmeta and ix.ocena>5))