Changes between Initial Version and Version 1 of AdvancedReports


Ignore:
Timestamp:
05/20/21 15:34:46 (4 years ago)
Author:
153081
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • AdvancedReports

    v1 v1  
     1= Апликативен дизајн - Случаи на употреба и Сценарија за пристап до базата - SQL Погледи
     2
     3== Погледи
     4
     5=== Поглед за наоѓање на најдобри клиенти
     6{{{#!sql
     7create view  najdobri_klienti as
     8select
     9k.id_klient ,k.korisnicko_ime ,k.prezime
     10from klienti as k
     11inner join naracka as n on k.id_klient =n.id_klient
     12where n.vkupna_cena in
     13(select max(n.vkupna_cena)
     14from naracka as n
     15inner join klienti as k on n.id_klient =k.id_klient) ;
     16}}}
     17
     18=== Поглед за наоѓање на најдобри работници
     19{{{#!sql
     20create view  najdobri_vraboteni_po_naracka as
     21select
     22n .naslov ,v.ime ,v.prezime ,max(enid.br_na_zavrseni_delovi)
     23from  naracka as n
     24inner join evidencija_na_naracki as enn on n.id_naracka =enn .id_naracka
     25inner join evidencija_naracki_izraboteni_delovi as enid on enn.id_evidencija =enid.id_evidencija
     26inner join delovi as d on enid.id_del =d.id_del
     27inner join delovi_izraboteni_od_mashina as diom on d.id_del =diom .id_del
     28inner join mashini as m on diom .id_mashina =m.id_mashina
     29inner join vraboteni_vo_proizvodstvo_raboti_na_mashina as vprrm on m.id_mashina =vprrm .id_mashina
     30inner join vraboteni_vo_proizvodstvo as vvp on vprrm .id_vraboten =vvp .id_vraboten
     31inner join vraboteni as v on vvp.id_vraboten =v.id_vraboten
     32group by 1,2,3;
     33}}}