Skip to content

Instantly share code, notes, and snippets.

Created August 30, 2013 17:23
Show Gist options
  • Save anonymous/6392247 to your computer and use it in GitHub Desktop.
Save anonymous/6392247 to your computer and use it in GitHub Desktop.
Insert list of id's (SQL)
CREATE TABLE Question (
QuestionID INT auto_increment PRIMARY KEY
, QuestionText varchar(50)
);
CREATE TABLE Answer (
AnswerID INT auto_increment PRIMARY KEY
, QuestionID INT
, AnswerText varchar(50)
);
INSERT INTO Question ( QuestionText )
VALUES ('Question 1'), ('Question 2');
INSERT INTO Answer ( QuestionID, AnswerText )
VALUES (1, 'Answer 1'), (2, 'Answer 2');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment