Back to posts Edit this post
Copy content

20 Jan 11:25

BSD 2
SELECT '' AS Zadanie_1 FROM dual; SELECT * FROM zespoly; SELECT '' AS Zadanie_2 FROM dual; SELECT * FROM pracownicy ORDER BY id_prac ASC; SELECT '' AS Zadanie_3 FROM dual; SELECT nazwisko, placa_pod * 12 AS roczna_placa FROM pracownicy ORDER BY nazwisko ASC; SELECT '' AS Zadanie_4 FROM dual; SELECT nazwisko, etat, placa_pod + COALESCE(placa_dod, 0) AS miesieczne_zarobki FROM pracownicy ORDER BY miesieczne_zarobki DESC; SELECT '' AS Zadanie_5 FROM dual; SELECT * FROM zespoly ORDER BY nazwa ASC; SELECT '' AS Zadanie_6 FROM dual; SELECT DISTINCT etat FROM pracownicy ORDER BY etat; SELECT '' AS Zadanie_7 FROM dual; SELECT * FROM pracownicy WHERE etat = 'ASYSTENT' ORDER BY nazwisko; SELECT '' AS Zadanie_8 FROM dual; SELECT id_prac, nazwisko, etat, placa_pod, id_zesp from pracownicy WHERE id_zesp = 30 OR id_zesp = 40 ORDER BY placa_pod DESC; SELECT '' AS Zadanie_9 FROM dual; SELECT nazwisko, id_zesp, placa_pod FROM pracownicy WHERE placa_pod BETWEEN 300 AND 800 ORDER BY nazwisko; SELECT '' AS Zadanie_10 FROM dual; SELECT nazwisko, etat, id_zesp FROM pracownicy WHERE nazwisko LIKE '%SKI' ORDER BY nazwisko ASC; SELECT '' AS Zadanie_11 FROM dual; SELECT id_prac, id_szefa, nazwisko, placa_pod FROM pracownicy WHERE id_szefa IS NOT NULL AND placa_pod > 1000; SELECT '' AS Zadanie_12 FROM dual; SELECT nazwisko, id_zesp FROM pracownicy WHERE id_zesp = 20 AND (nazwisko LIKE 'M%' OR nazwisko LIKE '%SKI') ORDER BY nazwisko; SELECT '' AS Zadanie_13 FROM dual; SELECT nazwisko, etat, placa_pod/20/8 AS stawka FROM pracownicy WHERE placa_pod NOT BETWEEN 400 AND 800 AND (etat != 'ADIUNKT' AND etat != 'ASYSTENT' AND etat != 'STAZYSTA') ORDER BY stawka ASC; SELECT '' AS Zadanie_14 FROM dual; SELECT nazwisko, etat, placa_pod, placa_dod FROM pracownicy WHERE placa_pod + COALESCE(placa_dod, 0) > 1000; SELECT '' AS Zadanie_15 FROM dual; SELECT nazwisko || ' pracuje od ' || zatrudniony || ' i zarabia ' || placa_pod AS profesorowie FROM pracownicy WHERE etat = 'PROFESOR' ORDER BY placa_pod DESC;

No files