First page Back Continue Last page Graphics

The Schema-in PostgreSQL DDL

  • CREATE TABLE Categories
  • (cat_id SERIAL PRIMARY KEY,
  • cname VARCHAR(12));
  • CREATE TABLE Refs
  • (ref_id INTEGER PRIMARY KEY,
  • authors VARCHAR(100),
  • title VARCHAR(50),
  • link VARCHAR(100));
  • CREATE TABLE Users
  • (uid CHAR(12) PRIMARY KEY,
  • email VARCHAR(50));
  • CREATE TABLE Tests
  • (test_id SERIAL PRIMARY KEY,
  • ref INTEGER REFERENCES Refs (ref_id),
  • cat SMALLINT REFERENCES Categories (cat_id),
  • sn FLOAT NOT NULL,
  • sp FLOAT NOT NULL,
  • uid CHAR(12) REFERENCES Users (uid),
  • t_stamp TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
  • approved LOGICAL);