group result of multiple table to get unique result after count operation
I've modified your query and I used CASE statement to COUNT:

Query:

select 
    survey_categories.survey_cat_id,
    survey_question.ques_id,
    survey_details.store_id,
    count(CASE WHEN survey_details.answer = 'excellent' THEN 1 END) AS Excellent,
    count(CASE WHEN survey_details.answer = 'very Good' THEN 1 END) AS Very_Good, 
    count(CASE WHEN survey_details.answer = 'good' THEN 1 END) AS Good, 
    '' AS Average,
    count(CASE WHEN survey_details.answer = 'poor' THEN 1 END) AS Poor 
from survey_categories 
INNER JOIN survey_question ON survey_categories.survey_cat_id = survey_question.survey_cat_id
INNER JOIN survey_details ON survey_question.ques_id = survey_details.ques_id
group by survey_categories.survey_cat_id,survey_question.ques_id
order by ques_id,answer;


Test:

mysql&gt; select 
    -&gt; survey_categories.survey_cat_id,
    -&gt; survey_question.ques_id,
    -&gt; survey_details.store_id,
    -&gt; count(CASE WHEN survey_details.answer = 'excellent' THEN 1 END) AS Excellent,
    -&gt; count(CASE WHEN survey_details.answer = 'very Good' THEN 1 END) AS Very_Good, 
    -&gt; count(CASE WHEN survey_details.answer = 'good' THEN 1 END) AS Good, 
    -&gt; '' AS Average,
    -&gt; count(CASE WHEN survey_details.answer = 'poor' THEN 1 END) AS Poor 
    -&gt; from survey_categories 
    -&gt; INNER JOIN survey_question ON survey_categories.survey_cat_id = survey_question.survey_cat_id
    -&gt; INNER JOIN survey_details ON survey_question.ques_id = survey_details.ques_id
    -&gt; group by survey_categories.survey_cat_id,survey_question.ques_id
    -&gt; order by ques_id,answer;
+---------------+---------+----------+-----------+-----------+------+---------+------+
| survey_cat_id | ques_id | store_id | Excellent | Very_Good | Good | Average | Poor |
+---------------+---------+----------+-----------+-----------+------+---------+------+
|             1 |       1 |      102 |         2 |         0 |    0 |         |    0 |
|             1 |       2 |      102 |         0 |         2 |    0 |         |    0 |
|             1 |       3 |      102 |         0 |         0 |    0 |         |    0 |
|             2 |       4 |      102 |         0 |         2 |    0 |         |    0 |
|             2 |       5 |      102 |         0 |         0 |    0 |         |    2 |
|             3 |       6 |      102 |         2 |         0 |    0 |         |    0 |
|             3 |       7 |      102 |         0 |         0 |    0 |         |    0 |
+---------------+---------+----------+-----------+-----------+------+---------+------+
7 rows in set (0.00 sec)

mysql&gt; 


By the way, for AVG, what is your expected calculation against which fields?