Advertisement
Guest User

Untitled

a guest
Jun 20th, 2019
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. CREATE TABLE `questions` (
  2. `question_id` int(5) unsigned NOT NULL AUTO_INCREMENT,
  3. `category_id` int(5) unsigned NOT NULL,
  4. `question` text NOT NULL,
  5. PRIMARY KEY (`question_id`),
  6. UNIQUE KEY `question_id` (`question_id`),
  7. KEY `questions_ibfk_1` (`category_id`),
  8. CONSTRAINT `questions_ibfk_1` FOREIGN KEY (`category_id`) REFERENCES `categories` (`category_id`)
  9. ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=latin1;
  10.  
  11. CREATE TABLE `categories` (
  12. `category_id` int(5) unsigned NOT NULL AUTO_INCREMENT,
  13. `category` varchar(64) NOT NULL,
  14. PRIMARY KEY (`category_id`),
  15. UNIQUE KEY `category_id` (`category_id`),
  16. ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=latin1;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement