I have three tables. Which is in at this fiddle, http://sqlfiddle.com/#!9/46dfd6
Which is like this?.
CREATE TABLE `user_answers` ( `id` int(250) NOT NULL, `question_id` varchar(250) NOT NULL, `user_id` int(250) NOT NULL, `answer` text NOT NULL, `date` date NOT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1; CREATE TABLE `user_questions` ( `id` varchar(250) NOT NULL, `user_id` int(250) NOT NULL, `note_id` int(250) NOT NULL, `title` text NOT NULL, `question` text NOT NULL, `date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP ) ENGINE=MyISAM DEFAULT CHARSET=latin1; CREATE TABLE `material_univarcity_list` ( `id` int(100) NOT NULL, `name` varchar(50) NOT NULL, `about` mediumtext NOT NULL, `date` date NOT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1;
I want to get a resultant table which has count – Name(Name is from material_univarcity_list) Total number of questions to that particular name. Here id of material_univarcity_list
table is the note_id
of user_questions
and I want total number of answers to that particular catagory here question_id
is the id of user_questions
. How can I do this?
My expected result is like
no|catagory |number_of_questions |number_of_answers 1|DBMS 5th sem ISE| 2 | 3
How can i do this?