SHARE
TWEET

Untitled

a guest Jan 22nd, 2019 52 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. CREATE TABLE author (
  2.     id SMALLINT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
  3.     name VARCHAR(100) NOT NULL
  4. ) ENGINE = InnoDB;
  5.  
  6. CREATE TABLE book (
  7.     id MEDIUMINT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
  8.     title VARCHAR(200) NOT NULL,
  9.     author_id SMALLINT UNSIGNED NOT NULL,
  10.     CONSTRAINT `fk_book_author`
  11.         FOREIGN KEY (author_id) REFERENCES author (id)
  12.         ON DELETE CASCADE
  13.         ON UPDATE RESTRICT
  14. ) ENGINE = InnoDB;
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top