Advertisement
Guest User

stijn leenknegt

a guest
Jan 19th, 2010
141
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
SQL 0.50 KB | None | 0 0
  1. CREATE TABLE gebruikers (
  2.     id INTEGER NOT NULL PRIMARY KEY,
  3.     naam VARCHAR(40) NOT NULL UNIQUE,
  4.     geboortedatum DATE NOT NULL CHECK(EXTRACT(YEAR FROM geboortedatum) >= 1950)
  5. );
  6.  
  7. CREATE TABLE topics(
  8.     id INTEGER NOT NULL PRIMARY KEY,
  9.     gebruiker INTEGER NOT NULL,
  10.     titel VARCHAR(50) NOT NULL,
  11.     topic text NOT NULL,
  12.     geplaatstOp TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
  13.     FOREIGN KEY(gebruiker) REFERENCES gebruikers(id)
  14.         ON UPDATE cascade
  15.         ON DELETE RESTRICT
  16. );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement