This week only. Pastebin PRO Accounts Christmas Special! Don't miss out!Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Aug 14th, 2012  |  syntax: PHP  |  size: 0.68 KB  |  views: 24  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
This paste has a previous version, view the difference. Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. CREATE TABLE students (
  2.   id INT NOT NULL PRIMARY KEY AUTO_INCREMENT,
  3.   username VARCHAR(64) NOT NULL,
  4.   password VARCHAR(64),
  5.   email VARCHAR(...)
  6.   UNIQUE KEY (username)
  7. );
  8.  
  9. CREATE TABLE courses (
  10.   id INT NOT NULL PRIMARY KEY AUTO_INCREMENT,
  11.   name VARCHAR(64) NOT NULL
  12. );
  13.  
  14. CREATE TABLE enrollments (
  15.   id INT NOT NULL PRIMARY KEY,
  16.   student_id INT NOT NULL,
  17.   course_id INT NOT NULL,
  18.   UNIQUE KEY (student_id, course_id),
  19.   FOREIGN KEY (student_id) REFERENCES students (id),
  20.   FOREIGN KEY (course_id) REFERENCES courses (id)
  21. );
  22.  
  23. CREATE TABLE assignments (
  24.   id INT NOT NULL PRIMARY KEY,
  25.   course_id INT NOT NULL,
  26.   title VARCHAR(64)
  27.   description VARCHAR(64)
  28. );
clone this paste RAW Paste Data