Tried to check with only questions and choices by creating different dummy database
CREATE TABLE `questions` (
`question_id` int(5) unsigned NOT NULL AUTO_INCREMENT,
`question_text` varchar(255) NOT NULL,
`quiz_id` int(5) unsigned NOT NULL,
PRIMARY KEY (`question_id`),
KEY `quiz_id` (`quiz_id`)
) ENGINE=MyISAM AUTO_INCREMENT=5 DEFAULT CHARSET=latin1
CREATE TABLE `choices` (
`choice_id` int(5) unsigned NOT NULL AUTO_INCREMENT,
`choice` varchar(100) NOT NULL,
`FK_question_id` int(5) NOT NULL,
PRIMARY KEY (`choice_id`),
KEY `FK_question_id` (`FK_question_id`)
) ENGINE=MyISAM AUTO_INCREMENT=14 DEFAULT CHARSET=latin1
MySQL/dummy_quiz/
http://localhost/phpmyadmin/db_sql.php?db=dummy_quiz
Your browser has phpMyAdmin configuration for this domain. Would you like to import it for current session?
Yes
/ No
/ Delete settings
Your SQL query has been executed successfully.
explain select * from questions inner join choices on choices.FK_question_id = questions.question_id where quiz_id = 1
1 SIMPLE questions NULL ref PRIMARY,quiz_id quiz_id 4 const 1 100.00 NULL
1 SIMPLE choices NULL ref FK_question_id FK_question_id 4 dummy_quiz.questions.question_id 2 100.00 Using index condition
How does it work so good?
What is wrong with my multi-language design and query?