title: Calculation of Percentage for Rows within particular range
body: <p>I have a List of students name and Marks Stored in a table like below.</p>
  
  <pre><code>CREATE TABLE StudentsList(StudentId INT NOT NULL PRIMARY KEY AUTO_INCREMENT,
                                Name  VARCHAR(50),
                                Marks INT);
  
  
  INSERT INTO StudentsList(Name, Marks)
        VALUES('Student A', 20),
              ('Student B', 45),
              ('Student C', 90),
              ('Student D', 81),
              ('Student E', 50),
              ('Student F', 10),
              ('Student G', 85),
              ('Student H', 41),
              ('Student I', 66),
              ('Student J', 65),
              ('Student K', 05),
              ('Student L', 20),
              ('Student M', 19),
              ('Student N', 80),
              ('Student O', 90),
              ('Student P', 91),
              ('Student Q', 10),
              ('Student R', 29);
  </code></pre>
  
  <p>I want to Group the no of students based on the mark range and percentage they contribute in whole. </p>
  
  <pre><code>    MarkRange   NoOfStudents  Percentage
        0 - 20       4             22.22
       20 - 50       5             27.77  
       50 - 70       3             16.66 
       70 - 90       3             16.66  
       90            3             16.66 
  </code></pre>
  
  <p>I Tried the Below Query and Brought the Result for Students between 0 -20</p>
  
  <pre><code>SELECT COUNT(*) , COUNT(*)/(T.total)* 100
    FROM StudentsList,
         (SELECT COUNT(*) AS total 
            FROM StudentsList) AS T 
           WHERE Marks &gt;= 0 and  Marks &lt; 20
  </code></pre>
  
  <p>How can I do this by using single Query</p>