drop table authors;

drop table books;

drop table shops;

drop table available;

------------------------------------------------------------------------


create table authors(aname varchar(20), authorid integer);

create table books(bname varchar(50), authorid integer, bookid integer);

create table shops(sname varchar(50), shopid integer);

create table available(shopid integer, bookid integer, price integer);

----------

insert into authors values ('Rider Haggard', 1);
insert into authors values ('Karl May', 2);
insert into authors values ('Stephen King', 3);
insert into authors values ('J.R.R. Tolkien', 4);
insert into authors values ('F. Schiller', 5);

----------

insert into books values('Heart of the World', 1, 1);
insert into books values('She', 1, 2);
insert into books values('King Salomon-s Mines', 1, 100);

insert into books values('Winnetou 1', 2, 3);
insert into books values('Winnetou 2', 2, 4);
insert into books values('Winnetou 3', 2, 5);

insert into books values('It', 3, 6);
insert into books values('Marny', 3, 7);

insert into books values('The Hobbit', 4, 8);
insert into books values('The Lord of the Rings', 4, 9);

insert into books values('Balladen', 5, 10);

----------

insert into shops values('Morawa', 1);
insert into shops values('Barnes & Nobles', 2);
insert into shops values('Libro', 3);

----------

insert into available values(1, 8, 20);
insert into available values(1, 7, 50);

insert into available values(2, 10, 30);
insert into available values(2, 6, 40);
insert into available values(2, 3, 35);

insert into available values(3, 8, 30);
insert into available values(3, 2, 20);
insert into available values(3, 1, 30);
insert into available values(3, 3, 40);


