CREATE TABLE customers (
   CId INT PRIMARY KEY,
   LastName CHAR(20),
   FirstName CHAR(20),
   UNIQUE (LastName, FirstName));


CREATE TABLE goods (
   GId    CHAR (15) PRIMARY KEY,
   Flavor CHAR (20),
   Food   CHAR (20),
   PRICE  FLOAT,
   UNIQUE (Flavor, Food)
   );


CREATE TABLE receipts (
   RNumber INT PRIMARY KEY,
   SaleDate DATE,
   Customer INT REFERENCES customers);


CREATE TABLE items (
  Receipt INT REFERENCES receipts,
  Ordinal INT,
  Item    CHAR(15) REFERENCES goods,
  PRIMARY KEY(Receipt, Ordinal) );

