v1: add 591 synthetic pairs for the demo schemas (M3)
Browse files- .gitattributes +1 -0
- README.md +26 -2
- synth_review.jsonl +50 -0
- train.jsonl +0 -0
.gitattributes
CHANGED
|
@@ -58,3 +58,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
| 58 |
# Video files - compressed
|
| 59 |
*.mp4 filter=lfs diff=lfs merge=lfs -text
|
| 60 |
*.webm filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
| 58 |
# Video files - compressed
|
| 59 |
*.mp4 filter=lfs diff=lfs merge=lfs -text
|
| 60 |
*.webm filter=lfs diff=lfs merge=lfs -text
|
| 61 |
+
train.jsonl filter=lfs diff=lfs merge=lfs -text
|
README.md
CHANGED
|
@@ -26,16 +26,17 @@ configs:
|
|
| 26 |
|
| 27 |
Question → DuckDB SQL pairs used to fine-tune [PocketSQL](https://github.com/MidlightDDK/pocketsql), a sub-1B model that writes DuckDB SQL in the browser. Every pair was checked by running it: the DuckDB query must return the same result as Spider's original SQLite query on the same data.
|
| 28 |
|
| 29 |
-
**Version:**
|
| 30 |
|
| 31 |
## Files
|
| 32 |
|
| 33 |
| File | Rows | What |
|
| 34 |
|---|---|---|
|
| 35 |
-
| `train.jsonl` | 7,
|
| 36 |
| `val.jsonl` | 858 | Spider train pairs from 16 held-out databases (no database is in both train and val) |
|
| 37 |
| `spider_dev_duckdb.jsonl` | 981 | Spider dev pairs, 20 databases: the test set. Never used for training. |
|
| 38 |
| `databases.zip` | 36 files | DuckDB files for the val and test databases, for execution scoring |
|
|
|
|
| 39 |
|
| 40 |
Train/val row: `{id, db_id, schema_text, question, sql, source, difficulty}`. Test row: `{id, db_id, question, gold_sql, gold_result_hash, difficulty}`. `difficulty` is Spider's official hardness (easy, medium, hard, extra), computed from Spider's parsed SQL.
|
| 41 |
|
|
@@ -52,6 +53,27 @@ Code: `training/src/pocketsql/data/` in the GitHub repo (`python -m pocketsql.da
|
|
| 52 |
5. **Dedupe and split.** 42 exact duplicates (same database, question, and SQL) were removed from train. Val is a seeded set of Spider train databases (about 10% of pairs).
|
| 53 |
6. **Leakage check.** No train or val item shares a database and a normalized question or SQL with a test item, or has question token-Jaccard ≥ 0.9 with one (`python -m pocketsql.data.leakage`, run in CI against this dataset).
|
| 54 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 55 |
## Retention
|
| 56 |
|
| 57 |
| Split | Spider pairs | Kept | Retention | DuckDB error | Result mismatch | SQLite error |
|
|
@@ -79,6 +101,8 @@ Prompt + SQL length with the Qwen3 tokenizer: median 297 tokens, p95 701, max 2,
|
|
| 79 |
|
| 80 |
Derived from Spider (Yu et al., 2018), licensed CC BY-SA 4.0; this dataset keeps the same license.
|
| 81 |
|
|
|
|
|
|
|
| 82 |
```bibtex
|
| 83 |
@inproceedings{yu-etal-2018-spider,
|
| 84 |
title = {{Spider}: A Large-Scale Human-Labeled Dataset for Complex and Cross-Domain Semantic Parsing and Text-to-{SQL} Task},
|
|
|
|
| 26 |
|
| 27 |
Question → DuckDB SQL pairs used to fine-tune [PocketSQL](https://github.com/MidlightDDK/pocketsql), a sub-1B model that writes DuckDB SQL in the browser. Every pair was checked by running it: the DuckDB query must return the same result as Spider's original SQLite query on the same data.
|
| 28 |
|
| 29 |
+
**Version:** v1 (milestone M3): Spider-derived pairs plus 591 synthetic pairs for the app's three demo schemas, filtered by 3-model self-consistency and spot-reviewed (88% acceptance). v0 (Spider only) is the previous revision.
|
| 30 |
|
| 31 |
## Files
|
| 32 |
|
| 33 |
| File | Rows | What |
|
| 34 |
|---|---|---|
|
| 35 |
+
| `train.jsonl` | 7,967 | 7,376 Spider train pairs (130 databases) + 591 synthetic pairs for the demo schemas (`source: synthetic`) |
|
| 36 |
| `val.jsonl` | 858 | Spider train pairs from 16 held-out databases (no database is in both train and val) |
|
| 37 |
| `spider_dev_duckdb.jsonl` | 981 | Spider dev pairs, 20 databases: the test set. Never used for training. |
|
| 38 |
| `databases.zip` | 36 files | DuckDB files for the val and test databases, for execution scoring |
|
| 39 |
+
| `synth_review.jsonl` | 50 | The reviewed sample of synthetic pairs, with each verdict (`accept`, `review_note`) |
|
| 40 |
|
| 41 |
Train/val row: `{id, db_id, schema_text, question, sql, source, difficulty}`. Test row: `{id, db_id, question, gold_sql, gold_result_hash, difficulty}`. `difficulty` is Spider's official hardness (easy, medium, hard, extra), computed from Spider's parsed SQL.
|
| 42 |
|
|
|
|
| 53 |
5. **Dedupe and split.** 42 exact duplicates (same database, question, and SQL) were removed from train. Val is a seeded set of Spider train databases (about 10% of pairs).
|
| 54 |
6. **Leakage check.** No train or val item shares a database and a normalized question or SQL with a test item, or has question token-Jaccard ≥ 0.9 with one (`python -m pocketsql.data.leakage`, run in CI against this dataset).
|
| 55 |
|
| 56 |
+
## Synthetic pairs (demo schemas)
|
| 57 |
+
|
| 58 |
+
The web app queries three small databases: Chinook (music store), Palmer penguins, and a World Bank indicators snapshot. Spider has nothing like them, so the model also trains on synthetic questions over these exact schemas. Code: `training/src/pocketsql/synth/` (`python -m pocketsql.synth --n 200`).
|
| 59 |
+
|
| 60 |
+
1. **Questions.** gpt-oss-120b (temperature 1.0) writes batches of 20 difficulty-tagged questions with SQL for one of 11 topics (filters, aggregates, grouping, joins, subqueries, windows, time, conditional, multistep, sets, text), shown the schema, a few data notes, and the questions already asked on that topic.
|
| 61 |
+
2. **Two more answers.** gpt-oss-20b and Qwen3.8-27B (temperature 0) answer the same questions independently from the schema alone.
|
| 62 |
+
3. **Self-consistency filter.** A question is kept only when at least 2 of the 3 SQL candidates run and return the same result, and that result is non-empty, not all NULL, and deterministic: the same on a copy of the database with rows in reverse order, and unchanged when ties in a top-level `ORDER BY` are broken either way. The shortest agreeing SQL becomes the target.
|
| 63 |
+
4. **Dedupe and leakage.** Repeated questions or SQL (normalized) and near-duplicate questions (token-Jaccard ≥ 0.9) on the same database are dropped (4 repeated SQL; no repeated questions), and so is anything close to a test item on the same database: the same normalized question or SQL, the same result as a test item's gold query, or question token-Jaccard ≥ 0.9.
|
| 64 |
+
5. **Cap.** At most 200 pairs per schema, in generation order.
|
| 65 |
+
|
| 66 |
+
| Schema | Questions | Agreed (≥ 2 of 3) | Dropped: leakage | Dropped: duplicate | Kept | Kept / questions |
|
| 67 |
+
|---|---|---|---|---|---|---|
|
| 68 |
+
| chinook | 478 | 218 | 11 | 2 | 200 | 41.8% |
|
| 69 |
+
| penguins | 409 | 287 | 13 | 2 | 200 | 48.9% |
|
| 70 |
+
| world_bank | 241 | 196 | 5 | 0 | 191 | 79.3% |
|
| 71 |
+
| **total** | **1,128** | **701** | **29** | **4** | **591** | **52.4%** |
|
| 72 |
+
|
| 73 |
+
Chinook and penguins reached the 200 cap (77 more agreed pairs were left over); world_bank stopped at 191 when the Groq free-tier daily token quota ran out, and the set was finalized from the cached calls. Of the questions that were not kept, 344 had fewer than 2 valid candidates (errors, empty or order-dependent results) and 83 had candidates that disagreed. Difficulty of the kept pairs: 180 easy, 199 medium, 167 hard, 45 extra. Per-model candidate validity and every decision are in `training/data/cards/synth_stats.json` and `processed/synth_candidates.jsonl` in the GitHub repo.
|
| 74 |
+
|
| 75 |
+
**Review.** 50 kept pairs (17 chinook, 17 penguins, 16 world_bank, seeded random sample) were checked by running each SQL and reading its result next to the question. A pair is accepted when the SQL returns what a reasonable analyst would read the question as asking on this data; ambiguous questions, wrong NULL handling, off-by-one periods, and answers that would change on other data are rejected. **44/50 accepted (88%)**: chinook 14/17, penguins 15/17, world_bank 15/16. The rejections: an average that skips empty playlists, a NULL billing state ranked as a state, "last 30 days" coded as a 31-day month, an ambiguous nested penguin question, penguins with no bill depth bucketed as 'large' through `ELSE`, and a question that calls population ÷ GDP "population density". The review was done by Claude (claude-opus-5-5) on the project owner's instruction; verdicts are in `synth_review.jsonl`.
|
| 76 |
+
|
| 77 |
## Retention
|
| 78 |
|
| 79 |
| Split | Spider pairs | Kept | Retention | DuckDB error | Result mismatch | SQLite error |
|
|
|
|
| 101 |
|
| 102 |
Derived from Spider (Yu et al., 2018), licensed CC BY-SA 4.0; this dataset keeps the same license.
|
| 103 |
|
| 104 |
+
Synthetic pairs: generated with gpt-oss-120b, gpt-oss-20b (OpenAI, Apache-2.0), and Qwen3.8-27B (Qwen team, Apache-2.0) through the Groq API, whose terms leave outputs to the customer. The demo databases they are written against are Chinook (MIT), Palmer penguins (CC0 1.0), and World Bank World Development Indicators (CC BY 4.0).
|
| 105 |
+
|
| 106 |
```bibtex
|
| 107 |
@inproceedings{yu-etal-2018-spider,
|
| 108 |
title = {{Spider}: A Large-Scale Human-Labeled Dataset for Complex and Cross-Domain Semantic Parsing and Text-to-{SQL} Task},
|
synth_review.jsonl
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{"id": "synth_chinook_0005", "db_id": "chinook", "schema_text": "CREATE TABLE Album (AlbumId BIGINT, Title VARCHAR, ArtistId BIGINT);\nCREATE TABLE Artist (ArtistId BIGINT, Name VARCHAR);\nCREATE TABLE Customer (CustomerId BIGINT, FirstName VARCHAR, LastName VARCHAR, Company VARCHAR /* e.g. 'Apple Inc.', 'Banco do Brasil S.A.' */, Address VARCHAR, City VARCHAR, State VARCHAR, Country VARCHAR, PostalCode VARCHAR, Phone VARCHAR, Fax VARCHAR /* e.g. '+1 (212) 221-4679', '+1 (408) 996-1011' */, Email VARCHAR, SupportRepId BIGINT);\nCREATE TABLE Employee (EmployeeId BIGINT, LastName VARCHAR /* e.g. 'Adams', 'Callahan' */, FirstName VARCHAR /* e.g. 'Andrew', 'Jane' */, Title VARCHAR /* e.g. 'Sales Support Agent', 'IT Staff' */, ReportsTo BIGINT, BirthDate TIMESTAMP, HireDate TIMESTAMP, Address VARCHAR /* e.g. '1111 6 Ave SW', '11120 Jasper Ave NW' */, City VARCHAR /* e.g. 'Calgary', 'Lethbridge' */, State VARCHAR /* e.g. 'AB' */, Country VARCHAR /* e.g. 'Canada' */, PostalCode VARCHAR /* e.g. 'T1H 1Y8', 'T1K 5N8' */, Phone VARCHAR /* e.g. '+1 (403) 262-3443', '+1 (403) 246-9887' */, Fax VARCHAR /* e.g. '+1 (403) 246-9899', '+1 (403) 262-3322' */, Email VARCHAR /* e.g. 'andrew@chinookcorp.com', 'jane@chinookcorp.com' */);\nCREATE TABLE Genre (GenreId BIGINT, Name VARCHAR);\nCREATE TABLE Invoice (InvoiceId BIGINT, CustomerId BIGINT, InvoiceDate TIMESTAMP, BillingAddress VARCHAR, BillingCity VARCHAR, BillingState VARCHAR, BillingCountry VARCHAR, BillingPostalCode VARCHAR, Total DOUBLE);\nCREATE TABLE InvoiceLine (InvoiceLineId BIGINT, InvoiceId BIGINT, TrackId BIGINT, UnitPrice DOUBLE, Quantity BIGINT);\nCREATE TABLE MediaType (MediaTypeId BIGINT, Name VARCHAR /* e.g. 'AAC audio file', 'MPEG audio file' */);\nCREATE TABLE Playlist (PlaylistId BIGINT, Name VARCHAR /* e.g. 'Audiobooks', 'Movies' */);\nCREATE TABLE PlaylistTrack (PlaylistId BIGINT, TrackId BIGINT);\nCREATE TABLE Track (TrackId BIGINT, Name VARCHAR, AlbumId BIGINT, MediaTypeId BIGINT, GenreId BIGINT, Composer VARCHAR, Milliseconds BIGINT, Bytes BIGINT, UnitPrice DOUBLE);", "question": "Which artists have released at least one album titled with the word 'Great' (case-insensitive)? Return distinct artist names.", "sql": "SELECT DISTINCT ar.Name FROM Artist ar JOIN Album al ON ar.ArtistId=al.ArtistId WHERE al.Title ILIKE '%great%';", "source": "synthetic", "difficulty": "medium", "accept": true, "review_note": "ILIKE '%great%' also matches 'Greatest'; acceptable reading"}
|
| 2 |
+
{"id": "synth_chinook_0009", "db_id": "chinook", "schema_text": "CREATE TABLE Album (AlbumId BIGINT, Title VARCHAR, ArtistId BIGINT);\nCREATE TABLE Artist (ArtistId BIGINT, Name VARCHAR);\nCREATE TABLE Customer (CustomerId BIGINT, FirstName VARCHAR, LastName VARCHAR, Company VARCHAR /* e.g. 'Apple Inc.', 'Banco do Brasil S.A.' */, Address VARCHAR, City VARCHAR, State VARCHAR, Country VARCHAR, PostalCode VARCHAR, Phone VARCHAR, Fax VARCHAR /* e.g. '+1 (212) 221-4679', '+1 (408) 996-1011' */, Email VARCHAR, SupportRepId BIGINT);\nCREATE TABLE Employee (EmployeeId BIGINT, LastName VARCHAR /* e.g. 'Adams', 'Callahan' */, FirstName VARCHAR /* e.g. 'Andrew', 'Jane' */, Title VARCHAR /* e.g. 'Sales Support Agent', 'IT Staff' */, ReportsTo BIGINT, BirthDate TIMESTAMP, HireDate TIMESTAMP, Address VARCHAR /* e.g. '1111 6 Ave SW', '11120 Jasper Ave NW' */, City VARCHAR /* e.g. 'Calgary', 'Lethbridge' */, State VARCHAR /* e.g. 'AB' */, Country VARCHAR /* e.g. 'Canada' */, PostalCode VARCHAR /* e.g. 'T1H 1Y8', 'T1K 5N8' */, Phone VARCHAR /* e.g. '+1 (403) 262-3443', '+1 (403) 246-9887' */, Fax VARCHAR /* e.g. '+1 (403) 246-9899', '+1 (403) 262-3322' */, Email VARCHAR /* e.g. 'andrew@chinookcorp.com', 'jane@chinookcorp.com' */);\nCREATE TABLE Genre (GenreId BIGINT, Name VARCHAR);\nCREATE TABLE Invoice (InvoiceId BIGINT, CustomerId BIGINT, InvoiceDate TIMESTAMP, BillingAddress VARCHAR, BillingCity VARCHAR, BillingState VARCHAR, BillingCountry VARCHAR, BillingPostalCode VARCHAR, Total DOUBLE);\nCREATE TABLE InvoiceLine (InvoiceLineId BIGINT, InvoiceId BIGINT, TrackId BIGINT, UnitPrice DOUBLE, Quantity BIGINT);\nCREATE TABLE MediaType (MediaTypeId BIGINT, Name VARCHAR /* e.g. 'AAC audio file', 'MPEG audio file' */);\nCREATE TABLE Playlist (PlaylistId BIGINT, Name VARCHAR /* e.g. 'Audiobooks', 'Movies' */);\nCREATE TABLE PlaylistTrack (PlaylistId BIGINT, TrackId BIGINT);\nCREATE TABLE Track (TrackId BIGINT, Name VARCHAR, AlbumId BIGINT, MediaTypeId BIGINT, GenreId BIGINT, Composer VARCHAR, Milliseconds BIGINT, Bytes BIGINT, UnitPrice DOUBLE);", "question": "Find the total number of tracks per media type, and show only media types with fewer than 500 tracks. Return media type name and track count, ordered by count ascending.", "sql": "SELECT m.Name AS MediaTypeName, COUNT(*) AS TrackCount FROM MediaType m JOIN Track t ON m.MediaTypeId=t.MediaTypeId GROUP BY m.MediaTypeId, m.Name HAVING COUNT(*) < 500 ORDER BY TrackCount ASC;", "source": "synthetic", "difficulty": "medium", "accept": true, "review_note": ""}
|
| 3 |
+
{"id": "synth_chinook_0013", "db_id": "chinook", "schema_text": "CREATE TABLE Album (AlbumId BIGINT, Title VARCHAR, ArtistId BIGINT);\nCREATE TABLE Artist (ArtistId BIGINT, Name VARCHAR);\nCREATE TABLE Customer (CustomerId BIGINT, FirstName VARCHAR, LastName VARCHAR, Company VARCHAR /* e.g. 'Apple Inc.', 'Banco do Brasil S.A.' */, Address VARCHAR, City VARCHAR, State VARCHAR, Country VARCHAR, PostalCode VARCHAR, Phone VARCHAR, Fax VARCHAR /* e.g. '+1 (212) 221-4679', '+1 (408) 996-1011' */, Email VARCHAR, SupportRepId BIGINT);\nCREATE TABLE Employee (EmployeeId BIGINT, LastName VARCHAR /* e.g. 'Adams', 'Callahan' */, FirstName VARCHAR /* e.g. 'Andrew', 'Jane' */, Title VARCHAR /* e.g. 'Sales Support Agent', 'IT Staff' */, ReportsTo BIGINT, BirthDate TIMESTAMP, HireDate TIMESTAMP, Address VARCHAR /* e.g. '1111 6 Ave SW', '11120 Jasper Ave NW' */, City VARCHAR /* e.g. 'Calgary', 'Lethbridge' */, State VARCHAR /* e.g. 'AB' */, Country VARCHAR /* e.g. 'Canada' */, PostalCode VARCHAR /* e.g. 'T1H 1Y8', 'T1K 5N8' */, Phone VARCHAR /* e.g. '+1 (403) 262-3443', '+1 (403) 246-9887' */, Fax VARCHAR /* e.g. '+1 (403) 246-9899', '+1 (403) 262-3322' */, Email VARCHAR /* e.g. 'andrew@chinookcorp.com', 'jane@chinookcorp.com' */);\nCREATE TABLE Genre (GenreId BIGINT, Name VARCHAR);\nCREATE TABLE Invoice (InvoiceId BIGINT, CustomerId BIGINT, InvoiceDate TIMESTAMP, BillingAddress VARCHAR, BillingCity VARCHAR, BillingState VARCHAR, BillingCountry VARCHAR, BillingPostalCode VARCHAR, Total DOUBLE);\nCREATE TABLE InvoiceLine (InvoiceLineId BIGINT, InvoiceId BIGINT, TrackId BIGINT, UnitPrice DOUBLE, Quantity BIGINT);\nCREATE TABLE MediaType (MediaTypeId BIGINT, Name VARCHAR /* e.g. 'AAC audio file', 'MPEG audio file' */);\nCREATE TABLE Playlist (PlaylistId BIGINT, Name VARCHAR /* e.g. 'Audiobooks', 'Movies' */);\nCREATE TABLE PlaylistTrack (PlaylistId BIGINT, TrackId BIGINT);\nCREATE TABLE Track (TrackId BIGINT, Name VARCHAR, AlbumId BIGINT, MediaTypeId BIGINT, GenreId BIGINT, Composer VARCHAR, Milliseconds BIGINT, Bytes BIGINT, UnitPrice DOUBLE);", "question": "Which country has the highest number of customers, and how many customers are there? Return the country and the count, ordered by count descending, limit 1.", "sql": "SELECT Country, COUNT(*) AS customer_count FROM Customer GROUP BY Country ORDER BY customer_count DESC LIMIT 1;", "source": "synthetic", "difficulty": "medium", "accept": true, "review_note": ""}
|
| 4 |
+
{"id": "synth_chinook_0024", "db_id": "chinook", "schema_text": "CREATE TABLE Album (AlbumId BIGINT, Title VARCHAR, ArtistId BIGINT);\nCREATE TABLE Artist (ArtistId BIGINT, Name VARCHAR);\nCREATE TABLE Customer (CustomerId BIGINT, FirstName VARCHAR, LastName VARCHAR, Company VARCHAR /* e.g. 'Apple Inc.', 'Banco do Brasil S.A.' */, Address VARCHAR, City VARCHAR, State VARCHAR, Country VARCHAR, PostalCode VARCHAR, Phone VARCHAR, Fax VARCHAR /* e.g. '+1 (212) 221-4679', '+1 (408) 996-1011' */, Email VARCHAR, SupportRepId BIGINT);\nCREATE TABLE Employee (EmployeeId BIGINT, LastName VARCHAR /* e.g. 'Adams', 'Callahan' */, FirstName VARCHAR /* e.g. 'Andrew', 'Jane' */, Title VARCHAR /* e.g. 'Sales Support Agent', 'IT Staff' */, ReportsTo BIGINT, BirthDate TIMESTAMP, HireDate TIMESTAMP, Address VARCHAR /* e.g. '1111 6 Ave SW', '11120 Jasper Ave NW' */, City VARCHAR /* e.g. 'Calgary', 'Lethbridge' */, State VARCHAR /* e.g. 'AB' */, Country VARCHAR /* e.g. 'Canada' */, PostalCode VARCHAR /* e.g. 'T1H 1Y8', 'T1K 5N8' */, Phone VARCHAR /* e.g. '+1 (403) 262-3443', '+1 (403) 246-9887' */, Fax VARCHAR /* e.g. '+1 (403) 246-9899', '+1 (403) 262-3322' */, Email VARCHAR /* e.g. 'andrew@chinookcorp.com', 'jane@chinookcorp.com' */);\nCREATE TABLE Genre (GenreId BIGINT, Name VARCHAR);\nCREATE TABLE Invoice (InvoiceId BIGINT, CustomerId BIGINT, InvoiceDate TIMESTAMP, BillingAddress VARCHAR, BillingCity VARCHAR, BillingState VARCHAR, BillingCountry VARCHAR, BillingPostalCode VARCHAR, Total DOUBLE);\nCREATE TABLE InvoiceLine (InvoiceLineId BIGINT, InvoiceId BIGINT, TrackId BIGINT, UnitPrice DOUBLE, Quantity BIGINT);\nCREATE TABLE MediaType (MediaTypeId BIGINT, Name VARCHAR /* e.g. 'AAC audio file', 'MPEG audio file' */);\nCREATE TABLE Playlist (PlaylistId BIGINT, Name VARCHAR /* e.g. 'Audiobooks', 'Movies' */);\nCREATE TABLE PlaylistTrack (PlaylistId BIGINT, TrackId BIGINT);\nCREATE TABLE Track (TrackId BIGINT, Name VARCHAR, AlbumId BIGINT, MediaTypeId BIGINT, GenreId BIGINT, Composer VARCHAR, Milliseconds BIGINT, Bytes BIGINT, UnitPrice DOUBLE);", "question": "What is the average number of tracks per playlist, rounded to two decimals?", "sql": "SELECT ROUND(AVG(cnt), 2) FROM (SELECT PlaylistId, COUNT(*) AS cnt FROM PlaylistTrack GROUP BY PlaylistId) sub;", "source": "synthetic", "difficulty": "easy", "accept": false, "review_note": "average skips the 4 empty playlists (622.5 instead of 484.17)"}
|
| 5 |
+
{"id": "synth_chinook_0032", "db_id": "chinook", "schema_text": "CREATE TABLE Album (AlbumId BIGINT, Title VARCHAR, ArtistId BIGINT);\nCREATE TABLE Artist (ArtistId BIGINT, Name VARCHAR);\nCREATE TABLE Customer (CustomerId BIGINT, FirstName VARCHAR, LastName VARCHAR, Company VARCHAR /* e.g. 'Apple Inc.', 'Banco do Brasil S.A.' */, Address VARCHAR, City VARCHAR, State VARCHAR, Country VARCHAR, PostalCode VARCHAR, Phone VARCHAR, Fax VARCHAR /* e.g. '+1 (212) 221-4679', '+1 (408) 996-1011' */, Email VARCHAR, SupportRepId BIGINT);\nCREATE TABLE Employee (EmployeeId BIGINT, LastName VARCHAR /* e.g. 'Adams', 'Callahan' */, FirstName VARCHAR /* e.g. 'Andrew', 'Jane' */, Title VARCHAR /* e.g. 'Sales Support Agent', 'IT Staff' */, ReportsTo BIGINT, BirthDate TIMESTAMP, HireDate TIMESTAMP, Address VARCHAR /* e.g. '1111 6 Ave SW', '11120 Jasper Ave NW' */, City VARCHAR /* e.g. 'Calgary', 'Lethbridge' */, State VARCHAR /* e.g. 'AB' */, Country VARCHAR /* e.g. 'Canada' */, PostalCode VARCHAR /* e.g. 'T1H 1Y8', 'T1K 5N8' */, Phone VARCHAR /* e.g. '+1 (403) 262-3443', '+1 (403) 246-9887' */, Fax VARCHAR /* e.g. '+1 (403) 246-9899', '+1 (403) 262-3322' */, Email VARCHAR /* e.g. 'andrew@chinookcorp.com', 'jane@chinookcorp.com' */);\nCREATE TABLE Genre (GenreId BIGINT, Name VARCHAR);\nCREATE TABLE Invoice (InvoiceId BIGINT, CustomerId BIGINT, InvoiceDate TIMESTAMP, BillingAddress VARCHAR, BillingCity VARCHAR, BillingState VARCHAR, BillingCountry VARCHAR, BillingPostalCode VARCHAR, Total DOUBLE);\nCREATE TABLE InvoiceLine (InvoiceLineId BIGINT, InvoiceId BIGINT, TrackId BIGINT, UnitPrice DOUBLE, Quantity BIGINT);\nCREATE TABLE MediaType (MediaTypeId BIGINT, Name VARCHAR /* e.g. 'AAC audio file', 'MPEG audio file' */);\nCREATE TABLE Playlist (PlaylistId BIGINT, Name VARCHAR /* e.g. 'Audiobooks', 'Movies' */);\nCREATE TABLE PlaylistTrack (PlaylistId BIGINT, TrackId BIGINT);\nCREATE TABLE Track (TrackId BIGINT, Name VARCHAR, AlbumId BIGINT, MediaTypeId BIGINT, GenreId BIGINT, Composer VARCHAR, Milliseconds BIGINT, Bytes BIGINT, UnitPrice DOUBLE);", "question": "Show the top 5 billing states by total sales amount, displaying state and total sales rounded to nearest dollar, sorted descending", "sql": "SELECT BillingState AS state, ROUND(SUM(Total)) AS total_sales FROM Invoice GROUP BY BillingState ORDER BY total_sales DESC LIMIT 5;", "source": "synthetic", "difficulty": "medium", "accept": false, "review_note": "a NULL billing state is ranked as a state (top row)"}
|
| 6 |
+
{"id": "synth_chinook_0041", "db_id": "chinook", "schema_text": "CREATE TABLE Album (AlbumId BIGINT, Title VARCHAR, ArtistId BIGINT);\nCREATE TABLE Artist (ArtistId BIGINT, Name VARCHAR);\nCREATE TABLE Customer (CustomerId BIGINT, FirstName VARCHAR, LastName VARCHAR, Company VARCHAR /* e.g. 'Apple Inc.', 'Banco do Brasil S.A.' */, Address VARCHAR, City VARCHAR, State VARCHAR, Country VARCHAR, PostalCode VARCHAR, Phone VARCHAR, Fax VARCHAR /* e.g. '+1 (212) 221-4679', '+1 (408) 996-1011' */, Email VARCHAR, SupportRepId BIGINT);\nCREATE TABLE Employee (EmployeeId BIGINT, LastName VARCHAR /* e.g. 'Adams', 'Callahan' */, FirstName VARCHAR /* e.g. 'Andrew', 'Jane' */, Title VARCHAR /* e.g. 'Sales Support Agent', 'IT Staff' */, ReportsTo BIGINT, BirthDate TIMESTAMP, HireDate TIMESTAMP, Address VARCHAR /* e.g. '1111 6 Ave SW', '11120 Jasper Ave NW' */, City VARCHAR /* e.g. 'Calgary', 'Lethbridge' */, State VARCHAR /* e.g. 'AB' */, Country VARCHAR /* e.g. 'Canada' */, PostalCode VARCHAR /* e.g. 'T1H 1Y8', 'T1K 5N8' */, Phone VARCHAR /* e.g. '+1 (403) 262-3443', '+1 (403) 246-9887' */, Fax VARCHAR /* e.g. '+1 (403) 246-9899', '+1 (403) 262-3322' */, Email VARCHAR /* e.g. 'andrew@chinookcorp.com', 'jane@chinookcorp.com' */);\nCREATE TABLE Genre (GenreId BIGINT, Name VARCHAR);\nCREATE TABLE Invoice (InvoiceId BIGINT, CustomerId BIGINT, InvoiceDate TIMESTAMP, BillingAddress VARCHAR, BillingCity VARCHAR, BillingState VARCHAR, BillingCountry VARCHAR, BillingPostalCode VARCHAR, Total DOUBLE);\nCREATE TABLE InvoiceLine (InvoiceLineId BIGINT, InvoiceId BIGINT, TrackId BIGINT, UnitPrice DOUBLE, Quantity BIGINT);\nCREATE TABLE MediaType (MediaTypeId BIGINT, Name VARCHAR /* e.g. 'AAC audio file', 'MPEG audio file' */);\nCREATE TABLE Playlist (PlaylistId BIGINT, Name VARCHAR /* e.g. 'Audiobooks', 'Movies' */);\nCREATE TABLE PlaylistTrack (PlaylistId BIGINT, TrackId BIGINT);\nCREATE TABLE Track (TrackId BIGINT, Name VARCHAR, AlbumId BIGINT, MediaTypeId BIGINT, GenreId BIGINT, Composer VARCHAR, Milliseconds BIGINT, Bytes BIGINT, UnitPrice DOUBLE);", "question": "What are the names of playlists that contain more than 100 tracks, and how many tracks do they contain?", "sql": "SELECT p.Name, COUNT(pt.TrackId) AS TrackCount FROM Playlist p JOIN PlaylistTrack pt ON p.PlaylistId = pt.PlaylistId GROUP BY p.PlaylistId, p.Name HAVING COUNT(pt.TrackId) > 100;", "source": "synthetic", "difficulty": "hard", "accept": true, "review_note": "two playlists named 'Music' are correctly kept apart"}
|
| 7 |
+
{"id": "synth_chinook_0042", "db_id": "chinook", "schema_text": "CREATE TABLE Album (AlbumId BIGINT, Title VARCHAR, ArtistId BIGINT);\nCREATE TABLE Artist (ArtistId BIGINT, Name VARCHAR);\nCREATE TABLE Customer (CustomerId BIGINT, FirstName VARCHAR, LastName VARCHAR, Company VARCHAR /* e.g. 'Apple Inc.', 'Banco do Brasil S.A.' */, Address VARCHAR, City VARCHAR, State VARCHAR, Country VARCHAR, PostalCode VARCHAR, Phone VARCHAR, Fax VARCHAR /* e.g. '+1 (212) 221-4679', '+1 (408) 996-1011' */, Email VARCHAR, SupportRepId BIGINT);\nCREATE TABLE Employee (EmployeeId BIGINT, LastName VARCHAR /* e.g. 'Adams', 'Callahan' */, FirstName VARCHAR /* e.g. 'Andrew', 'Jane' */, Title VARCHAR /* e.g. 'Sales Support Agent', 'IT Staff' */, ReportsTo BIGINT, BirthDate TIMESTAMP, HireDate TIMESTAMP, Address VARCHAR /* e.g. '1111 6 Ave SW', '11120 Jasper Ave NW' */, City VARCHAR /* e.g. 'Calgary', 'Lethbridge' */, State VARCHAR /* e.g. 'AB' */, Country VARCHAR /* e.g. 'Canada' */, PostalCode VARCHAR /* e.g. 'T1H 1Y8', 'T1K 5N8' */, Phone VARCHAR /* e.g. '+1 (403) 262-3443', '+1 (403) 246-9887' */, Fax VARCHAR /* e.g. '+1 (403) 246-9899', '+1 (403) 262-3322' */, Email VARCHAR /* e.g. 'andrew@chinookcorp.com', 'jane@chinookcorp.com' */);\nCREATE TABLE Genre (GenreId BIGINT, Name VARCHAR);\nCREATE TABLE Invoice (InvoiceId BIGINT, CustomerId BIGINT, InvoiceDate TIMESTAMP, BillingAddress VARCHAR, BillingCity VARCHAR, BillingState VARCHAR, BillingCountry VARCHAR, BillingPostalCode VARCHAR, Total DOUBLE);\nCREATE TABLE InvoiceLine (InvoiceLineId BIGINT, InvoiceId BIGINT, TrackId BIGINT, UnitPrice DOUBLE, Quantity BIGINT);\nCREATE TABLE MediaType (MediaTypeId BIGINT, Name VARCHAR /* e.g. 'AAC audio file', 'MPEG audio file' */);\nCREATE TABLE Playlist (PlaylistId BIGINT, Name VARCHAR /* e.g. 'Audiobooks', 'Movies' */);\nCREATE TABLE PlaylistTrack (PlaylistId BIGINT, TrackId BIGINT);\nCREATE TABLE Track (TrackId BIGINT, Name VARCHAR, AlbumId BIGINT, MediaTypeId BIGINT, GenreId BIGINT, Composer VARCHAR, Milliseconds BIGINT, Bytes BIGINT, UnitPrice DOUBLE);", "question": "List the first and last names of employees who were hired before 2003 and report their hire date, ordered by hire date ascending.", "sql": "SELECT FirstName, LastName, HireDate FROM Employee WHERE HireDate < '2003-01-01' ORDER BY HireDate ASC;", "source": "synthetic", "difficulty": "easy", "accept": true, "review_note": ""}
|
| 8 |
+
{"id": "synth_chinook_0065", "db_id": "chinook", "schema_text": "CREATE TABLE Album (AlbumId BIGINT, Title VARCHAR, ArtistId BIGINT);\nCREATE TABLE Artist (ArtistId BIGINT, Name VARCHAR);\nCREATE TABLE Customer (CustomerId BIGINT, FirstName VARCHAR, LastName VARCHAR, Company VARCHAR /* e.g. 'Apple Inc.', 'Banco do Brasil S.A.' */, Address VARCHAR, City VARCHAR, State VARCHAR, Country VARCHAR, PostalCode VARCHAR, Phone VARCHAR, Fax VARCHAR /* e.g. '+1 (212) 221-4679', '+1 (408) 996-1011' */, Email VARCHAR, SupportRepId BIGINT);\nCREATE TABLE Employee (EmployeeId BIGINT, LastName VARCHAR /* e.g. 'Adams', 'Callahan' */, FirstName VARCHAR /* e.g. 'Andrew', 'Jane' */, Title VARCHAR /* e.g. 'Sales Support Agent', 'IT Staff' */, ReportsTo BIGINT, BirthDate TIMESTAMP, HireDate TIMESTAMP, Address VARCHAR /* e.g. '1111 6 Ave SW', '11120 Jasper Ave NW' */, City VARCHAR /* e.g. 'Calgary', 'Lethbridge' */, State VARCHAR /* e.g. 'AB' */, Country VARCHAR /* e.g. 'Canada' */, PostalCode VARCHAR /* e.g. 'T1H 1Y8', 'T1K 5N8' */, Phone VARCHAR /* e.g. '+1 (403) 262-3443', '+1 (403) 246-9887' */, Fax VARCHAR /* e.g. '+1 (403) 246-9899', '+1 (403) 262-3322' */, Email VARCHAR /* e.g. 'andrew@chinookcorp.com', 'jane@chinookcorp.com' */);\nCREATE TABLE Genre (GenreId BIGINT, Name VARCHAR);\nCREATE TABLE Invoice (InvoiceId BIGINT, CustomerId BIGINT, InvoiceDate TIMESTAMP, BillingAddress VARCHAR, BillingCity VARCHAR, BillingState VARCHAR, BillingCountry VARCHAR, BillingPostalCode VARCHAR, Total DOUBLE);\nCREATE TABLE InvoiceLine (InvoiceLineId BIGINT, InvoiceId BIGINT, TrackId BIGINT, UnitPrice DOUBLE, Quantity BIGINT);\nCREATE TABLE MediaType (MediaTypeId BIGINT, Name VARCHAR /* e.g. 'AAC audio file', 'MPEG audio file' */);\nCREATE TABLE Playlist (PlaylistId BIGINT, Name VARCHAR /* e.g. 'Audiobooks', 'Movies' */);\nCREATE TABLE PlaylistTrack (PlaylistId BIGINT, TrackId BIGINT);\nCREATE TABLE Track (TrackId BIGINT, Name VARCHAR, AlbumId BIGINT, MediaTypeId BIGINT, GenreId BIGINT, Composer VARCHAR, Milliseconds BIGINT, Bytes BIGINT, UnitPrice DOUBLE);", "question": "What was the average invoice total for each quarter of 2021? Return quarter (1-4) and average, ordered by quarter.", "sql": "SELECT QUARTER(InvoiceDate) AS quarter, AVG(Total) AS avg_total FROM Invoice WHERE YEAR(InvoiceDate)=2021 GROUP BY quarter ORDER BY quarter;", "source": "synthetic", "difficulty": "medium", "accept": true, "review_note": ""}
|
| 9 |
+
{"id": "synth_chinook_0068", "db_id": "chinook", "schema_text": "CREATE TABLE Album (AlbumId BIGINT, Title VARCHAR, ArtistId BIGINT);\nCREATE TABLE Artist (ArtistId BIGINT, Name VARCHAR);\nCREATE TABLE Customer (CustomerId BIGINT, FirstName VARCHAR, LastName VARCHAR, Company VARCHAR /* e.g. 'Apple Inc.', 'Banco do Brasil S.A.' */, Address VARCHAR, City VARCHAR, State VARCHAR, Country VARCHAR, PostalCode VARCHAR, Phone VARCHAR, Fax VARCHAR /* e.g. '+1 (212) 221-4679', '+1 (408) 996-1011' */, Email VARCHAR, SupportRepId BIGINT);\nCREATE TABLE Employee (EmployeeId BIGINT, LastName VARCHAR /* e.g. 'Adams', 'Callahan' */, FirstName VARCHAR /* e.g. 'Andrew', 'Jane' */, Title VARCHAR /* e.g. 'Sales Support Agent', 'IT Staff' */, ReportsTo BIGINT, BirthDate TIMESTAMP, HireDate TIMESTAMP, Address VARCHAR /* e.g. '1111 6 Ave SW', '11120 Jasper Ave NW' */, City VARCHAR /* e.g. 'Calgary', 'Lethbridge' */, State VARCHAR /* e.g. 'AB' */, Country VARCHAR /* e.g. 'Canada' */, PostalCode VARCHAR /* e.g. 'T1H 1Y8', 'T1K 5N8' */, Phone VARCHAR /* e.g. '+1 (403) 262-3443', '+1 (403) 246-9887' */, Fax VARCHAR /* e.g. '+1 (403) 246-9899', '+1 (403) 262-3322' */, Email VARCHAR /* e.g. 'andrew@chinookcorp.com', 'jane@chinookcorp.com' */);\nCREATE TABLE Genre (GenreId BIGINT, Name VARCHAR);\nCREATE TABLE Invoice (InvoiceId BIGINT, CustomerId BIGINT, InvoiceDate TIMESTAMP, BillingAddress VARCHAR, BillingCity VARCHAR, BillingState VARCHAR, BillingCountry VARCHAR, BillingPostalCode VARCHAR, Total DOUBLE);\nCREATE TABLE InvoiceLine (InvoiceLineId BIGINT, InvoiceId BIGINT, TrackId BIGINT, UnitPrice DOUBLE, Quantity BIGINT);\nCREATE TABLE MediaType (MediaTypeId BIGINT, Name VARCHAR /* e.g. 'AAC audio file', 'MPEG audio file' */);\nCREATE TABLE Playlist (PlaylistId BIGINT, Name VARCHAR /* e.g. 'Audiobooks', 'Movies' */);\nCREATE TABLE PlaylistTrack (PlaylistId BIGINT, TrackId BIGINT);\nCREATE TABLE Track (TrackId BIGINT, Name VARCHAR, AlbumId BIGINT, MediaTypeId BIGINT, GenreId BIGINT, Composer VARCHAR, Milliseconds BIGINT, Bytes BIGINT, UnitPrice DOUBLE);", "question": "How many invoices were issued in each quarter of 2024? Return quarter (Q1-Q4) and count, ordered by quarter.", "sql": "SELECT CONCAT('Q', QUARTER(InvoiceDate)) AS quarter, COUNT(*) AS invoice_count FROM Invoice WHERE YEAR(InvoiceDate)=2024 GROUP BY quarter ORDER BY quarter;", "source": "synthetic", "difficulty": "medium", "accept": true, "review_note": ""}
|
| 10 |
+
{"id": "synth_chinook_0100", "db_id": "chinook", "schema_text": "CREATE TABLE Album (AlbumId BIGINT, Title VARCHAR, ArtistId BIGINT);\nCREATE TABLE Artist (ArtistId BIGINT, Name VARCHAR);\nCREATE TABLE Customer (CustomerId BIGINT, FirstName VARCHAR, LastName VARCHAR, Company VARCHAR /* e.g. 'Apple Inc.', 'Banco do Brasil S.A.' */, Address VARCHAR, City VARCHAR, State VARCHAR, Country VARCHAR, PostalCode VARCHAR, Phone VARCHAR, Fax VARCHAR /* e.g. '+1 (212) 221-4679', '+1 (408) 996-1011' */, Email VARCHAR, SupportRepId BIGINT);\nCREATE TABLE Employee (EmployeeId BIGINT, LastName VARCHAR /* e.g. 'Adams', 'Callahan' */, FirstName VARCHAR /* e.g. 'Andrew', 'Jane' */, Title VARCHAR /* e.g. 'Sales Support Agent', 'IT Staff' */, ReportsTo BIGINT, BirthDate TIMESTAMP, HireDate TIMESTAMP, Address VARCHAR /* e.g. '1111 6 Ave SW', '11120 Jasper Ave NW' */, City VARCHAR /* e.g. 'Calgary', 'Lethbridge' */, State VARCHAR /* e.g. 'AB' */, Country VARCHAR /* e.g. 'Canada' */, PostalCode VARCHAR /* e.g. 'T1H 1Y8', 'T1K 5N8' */, Phone VARCHAR /* e.g. '+1 (403) 262-3443', '+1 (403) 246-9887' */, Fax VARCHAR /* e.g. '+1 (403) 246-9899', '+1 (403) 262-3322' */, Email VARCHAR /* e.g. 'andrew@chinookcorp.com', 'jane@chinookcorp.com' */);\nCREATE TABLE Genre (GenreId BIGINT, Name VARCHAR);\nCREATE TABLE Invoice (InvoiceId BIGINT, CustomerId BIGINT, InvoiceDate TIMESTAMP, BillingAddress VARCHAR, BillingCity VARCHAR, BillingState VARCHAR, BillingCountry VARCHAR, BillingPostalCode VARCHAR, Total DOUBLE);\nCREATE TABLE InvoiceLine (InvoiceLineId BIGINT, InvoiceId BIGINT, TrackId BIGINT, UnitPrice DOUBLE, Quantity BIGINT);\nCREATE TABLE MediaType (MediaTypeId BIGINT, Name VARCHAR /* e.g. 'AAC audio file', 'MPEG audio file' */);\nCREATE TABLE Playlist (PlaylistId BIGINT, Name VARCHAR /* e.g. 'Audiobooks', 'Movies' */);\nCREATE TABLE PlaylistTrack (PlaylistId BIGINT, TrackId BIGINT);\nCREATE TABLE Track (TrackId BIGINT, Name VARCHAR, AlbumId BIGINT, MediaTypeId BIGINT, GenreId BIGINT, Composer VARCHAR, Milliseconds BIGINT, Bytes BIGINT, UnitPrice DOUBLE);", "question": "Show the average track length (in minutes, rounded to two decimals) for each genre where the genre name contains the letter \"e\" (case-insensitive). Return genre name and average minutes, ordered by average minutes descending.", "sql": "SELECT g.Name AS GenreName, ROUND(AVG(t.Milliseconds/60000.0),2) AS AvgMinutes FROM Track t JOIN Genre g ON t.GenreId=g.GenreId WHERE LOWER(g.Name) LIKE '%e%' GROUP BY g.Name ORDER BY AvgMinutes DESC;", "source": "synthetic", "difficulty": "hard", "accept": true, "review_note": ""}
|
| 11 |
+
{"id": "synth_chinook_0118", "db_id": "chinook", "schema_text": "CREATE TABLE Album (AlbumId BIGINT, Title VARCHAR, ArtistId BIGINT);\nCREATE TABLE Artist (ArtistId BIGINT, Name VARCHAR);\nCREATE TABLE Customer (CustomerId BIGINT, FirstName VARCHAR, LastName VARCHAR, Company VARCHAR /* e.g. 'Apple Inc.', 'Banco do Brasil S.A.' */, Address VARCHAR, City VARCHAR, State VARCHAR, Country VARCHAR, PostalCode VARCHAR, Phone VARCHAR, Fax VARCHAR /* e.g. '+1 (212) 221-4679', '+1 (408) 996-1011' */, Email VARCHAR, SupportRepId BIGINT);\nCREATE TABLE Employee (EmployeeId BIGINT, LastName VARCHAR /* e.g. 'Adams', 'Callahan' */, FirstName VARCHAR /* e.g. 'Andrew', 'Jane' */, Title VARCHAR /* e.g. 'Sales Support Agent', 'IT Staff' */, ReportsTo BIGINT, BirthDate TIMESTAMP, HireDate TIMESTAMP, Address VARCHAR /* e.g. '1111 6 Ave SW', '11120 Jasper Ave NW' */, City VARCHAR /* e.g. 'Calgary', 'Lethbridge' */, State VARCHAR /* e.g. 'AB' */, Country VARCHAR /* e.g. 'Canada' */, PostalCode VARCHAR /* e.g. 'T1H 1Y8', 'T1K 5N8' */, Phone VARCHAR /* e.g. '+1 (403) 262-3443', '+1 (403) 246-9887' */, Fax VARCHAR /* e.g. '+1 (403) 246-9899', '+1 (403) 262-3322' */, Email VARCHAR /* e.g. 'andrew@chinookcorp.com', 'jane@chinookcorp.com' */);\nCREATE TABLE Genre (GenreId BIGINT, Name VARCHAR);\nCREATE TABLE Invoice (InvoiceId BIGINT, CustomerId BIGINT, InvoiceDate TIMESTAMP, BillingAddress VARCHAR, BillingCity VARCHAR, BillingState VARCHAR, BillingCountry VARCHAR, BillingPostalCode VARCHAR, Total DOUBLE);\nCREATE TABLE InvoiceLine (InvoiceLineId BIGINT, InvoiceId BIGINT, TrackId BIGINT, UnitPrice DOUBLE, Quantity BIGINT);\nCREATE TABLE MediaType (MediaTypeId BIGINT, Name VARCHAR /* e.g. 'AAC audio file', 'MPEG audio file' */);\nCREATE TABLE Playlist (PlaylistId BIGINT, Name VARCHAR /* e.g. 'Audiobooks', 'Movies' */);\nCREATE TABLE PlaylistTrack (PlaylistId BIGINT, TrackId BIGINT);\nCREATE TABLE Track (TrackId BIGINT, Name VARCHAR, AlbumId BIGINT, MediaTypeId BIGINT, GenreId BIGINT, Composer VARCHAR, Milliseconds BIGINT, Bytes BIGINT, UnitPrice DOUBLE);", "question": "How many tracks have a composer name that contains the word 'John' (case-insensitive)?", "sql": "SELECT COUNT(*) FROM Track WHERE LOWER(Composer) LIKE '%john%';", "source": "synthetic", "difficulty": "easy", "accept": true, "review_note": "substring match also counts 'Johnson'; acceptable reading"}
|
| 12 |
+
{"id": "synth_chinook_0139", "db_id": "chinook", "schema_text": "CREATE TABLE Album (AlbumId BIGINT, Title VARCHAR, ArtistId BIGINT);\nCREATE TABLE Artist (ArtistId BIGINT, Name VARCHAR);\nCREATE TABLE Customer (CustomerId BIGINT, FirstName VARCHAR, LastName VARCHAR, Company VARCHAR /* e.g. 'Apple Inc.', 'Banco do Brasil S.A.' */, Address VARCHAR, City VARCHAR, State VARCHAR, Country VARCHAR, PostalCode VARCHAR, Phone VARCHAR, Fax VARCHAR /* e.g. '+1 (212) 221-4679', '+1 (408) 996-1011' */, Email VARCHAR, SupportRepId BIGINT);\nCREATE TABLE Employee (EmployeeId BIGINT, LastName VARCHAR /* e.g. 'Adams', 'Callahan' */, FirstName VARCHAR /* e.g. 'Andrew', 'Jane' */, Title VARCHAR /* e.g. 'Sales Support Agent', 'IT Staff' */, ReportsTo BIGINT, BirthDate TIMESTAMP, HireDate TIMESTAMP, Address VARCHAR /* e.g. '1111 6 Ave SW', '11120 Jasper Ave NW' */, City VARCHAR /* e.g. 'Calgary', 'Lethbridge' */, State VARCHAR /* e.g. 'AB' */, Country VARCHAR /* e.g. 'Canada' */, PostalCode VARCHAR /* e.g. 'T1H 1Y8', 'T1K 5N8' */, Phone VARCHAR /* e.g. '+1 (403) 262-3443', '+1 (403) 246-9887' */, Fax VARCHAR /* e.g. '+1 (403) 246-9899', '+1 (403) 262-3322' */, Email VARCHAR /* e.g. 'andrew@chinookcorp.com', 'jane@chinookcorp.com' */);\nCREATE TABLE Genre (GenreId BIGINT, Name VARCHAR);\nCREATE TABLE Invoice (InvoiceId BIGINT, CustomerId BIGINT, InvoiceDate TIMESTAMP, BillingAddress VARCHAR, BillingCity VARCHAR, BillingState VARCHAR, BillingCountry VARCHAR, BillingPostalCode VARCHAR, Total DOUBLE);\nCREATE TABLE InvoiceLine (InvoiceLineId BIGINT, InvoiceId BIGINT, TrackId BIGINT, UnitPrice DOUBLE, Quantity BIGINT);\nCREATE TABLE MediaType (MediaTypeId BIGINT, Name VARCHAR /* e.g. 'AAC audio file', 'MPEG audio file' */);\nCREATE TABLE Playlist (PlaylistId BIGINT, Name VARCHAR /* e.g. 'Audiobooks', 'Movies' */);\nCREATE TABLE PlaylistTrack (PlaylistId BIGINT, TrackId BIGINT);\nCREATE TABLE Track (TrackId BIGINT, Name VARCHAR, AlbumId BIGINT, MediaTypeId BIGINT, GenreId BIGINT, Composer VARCHAR, Milliseconds BIGINT, Bytes BIGINT, UnitPrice DOUBLE);", "question": "List the names of tracks that are longer than 7 minutes and belong to albums released by the artist 'Pink Floyd', showing track name, album title, and duration in minutes rounded to one decimal, sorted by duration descending, limit 5 rows", "sql": "SELECT t.Name AS track_name, al.Title AS album_title, ROUND(t.Milliseconds/60000.0,1) AS duration_minutes FROM Track t JOIN Album al ON t.AlbumId = al.AlbumId JOIN Artist ar ON al.ArtistId = ar.ArtistId WHERE t.Milliseconds > 7*60000 AND ar.Name='Pink Floyd' ORDER BY duration_minutes DESC LIMIT 5;", "source": "synthetic", "difficulty": "hard", "accept": true, "review_note": ""}
|
| 13 |
+
{"id": "synth_chinook_0153", "db_id": "chinook", "schema_text": "CREATE TABLE Album (AlbumId BIGINT, Title VARCHAR, ArtistId BIGINT);\nCREATE TABLE Artist (ArtistId BIGINT, Name VARCHAR);\nCREATE TABLE Customer (CustomerId BIGINT, FirstName VARCHAR, LastName VARCHAR, Company VARCHAR /* e.g. 'Apple Inc.', 'Banco do Brasil S.A.' */, Address VARCHAR, City VARCHAR, State VARCHAR, Country VARCHAR, PostalCode VARCHAR, Phone VARCHAR, Fax VARCHAR /* e.g. '+1 (212) 221-4679', '+1 (408) 996-1011' */, Email VARCHAR, SupportRepId BIGINT);\nCREATE TABLE Employee (EmployeeId BIGINT, LastName VARCHAR /* e.g. 'Adams', 'Callahan' */, FirstName VARCHAR /* e.g. 'Andrew', 'Jane' */, Title VARCHAR /* e.g. 'Sales Support Agent', 'IT Staff' */, ReportsTo BIGINT, BirthDate TIMESTAMP, HireDate TIMESTAMP, Address VARCHAR /* e.g. '1111 6 Ave SW', '11120 Jasper Ave NW' */, City VARCHAR /* e.g. 'Calgary', 'Lethbridge' */, State VARCHAR /* e.g. 'AB' */, Country VARCHAR /* e.g. 'Canada' */, PostalCode VARCHAR /* e.g. 'T1H 1Y8', 'T1K 5N8' */, Phone VARCHAR /* e.g. '+1 (403) 262-3443', '+1 (403) 246-9887' */, Fax VARCHAR /* e.g. '+1 (403) 246-9899', '+1 (403) 262-3322' */, Email VARCHAR /* e.g. 'andrew@chinookcorp.com', 'jane@chinookcorp.com' */);\nCREATE TABLE Genre (GenreId BIGINT, Name VARCHAR);\nCREATE TABLE Invoice (InvoiceId BIGINT, CustomerId BIGINT, InvoiceDate TIMESTAMP, BillingAddress VARCHAR, BillingCity VARCHAR, BillingState VARCHAR, BillingCountry VARCHAR, BillingPostalCode VARCHAR, Total DOUBLE);\nCREATE TABLE InvoiceLine (InvoiceLineId BIGINT, InvoiceId BIGINT, TrackId BIGINT, UnitPrice DOUBLE, Quantity BIGINT);\nCREATE TABLE MediaType (MediaTypeId BIGINT, Name VARCHAR /* e.g. 'AAC audio file', 'MPEG audio file' */);\nCREATE TABLE Playlist (PlaylistId BIGINT, Name VARCHAR /* e.g. 'Audiobooks', 'Movies' */);\nCREATE TABLE PlaylistTrack (PlaylistId BIGINT, TrackId BIGINT);\nCREATE TABLE Track (TrackId BIGINT, Name VARCHAR, AlbumId BIGINT, MediaTypeId BIGINT, GenreId BIGINT, Composer VARCHAR, Milliseconds BIGINT, Bytes BIGINT, UnitPrice DOUBLE);", "question": "List the first 10 tracks ordered by length (milliseconds) with their album title and the cumulative length of tracks within the same album up to that track ordered by track name", "sql": "SELECT t.Name, a.Title, SUM(t.Milliseconds) OVER (PARTITION BY t.AlbumId ORDER BY t.Name) AS cumulative_length FROM Track t JOIN Album a ON t.AlbumId = a.AlbumId ORDER BY t.Milliseconds LIMIT 10;", "source": "synthetic", "difficulty": "medium", "accept": true, "review_note": "contrived question, but the SQL does what it asks"}
|
| 14 |
+
{"id": "synth_chinook_0166", "db_id": "chinook", "schema_text": "CREATE TABLE Album (AlbumId BIGINT, Title VARCHAR, ArtistId BIGINT);\nCREATE TABLE Artist (ArtistId BIGINT, Name VARCHAR);\nCREATE TABLE Customer (CustomerId BIGINT, FirstName VARCHAR, LastName VARCHAR, Company VARCHAR /* e.g. 'Apple Inc.', 'Banco do Brasil S.A.' */, Address VARCHAR, City VARCHAR, State VARCHAR, Country VARCHAR, PostalCode VARCHAR, Phone VARCHAR, Fax VARCHAR /* e.g. '+1 (212) 221-4679', '+1 (408) 996-1011' */, Email VARCHAR, SupportRepId BIGINT);\nCREATE TABLE Employee (EmployeeId BIGINT, LastName VARCHAR /* e.g. 'Adams', 'Callahan' */, FirstName VARCHAR /* e.g. 'Andrew', 'Jane' */, Title VARCHAR /* e.g. 'Sales Support Agent', 'IT Staff' */, ReportsTo BIGINT, BirthDate TIMESTAMP, HireDate TIMESTAMP, Address VARCHAR /* e.g. '1111 6 Ave SW', '11120 Jasper Ave NW' */, City VARCHAR /* e.g. 'Calgary', 'Lethbridge' */, State VARCHAR /* e.g. 'AB' */, Country VARCHAR /* e.g. 'Canada' */, PostalCode VARCHAR /* e.g. 'T1H 1Y8', 'T1K 5N8' */, Phone VARCHAR /* e.g. '+1 (403) 262-3443', '+1 (403) 246-9887' */, Fax VARCHAR /* e.g. '+1 (403) 246-9899', '+1 (403) 262-3322' */, Email VARCHAR /* e.g. 'andrew@chinookcorp.com', 'jane@chinookcorp.com' */);\nCREATE TABLE Genre (GenreId BIGINT, Name VARCHAR);\nCREATE TABLE Invoice (InvoiceId BIGINT, CustomerId BIGINT, InvoiceDate TIMESTAMP, BillingAddress VARCHAR, BillingCity VARCHAR, BillingState VARCHAR, BillingCountry VARCHAR, BillingPostalCode VARCHAR, Total DOUBLE);\nCREATE TABLE InvoiceLine (InvoiceLineId BIGINT, InvoiceId BIGINT, TrackId BIGINT, UnitPrice DOUBLE, Quantity BIGINT);\nCREATE TABLE MediaType (MediaTypeId BIGINT, Name VARCHAR /* e.g. 'AAC audio file', 'MPEG audio file' */);\nCREATE TABLE Playlist (PlaylistId BIGINT, Name VARCHAR /* e.g. 'Audiobooks', 'Movies' */);\nCREATE TABLE PlaylistTrack (PlaylistId BIGINT, TrackId BIGINT);\nCREATE TABLE Track (TrackId BIGINT, Name VARCHAR, AlbumId BIGINT, MediaTypeId BIGINT, GenreId BIGINT, Composer VARCHAR, Milliseconds BIGINT, Bytes BIGINT, UnitPrice DOUBLE);", "question": "What percentage of 2022 revenue came from invoices dated in the last 30 days of the year? Return percentage rounded to one decimal.", "sql": "SELECT ROUND( SUM(CASE WHEN InvoiceDate >= '2022-12-01' THEN Total ELSE 0 END) * 100.0 / SUM(Total), 1 ) AS percentage FROM Invoice WHERE EXTRACT(YEAR FROM InvoiceDate) = 2022;", "source": "synthetic", "difficulty": "medium", "accept": false, "review_note": "'last 30 days of the year' coded as Dec 1-31 (31 days)"}
|
| 15 |
+
{"id": "synth_chinook_0173", "db_id": "chinook", "schema_text": "CREATE TABLE Album (AlbumId BIGINT, Title VARCHAR, ArtistId BIGINT);\nCREATE TABLE Artist (ArtistId BIGINT, Name VARCHAR);\nCREATE TABLE Customer (CustomerId BIGINT, FirstName VARCHAR, LastName VARCHAR, Company VARCHAR /* e.g. 'Apple Inc.', 'Banco do Brasil S.A.' */, Address VARCHAR, City VARCHAR, State VARCHAR, Country VARCHAR, PostalCode VARCHAR, Phone VARCHAR, Fax VARCHAR /* e.g. '+1 (212) 221-4679', '+1 (408) 996-1011' */, Email VARCHAR, SupportRepId BIGINT);\nCREATE TABLE Employee (EmployeeId BIGINT, LastName VARCHAR /* e.g. 'Adams', 'Callahan' */, FirstName VARCHAR /* e.g. 'Andrew', 'Jane' */, Title VARCHAR /* e.g. 'Sales Support Agent', 'IT Staff' */, ReportsTo BIGINT, BirthDate TIMESTAMP, HireDate TIMESTAMP, Address VARCHAR /* e.g. '1111 6 Ave SW', '11120 Jasper Ave NW' */, City VARCHAR /* e.g. 'Calgary', 'Lethbridge' */, State VARCHAR /* e.g. 'AB' */, Country VARCHAR /* e.g. 'Canada' */, PostalCode VARCHAR /* e.g. 'T1H 1Y8', 'T1K 5N8' */, Phone VARCHAR /* e.g. '+1 (403) 262-3443', '+1 (403) 246-9887' */, Fax VARCHAR /* e.g. '+1 (403) 246-9899', '+1 (403) 262-3322' */, Email VARCHAR /* e.g. 'andrew@chinookcorp.com', 'jane@chinookcorp.com' */);\nCREATE TABLE Genre (GenreId BIGINT, Name VARCHAR);\nCREATE TABLE Invoice (InvoiceId BIGINT, CustomerId BIGINT, InvoiceDate TIMESTAMP, BillingAddress VARCHAR, BillingCity VARCHAR, BillingState VARCHAR, BillingCountry VARCHAR, BillingPostalCode VARCHAR, Total DOUBLE);\nCREATE TABLE InvoiceLine (InvoiceLineId BIGINT, InvoiceId BIGINT, TrackId BIGINT, UnitPrice DOUBLE, Quantity BIGINT);\nCREATE TABLE MediaType (MediaTypeId BIGINT, Name VARCHAR /* e.g. 'AAC audio file', 'MPEG audio file' */);\nCREATE TABLE Playlist (PlaylistId BIGINT, Name VARCHAR /* e.g. 'Audiobooks', 'Movies' */);\nCREATE TABLE PlaylistTrack (PlaylistId BIGINT, TrackId BIGINT);\nCREATE TABLE Track (TrackId BIGINT, Name VARCHAR, AlbumId BIGINT, MediaTypeId BIGINT, GenreId BIGINT, Composer VARCHAR, Milliseconds BIGINT, Bytes BIGINT, UnitPrice DOUBLE);", "question": "For each year, what is the total number of invoices and what share of the total invoice count does that year represent, sorted by year ascending?", "sql": "SELECT CAST(strftime('%Y', InvoiceDate) AS INTEGER) AS year, COUNT(*) AS invoices, ROUND(100.0*COUNT(*)/SUM(COUNT(*)) OVER(),2) AS share FROM Invoice GROUP BY year ORDER BY year ASC;", "source": "synthetic", "difficulty": "easy", "accept": true, "review_note": "rounds the share to 2 decimals though not asked"}
|
| 16 |
+
{"id": "synth_chinook_0192", "db_id": "chinook", "schema_text": "CREATE TABLE Album (AlbumId BIGINT, Title VARCHAR, ArtistId BIGINT);\nCREATE TABLE Artist (ArtistId BIGINT, Name VARCHAR);\nCREATE TABLE Customer (CustomerId BIGINT, FirstName VARCHAR, LastName VARCHAR, Company VARCHAR /* e.g. 'Apple Inc.', 'Banco do Brasil S.A.' */, Address VARCHAR, City VARCHAR, State VARCHAR, Country VARCHAR, PostalCode VARCHAR, Phone VARCHAR, Fax VARCHAR /* e.g. '+1 (212) 221-4679', '+1 (408) 996-1011' */, Email VARCHAR, SupportRepId BIGINT);\nCREATE TABLE Employee (EmployeeId BIGINT, LastName VARCHAR /* e.g. 'Adams', 'Callahan' */, FirstName VARCHAR /* e.g. 'Andrew', 'Jane' */, Title VARCHAR /* e.g. 'Sales Support Agent', 'IT Staff' */, ReportsTo BIGINT, BirthDate TIMESTAMP, HireDate TIMESTAMP, Address VARCHAR /* e.g. '1111 6 Ave SW', '11120 Jasper Ave NW' */, City VARCHAR /* e.g. 'Calgary', 'Lethbridge' */, State VARCHAR /* e.g. 'AB' */, Country VARCHAR /* e.g. 'Canada' */, PostalCode VARCHAR /* e.g. 'T1H 1Y8', 'T1K 5N8' */, Phone VARCHAR /* e.g. '+1 (403) 262-3443', '+1 (403) 246-9887' */, Fax VARCHAR /* e.g. '+1 (403) 246-9899', '+1 (403) 262-3322' */, Email VARCHAR /* e.g. 'andrew@chinookcorp.com', 'jane@chinookcorp.com' */);\nCREATE TABLE Genre (GenreId BIGINT, Name VARCHAR);\nCREATE TABLE Invoice (InvoiceId BIGINT, CustomerId BIGINT, InvoiceDate TIMESTAMP, BillingAddress VARCHAR, BillingCity VARCHAR, BillingState VARCHAR, BillingCountry VARCHAR, BillingPostalCode VARCHAR, Total DOUBLE);\nCREATE TABLE InvoiceLine (InvoiceLineId BIGINT, InvoiceId BIGINT, TrackId BIGINT, UnitPrice DOUBLE, Quantity BIGINT);\nCREATE TABLE MediaType (MediaTypeId BIGINT, Name VARCHAR /* e.g. 'AAC audio file', 'MPEG audio file' */);\nCREATE TABLE Playlist (PlaylistId BIGINT, Name VARCHAR /* e.g. 'Audiobooks', 'Movies' */);\nCREATE TABLE PlaylistTrack (PlaylistId BIGINT, TrackId BIGINT);\nCREATE TABLE Track (TrackId BIGINT, Name VARCHAR, AlbumId BIGINT, MediaTypeId BIGINT, GenreId BIGINT, Composer VARCHAR, Milliseconds BIGINT, Bytes BIGINT, UnitPrice DOUBLE);", "question": "List track names that are in the 'Rock' genre but never appear in invoices for customers from the United States. Return track name and album title, ordered by track name, limit 7.", "sql": "SELECT t.Name AS track_name, al.Title AS album_title FROM Track t JOIN Genre g ON t.GenreId = g.GenreId JOIN Album al ON t.AlbumId = al.AlbumId WHERE g.Name = 'Rock' AND NOT EXISTS (SELECT 1 FROM InvoiceLine il JOIN Invoice i ON il.InvoiceId = i.InvoiceId WHERE il.TrackId = t.TrackId AND i.BillingCountry = 'USA') ORDER BY t.Name LIMIT 7;", "source": "synthetic", "difficulty": "medium", "accept": true, "review_note": "billing country stands in for customer country"}
|
| 17 |
+
{"id": "synth_chinook_0193", "db_id": "chinook", "schema_text": "CREATE TABLE Album (AlbumId BIGINT, Title VARCHAR, ArtistId BIGINT);\nCREATE TABLE Artist (ArtistId BIGINT, Name VARCHAR);\nCREATE TABLE Customer (CustomerId BIGINT, FirstName VARCHAR, LastName VARCHAR, Company VARCHAR /* e.g. 'Apple Inc.', 'Banco do Brasil S.A.' */, Address VARCHAR, City VARCHAR, State VARCHAR, Country VARCHAR, PostalCode VARCHAR, Phone VARCHAR, Fax VARCHAR /* e.g. '+1 (212) 221-4679', '+1 (408) 996-1011' */, Email VARCHAR, SupportRepId BIGINT);\nCREATE TABLE Employee (EmployeeId BIGINT, LastName VARCHAR /* e.g. 'Adams', 'Callahan' */, FirstName VARCHAR /* e.g. 'Andrew', 'Jane' */, Title VARCHAR /* e.g. 'Sales Support Agent', 'IT Staff' */, ReportsTo BIGINT, BirthDate TIMESTAMP, HireDate TIMESTAMP, Address VARCHAR /* e.g. '1111 6 Ave SW', '11120 Jasper Ave NW' */, City VARCHAR /* e.g. 'Calgary', 'Lethbridge' */, State VARCHAR /* e.g. 'AB' */, Country VARCHAR /* e.g. 'Canada' */, PostalCode VARCHAR /* e.g. 'T1H 1Y8', 'T1K 5N8' */, Phone VARCHAR /* e.g. '+1 (403) 262-3443', '+1 (403) 246-9887' */, Fax VARCHAR /* e.g. '+1 (403) 246-9899', '+1 (403) 262-3322' */, Email VARCHAR /* e.g. 'andrew@chinookcorp.com', 'jane@chinookcorp.com' */);\nCREATE TABLE Genre (GenreId BIGINT, Name VARCHAR);\nCREATE TABLE Invoice (InvoiceId BIGINT, CustomerId BIGINT, InvoiceDate TIMESTAMP, BillingAddress VARCHAR, BillingCity VARCHAR, BillingState VARCHAR, BillingCountry VARCHAR, BillingPostalCode VARCHAR, Total DOUBLE);\nCREATE TABLE InvoiceLine (InvoiceLineId BIGINT, InvoiceId BIGINT, TrackId BIGINT, UnitPrice DOUBLE, Quantity BIGINT);\nCREATE TABLE MediaType (MediaTypeId BIGINT, Name VARCHAR /* e.g. 'AAC audio file', 'MPEG audio file' */);\nCREATE TABLE Playlist (PlaylistId BIGINT, Name VARCHAR /* e.g. 'Audiobooks', 'Movies' */);\nCREATE TABLE PlaylistTrack (PlaylistId BIGINT, TrackId BIGINT);\nCREATE TABLE Track (TrackId BIGINT, Name VARCHAR, AlbumId BIGINT, MediaTypeId BIGINT, GenreId BIGINT, Composer VARCHAR, Milliseconds BIGINT, Bytes BIGINT, UnitPrice DOUBLE);", "question": "List album titles that have tracks sold to customers in Brazil but no tracks sold to customers in Canada. Return album title, sorted alphabetically, limit 6.", "sql": "SELECT al.Title FROM Album al WHERE EXISTS (SELECT 1 FROM Track t JOIN InvoiceLine il ON t.TrackId = il.TrackId JOIN Invoice i ON il.InvoiceId = i.InvoiceId WHERE t.AlbumId = al.AlbumId AND i.BillingCountry = 'Brazil') AND NOT EXISTS (SELECT 1 FROM Track t JOIN InvoiceLine il ON t.TrackId = il.TrackId JOIN Invoice i ON il.InvoiceId = i.InvoiceId WHERE t.AlbumId = al.AlbumId AND i.BillingCountry = 'Canada') ORDER BY al.Title LIMIT 6;", "source": "synthetic", "difficulty": "hard", "accept": true, "review_note": ""}
|
| 18 |
+
{"id": "synth_penguins_0021", "db_id": "penguins", "schema_text": "CREATE TABLE penguins (species VARCHAR /* e.g. 'Adelie', 'Gentoo' */, island VARCHAR /* e.g. 'Biscoe', 'Dream' */, bill_length_mm DOUBLE, bill_depth_mm DOUBLE, flipper_length_mm BIGINT, body_mass_g BIGINT, sex VARCHAR /* e.g. 'male', 'female' */, year BIGINT);", "question": "Which species has the highest average body mass? Return species and average body mass, rounded to nearest integer.", "sql": "SELECT species, ROUND(AVG(body_mass_g)) AS avg_body_mass FROM penguins GROUP BY species ORDER BY avg_body_mass DESC LIMIT 1;", "source": "synthetic", "difficulty": "medium", "accept": true, "review_note": ""}
|
| 19 |
+
{"id": "synth_penguins_0029", "db_id": "penguins", "schema_text": "CREATE TABLE penguins (species VARCHAR /* e.g. 'Adelie', 'Gentoo' */, island VARCHAR /* e.g. 'Biscoe', 'Dream' */, bill_length_mm DOUBLE, bill_depth_mm DOUBLE, flipper_length_mm BIGINT, body_mass_g BIGINT, sex VARCHAR /* e.g. 'male', 'female' */, year BIGINT);", "question": "What is the average bill length for each year, rounded to two decimals, and show the year with the lowest average bill length? Return year and average bill length.", "sql": "SELECT year, ROUND(AVG(bill_length_mm),2) AS avg_bill_length FROM penguins GROUP BY year ORDER BY avg_bill_length ASC LIMIT 1;", "source": "synthetic", "difficulty": "hard", "accept": true, "review_note": "wording mixes 'each year' with 'the lowest year'; SQL returns the lowest year, matching 'return year and average'"}
|
| 20 |
+
{"id": "synth_penguins_0050", "db_id": "penguins", "schema_text": "CREATE TABLE penguins (species VARCHAR /* e.g. 'Adelie', 'Gentoo' */, island VARCHAR /* e.g. 'Biscoe', 'Dream' */, bill_length_mm DOUBLE, bill_depth_mm DOUBLE, flipper_length_mm BIGINT, body_mass_g BIGINT, sex VARCHAR /* e.g. 'male', 'female' */, year BIGINT);", "question": "List the top 5 heaviest penguins (species, body mass) that are not on the island of Dream.", "sql": "SELECT species, body_mass_g FROM penguins WHERE island<>'Dream' ORDER BY body_mass_g DESC LIMIT 5;", "source": "synthetic", "difficulty": "easy", "accept": true, "review_note": ""}
|
| 21 |
+
{"id": "synth_penguins_0055", "db_id": "penguins", "schema_text": "CREATE TABLE penguins (species VARCHAR /* e.g. 'Adelie', 'Gentoo' */, island VARCHAR /* e.g. 'Biscoe', 'Dream' */, bill_length_mm DOUBLE, bill_depth_mm DOUBLE, flipper_length_mm BIGINT, body_mass_g BIGINT, sex VARCHAR /* e.g. 'male', 'female' */, year BIGINT);", "question": "Retrieve the species and year of any penguin that has a bill length equal to the maximum bill length recorded for its species.", "sql": "SELECT species, year FROM penguins p WHERE bill_length_mm = (SELECT MAX(bill_length_mm) FROM penguins WHERE species=p.species);", "source": "synthetic", "difficulty": "medium", "accept": true, "review_note": ""}
|
| 22 |
+
{"id": "synth_penguins_0056", "db_id": "penguins", "schema_text": "CREATE TABLE penguins (species VARCHAR /* e.g. 'Adelie', 'Gentoo' */, island VARCHAR /* e.g. 'Biscoe', 'Dream' */, bill_length_mm DOUBLE, bill_depth_mm DOUBLE, flipper_length_mm BIGINT, body_mass_g BIGINT, sex VARCHAR /* e.g. 'male', 'female' */, year BIGINT);", "question": "Show the year and average flipper length for years where the average flipper length exceeds the overall average flipper length.", "sql": "SELECT year, AVG(flipper_length_mm) AS avg_flipper FROM penguins GROUP BY year HAVING AVG(flipper_length_mm) > (SELECT AVG(flipper_length_mm) FROM penguins);", "source": "synthetic", "difficulty": "medium", "accept": true, "review_note": ""}
|
| 23 |
+
{"id": "synth_penguins_0059", "db_id": "penguins", "schema_text": "CREATE TABLE penguins (species VARCHAR /* e.g. 'Adelie', 'Gentoo' */, island VARCHAR /* e.g. 'Biscoe', 'Dream' */, bill_length_mm DOUBLE, bill_depth_mm DOUBLE, flipper_length_mm BIGINT, body_mass_g BIGINT, sex VARCHAR /* e.g. 'male', 'female' */, year BIGINT);", "question": "Give the island, species, and average bill length for islands that host more than 5 penguins whose bill length is below the overall average bill length.", "sql": "SELECT island, species, AVG(bill_length_mm) AS avg_bill_length FROM penguins WHERE bill_length_mm < (SELECT AVG(bill_length_mm) FROM penguins) GROUP BY island, species HAVING COUNT(*)>5;", "source": "synthetic", "difficulty": "extra", "accept": false, "review_note": "ambiguous: the island-level condition is applied per island and species, and the average covers only the below-average penguins"}
|
| 24 |
+
{"id": "synth_penguins_0074", "db_id": "penguins", "schema_text": "CREATE TABLE penguins (species VARCHAR /* e.g. 'Adelie', 'Gentoo' */, island VARCHAR /* e.g. 'Biscoe', 'Dream' */, bill_length_mm DOUBLE, bill_depth_mm DOUBLE, flipper_length_mm BIGINT, body_mass_g BIGINT, sex VARCHAR /* e.g. 'male', 'female' */, year BIGINT);", "question": "What is the average body mass for each species in 2009, listed from the heaviest to the lightest average?", "sql": "SELECT species, AVG(body_mass_g) AS avg_body_mass FROM penguins WHERE year=2009 GROUP BY species ORDER BY avg_body_mass DESC;", "source": "synthetic", "difficulty": "medium", "accept": true, "review_note": ""}
|
| 25 |
+
{"id": "synth_penguins_0083", "db_id": "penguins", "schema_text": "CREATE TABLE penguins (species VARCHAR /* e.g. 'Adelie', 'Gentoo' */, island VARCHAR /* e.g. 'Biscoe', 'Dream' */, bill_length_mm DOUBLE, bill_depth_mm DOUBLE, flipper_length_mm BIGINT, body_mass_g BIGINT, sex VARCHAR /* e.g. 'male', 'female' */, year BIGINT);", "question": "For each year, give the minimum and maximum body mass observed.", "sql": "SELECT year, MIN(body_mass_g) AS min_mass, MAX(body_mass_g) AS max_mass FROM penguins GROUP BY year;", "source": "synthetic", "difficulty": "easy", "accept": true, "review_note": ""}
|
| 26 |
+
{"id": "synth_penguins_0091", "db_id": "penguins", "schema_text": "CREATE TABLE penguins (species VARCHAR /* e.g. 'Adelie', 'Gentoo' */, island VARCHAR /* e.g. 'Biscoe', 'Dream' */, bill_length_mm DOUBLE, bill_depth_mm DOUBLE, flipper_length_mm BIGINT, body_mass_g BIGINT, sex VARCHAR /* e.g. 'male', 'female' */, year BIGINT);", "question": "Create buckets for bill depth: small (≤ 15 mm), medium (15-17 mm), large (> 17 mm). Show each bucket and the count of penguins in it.", "sql": "SELECT CASE WHEN bill_depth_mm <= 15 THEN 'small' WHEN bill_depth_mm <= 17 THEN 'medium' ELSE 'large' END AS bucket, COUNT(*) AS count FROM penguins GROUP BY bucket ORDER BY bucket;", "source": "synthetic", "difficulty": "medium", "accept": false, "review_note": "the 2 penguins with no bill depth fall into 'large' through ELSE"}
|
| 27 |
+
{"id": "synth_penguins_0100", "db_id": "penguins", "schema_text": "CREATE TABLE penguins (species VARCHAR /* e.g. 'Adelie', 'Gentoo' */, island VARCHAR /* e.g. 'Biscoe', 'Dream' */, bill_length_mm DOUBLE, bill_depth_mm DOUBLE, flipper_length_mm BIGINT, body_mass_g BIGINT, sex VARCHAR /* e.g. 'male', 'female' */, year BIGINT);", "question": "What is the count of penguins for each combination of species and sex, ordered by species then sex?", "sql": "SELECT species, sex, COUNT(*) AS count FROM penguins GROUP BY species, sex ORDER BY species, sex;", "source": "synthetic", "difficulty": "easy", "accept": true, "review_note": "includes the unknown-sex groups, which are combinations in the data"}
|
| 28 |
+
{"id": "synth_penguins_0120", "db_id": "penguins", "schema_text": "CREATE TABLE penguins (species VARCHAR /* e.g. 'Adelie', 'Gentoo' */, island VARCHAR /* e.g. 'Biscoe', 'Dream' */, bill_length_mm DOUBLE, bill_depth_mm DOUBLE, flipper_length_mm BIGINT, body_mass_g BIGINT, sex VARCHAR /* e.g. 'male', 'female' */, year BIGINT);", "question": "List the top three penguins with the largest difference between bill length and bill depth, showing species, island, year, and the difference value.", "sql": "SELECT species, island, year, ABS(bill_length_mm - bill_depth_mm) AS diff FROM penguins WHERE bill_length_mm IS NOT NULL AND bill_depth_mm IS NOT NULL ORDER BY diff DESC LIMIT 3;", "source": "synthetic", "difficulty": "extra", "accept": true, "review_note": ""}
|
| 29 |
+
{"id": "synth_penguins_0125", "db_id": "penguins", "schema_text": "CREATE TABLE penguins (species VARCHAR /* e.g. 'Adelie', 'Gentoo' */, island VARCHAR /* e.g. 'Biscoe', 'Dream' */, bill_length_mm DOUBLE, bill_depth_mm DOUBLE, flipper_length_mm BIGINT, body_mass_g BIGINT, sex VARCHAR /* e.g. 'male', 'female' */, year BIGINT);", "question": "Show the bill length and flipper length for the top three heaviest male Adelie penguins, sorted by body mass descending.", "sql": "SELECT bill_length_mm, flipper_length_mm FROM penguins WHERE species='Adelie' AND sex='male' ORDER BY body_mass_g DESC LIMIT 3;", "source": "synthetic", "difficulty": "hard", "accept": true, "review_note": ""}
|
| 30 |
+
{"id": "synth_penguins_0135", "db_id": "penguins", "schema_text": "CREATE TABLE penguins (species VARCHAR /* e.g. 'Adelie', 'Gentoo' */, island VARCHAR /* e.g. 'Biscoe', 'Dream' */, bill_length_mm DOUBLE, bill_depth_mm DOUBLE, flipper_length_mm BIGINT, body_mass_g BIGINT, sex VARCHAR /* e.g. 'male', 'female' */, year BIGINT);", "question": "Give the average flipper length for each combination of species and island, ignoring missing flipper lengths, ordered by species then island.", "sql": "SELECT species, island, AVG(flipper_length_mm) AS avg_flipper FROM penguins WHERE flipper_length_mm IS NOT NULL GROUP BY species, island ORDER BY species, island;", "source": "synthetic", "difficulty": "medium", "accept": true, "review_note": ""}
|
| 31 |
+
{"id": "synth_penguins_0139", "db_id": "penguins", "schema_text": "CREATE TABLE penguins (species VARCHAR /* e.g. 'Adelie', 'Gentoo' */, island VARCHAR /* e.g. 'Biscoe', 'Dream' */, bill_length_mm DOUBLE, bill_depth_mm DOUBLE, flipper_length_mm BIGINT, body_mass_g BIGINT, sex VARCHAR /* e.g. 'male', 'female' */, year BIGINT);", "question": "List the distinct first two letters of each species name, along with how many penguins have that prefix, ordered by the prefix.", "sql": "SELECT SUBSTRING(species,1,2) AS prefix, COUNT(*) AS cnt FROM penguins GROUP BY prefix ORDER BY prefix;", "source": "synthetic", "difficulty": "easy", "accept": true, "review_note": ""}
|
| 32 |
+
{"id": "synth_penguins_0140", "db_id": "penguins", "schema_text": "CREATE TABLE penguins (species VARCHAR /* e.g. 'Adelie', 'Gentoo' */, island VARCHAR /* e.g. 'Biscoe', 'Dream' */, bill_length_mm DOUBLE, bill_depth_mm DOUBLE, flipper_length_mm BIGINT, body_mass_g BIGINT, sex VARCHAR /* e.g. 'male', 'female' */, year BIGINT);", "question": "Show the total number of penguins for each year, but display the year as a string padded to 4 characters with leading zeros.", "sql": "SELECT LPAD(CAST(year AS VARCHAR), 4, '0') AS year_str, COUNT(*) AS total FROM penguins GROUP BY year ORDER BY year;", "source": "synthetic", "difficulty": "easy", "accept": true, "review_note": ""}
|
| 33 |
+
{"id": "synth_penguins_0159", "db_id": "penguins", "schema_text": "CREATE TABLE penguins (species VARCHAR /* e.g. 'Adelie', 'Gentoo' */, island VARCHAR /* e.g. 'Biscoe', 'Dream' */, bill_length_mm DOUBLE, bill_depth_mm DOUBLE, flipper_length_mm BIGINT, body_mass_g BIGINT, sex VARCHAR /* e.g. 'male', 'female' */, year BIGINT);", "question": "How many distinct islands have at least one Gentoo penguin?", "sql": "SELECT COUNT(DISTINCT island) FROM penguins WHERE species = 'Gentoo';", "source": "synthetic", "difficulty": "easy", "accept": true, "review_note": ""}
|
| 34 |
+
{"id": "synth_penguins_0177", "db_id": "penguins", "schema_text": "CREATE TABLE penguins (species VARCHAR /* e.g. 'Adelie', 'Gentoo' */, island VARCHAR /* e.g. 'Biscoe', 'Dream' */, bill_length_mm DOUBLE, bill_depth_mm DOUBLE, flipper_length_mm BIGINT, body_mass_g BIGINT, sex VARCHAR /* e.g. 'male', 'female' */, year BIGINT);", "question": "Which species have at least 15 records and an average bill depth greater than 17 mm, showing species and that average, sorted by average descending", "sql": "SELECT species, AVG(bill_depth_mm) AS avg_depth FROM penguins GROUP BY species HAVING COUNT(*)>=15 AND AVG(bill_depth_mm)>17 ORDER BY avg_depth DESC;", "source": "synthetic", "difficulty": "easy", "accept": true, "review_note": ""}
|
| 35 |
+
{"id": "synth_world_bank_0013", "db_id": "world_bank", "schema_text": "CREATE TABLE countries (iso3 VARCHAR, name VARCHAR, region VARCHAR /* e.g. 'Europe & Central Asia', 'Sub-Saharan Africa' */, income_group VARCHAR /* e.g. 'High income', 'Upper middle income' */, capital_city VARCHAR);\nCREATE TABLE country_stats (iso3 VARCHAR, year BIGINT, population BIGINT, gdp_usd BIGINT, gdp_per_capita_usd DOUBLE, life_expectancy_years DOUBLE, fertility_rate DOUBLE, urban_population_pct DOUBLE, internet_users_pct DOUBLE, unemployment_pct DOUBLE);", "question": "Find the country with the largest increase in life expectancy between 2000 and 2020.", "sql": "SELECT c.name, (s2020.life_expectancy_years - s2000.life_expectancy_years) AS increase FROM country_stats s2000 JOIN country_stats s2020 ON s2000.iso3=s2020.iso3 JOIN countries c ON s2000.iso3=c.iso3 WHERE s2000.year=2000 AND s2020.year=2020 ORDER BY increase DESC LIMIT 1;", "source": "synthetic", "difficulty": "hard", "accept": true, "review_note": ""}
|
| 36 |
+
{"id": "synth_world_bank_0014", "db_id": "world_bank", "schema_text": "CREATE TABLE countries (iso3 VARCHAR, name VARCHAR, region VARCHAR /* e.g. 'Europe & Central Asia', 'Sub-Saharan Africa' */, income_group VARCHAR /* e.g. 'High income', 'Upper middle income' */, capital_city VARCHAR);\nCREATE TABLE country_stats (iso3 VARCHAR, year BIGINT, population BIGINT, gdp_usd BIGINT, gdp_per_capita_usd DOUBLE, life_expectancy_years DOUBLE, fertility_rate DOUBLE, urban_population_pct DOUBLE, internet_users_pct DOUBLE, unemployment_pct DOUBLE);", "question": "What are the top 5 countries by population density (population divided by GDP) in 2021?", "sql": "SELECT c.name, s.population / s.gdp_usd AS density FROM country_stats s JOIN countries c ON s.iso3=c.iso3 WHERE s.year=2021 ORDER BY density DESC LIMIT 5;", "source": "synthetic", "difficulty": "hard", "accept": false, "review_note": "calls population / GDP 'population density': teaches a wrong meaning"}
|
| 37 |
+
{"id": "synth_world_bank_0045", "db_id": "world_bank", "schema_text": "CREATE TABLE countries (iso3 VARCHAR, name VARCHAR, region VARCHAR /* e.g. 'Europe & Central Asia', 'Sub-Saharan Africa' */, income_group VARCHAR /* e.g. 'High income', 'Upper middle income' */, capital_city VARCHAR);\nCREATE TABLE country_stats (iso3 VARCHAR, year BIGINT, population BIGINT, gdp_usd BIGINT, gdp_per_capita_usd DOUBLE, life_expectancy_years DOUBLE, fertility_rate DOUBLE, urban_population_pct DOUBLE, internet_users_pct DOUBLE, unemployment_pct DOUBLE);", "question": "Find the region whose countries together have the lowest average fertility rate in 2015, showing the region and the average fertility rate rounded to two decimals.", "sql": "SELECT region, ROUND(AVG(fertility_rate),2) AS avg_fertility FROM country_stats JOIN countries USING(iso3) WHERE year=2015 GROUP BY region ORDER BY avg_fertility ASC LIMIT 1;", "source": "synthetic", "difficulty": "medium", "accept": true, "review_note": "unweighted mean over the region's countries; fair reading of 'together'"}
|
| 38 |
+
{"id": "synth_world_bank_0055", "db_id": "world_bank", "schema_text": "CREATE TABLE countries (iso3 VARCHAR, name VARCHAR, region VARCHAR /* e.g. 'Europe & Central Asia', 'Sub-Saharan Africa' */, income_group VARCHAR /* e.g. 'High income', 'Upper middle income' */, capital_city VARCHAR);\nCREATE TABLE country_stats (iso3 VARCHAR, year BIGINT, population BIGINT, gdp_usd BIGINT, gdp_per_capita_usd DOUBLE, life_expectancy_years DOUBLE, fertility_rate DOUBLE, urban_population_pct DOUBLE, internet_users_pct DOUBLE, unemployment_pct DOUBLE);", "question": "List income groups that have at least ten countries with a recorded unemployment percentage below 5% in any year, showing income group and the count of such countries, sorted by count descending.", "sql": "SELECT income_group, COUNT(DISTINCT iso3) AS country_count FROM country_stats JOIN countries USING(iso3) WHERE unemployment_pct<5 GROUP BY income_group HAVING country_count>=10 ORDER BY country_count DESC;", "source": "synthetic", "difficulty": "extra", "accept": true, "review_note": ""}
|
| 39 |
+
{"id": "synth_world_bank_0061", "db_id": "world_bank", "schema_text": "CREATE TABLE countries (iso3 VARCHAR, name VARCHAR, region VARCHAR /* e.g. 'Europe & Central Asia', 'Sub-Saharan Africa' */, income_group VARCHAR /* e.g. 'High income', 'Upper middle income' */, capital_city VARCHAR);\nCREATE TABLE country_stats (iso3 VARCHAR, year BIGINT, population BIGINT, gdp_usd BIGINT, gdp_per_capita_usd DOUBLE, life_expectancy_years DOUBLE, fertility_rate DOUBLE, urban_population_pct DOUBLE, internet_users_pct DOUBLE, unemployment_pct DOUBLE);", "question": "How many countries have missing capital city information?", "sql": "SELECT COUNT(*) FROM countries WHERE capital_city IS NULL;", "source": "synthetic", "difficulty": "easy", "accept": true, "review_note": ""}
|
| 40 |
+
{"id": "synth_world_bank_0069", "db_id": "world_bank", "schema_text": "CREATE TABLE countries (iso3 VARCHAR, name VARCHAR, region VARCHAR /* e.g. 'Europe & Central Asia', 'Sub-Saharan Africa' */, income_group VARCHAR /* e.g. 'High income', 'Upper middle income' */, capital_city VARCHAR);\nCREATE TABLE country_stats (iso3 VARCHAR, year BIGINT, population BIGINT, gdp_usd BIGINT, gdp_per_capita_usd DOUBLE, life_expectancy_years DOUBLE, fertility_rate DOUBLE, urban_population_pct DOUBLE, internet_users_pct DOUBLE, unemployment_pct DOUBLE);", "question": "Give the name and capital city of the country with the smallest population in 2022.", "sql": "SELECT c.name, c.capital_city FROM countries c JOIN country_stats cs ON c.iso3=cs.iso3 WHERE cs.year=2022 ORDER BY cs.population ASC LIMIT 1;", "source": "synthetic", "difficulty": "medium", "accept": true, "review_note": ""}
|
| 41 |
+
{"id": "synth_world_bank_0073", "db_id": "world_bank", "schema_text": "CREATE TABLE countries (iso3 VARCHAR, name VARCHAR, region VARCHAR /* e.g. 'Europe & Central Asia', 'Sub-Saharan Africa' */, income_group VARCHAR /* e.g. 'High income', 'Upper middle income' */, capital_city VARCHAR);\nCREATE TABLE country_stats (iso3 VARCHAR, year BIGINT, population BIGINT, gdp_usd BIGINT, gdp_per_capita_usd DOUBLE, life_expectancy_years DOUBLE, fertility_rate DOUBLE, urban_population_pct DOUBLE, internet_users_pct DOUBLE, unemployment_pct DOUBLE);", "question": "What proportion of countries have missing internet user percentages in 2022? Return the proportion as a decimal between 0 and 1.", "sql": "SELECT COUNT(CASE WHEN internet_users_pct IS NULL THEN 1 END) * 1.0 / COUNT(*) AS proportion_missing FROM country_stats WHERE year = 2022;", "source": "synthetic", "difficulty": "easy", "accept": true, "review_note": "share of the 2022 rows, i.e. countries with 2022 data"}
|
| 42 |
+
{"id": "synth_world_bank_0106", "db_id": "world_bank", "schema_text": "CREATE TABLE countries (iso3 VARCHAR, name VARCHAR, region VARCHAR /* e.g. 'Europe & Central Asia', 'Sub-Saharan Africa' */, income_group VARCHAR /* e.g. 'High income', 'Upper middle income' */, capital_city VARCHAR);\nCREATE TABLE country_stats (iso3 VARCHAR, year BIGINT, population BIGINT, gdp_usd BIGINT, gdp_per_capita_usd DOUBLE, life_expectancy_years DOUBLE, fertility_rate DOUBLE, urban_population_pct DOUBLE, internet_users_pct DOUBLE, unemployment_pct DOUBLE);", "question": "List the top 5 countries by internet usage percentage in 2019, showing country name and internet users percentage, ordered from highest to lowest.", "sql": "SELECT c.name, cs.internet_users_pct FROM country_stats cs JOIN countries c USING (iso3) WHERE cs.year = 2019 ORDER BY cs.internet_users_pct DESC LIMIT 5;", "source": "synthetic", "difficulty": "medium", "accept": true, "review_note": ""}
|
| 43 |
+
{"id": "synth_world_bank_0117", "db_id": "world_bank", "schema_text": "CREATE TABLE countries (iso3 VARCHAR, name VARCHAR, region VARCHAR /* e.g. 'Europe & Central Asia', 'Sub-Saharan Africa' */, income_group VARCHAR /* e.g. 'High income', 'Upper middle income' */, capital_city VARCHAR);\nCREATE TABLE country_stats (iso3 VARCHAR, year BIGINT, population BIGINT, gdp_usd BIGINT, gdp_per_capita_usd DOUBLE, life_expectancy_years DOUBLE, fertility_rate DOUBLE, urban_population_pct DOUBLE, internet_users_pct DOUBLE, unemployment_pct DOUBLE);", "question": "Which five years saw the greatest total increase in world population compared to the previous year? Return year and increase, ordered by increase descending.", "sql": "SELECT year, SUM(population) - LAG(SUM(population)) OVER (ORDER BY year) AS pop_increase FROM country_stats GROUP BY year ORDER BY pop_increase DESC LIMIT 5;", "source": "synthetic", "difficulty": "extra", "accept": true, "review_note": "sums whichever countries report each year; coverage barely changes"}
|
| 44 |
+
{"id": "synth_world_bank_0119", "db_id": "world_bank", "schema_text": "CREATE TABLE countries (iso3 VARCHAR, name VARCHAR, region VARCHAR /* e.g. 'Europe & Central Asia', 'Sub-Saharan Africa' */, income_group VARCHAR /* e.g. 'High income', 'Upper middle income' */, capital_city VARCHAR);\nCREATE TABLE country_stats (iso3 VARCHAR, year BIGINT, population BIGINT, gdp_usd BIGINT, gdp_per_capita_usd DOUBLE, life_expectancy_years DOUBLE, fertility_rate DOUBLE, urban_population_pct DOUBLE, internet_users_pct DOUBLE, unemployment_pct DOUBLE);", "question": "Which country had the highest average fertility rate over the period 2005-2015? Return country name and average fertility rate.", "sql": "SELECT c.name, AVG(cs.fertility_rate) AS avg_fertility FROM country_stats cs JOIN countries c USING (iso3) WHERE cs.year BETWEEN 2005 AND 2015 GROUP BY c.name ORDER BY avg_fertility DESC LIMIT 1;", "source": "synthetic", "difficulty": "medium", "accept": true, "review_note": ""}
|
| 45 |
+
{"id": "synth_world_bank_0136", "db_id": "world_bank", "schema_text": "CREATE TABLE countries (iso3 VARCHAR, name VARCHAR, region VARCHAR /* e.g. 'Europe & Central Asia', 'Sub-Saharan Africa' */, income_group VARCHAR /* e.g. 'High income', 'Upper middle income' */, capital_city VARCHAR);\nCREATE TABLE country_stats (iso3 VARCHAR, year BIGINT, population BIGINT, gdp_usd BIGINT, gdp_per_capita_usd DOUBLE, life_expectancy_years DOUBLE, fertility_rate DOUBLE, urban_population_pct DOUBLE, internet_users_pct DOUBLE, unemployment_pct DOUBLE);", "question": "What is the median fertility rate across all countries in 2017?", "sql": "SELECT MEDIAN(fertility_rate) AS median_fertility_rate FROM country_stats WHERE year = 2017;", "source": "synthetic", "difficulty": "hard", "accept": true, "review_note": ""}
|
| 46 |
+
{"id": "synth_world_bank_0144", "db_id": "world_bank", "schema_text": "CREATE TABLE countries (iso3 VARCHAR, name VARCHAR, region VARCHAR /* e.g. 'Europe & Central Asia', 'Sub-Saharan Africa' */, income_group VARCHAR /* e.g. 'High income', 'Upper middle income' */, capital_city VARCHAR);\nCREATE TABLE country_stats (iso3 VARCHAR, year BIGINT, population BIGINT, gdp_usd BIGINT, gdp_per_capita_usd DOUBLE, life_expectancy_years DOUBLE, fertility_rate DOUBLE, urban_population_pct DOUBLE, internet_users_pct DOUBLE, unemployment_pct DOUBLE);", "question": "Which country had the highest internet users percentage in 2019, and what was that percentage?", "sql": "SELECT c.name, cs.internet_users_pct FROM countries c JOIN country_stats cs ON c.iso3=cs.iso3 WHERE cs.year=2019 ORDER BY cs.internet_users_pct DESC LIMIT 1;", "source": "synthetic", "difficulty": "easy", "accept": true, "review_note": ""}
|
| 47 |
+
{"id": "synth_world_bank_0156", "db_id": "world_bank", "schema_text": "CREATE TABLE countries (iso3 VARCHAR, name VARCHAR, region VARCHAR /* e.g. 'Europe & Central Asia', 'Sub-Saharan Africa' */, income_group VARCHAR /* e.g. 'High income', 'Upper middle income' */, capital_city VARCHAR);\nCREATE TABLE country_stats (iso3 VARCHAR, year BIGINT, population BIGINT, gdp_usd BIGINT, gdp_per_capita_usd DOUBLE, life_expectancy_years DOUBLE, fertility_rate DOUBLE, urban_population_pct DOUBLE, internet_users_pct DOUBLE, unemployment_pct DOUBLE);", "question": "What are the three countries with the largest increase in internet users percentage between 2000 and 2023, showing country name and increase rounded to one decimal?", "sql": "SELECT c.name, ROUND((cs2023.internet_users_pct - cs2000.internet_users_pct),1) AS increase FROM countries c JOIN country_stats cs2000 ON c.iso3=cs2000.iso3 AND cs2000.year=2000 JOIN country_stats cs2023 ON c.iso3=cs2023.iso3 AND cs2023.year=2023 ORDER BY increase DESC LIMIT 3;", "source": "synthetic", "difficulty": "hard", "accept": true, "review_note": ""}
|
| 48 |
+
{"id": "synth_world_bank_0166", "db_id": "world_bank", "schema_text": "CREATE TABLE countries (iso3 VARCHAR, name VARCHAR, region VARCHAR /* e.g. 'Europe & Central Asia', 'Sub-Saharan Africa' */, income_group VARCHAR /* e.g. 'High income', 'Upper middle income' */, capital_city VARCHAR);\nCREATE TABLE country_stats (iso3 VARCHAR, year BIGINT, population BIGINT, gdp_usd BIGINT, gdp_per_capita_usd DOUBLE, life_expectancy_years DOUBLE, fertility_rate DOUBLE, urban_population_pct DOUBLE, internet_users_pct DOUBLE, unemployment_pct DOUBLE);", "question": "List the ISO-3 codes that appear in the country_stats table for 2022 but are not present in the set of codes from countries whose region is 'Sub-Saharan Africa'. Return the codes sorted descending, limit 20.", "sql": "SELECT DISTINCT cs.iso3 FROM country_stats cs WHERE cs.year = 2022 AND cs.iso3 NOT IN (SELECT iso3 FROM countries WHERE region = 'Sub-Saharan Africa') ORDER BY cs.iso3 DESC LIMIT 20;", "source": "synthetic", "difficulty": "hard", "accept": true, "review_note": "contrived but precise"}
|
| 49 |
+
{"id": "synth_world_bank_0176", "db_id": "world_bank", "schema_text": "CREATE TABLE countries (iso3 VARCHAR, name VARCHAR, region VARCHAR /* e.g. 'Europe & Central Asia', 'Sub-Saharan Africa' */, income_group VARCHAR /* e.g. 'High income', 'Upper middle income' */, capital_city VARCHAR);\nCREATE TABLE country_stats (iso3 VARCHAR, year BIGINT, population BIGINT, gdp_usd BIGINT, gdp_per_capita_usd DOUBLE, life_expectancy_years DOUBLE, fertility_rate DOUBLE, urban_population_pct DOUBLE, internet_users_pct DOUBLE, unemployment_pct DOUBLE);", "question": "Retrieve the ISO-3 codes that are present in the country_stats table for both 2017 and 2021 but are missing from the list of countries whose capital city is known. Return the codes sorted ascending, limit 15.", "sql": "SELECT iso3 FROM country_stats WHERE year IN (2017, 2021) GROUP BY iso3 HAVING COUNT(DISTINCT year) = 2 AND iso3 NOT IN ( SELECT iso3 FROM countries WHERE capital_city IS NOT NULL ) ORDER BY iso3 LIMIT 15;", "source": "synthetic", "difficulty": "extra", "accept": true, "review_note": "contrived but precise; Israel has no capital in the source data"}
|
| 50 |
+
{"id": "synth_world_bank_0182", "db_id": "world_bank", "schema_text": "CREATE TABLE countries (iso3 VARCHAR, name VARCHAR, region VARCHAR /* e.g. 'Europe & Central Asia', 'Sub-Saharan Africa' */, income_group VARCHAR /* e.g. 'High income', 'Upper middle income' */, capital_city VARCHAR);\nCREATE TABLE country_stats (iso3 VARCHAR, year BIGINT, population BIGINT, gdp_usd BIGINT, gdp_per_capita_usd DOUBLE, life_expectancy_years DOUBLE, fertility_rate DOUBLE, urban_population_pct DOUBLE, internet_users_pct DOUBLE, unemployment_pct DOUBLE);", "question": "Which country had the highest increase in internet users percentage from 2015 to 2021? Return the country name and the increase amount.", "sql": "SELECT c.name, (s2021.internet_users_pct - s2015.internet_users_pct) AS increase FROM countries c JOIN country_stats s2015 ON c.iso3 = s2015.iso3 AND s2015.year = 2015 JOIN country_stats s2021 ON c.iso3 = s2021.iso3 AND s2021.year = 2021 ORDER BY increase DESC LIMIT 1;", "source": "synthetic", "difficulty": "hard", "accept": true, "review_note": ""}
|
train.jsonl
CHANGED
|
The diff for this file is too large to render.
See raw diff
|
|
|