title: How to get count of State and city of country using SQL query from database?
body: <p>By running this query:</p>
  
  <pre><code>select 
      c.name, count(s.name) as statecount,  
      sum(count(ci.name)) OVER() AS citycount 
  from 
      countries c, states s, cities ci
  where 
      ci.state_id = s.id 
      and s.country_id = c.id 
  group by 
      s.name
  </code></pre>
  
  <p>I need to get an output in this style:</p>
  
  <pre><code>Country =&gt; statecount =&gt; citycount
  </code></pre>