create table Customer(
  id integer PRIMARY KEY AUTOINCREMENT,
  name text NOT NULL,
  age integer,
  female integer,
  rented integer,
  student integer,
  grantee integer,
  qualif text
);

create table Book(
  id integer PRIMARY KEY AUTOINCREMENT,
  author text NOT NULL,
  title text NOT NULL,
  year integer NOT NULL,
  category text NOT NULL,
  price integer NOT NULL,
  pieces integer NOT NULL,
  ancient integer NOT NULL
);

create table SoldBookInstances(
  id integer PRIMARY KEY AUTOINCREMENT,
  bookid integer,
  customerid integer,
  sellDate timestamp,
  FOREIGN KEY (bookid) REFERENCES Book(id),
  FOREIGN KEY (customerid) REFERENCES Customer(id)
);