CREATE VIEW scoring_quality_rate_view (
 user_id,
 participant_type,
 rate
) as
select scoring_amount.user_id AS user_id,
scoring_amount.participant_type AS participant_type,
(scoring_amount.total_scoring / scoring_count.count_scoring) AS rate
from ((
    (
        select scoring.user_id AS user_id,scoring.participant_type AS participant_type,scoring.scoring_type AS scoring_type,
            sum(scoring.scoring) AS total_scoring 
            from scoring 
        	where scoring.scoring_type = 3
        	group by scoring.user_id,scoring.participant_type,scoring.scoring_type
        	
    )
    )
     scoring_amount join (
                        select scoring.user_id AS user_id,scoring.participant_type AS participant_type,
                        scoring.scoring_type AS scoring_type,count(scoring.scoring) AS count_scoring 
                        from scoring where (scoring.scoring > 0) 
         				and scoring.scoring_type = 3 group by scoring.user_id,scoring.participant_type,scoring.scoring_type
                    )
      scoring_count on(
                            (
                                (scoring_amount.user_id = scoring_count.user_id) 
                                and (scoring_amount.participant_type = scoring_count.participant_type) 
                                and (scoring_amount.scoring_type = scoring_count.scoring_type)
                            )
                        )
    )
    where scoring_amount.scoring_type = 3