A comprehensive MySQL and SQLite database containing the complete Quran text with multiple translations and editions.
| File | Format | Size | Description |
|---|---|---|---|
quran.sql.zip |
MySQL dump | ~187 MB uncompressed | Full database dump for MySQL |
quran.db.gz |
SQLite database | ~208 MB uncompressed | Full database for SQLite |
convert_to_sqlite.py |
Python script | — | Converts quran.sql to quran.db |
The actual schema (dynamically extracted from the MySQL dump):
surahsStores metadata for all 114 surahs.
| Column | Description |
|---|---|
id |
Surah number |
number |
Surah number |
name_ar |
Surah name in Arabic (e.g. الفاتحة) |
name_en |
Surah name transliterated (e.g. Al-Fatiha) |
name_en_translation |
English meaning (e.g. The Opening) |
type |
Revelation type (Meccan / Medinan) |
ayahsContains the original Arabic text of every ayah (6,236 verses).
| Column | Description |
|---|---|
id |
Unique ayah ID (1–6236) |
number |
Global ayah number |
text |
Ayah text in Arabic |
number_in_surah |
Ayah number within its surah |
page |
Mushaf page number |
surah_id |
Reference to surah |
hizb_id |
Reference to hizb (1–60) |
juz_id |
Reference to juz (1–30) |
sajda |
Prostration marker (0/1) — 15 ayahs |
editionsAvailable translations and editions (134 entries).
| Column | Description |
|---|---|
id |
Unique ID |
identifier |
Unique identifier (e.g. en.sahih) |
language |
Language code |
name |
Edition name in native language |
english_name |
Edition name in English |
format |
Format (text) |
type |
Type (translation, tafsir) |
ayah_editionAyah-by-ayah translations (835,624 rows — 6,236 ayahs × 134 editions).
| Column | Description |
|---|---|
id |
Unique ID |
ayah_id |
Reference to ayah |
edition_id |
Reference to edition |
data |
Translated/annotated text |
is_audio |
Audio flag |
juzs (SQLite only — new)30 juz (parts) with ayah ranges.
| Column | Description |
|---|---|
id |
Juz ID (1–30) |
juz_number |
Juz number |
name_ar |
Arabic name (e.g. الجزء الأول) |
start_ayah_id |
First ayah in this juz |
end_ayah_id |
Last ayah in this juz |
hizbs (SQLite only — new)60 hizbs (half-parts) with ayah ranges and juz references.
| Column | Description |
|---|---|
id |
Hizb ID (1–60) |
hizb_number |
Hizb number |
juz_id |
Parent juz |
name_ar |
Arabic name |
start_ayah_id |
First ayah in this hizb |
end_ayah_id |
Last ayah in this hizb |
Extract the SQL file:
bash
unzip quran.sql.zip
Import into MySQL:
bash
mysql -u <username> -p <database_name> < quran.sql
Extract the database:
bash
gunzip quran.db.gz
Open with any SQLite client:
bash
sqlite3 quran.db
Or use in Python:
python
import sqlite3
db = sqlite3.connect("quran.db")
# Get Surah Al-Fatiha
rows = db.execute("SELECT * FROM ayahs WHERE surah_id = 1").fetchall()
# Get ayah with translation
rows = db.execute("SELECT arabic, translation FROM ayah_with_translation WHERE surah_id = 1 AND language = 'en'").fetchall()
bash
unzip quran.sql.zip
python3 convert_to_sqlite.pyThe SQLite version adds:
- Proper foreign key constraints and CHECK constraints
- Indexes on commonly queried columns (surah_id, juz_id, hizb_id, page, number_in_surah, sajda)
- Pre-populated juzs and hizbs lookup tables with ayah ranges
- Views: surah_stats (ayat counts per surah), ayah_with_translation (joined ayah + translation)
We welcome contributions! Here's the planned roadmap for this project. Pick any item and submit a PR.
juz (parts) table with ayah rangeshizb and rub (quarter) divisionspages table (Mushaf page mapping)Contributions are welcome and encouraged! Here's how you can help:
git checkout -b feature/your-featuregit commit -m "Add your feature"git push origin feature/your-featureIf you're unsure where to start, look for items marked in the roadmap above or open an issue to discuss your idea.

This project is open source. The Quran text is in the public domain.
$ claude mcp add quran-database \
-- python -m otcore.mcp_server <graph>