drop table position;
drop table produkt;
drop table rechnung;

create table produkt
( pnr   integer,
  pbez  varchar2(20),
  preis number(8,2),
  constraint is_PKprod primary key(pnr)
);

create table rechnung
( rnr    integer,
  datum  date,
  pges   number(8,2),
  primary key(rnr)
);

create table position
( rnr   integer,
  pnr   integer,
  menge integer,
  primary key(rnr,pnr),
  foreign key(rnr) references rechnung(rnr),
  foreign key(pnr) references produkt(pnr)
);




