create table book (
    isbn           char(16)   primary key,
    title          char(32),
    price          float,
    amount         int        check (amount >= 0)
);

create table customer (
    id             char(32)   primary key,
    email          char(32)   unique,
    password       char(16),
    firstname      char(32),
    lastname       char(32),
    street         char(32),
    zip            char(32),
    city           char(32),
    creditcardnr   char(16),
    validuntilMonth int,
    validuntilYear int
);

create table orders (
    customer       char(32)   references customer(id),
    book           char(16)   references book(isbn),
    date           char(20),
    amount         int,
    bill           int,
                              primary key(customer, book, date)
);
