Back to posts Edit this post
Copy content

20 Jan 11:26

BSD 3
select '' as Zadanie_1 from dual; select NAZWISKO, concat(SUBSTR(ETAT, 0, 2), ID_PRAC) as "KOD" from PRACOWNICY; select '' as Zadanie_2 from dual; select NAZWISKO, REPLACE(REPLACE(REPLACE(NAZWISKO, 'M', 'X'), 'L', 'X'), 'K', 'X') as "WOJNA_LITEROM" from PRACOWNICY; select NAZWISKO, TRANSLATE(UPPER(nazwisko), 'KML', 'XXX') as "WOJNA_LITEROM" from PRACOWNICY; select '' as Zadanie_3 from dual; select NAZWISKO from PRACOWNICY where INSTR(substr(nazwisko, 1, length(nazwisko)/2), 'L', 1, 1) > 0; select '' as Zadanie_4 from dual; select nazwisko, round(PLACA_POD*1.15) from PRACOWNICY; select '' as Zadanie_5 from dual; select nazwisko, PLACA_POD, PLACA_POD * 0.2 as "INWESTYCJA", (PLACA_POD*0.2)*POWER((1+0.1),10) as "KAPITAƁ", (PLACA_POD*0.2)*POWER((1+0.1),10)-PLACA_POD * 0.2 as "ZYSK" from PRACOWNICY; select '' as Zadanie_6 from dual; SELECT nazwisko, TO_CHAR(ZATRUDNIONY, 'YY/MM/DD') as "ZATRUDNIONY", trunc((DATE '2000-01-01' - ZATRUDNIONY)/365,0) as "STAZ_W_2001" from PRACOWNICY; select '' as Zadanie_7 from dual; SELECT nazwisko, TO_CHAR(ZATRUDNIONY, 'MONTH , DD YYYY') as "DATA_ZATRUDNIENIA" from PRACOWNICY WHERE ID_ZESP = 20; select '' as Zadanie_8 from dual; SELECT TO_CHAR(CURRENT_DATE, 'DAY') as "DZIS" FROM dual; select '' as Zadanie_9 from dual; select nazwa, adres, case when adres like '%PIOTROWO%' THEN 'NOWE MIASTO' when adres like '%WLODKOWICA%' THEN 'GRUNWALD' when adres like '%MIELZYNSKIEGO%' THEN 'STARE MIASTO' when adres like '%STRZELECKA%' THEN 'STARE MIASTO' ELSE 'BRAK DANYCH' END as DZIELNICA from zespoly; select '' as Zadanie_10 from dual; select nazwisko, placa_pod, case when placa_pod>480 then 'Powyzej 480' when placa_pod<480 then 'Ponizej 480' ELSE 'Dokladnie 480' END as PROG from pracownicy order by placa_pod desc; select '' as Zadanie_11 from dual; select nazwisko, id_zesp, placa_pod from pracownicy where case when id_zesp = 10 and placa_pod >= 1070.10 then 1 when id_zesp = 20 and placa_pod >= 616.60 then 1 when id_zesp = 30 and placa_pod >= 502 then 1 when id_zesp = 40 and placa_pod >= 1350 then 1 else 0 end = 1 order by id_zesp asc, placa_pod asc; select '' as Zadanie_12 from dual; select nazwisko, etat, case when etat in ('PROFESOR', 'DYREKTOR') then floor((TO_DATE('2000-01-01', 'YYYY-MM-DD')-zatrudniony)/365) else null end as STAZ_W_2000, CASE when etat in ('ADIUNKT', 'ASYSTENT') then floor((TO_DATE('2010-01-01', 'YYYY-MM-DD')-zatrudniony)/365) else null end as STAZ_W_2010, CASE when etat in ('STAZYSTA', 'SEKRETARKA') then floor((TO_DATE('2020-01-01', 'YYYY-MM-DD')-zatrudniony)/365) else null end as STAZ_W_2020 from pracownicy order by case when etat in ('PROFESOR', 'DYREKTOR') then 1 when etat in ('ADIUNKT', 'ASYSTENT') then 2 when etat in ('STAZYSTA', 'SEKRETARKA') then 3 end, case when etat in ('PROFESOR', 'DYREKTOR') then floor((TO_DATE('2000-01-01', 'YYYY-MM-DD')-zatrudniony)/365) when etat in ('ADIUNKT', 'ASYSTENT') then floor((TO_DATE('2010-01-01', 'YYYY-MM-DD')-zatrudniony)/365) when etat in ('STAZYSTA', 'SEKRETARKA') then floor((TO_DATE('2020-01-01', 'YYYY-MM-DD')-zatrudniony)/365) end;

No files