Created
October 4, 2012 15:31
-
-
Save styliii/3834427 to your computer and use it in GitHub Desktop.
Setting up the Database
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE TABLE user ( | |
id INTEGER PRIMARY KEY, | |
first_name TEXT, | |
email TEXT | |
); | |
CREATE TABLE quiz ( | |
id INTEGER PRIMARY KEY, | |
user_id INTEGER, | |
name TEXT | |
); | |
CREATE TABLE question ( | |
id INTEGER PRIMARY KEY, | |
content TEXT | |
); | |
CREATE TABLE quiz_question ( | |
id INTEGER PRIMARY KEY, | |
quiz_id INTEGER, | |
question_id INTEGER | |
); | |
CREATE TABLE choice ( | |
id INTEGER PRIMARY KEY, | |
content TEXT, | |
question_id INTEGER, | |
correct BOOLEAN | |
); | |
CREATE TABLE answer ( | |
id INTEGER PRIMARY KEY, | |
user_id INTEGER, | |
question_id INTEGER, | |
choice_id INTEGER | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment