Advertisement
Guest User

Untitled

a guest
Dec 12th, 2017
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.13 KB | None | 0 0
  1. drop database if exists entechnic;
  2. create database entechnic;
  3.  
  4. use entechnic;
  5.  
  6. CREATE TABLE IF NOT EXISTS mult_choice_questions (
  7. id int auto_increment primary key,
  8. question varchar(256) not null,
  9. a varchar(256) not null,
  10. b varchar(256) not null,
  11. c varchar(256) not null,
  12. d varchar(256) not null,
  13. correct char(1) not null
  14. );
  15.  
  16. CREATE TABLE IF NOT EXISTS gap_questions (
  17. id int auto_increment primary key
  18. );
  19.  
  20. CREATE TABLE IF NOT EXISTS gaps (
  21. id int auto_increment primary key,
  22. gap_question_id int not null,
  23. foreign key(gap_question_id) references gap_questions(id),
  24. content varchar(256) not null,
  25. is_gap bool
  26. );
  27.  
  28. insert into mult_choice_questions values
  29. (null, 'Question content asasas?', 'a answer', 'b answer', 'c answer', 'd answer', 'a'),
  30. (null, 'Question content second?', 'a aaaaanswer', 'b bbanswer', 'c ccanswer', 'd ddanswer', 'a');
  31.  
  32. insert into gap_questions values
  33. (null),
  34. (null);
  35.  
  36. insert into gaps values
  37. (null, 1, 'First part', false),
  38. (null, 1, 'first gap', true),
  39. (null, 1, '2nd part', false),
  40. (null, 1, '2nd gap', true),
  41. (null, 1, 'third part', false);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement