sql/queries: add chapter-count-by-city.sql

This commit is contained in:
0x1eef 2022-09-02 15:46:16 -03:00
parent fb38880cbc
commit fb519c9304

View file

@ -0,0 +1,22 @@
-- | DESCRIPTION
--
-- This query groups the number of chapters to one of two
-- cities they were revealed in: either Makkah, or Medina.
--
-- | EXAMPLE RESULT SET
--
-- city chapters
-- ------- --------
-- Madinah 28
-- Makkah 86
SELECT
chapters.city,
COUNT(chapters.city) AS chapters
from
chapters
where
chapters.quran_id = 1
GROUP BY
chapters.city;