CREATE TABLE [dbo].[Questions] (
[QuestionID] INT NOT NULL,
[Question] NCHAR (300) NOT NULL,
[Choices] NCHAR [200] NOT NULL, -- something like this
[Answer] NCHAR (200) NOT NULL, -- one of the indexes in Choices
);
I have multiple choice questions that I am storing into a database, and I would like to keep all information grouped together in one table. The QuestionID and Question is not difficult, but I don't know how to set up some array of strings to store the possible answers (A: one, B: two, C: three, D: four) into the Choices column and to have the Answer column store a copy of the correct choice or the index of the correct choice (whichever is easier).
Many responses I've read quickly suggest that a text file would be easier, however, that is not something I want to do.
This is a personal project (not to be used in any real production), so it doesn't have to be secure or safe by any means. Any hack-y solutions that work are perfect.