Why this query giving wrong output? I want to find review group by ratings 1,2 etc and for doing so i write below query but this giving wrong info.

This is the query:

SELECT CASE ur.rating
           WHEN ur.rating between 0.5 and 1 THEN 1
           WHEN ur.rating between 1.5 and 2 THEN 2
           WHEN ur.rating between 2.5 and 3 THEN 3
           WHEN ur.rating between 3.5 and 4 THEN 4
           WHEN (ur.rating between 4.5 and 5) THEN 5
           END As 'ratings',
       count(ur.rating)
from user_review ur
group by ratings;


That is output:

+---------+------------------+
| ratings | count(ur.rating) |
+---------+------------------+
|    NULL |               10 |
|       1 |                1 |
+---------+------------------+


My accepted output will be like below:

+---------+------------------+
| ratings | count(ur.rating) |
+---------+------------------+
|       1 |                2 |
|       2 |                2 |
|       3 |                2 |
|       4 |                2 |
|       5 |                3 |
+---------+------------------+


Below is my user_review table with demo data:

+----+--------+---------+--------+---------------------+---------------+
| id | userId | giverId | rating | date                | comments      |
+----+--------+---------+--------+---------------------+---------------+
|  2 |      1 |       3 |      5 | 2019-07-21 00:00:28 | update test 1 |
|  3 |      1 |       2 |      3 | 2019-07-21 02:41:56 | test it       |
|  4 |      1 |       3 |    3.5 | 2019-07-21 02:42:16 | test it       |
|  5 |      1 |       4 |      4 | 2019-07-21 02:42:21 | test it       |
|  6 |      1 |       5 |    4.5 | 2019-07-21 02:42:27 | test it       |
|  7 |      1 |       6 |      5 | 2019-07-21 02:42:36 | test it       |
|  8 |      1 |       7 |      1 | 2019-07-21 02:42:41 | test it       |
|  9 |      1 |       8 |    1.5 | 2019-07-21 02:42:47 | test it       |
| 10 |      1 |       9 |      2 | 2019-07-21 02:42:57 | test it       |
| 11 |      1 |      10 |    2.5 | 2019-07-21 02:43:08 | test it       |
| 12 |      1 |      12 |    0.5 | 2019-07-21 02:49:32 | test it       |
+----+--------+---------+--------+---------------------+---------------+


I also tried below query it also give same output :

SELECT count(CASE ur.rating WHEN ur.rating between .5 and 1 THEN 1 end) as '1',
       count(CASE ur.rating WHEN ur.rating between 1.5 and 2 THEN 1 end)   '2',
       count(CASE ur.rating WHEN ur.rating between 2.5 and 3 THEN 1 end)   '3',
       count(CASE ur.rating WHEN ur.rating between 3.5 and 4 THEN 1 end)   '4',
       count(CASE ur.rating WHEN ur.rating between 4.5 and 5 THEN 1 end)   '5',
       count(*)
from user_review ur;



  Whats the wrong with my Query? why its not working properly?
You don't need the long CASE, use MySQL's CEILING function - https://dev.mysql.com/doc/refman/8.0/en/mathematical-functions.html#function_ceiling
What is the data type for the rating column? My guess is that it's a FLOAT, and being an approximate, your actual values fall within the ranges that aren't covered by the CASE , 2.00001 for example. Change it to DECIMAL to avoid similar issues.
When using CASE, it's a good idea to always include an ELSE clause. Try adding ELSE -1  or other value just to troubleshoot this issue, and you will see for yourself.

HTH
UPDATE - I stand partly corrected. While my answer and points are still valid, I believe that @RickJames and @RolaondoMySQLDBA were right for this case as well.
According to IEEE 754 these number do happen to have exact representation as FLOAT, and the problem was your CASE. Using CEILING is better than CASE and IF for this, but to understand the root issue see @RolandoMySQLDBA Answer below, and @RickJames comments.
UPDATE 2019-07-21 18:03 EDT (RolandoMySQLDBA)
In all fairness, CEILING() does make the most sense.
I ran this
SELECT CEILING(rating) ratings,COUNT(1)
FROM user_review GROUP BY CEILING(rating);

on the sample data and got this
mysql&gt; SELECT CEILING(rating) ratings,COUNT(1)
    -&gt; FROM user_review GROUP BY CEILING(rating);
+---------+----------+
| ratings | COUNT(1) |
+---------+----------+
|       5 |        3 |
|       3 |        2 |
|       4 |        2 |
|       1 |        2 |
|       2 |        2 |
+---------+----------+
5 rows in set (0.00 sec)

So, CEILING() is the most concise in this case. +1 to you !!!