Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- ZAD 1
- CREATE OR REPLACE VIEW ASYSTENCI (ID, NAZWISKO, PLACA, STAŻ_PRACY) AS
- SELECT ID_PRAC, NAZWISKO, PLACA_POD, 'lat: '
- || ROUND( (MONTHS_BETWEEN(CURRENT_DATE, ZATRUDNIONY) / 12 ), 0)
- || ', miesięcy: '
- || ROUND( ( MOD( MONTHS_BETWEEN(CURRENT_DATE, ZATRUDNIONY), 12) ), 0)
- FROM PRACOWNICY WHERE ETAT = 'ASYSTENT';
- -- ZAD 2
- CREATE OR REPLACE VIEW PLACE (ID_ZESP, SREDNIA, MINIMUM, MAXIMUM, FUNDUSZ, L_PENSJI, L_DODATKOW) AS
- SELECT ID_ZESP, AVG(PLACA_POD + NVL(PLACA_DOD, 0)), MIN(PLACA_POD + NVL(PLACA_DOD, 0)),
- MAX(PLACA_POD + NVL(PLACA_DOD, 0)), SUM(PLACA_POD + NVL(PLACA_DOD, 0)), COUNT(PLACA_POD), COUNT(PLACA_DOD)
- FROM PRACOWNICY GROUP BY ID_ZESP ORDER BY ID_ZESP ASC;
- -- ZAD 3
- SELECT P.NAZWISKO, P.PLACA_POD FROM PRACOWNICY P
- WHERE ( P.PLACA_POD + NVL(P.PLACA_DOD, 0) ) < (SELECT SREDNIA FROM PLACE PL WHERE PL.ID_ZESP = P.ID_ZESP);
- -- ZAD 4
- CREATE OR REPLACE VIEW PLACE_MINIMALNE (ID_PRAC, NAZWISKO, ETAT, PLACA_POD) AS
- SELECT ID_PRAC, NAZWISKO, ETAT, PLACA_POD FROM PRACOWNICY WHERE PLACA_POD < 700;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement