-
-
Save LaurMo/5621616 to your computer and use it in GitHub Desktop.
CREATE TABLE users ( | |
id integer PRIMARY KEY, | |
name string, | |
email string | |
); | |
CREATE TABLE questions ( | |
id integer PRIMARY KEY, | |
question varchar, | |
user_id integer | |
); | |
CREATE TABLE comments ( | |
id integer PRIMARY KEY, | |
comment varchar, | |
user_id integer, | |
question_id integer, | |
comment_id integer | |
); | |
CREATE TABLE votes ( | |
id integer PRIMARY KEY, | |
comments CHECK (boolean), | |
comment_id integer, | |
user_id integer | |
); |
CREATE TABLE users (
id integer PRIMARY KEY,
name varchar,
email varchar
);
INSERT INTO users (id, name, email) VALUES
(1, 'Lauren', 'lmo2u@aol.com'),
(2, 'LMo', 'lauren.mosenthal@gmail.com'),
(3, 'Mo', 'lauren.mosenthal@colorado.edu');
CREATE TABLE questions (
id integer PRIMARY KEY,
question varchar,
user_id integer
);
INSERT INTO questions (id, question, user_id) VALUES
(1, 'why',1),
(2, 'who',1),
(3, 'what', 2);
CREATE TABLE comments (
id integer PRIMARY KEY,
comment varchar,
user_id integer,
question_id integer,
comment_id integer
);
INSERT INTO comments (id, comment, user_id, question_id, comment_id) VALUES
(1, 'millennials comment',1,2,3),
(2, 'comment from millennial',2,3,1),
(3, 'comment comment',2,2,3);
CREATE TABLE votes (
id integer PRIMARY KEY,
sentiment boolean
comment_id integer,
user_id integer
);
INSERT INTO votes (id, sentiment, comment_id, user_id) VALUES
(1, 't' ,1,2),
(2, 'f',1,2),
(3, 't',2,3);
CREATE TABLE users (
id integer PRIMARY KEY,
name varchar,
email varchar
);
INSERT INTO users (id, name, email) VALUES
(1, 'Lauren', 'lmo2u@aol.com'),
(2, 'LMo', 'lauren.mosenthal@gmail.com'),
(3, 'Mo', 'lauren.mosenthal@colorado.edu');
CREATE TABLE questions (
id integer PRIMARY KEY,
question varchar,
user_id integer
);
INSERT INTO questions (id, questions, user_id) VALUES
(1, 'why',1),
(2, 'who',1),
(3, 'what', 2);
CREATE TABLE comments (
id integer PRIMARY KEY,
comment varchar,
user_id integer,
question_id integer,
comment_id integer
);
INSERT INTO comments (id, comment, user_id, question_id, comment_id) VALUES
(1, 'millennials comment',1,2,3),
(2, 'comment from millennial',2,3,1),
(3, 'comment comment',2,2,3);
CREATE TABLE votes (
id integer PRIMARY KEY,
sentiment boolean
comment_id integer,
user_id integer
);
INSERT INTO votes (id, sentiment, comment_id, user_id) VALUES
(1, t ,1,2),
(2, f,1,2),
(3, t,2,3);