Your Solution:
<code>Table Creation</code>
<pre lang="SQL">create table rating
(
rate_id INT,
rname varchar(30)
)
create table code_Review
(
pk_id INT,
code_reviewer INT,
rate INT
)
</pre>
<code>Insert Values</code>
<pre lang="SQL">
insert into rating values(1,'very good')
insert into rating values(2,'good')
insert into rating values(3,'bad')
insert into rating values(4,'very bad')
insert into code_review values(1,200,1)
insert into code_review values(2,200,1)
insert into code_review values(3,200,2)
insert into code_review values(4,200,2)
insert into code_review values(5,200,2)
insert into code_review values(6,200,2)
insert into code_review values(7,200,3)
insert into code_review values(8,200,3)
insert into code_review values(9,200,3)</pre>
<code>Finally your SQL Query</code>
<pre lang="sql">select count(cr.pk_id),r.rname
from rating r
left join code_review cr on cr.rate = r.rate_id and cr.code_reviewer = 200
group by r.rname,r.rate_id
order by r.rate_id
</pre>
<code>Result</code>
<pre>count rname
----------- ------------------------------
2 very good
4 good
3 bad
0 very bad</pre>