create table klienci
( klient_id number(3) constraint klienci_pk primary key,
  imie varchar2(15) not null,
  nazwisko varchar2(20) not null,
  adres varchar2(30) not null
);

create table r_ror
( nr_rachunku varchar2(25) constraint r_ror_pk primary key,
  kwota number (8,2) default 0 not null,
  ost_aktualiz date default sysdate,
  klient_id number(3) constraint r_ror_fk references klienci(klient_id)
);

create table r_terminowe
( nr_rachunku varchar2(25) constraint r_term_pk primary key,
  kwota number (8,2) default 0 not null,
  termin number(2) not null,
  procent number(4,2) not null,
  ost_aktualiz date default sysdate,
  klient_id number(3) constraint r_ror_fk2 references klienci(klient_id)
);

insert into klienci values ('1', 'Juliusz', 'Jezierski', 'ul. Polska 3');
insert into klienci values ('2', 'Tomasz', 'Koszlajda', 'ul. Wielka 2/3');
insert into klienci values ('3', 'Robert', 'Wrembel', 'ul. Sienkiewicza 4/9');

insert into r_ror values ('10203040-223344-15-23', 1000, sysdate, 1);
insert into r_ror values ('10203040-288900-16-23', 2000, sysdate, 2);
insert into r_ror values ('10203040-117703-20-24', 1200, sysdate, 3);

insert into r_terminowe values
('10203040-100344-15-50', 5000, 3, 11, sysdate, 1);
insert into r_terminowe values
('10203040-211445-15-50', 3000, 3, 11, sysdate, 2);
insert into r_terminowe values
('10203040-130001-15-50', 4500, 3, 11, sysdate, 3);
commit;