Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- ZAD 1
- SELECT MIN(PLACA_POD) AS MINIMUM, MAX(PLACA_POD) AS MAKSIMUM, MAX(PLACA_POD) - MIN(PLACA_POD) AS RÓŻNICA FROM PRACOWNICY
- -- ZAD 2
- SELECT ETAT, AVG(PLACA_POD) FROM PRACOWNICY GROUP BY ETAT ORDER BY AVG(PLACA_POD) DESC
- -- ZAD 3
- SELECT COUNT(*) AS PROFESOROWIE FROM PRACOWNICY GROUP BY ETAT HAVING ETAT = 'PROFESOR'
- -- ZAD 4
- SELECT ID_ZESP, SUM(PLACA_POD) + SUM(PLACA_DOD) AS SUMARYCZNA_PLACA FROM PRACOWNICY GROUP BY ID_ZESP
- -- ZAD 5
- SELECT MAX(SUM(PLACA_POD) + SUM(PLACA_DOD)) AS MAX_SUM_PRACA FROM PRACOWNICY GROUP BY ID_ZESP
- -- ZAD 6
- SELECT ID_SZEFA, MIN(PLACA_POD) AS MINIMALNA FROM PRACOWNICY GROUP BY ID_SZEFA ORDER BY MIN(PLACA_POD) DESC
- -- ZAD 7
- SELECT ID_ZESP, COUNT(ID_ZESP) AS ILE_PRACUJE FROM PRACOWNICY GROUP BY ID_ZESP ORDER BY COUNT(ID_ZESP) DESC
- -- ZAD 8
- SELECT ID_ZESP, COUNT(ID_ZESP) AS ILE_PRACUJE FROM PRACOWNICY GROUP BY ID_ZESP HAVING COUNT(ID_ZESP) > 3 ORDER BY COUNT(ID_ZESP) DESC
- -- ZAD 9
- SELECT ID_PRAC FROM PRACOWNICY GROUP BY ID_PRAC HAVING COUNT(ID_PRAC) > 1
- -- ZAD 10
- SELECT ETAT, AVG(PLACA_POD), COUNT(*) FROM PRACOWNICY WHERE ZATRUDNIONY <= DATE '1990-01-01' GROUP BY ETAT
- -- ZAD 11
- SELECT ID_ZESP, ETAT, ROUND(AVG(PLACA_POD + NVL(PLACA_DOD, 0))) AS ŚREDNIA, ROUND(MAX(PLACA_POD + NVL(PLACA_DOD, 0))) AS MAKSYMALNA FROM PRACOWNICY WHERE ETAT = 'PROFESOR' OR ETAT = 'ASYSTENT' GROUP BY ID_ZESP, ETAT ORDER BY ID_ZESP
- -- ZAD 12
- SELECT EXTRACT(YEAR FROM ZATRUDNIONY) AS ROK, COUNT(*) AS ILU_PRACOWNIKOW FROM PRACOWNICY GROUP BY EXTRACT(YEAR FROM ZATRUDNIONY) ORDER BY EXTRACT(YEAR FROM ZATRUDNIONY)
- -- ZAD 13
- SELECT LENGTH(NAZWISKO) AS ILE_LITER, COUNT(*) AS W_ILU_NAZWISKACH FROM PRACOWNICY GROUP BY LENGTH(NAZWISKO) ORDER BY LENGTH(NAZWISKO)
- -- ZAD 14
- --SELECT COUNT(*) AS ILE_NAZWISK_Z_A, COUNT(*) - 2 AS ILE_NAZWISK_Z_E FROM PRACOWNICY WHERE INSTR(NAZWISKO, 'A') != 0 OR INSTR(NAZWISKO, 'a') != 0
- --BTW TO NIE DZIALA, TAKI ZARCIK KOSMONALCIK
- SELECT COUNT(TRANSLATE(SIGN(INSTR(NAZWISKO, 'A')), '10', '1')) AS ILE_Z_A, COUNT(TRANSLATE(SIGN(INSTR(NAZWISKO, 'E')), '10', '1')) AS ILE_Z_E FROM PRACOWNICY
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement