Dataset Preview
Duplicate
The full dataset viewer is not available (click to read why). Only showing a preview of the rows.
The dataset generation failed because of a cast error
Error code:   DatasetGenerationCastError
Exception:    DatasetGenerationCastError
Message:      An error occurred while generating the dataset

All the data files must have the same columns, but at some point there are 1 new columns ({'db_size'})

This happened while the csv dataset builder was generating data using

hf://datasets/salmane11/Dialect2SQL/train.csv (at revision 6b0cd8242dd19b267a39530c3853fd76eb22a0e9)

Please either edit the data files to have matching columns, or separate them into different configurations (see docs at https://hf.co/docs/hub/datasets-manual-configuration#multiple-configurations)
Traceback:    Traceback (most recent call last):
                File "/usr/local/lib/python3.12/site-packages/datasets/builder.py", line 1831, in _prepare_split_single
                  writer.write_table(table)
                File "/usr/local/lib/python3.12/site-packages/datasets/arrow_writer.py", line 714, in write_table
                  pa_table = table_cast(pa_table, self._schema)
                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                File "/usr/local/lib/python3.12/site-packages/datasets/table.py", line 2272, in table_cast
                  return cast_table_to_schema(table, schema)
                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                File "/usr/local/lib/python3.12/site-packages/datasets/table.py", line 2218, in cast_table_to_schema
                  raise CastError(
              datasets.table.CastError: Couldn't cast
              db_id: string
              question: string
              darija_question: string
              evidence: string
              SQL: string
              schema: string
              db_size: int64
              -- schema metadata --
              pandas: '{"index_columns": [{"kind": "range", "name": null, "start": 0, "' + 1063
              to
              {'db_id': Value('string'), 'question': Value('string'), 'darija_question': Value('string'), 'evidence': Value('string'), 'SQL': Value('string'), 'schema': Value('string')}
              because column names don't match
              
              During handling of the above exception, another exception occurred:
              
              Traceback (most recent call last):
                File "/src/services/worker/src/worker/job_runners/config/parquet_and_info.py", line 1339, in compute_config_parquet_and_info_response
                  parquet_operations = convert_to_parquet(builder)
                                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^
                File "/src/services/worker/src/worker/job_runners/config/parquet_and_info.py", line 972, in convert_to_parquet
                  builder.download_and_prepare(
                File "/usr/local/lib/python3.12/site-packages/datasets/builder.py", line 894, in download_and_prepare
                  self._download_and_prepare(
                File "/usr/local/lib/python3.12/site-packages/datasets/builder.py", line 970, in _download_and_prepare
                  self._prepare_split(split_generator, **prepare_split_kwargs)
                File "/usr/local/lib/python3.12/site-packages/datasets/builder.py", line 1702, in _prepare_split
                  for job_id, done, content in self._prepare_split_single(
                                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^
                File "/usr/local/lib/python3.12/site-packages/datasets/builder.py", line 1833, in _prepare_split_single
                  raise DatasetGenerationCastError.from_cast_error(
              datasets.exceptions.DatasetGenerationCastError: An error occurred while generating the dataset
              
              All the data files must have the same columns, but at some point there are 1 new columns ({'db_size'})
              
              This happened while the csv dataset builder was generating data using
              
              hf://datasets/salmane11/Dialect2SQL/train.csv (at revision 6b0cd8242dd19b267a39530c3853fd76eb22a0e9)
              
              Please either edit the data files to have matching columns, or separate them into different configurations (see docs at https://hf.co/docs/hub/datasets-manual-configuration#multiple-configurations)

Need help to make the dataset viewer work? Make sure to review how to configure the dataset viewer, and open a discussion for direct support.

db_id
string
question
string
darija_question
string
evidence
string
SQL
string
schema
string
video_games
List down at least five publishers of the games with number of sales less than 10000.
يمكن لك تذكر لي خمسة ديال الناشرين ديال الألعاب اللي تباعو قل من 10000 مرة.
publishers refers to publisher_name; number of sales less than 10000 refers to num_sales < 0.1;
SELECT T.publisher_name FROM ( SELECT DISTINCT T5.publisher_name FROM region AS T1 INNER JOIN region_sales AS T2 ON T1.id = T2.region_id INNER JOIN game_platform AS T3 ON T2.game_platform_id = T3.id INNER JOIN game_publisher AS T4 ON T3.game_publisher_id = T4.id INNER JOIN publisher AS T5 ON T4.publisher_id = T5.id WHE...
CREATE TABLE genre ( id INTEGER not null primary key, genre_name TEXT default NULL ); CREATE TABLE game ( id INTEGER not null primary key, genre_id INTEGER default NULL, game_name TEXT default NULL, foreign key (genre_id) references genre(id) ); C...
retail_complains
What is the full address of the customers who, having received a timely response from the company, have dispute about that response?
شنو هو العنوان الكامل ديال الكليان اللي، بعد ما وصلهوم الجواب فالوقت من الشركة، ماعجبهمش داك الجواب؟
full address = address_1, address_2; received a timely response refers to Timely response? = 'Yes'; have dispute refers to "Consumer disputed?" = 'Yes';
SELECT T1.address_1, T1.address_2 FROM client AS T1 INNER JOIN events AS T2 ON T1.client_id = T2.Client_ID WHERE T2.`Timely response?` = 'Yes' AND T2.`Consumer disputed?` = 'Yes'
CREATE TABLE state ( StateCode TEXT constraint state_pk primary key, State TEXT, Region TEXT ); CREATE TABLE callcenterlogs ( "Date received" DATE, "Complaint ID" TEXT, "rand client" TEXT, phonefinal TEXT, "vru+line" TEXT, call_id INTEG...
disney
How many movies did Wolfgang Reitherman direct?
شحال من فيلم دار الإخراج ديالو "Wolfgang Reitherman"؟
Wolfgang Reitherman refers director = 'Wolfgang Reitherman';
SELECT COUNT(name) FROM director WHERE director = 'Wolfgang Reitherman'
CREATE TABLE characters ( movie_title TEXT primary key, release_date TEXT, hero TEXT, villian TEXT, song TEXT, foreign key (hero) references "voice-actors"(character) ); CREATE TABLE director ( name TEXT primary key, director TEXT, fo...
legislator
How many legislators are not senator?
شحال من مشرع ماشي سيناتور؟
not senator refers to class is null;
SELECT COUNT(bioguide) FROM `current-terms` WHERE class IS NULL
CREATE TABLE current ( ballotpedia_id TEXT, bioguide_id TEXT, birthday_bio DATE, cspan_id REAL, fec_id TEXT, first_name TEXT, gender_bio TEXT, google_entity_id_id TEXT, govtrack_id INTEGER, house_history_id ...
food_inspection_2
How many inspections done by Lisa Tillman ended up with the result of "Out of Business"?
شحال من تفتيش دارت "Lisa Tillman" اللي النتيجة ديالو كانت "Out of Business"؟
the result of "Out of Business" refers to results = 'Out of Business'
SELECT COUNT(T1.inspection_id) FROM inspection AS T1 INNER JOIN employee AS T2 ON T1.employee_id = T2.employee_id WHERE T2.first_name = 'Lisa' AND T2.last_name = 'Tillman' AND T1.results = 'Out of Business'
CREATE TABLE employee ( employee_id INTEGER primary key, first_name TEXT, last_name TEXT, address TEXT, city TEXT, state TEXT, zip INTEGER, phone TEXT, title TEXT, salary INTEGER, supervisor INTEGER, foreign key (s...
mondial_geo
In which group of islands is Rinjani Mountain located?
فأي مجموعة ديال الجزر كاين جبل "Rinjani"؟
null
SELECT T1.Islands FROM island AS T1 INNER JOIN mountainOnIsland AS T2 ON T1.Name = T2.Island INNER JOIN mountain AS T3 ON T3.Name = T2.Mountain WHERE T3.Name = 'Rinjani'
CREATE TABLE IF NOT EXISTS "borders" ( Country1 TEXT default '' not null constraint borders_ibfk_1 references country, Country2 TEXT default '' not null constraint borders_ibfk_2 references country, Length REAL, primary key (Country1, Country2) ); CREATE TABLE I...
shakespeare
Give the character's ID of the character that said the paragraph "O my poor brother! and so perchance may he be."
عطيني الهوية ديال الشخصية اللي قالت "O my poor brother! and so perchance may he be."
"O my poor brother! and so perchance may he be." refers to  PlainText = 'O my poor brother! and so perchance may he be.'
SELECT character_id FROM paragraphs WHERE PlainText = 'O my poor brother! and so perchance may he be.'
CREATE TABLE IF NOT EXISTS "chapters" ( id INTEGER primary key autoincrement, Act INTEGER not null, Scene INTEGER not null, Description TEXT not null, work_id INTEGER not null references works ); CREATE TABLE sqlite_sequence(name,seq); CREATE TABLE IF NO...
food_inspection_2
Calculate the average salary for employees who did inspection on License Re-Inspection.
حسب السالير المتوسط ديال الموظفين اللي دارو التفتيش على إعادة فحص الرخصة.
inspection on License Re-Inspection refers to inspection_type = 'License Re-Inspection'; average salary = avg(salary)
SELECT AVG(T2.salary) FROM inspection AS T1 INNER JOIN employee AS T2 ON T1.employee_id = T2.employee_id WHERE T1.inspection_type = 'License Re-Inspection'
CREATE TABLE employee ( employee_id INTEGER primary key, first_name TEXT, last_name TEXT, address TEXT, city TEXT, state TEXT, zip INTEGER, phone TEXT, title TEXT, salary INTEGER, supervisor INTEGER, foreign key (s...
movie_3
Give the full name of the actor with the highest rental rate.
عطيني الاسم الكامل ديال الممثل لي عندو أعلى معدل ديال الكرا.
full name refers to first_name, last_name; the highest rental rate refers to max(rental_rate)
SELECT T1.first_name, T1.last_name FROM actor AS T1 INNER JOIN film_actor AS T2 ON T1.actor_id = T2.actor_id INNER JOIN film AS T3 ON T3.film_id = T2.film_id ORDER BY T3.rental_rate DESC LIMIT 1
CREATE TABLE film_text ( film_id INTEGER not null primary key, title TEXT not null, description TEXT null ); CREATE TABLE IF NOT EXISTS "actor" ( actor_id INTEGER primary key autoincrement, first_name TEXT not null, last_nam...
car_retails
From which branch does the sales representative employee who made the most sales in 2005? Please indicates its full address and phone number.
فاينا فرع كيخدم الموظف الممثل المبيعات لي دار أكثر المبيعات فـ 2005؟ عفاك عطني العنوان الكامل ديال الفرع ورقم الهاتف ديالو.
orderDate between '2005-01-01' and '2005-12-31'; full address = addressLine1+addressLine2;
SELECT T3.addressLine1, T3.addressLine2, T3.phone FROM orderdetails AS T1 INNER JOIN orders AS T2 ON T1.orderNumber = T2.orderNumber INNER JOIN customers AS T3 ON T2.customerNumber = T3.customerNumber INNER JOIN employees AS T4 ON T3.salesRepEmployeeNumber = T4.employeeNumber INNER JOIN offices AS T5 ON T4.officeCode =...
CREATE TABLE offices ( officeCode TEXT not null primary key, city TEXT not null, phone TEXT not null, addressLine1 TEXT not null, addressLine2 TEXT, state TEXT, country TEXT not null, postalCode TEXT not null, territory TEXT not null ); CREATE...
food_inspection
Provide the name of the business which had the most number of inspections because of complaint.
عطيني السمية ديال المحل اللي تعرض لأكبر عدد من التفتيشات بسبب الشكاوي.
the most number of inspections because of complaint refers to type = 'Complaint' where MAX(business_id);
SELECT T2.name FROM inspections AS T1 INNER JOIN businesses AS T2 ON T1.business_id = T2.business_id WHERE T1.type = 'Complaint' GROUP BY T2.name ORDER BY COUNT(T1.business_id) DESC LIMIT 1
CREATE TABLE `businesses` ( `business_id` INTEGER NOT NULL, `name` TEXT NOT NULL, `address` TEXT DEFAULT NULL, `city` TEXT DEFAULT NULL, `postal_code` TEXT DEFAULT NULL, `latitude` REAL DEFAULT NULL, `longitude` REAL DEFAULT NULL, `phone_number` INTEGER DEFAULT NULL, `tax_code` TEXT DEFAULT NULL, `b...
superstore
What are the names of the products that were ordered by Alejandro Grove?
شنو هوما السميات ديال المنتجات اللي طلبهم Alejandro Grove؟
ordered by Alejandro Grove refers to "Customer Name" = 'Alejandro Grove'; names of the products refers to "Product Name"
SELECT DISTINCT T3.`Product Name` FROM west_superstore AS T1 INNER JOIN people AS T2 ON T1.`Customer ID` = T2.`Customer ID` INNER JOIN product AS T3 ON T3.`Product ID` = T1.`Product ID` WHERE T2.`Customer Name` = 'Alejandro Grove'
CREATE TABLE people ( "Customer ID" TEXT, "Customer Name" TEXT, Segment TEXT, Country TEXT, City TEXT, State TEXT, "Postal Code" INTEGER, Region TEXT, primary key ("Customer ID", Region) ); CREATE TABLE product ( "Product ID" TE...
regional_sales
Name the product that was registered in the sales order 'SO - 0005951'.
سميلي المنتج اللي كان مسجل فـ أمر البيع 'SO - 0005951'.
sales order 'SO - 0005951' refers to OrderNumber = 'SO - 0005951'; product refers to Product Name
SELECT T FROM ( SELECT DISTINCT CASE WHEN T2.OrderNumber = 'SO - 0005951' THEN T1.`Product Name` ELSE NULL END AS T FROM Products T1 INNER JOIN `Sales Orders` T2 ON T2._ProductID = T1.ProductID ) WHERE T IS NOT NULL
CREATE TABLE Customers ( CustomerID INTEGER constraint Customers_pk primary key, "Customer Names" TEXT ); CREATE TABLE Products ( ProductID INTEGER constraint Products_pk primary key, "Product Name" TEXT ); CREATE TABLE Regions ( StateCode TEXT ...
talkingdata
How many app IDs were included under science fiction category?
شحال ديال التطبيقات اللي كانو مصنفين ففئة الخيال العلمي؟
null
SELECT COUNT(T2.app_id) FROM label_categories AS T1 INNER JOIN app_labels AS T2 ON T2.label_id = T1.label_id WHERE T1.category = 'science fiction'
CREATE TABLE `app_all` ( `app_id` INTEGER NOT NULL, PRIMARY KEY (`app_id`) ); CREATE TABLE `app_events` ( `event_id` INTEGER NOT NULL, `app_id` INTEGER NOT NULL, `is_installed` INTEGER NOT NULL, `is_active` INTEGER NOT NULL, PRIMARY KEY (`event_id`,`app_id`), FOREIGN KEY (`event_id`) REFERENCES `eve...
video_games
How many games did BMG Interactive Entertainment release in 2012?
شحال من لعبة خرجات BMG Interactive Entertainment ف 2012؟
BMG Interactive Entertainment refers to publisher_name = 'BMG Interactive Entertainment'; release in 2012 refers to release_year = 2012;
SELECT COUNT(DISTINCT T2.game_id) FROM publisher AS T1 INNER JOIN game_publisher AS T2 ON T1.id = T2.publisher_id INNER JOIN game_platform AS T3 ON T2.id = T3.game_publisher_id WHERE T3.release_year = 2012
CREATE TABLE genre ( id INTEGER not null primary key, genre_name TEXT default NULL ); CREATE TABLE game ( id INTEGER not null primary key, genre_id INTEGER default NULL, game_name TEXT default NULL, foreign key (genre_id) references genre(id) ); C...
ice_hockey_draft
How many players were born in 1982 and have a height above 182cm?
شحال من لاعب تزاد فـ 1982 وعندو الطول كتر من 182سم؟
born in 1982 refers to birthyear = 1982; height above 182cm refers to height_in_cm > 182 ;
SELECT COUNT(T2.ELITEID) FROM height_info AS T1 INNER JOIN PlayerInfo AS T2 ON T1.height_id = T2.height WHERE T1.height_in_cm > 182 AND strftime('%Y', T2.birthdate) = '1982'
CREATE TABLE height_info ( height_id INTEGER primary key, height_in_cm INTEGER, height_in_inch TEXT ); CREATE TABLE weight_info ( weight_id INTEGER primary key, weight_in_kg INTEGER, weight_in_lbs INTEGER ); CREATE TABLE PlayerInfo ( ELITEID INTE...
works_cycles
What is the highest profit on net for a product?
شنو هو أعلى ربح صاف على منتوج؟
profit on net = subtract(LastReceiptCost, StandardPrice)
SELECT LastReceiptCost - StandardPrice FROM ProductVendor ORDER BY LastReceiptCost - StandardPrice DESC LIMIT 1
CREATE TABLE sqlite_sequence(name,seq); CREATE TABLE CountryRegion ( CountryRegionCode TEXT not null primary key, Name TEXT not null unique, ModifiedDate DATETIME default current_timestamp not null ); CREATE TABLE Culture ...
simpson_episodes
State the name of director for the 'Treehouse of Horror XIX' episode.
واش يمكن ليك تقولي شكون هو المخرج ديال الحلقة "Treehouse of Horror XIX"؟
"Treehouse of Horror XIX" is the title of episode; 'director' is the role of person; name refers to person
SELECT T2.person FROM Episode AS T1 INNER JOIN Credit AS T2 ON T1.episode_id = T2.episode_id WHERE T1.title = 'Treehouse of Horror XIX' AND T2.role = 'director';
CREATE TABLE IF NOT EXISTS "Episode" ( episode_id TEXT constraint Episode_pk primary key, season INTEGER, episode INTEGER, number_in_series INTEGER, title TEXT, summary TEXT, air_date TEXT, episode_image TEXT, ...
movies_4
How many female characters are there in the movie "Spider-Man 3"?
شحال من شخصية نسائية كاينة فالفيلم "Spider-Man 3"؟
female characters refer to gender = 'Female'; "Spider-Man 3" refers to title = 'Spider-Man 3'
SELECT COUNT(*) FROM movie AS T1 INNER JOIN movie_cast AS T2 ON T1.movie_id = T2.movie_id INNER JOIN gender AS T3 ON T2.gender_id = T3.gender_id WHERE T1.title = 'Spider-Man 3' AND T3.gender = 'Female'
CREATE TABLE country ( country_id INTEGER not null primary key, country_iso_code TEXT default NULL, country_name TEXT default NULL ); CREATE TABLE department ( department_id INTEGER not null primary key, department_name TEXT default NULL ); CREATE TABLE gender ( ...
food_inspection_2
List down the dba name of restaurants that were inspected due to license.
عطيني السميات ديال لي ريسطو اللي تفتشو بسباب الرخصة
inspected due to license refers to inspection_type = 'License'
SELECT T1.dba_name FROM establishment AS T1 INNER JOIN inspection AS T2 ON T1.license_no = T2.license_no WHERE T2.inspection_type = 'License'
CREATE TABLE employee ( employee_id INTEGER primary key, first_name TEXT, last_name TEXT, address TEXT, city TEXT, state TEXT, zip INTEGER, phone TEXT, title TEXT, salary INTEGER, supervisor INTEGER, foreign key (s...
cars
Which country produced the car with the lowest price?
شنو هي البلاد اللي صنعت الطوموبيل اللي عندها أرخص ثمن؟
the lowest price refers to min(price)
SELECT T3.country FROM price AS T1 INNER JOIN production AS T2 ON T1.ID = T2.ID INNER JOIN country AS T3 ON T3.origin = T2.country ORDER BY T1.price ASC LIMIT 1
CREATE TABLE country ( origin INTEGER primary key, country TEXT ); CREATE TABLE price ( ID INTEGER primary key, price REAL ); CREATE TABLE data ( ID INTEGER primary key, mpg REAL, cylinders INTEGER, displacement REAL, hors...
student_loan
Please list the departments the students are absent from school for 9 months are in.
عفاك جبد ليا الشُعب ديال التلامذ اللي غائبين على المدرسة هادي 9 شهور.
absent from school for 9 months refers to month = 9
SELECT T2.organ FROM longest_absense_from_school AS T1 INNER JOIN enlist AS T2 ON T1.`name` = T2.`name` WHERE T1.`month` = 9
CREATE TABLE bool ( "name" TEXT default '' not null primary key ); CREATE TABLE person ( "name" TEXT default '' not null primary key ); CREATE TABLE disabled ( "name" TEXT default '' not null primary key, foreign key ("name") references person ("name") on update c...
legislator
What is the ratio between male and female legislators?
شحال نسبة النواب الرجال مقارنةً بالنساء؟
ratio = DIVIDE(SUM(gender_bio = 'M'),  SUM(gender_bio = 'F')); male refers to gender_bio = 'M'; female refers to gender_bio = 'F'
SELECT CAST(SUM(CASE WHEN gender_bio = 'M' THEN 1 ELSE 0 END) AS REAL) / SUM(CASE WHEN gender_bio = 'F' THEN 1 ELSE 0 END) FROM historical
CREATE TABLE current ( ballotpedia_id TEXT, bioguide_id TEXT, birthday_bio DATE, cspan_id REAL, fec_id TEXT, first_name TEXT, gender_bio TEXT, google_entity_id_id TEXT, govtrack_id INTEGER, house_history_id ...
olympics
Calculate the bmi of the competitor id 147420.
حسب مؤشر كتلة الجسم ديال المنافس رقم 147420.
DIVIDE(weight), MULTIPLY(height, height) where id = 147420;
SELECT CAST(T1.weight AS REAL) / (T1.height * T1.height) FROM person AS T1 INNER JOIN games_competitor AS T2 ON T1.id = T2.person_id WHERE T2.id = 147420
CREATE TABLE city ( id INTEGER not null primary key, city_name TEXT default NULL ); CREATE TABLE games ( id INTEGER not null primary key, games_year INTEGER default NULL, games_name TEXT default NULL, season TEXT default NULL ); CREATE TABLE ga...
hockey
For the goalie who had the most shutouts in 2010, what's his catching hand?
بالنسبة لحارس المرمى اللي دار أكبر عدد من الكلين شيت فـ 2010، شنو هي اليد اللي كيطاكي بيها؟
the most shutouts refer to MAX(SHO); catching hand refers to shootCatch; year = 2010;
SELECT T2.shootCatch FROM Goalies AS T1 INNER JOIN Master AS T2 ON T1.playerID = T2.playerID WHERE T1.year = 2010 GROUP BY T2.shootCatch ORDER BY SUM(T1.SHO) DESC LIMIT 1
CREATE TABLE AwardsMisc ( name TEXT not null primary key, ID TEXT, award TEXT, year INTEGER, lgID TEXT, note TEXT ); CREATE TABLE HOF ( year INTEGER, hofID TEXT not null primary key, name TEXT, category TEXT ); CREATE TABLE Teams ( year ...
public_review_platform
Which city has more Yelp_Business that's more appealing to users, Scottsdale or Anthem?
اينا مدينة عندها بزاف ديال الـ Yelp_Business لي كاتاتيري المستخدمين كثر، Scottsdale ولا Anthem؟
more appealing to users refers to MAX(review_count);
SELECT city FROM Business ORDER BY review_count DESC LIMIT 1
CREATE TABLE Attributes ( attribute_id INTEGER constraint Attributes_pk primary key, attribute_name TEXT ); CREATE TABLE Categories ( category_id INTEGER constraint Categories_pk primary key, category_name TEXT ); CREATE TABLE Compliments ( compliment_id ...
works_cycles
What is the thumbnail photo file for the product with the id "979"?
شنو هو الملف ديال الصورة المصغرة للمنتوج اللي عندو الرقم "979"؟
thumbnail photo file refers to ThumbnailPhotoFileName;
SELECT T2.ThumbnailPhotoFileName FROM ProductProductPhoto AS T1 INNER JOIN ProductPhoto AS T2 ON T1.ProductPhotoID = T2.ProductPhotoID WHERE T1.ProductID = 979
CREATE TABLE sqlite_sequence(name,seq); CREATE TABLE CountryRegion ( CountryRegionCode TEXT not null primary key, Name TEXT not null unique, ModifiedDate DATETIME default current_timestamp not null ); CREATE TABLE Culture ...
End of preview.

Dialect2SQL

Dataset Description

Dialect2SQL is a novel dataset designed for the Text-to-SQL task in Arabic dialects, with a particular focus on Moroccan Darija.
It provides natural language questions written in Darija, paired with corresponding SQL queries and database schemas.
The dataset enables research on low-resource natural language interfaces to databases (NLIDB) in non-standard Arabic varieties.


Dataset Summary

Dialect2SQL aims to bridge the gap between Arabic dialects and structured query understanding.
The dataset consists of manually and semi-automatically curated Darija–SQL pairs mapped to realistic database schemas spanning multiple domains (e.g., education, e-commerce, banking, and transportation).
Each entry contains:

  • a Darija question (darija_question)
  • an optional English translation (en_question)
  • the SQL query (sql)
  • the database schema (db_schema)
  • the database name (db_id)

Supported Tasks and Leaderboards

Task: Text-to-SQL / NLQ-to-SQL

Given a natural language question written in Darija (Moroccan Arabic), the goal is to generate the correct SQL query that retrieves the requested information.

Example Task:

Field Example
darija_question شحال من تلميذ عندو أكثر من 15 ف الرياضيات؟
en_question How many students scored more than 15 in mathematics?
sql SELECT COUNT(*) FROM Grades WHERE subject = 'Mathematics' AND grade > 15;
db_schema CREATE TABLE Grades(student_id number, subject varchar, grade real);
db_id School_DB

Languages

  • Darija (Moroccan Arabic) — primary source language
  • English — provided for reference and cross-lingual studies

Data Splits

Split Size (approx.) Description
train ~7,000 Main training set
validation ~1,000 Development split
test ~1,000 Evaluation split
Dialect2SQL full dataset Combined dataset file

Dataset Structure

Each row in the dataset includes:

Column Description
db_id Database identifier
db_schema SQL table definitions
darija_question Question in Moroccan Darija
en_question English translation (optional)
sql Target SQL query

Use Cases

  • Fine-tuning text-to-SQL models for Arabic dialects
  • Research on multilingual and dialectal NLIDB systems
  • Cross-lingual transfer learning for SQL understanding
  • Evaluating low-resource adaptation of code LLMs (e.g., Qwen, StarCoder, Codex)

Limitations

  • The dataset currently focuses on Moroccan Darija, and performance may not generalize to other Arabic dialects.
  • Some questions are written using Arabic script, while others mix Latin characters (Arabizi), reflecting real user input diversity.
  • SQL coverage is limited to single-domain, schema-bounded tasks.

Citation

If you use this dataset, please cite the following paper:

@inproceedings{chafik2025dialect2sql,
  title={Dialect2SQL: A Novel Text-to-SQL Dataset for Arabic Dialects with a Focus on Moroccan Darija},
  author={Chafik, Salmane and Ezzini, Saad and Berrada, Ismail},
  booktitle={Proceedings of the 4th Workshop on Arabic Corpus Linguistics (WACL-4)},
  pages={86--92},
  year={2025}
}

@article{10.1145/3787497,
  author = {Chafik, Salmane and Ezzini, Saad and Berrada, Ismail},
  title = {DarijaDB: Unlocking Text-to-SQL for Arabic Dialects},
  year = {2026},
  publisher = {Association for Computing Machinery},
  address = {New York, NY, USA},
  issn = {2375-4699},
  url = {https://doi.org/10.1145/3787497},
  doi = {10.1145/3787497},
  journal = {ACM Trans. Asian Low-Resour. Lang. Inf. Process.},
  month = jan
}
Downloads last month
98

Models trained or fine-tuned on salmane11/Dialect2SQL