CREATE TABLE mcq_responses (
    mcq_response_id int NOT NULL,
	mcq_result_id int NOT NULL,
	mcq_question_id int NOT NULL,
	responses tinyint NOT NULL,
	CONSTRAINT PK_mcq_responses PRIMARY KEY
	(
		mcq_response_id
	),
	CONSTRAINT FK_mcq_response_to_objects FOREIGN KEY
	(
		mcq_response_id
	) REFERENCES objects (
		id
	),
	CONSTRAINT FK_mcq_response_to_results FOREIGN KEY
	(
		mcq_result_id
	) REFERENCES mcq_results (
		mcq_result_id
	),
	CONSTRAINT FK_mcq_response_to_questions FOREIGN KEY
	(
		mcq_question_id
	) REFERENCES mcq_questions (
		mcq_question_id
	)
)
GO


INSERT INTO classes (type, db_name, table_name, java_class)
	VALUES(32,	'building2', 'mcq_responses', 'org.bodington.assessment.McqResponse')
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(32, 1, 'mcq_response_id', 'setMcqResponseId', 'getMcqResponseId', '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(32, 2, 'mcq_result_id', 'setMcqResultId', 'getMcqResultId', '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(32, 3, 'mcq_question_id', 'setMcqQuestionId', 'getMcqQuestionId', '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(32, 4, 'responses', 'setResponses', 'getResponses', 'byte', 'byte', 0, null, null, null )
GO
