Skip to content

Instantly share code, notes, and snippets.

@przemyslawjanpietrzak
Last active May 27, 2017 18:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save przemyslawjanpietrzak/08788851287ce132182772d6912441ff to your computer and use it in GitHub Desktop.
Save przemyslawjanpietrzak/08788851287ce132182772d6912441ff to your computer and use it in GitHub Desktop.
databases-training
select * from pracownicy;
select * from zespoly;
select NAZWISKO, PLACA_POD * 12 as "placa roczna" from pracownicy;
select ID_ZESP, NAZWA, ADRES from zespoly order by NAZWA;
select distinct ETAT from pracownicy;
select * from pracownicy where etat = 'ASYSTENT';
select * from pracownicy where ID_ZESP in ('30', '40') order by PLACA_POD desc;
select * from pracownicy where PLACA_POD > 300 and PLACA_POD < 800;
select * from pracownicy where NAZWISKO like '%SKI';
select * from pracownicy where PLACA_POD > 1000 and not ID_SZEFA is NULL;
select * from pracownicy where ID_ZESP = '20' and (NAZWISKO like 'M%' or NAZWISKO like '%SKI');
select NAZWISKO, ETAT, PLACA_POD / 20 / 8 as "STAWKA"
from pracownicy
where not ETAT in ('ADIUNKT','ASYSTENT', 'STAZYSTA') and
(PLACA_POD <= 400 or PLACA_POD > 800)
order by STAWKA;
select * from pracownicy
where PLACA_POD + nvl(PLACA_DOD, 0) > 1000
order by ETAT, NAZWISKO;
select NAZWISKO || ' PRACUJE OD ' || ZATRUDNIONY || ' I ZARABIA ' || PLACA_POD
from pracownicy
where ETAT = 'PROFESOR'
order by PLACA_POD desc;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment