insert into zakaznik (id, jmeno, vek) values (0, 'karel', null);
insert into zakaznik (id, jmeno, vek) values (1, 'jan', 30);
insert into zakaznik (id, jmeno, vek) values (2, 'petr', 20);
insert into zakaznik (id, jmeno, vek) values (3, 'pepa', null);
insert into zakaznik (id, jmeno, vek) values (4, 'pepa', null);

savepoint jedna;

insert into kniha (id, nazev) values (0, 'temno');
insert into kniha (id, nazev) values (1, 'svetlo');
insert into kniha (id, nazev) values (2, 'svejk');
insert into kniha (id, nazev) values (3, 'kladivo na carodejnice');

savepoint dva;

alter session set NLS_DATE_FORMAT = 'YYYYMMDD';

Insert into Vypujcka (datum, kniha_ID, zakaznik_id) values ('20170210',0,0);
Insert into Vypujcka (datum, kniha_ID, zakaznik_id) values ('20170210',1,0);
Insert into Vypujcka (datum, kniha_ID, zakaznik_id) values ('20170210',2,0);
Insert into Vypujcka (datum, kniha_ID, zakaznik_id) values ('20170210',3,0);
Insert into Vypujcka (datum, kniha_ID, zakaznik_id) values ('20170210',1,1);
Insert into Vypujcka (datum, kniha_ID, zakaznik_id) values ('20170210',3,2);
Insert into Vypujcka (datum, kniha_ID, zakaznik_id) values ('20170210',2,2);

savepoint tri;

update zakaznik set jmeno = 'anezka' where id = 1;

savepoint ctyri;

delete from zakaznik where jmeno = 'pepa';

rollback to SAVEPOINT tri;
rollback to SAVEPOINT jedna;
delete from zakaznik where id = 0;

drop table vypujcka;
drop table zakaznik;

select * from zakaznik;
select * from kniha;
select * from vypujcka;

commit;

set autocommit on;
set autocommit off;

//commit;

//select * from zakaznik;

//delete from zakaznik where id = 1;

//drop table vypujcka;

//set autocommit on;  