CREATE TABLE mcq_questions (
	mcq_question_id int NOT NULL ,
	resource_id int NOT NULL ,
	question_big_string_id int NOT NULL ,
	explanation_big_string_id int NOT NULL ,
	statement_a_big_string_id int NOT NULL ,
	statement_b_big_string_id int NOT NULL ,
	statement_c_big_string_id int NOT NULL ,
	statement_d_big_string_id int NOT NULL ,
	statement_e_big_string_id int NOT NULL ,
	ordinal int NOT NULL,
	flags tinyint NOT NULL,
	answers tinyint NOT NULL,
	CONSTRAINT PK_mcq_questions PRIMARY KEY
	(
		mcq_question_id
	),
	CONSTRAINT FK_mcq_questions_to_objects FOREIGN KEY
	(
		mcq_question_id
	) REFERENCES objects (
		id
	),
	CONSTRAINT FK_questions_to_resources FOREIGN KEY
	(
		resource_id
	) REFERENCES resources (
		resource_id
	),
	CONSTRAINT FK_q_to_big_strings FOREIGN KEY
	(
		question_big_string_id
	) REFERENCES big_strings (
		big_string_id
	),
	CONSTRAINT FK_e_to_big_strings FOREIGN KEY
	(
		explanation_big_string_id
	) REFERENCES big_strings (
		big_string_id
	),
	CONSTRAINT FK_sa_to_big_strings FOREIGN KEY
	(
		statement_a_big_string_id
	) REFERENCES big_strings (
		big_string_id
	),
	CONSTRAINT FK_sb_to_big_strings FOREIGN KEY
	(
		statement_b_big_string_id
	) REFERENCES big_strings (
		big_string_id
	),
	CONSTRAINT FK_sc_to_big_strings FOREIGN KEY
	(
		statement_c_big_string_id
	) REFERENCES big_strings (
		big_string_id
	),
	CONSTRAINT FK_sd_to_big_strings FOREIGN KEY
	(
		statement_d_big_string_id
	) REFERENCES big_strings (
		big_string_id
	),
	CONSTRAINT FK_se_to_big_strings FOREIGN KEY
	(
		statement_e_big_string_id
	) REFERENCES big_strings (
		big_string_id
	)
)
GO


INSERT INTO classes (type, db_name, table_name, java_class)
	VALUES(30,	'building2', 'mcq_questions', 'org.bodington.assessment.McqQuestion')
GO

INSERT INTO fields (type, sequence, field, set_method_name, get_method_name, set_java_class, get_java_class, flags, foreign_type, set_method_name_foreign, get_method_name_foreign )
	VALUES(30, 1, 'mcq_question_id', 'setMcqQuestionId', 'getMcqQuestionId', 'org.bodington.database.PrimaryKey', 'org.bodington.database.PrimaryKey', 1, null, null, null )
GO

INSERT INTO fields (type, sequence, field, set_method_name, get_method_name, set_java_class, get_java_class, flags, foreign_type, set_method_name_foreign, get_method_name_foreign )
	VALUES(30, 2, 'resource_id', 'setResourceId', 'getResourceId', 'org.bodington.database.PrimaryKey', 'org.bodington.database.PrimaryKey', 0, null, null, null )
GO

INSERT INTO fields (type, sequence, field, set_method_name, get_method_name, set_java_class, get_java_class, flags, foreign_type, set_method_name_foreign, get_method_name_foreign )
	VALUES(30, 3, 'question_big_string_id', 'setQuestionBigStringId', 'getQuestionBigStringId', 'org.bodington.database.PrimaryKey', 'org.bodington.database.PrimaryKey', 0, null, null, null )
GO

INSERT INTO fields (type, sequence, field, set_method_name, get_method_name, set_java_class, get_java_class, flags, foreign_type, set_method_name_foreign, get_method_name_foreign )
	VALUES(30, 4, 'explanation_big_string_id', 'setExplanationBigStringId', 'getExplanationBigStringId', 'org.bodington.database.PrimaryKey', 'org.bodington.database.PrimaryKey', 0, null, null, null )
GO

INSERT INTO fields (type, sequence, field, set_method_name, get_method_name, set_java_class, get_java_class, flags, foreign_type, set_method_name_foreign, get_method_name_foreign )
	VALUES(30, 5, 'statement_a_big_string_id', 'setStatementABigStringId', 'getStatementABigStringId', 'org.bodington.database.PrimaryKey', 'org.bodington.database.PrimaryKey', 0, null, null, null )
GO

INSERT INTO fields (type, sequence, field, set_method_name, get_method_name, set_java_class, get_java_class, flags, foreign_type, set_method_name_foreign, get_method_name_foreign )
	VALUES(30, 6, 'statement_b_big_string_id', 'setStatementBBigStringId', 'getStatementBBigStringId', 'org.bodington.database.PrimaryKey', 'org.bodington.database.PrimaryKey', 0, null, null, null )
GO

INSERT INTO fields (type, sequence, field, set_method_name, get_method_name, set_java_class, get_java_class, flags, foreign_type, set_method_name_foreign, get_method_name_foreign )
	VALUES(30, 7, 'statement_c_big_string_id', 'setStatementCBigStringId', 'getStatementCBigStringId', 'org.bodington.database.PrimaryKey', 'org.bodington.database.PrimaryKey', 0, null, null, null )
GO

INSERT INTO fields (type, sequence, field, set_method_name, get_method_name, set_java_class, get_java_class, flags, foreign_type, set_method_name_foreign, get_method_name_foreign )
	VALUES(30, 8, 'statement_d_big_string_id', 'setStatementDBigStringId', 'getStatementDBigStringId', 'org.bodington.database.PrimaryKey', 'org.bodington.database.PrimaryKey', 0, null, null, null )
GO

INSERT INTO fields (type, sequence, field, set_method_name, get_method_name, set_java_class, get_java_class, flags, foreign_type, set_method_name_foreign, get_method_name_foreign )
	VALUES(30, 9, 'statement_e_big_string_id', 'setStatementEBigStringId', 'getStatementEBigStringId', 'org.bodington.database.PrimaryKey', 'org.bodington.database.PrimaryKey', 0, null, null, null )
GO

INSERT INTO fields (type, sequence, field, set_method_name, get_method_name, set_java_class, get_java_class, flags, foreign_type, set_method_name_foreign, get_method_name_foreign )
	VALUES(30, 10, 'ordinal', 'setOrdinal', 'getOrdinal', 'int', 'int', 0, null, null, null )
GO

INSERT INTO fields (type, sequence, field, set_method_name, get_method_name, set_java_class, get_java_class, flags, foreign_type, set_method_name_foreign, get_method_name_foreign )
	VALUES(30, 11, 'flags', 'setFlags', 'getFlags', 'byte', 'byte', 0, null, null, null )
GO

INSERT INTO fields (type, sequence, field, set_method_name, get_method_name, set_java_class, get_java_class, flags, foreign_type, set_method_name_foreign, get_method_name_foreign )
	VALUES(30, 12, 'answers', 'setAnswers', 'getAnswers', 'byte', 'byte', 0, null, null, null )
GO


