Dataset Viewer
Auto-converted to Parquet Duplicate
task_id
stringlengths
10
10
category
stringclasses
4 values
prompt
stringlengths
61
222
schema
stringclasses
1 value
fixture
stringclasses
1 value
expected_output
stringlengths
15
430
django-000
filtering
Return the titles of every Book published in 2015 or later, ordered by title ascending, as a list of 1-tuples.
Models (app label `bookshop`): class Publisher(models.Model): name = CharField(max_length=64) country = CharField(max_length=2) class Author(models.Model): name = CharField(max_length=64) birth_year = IntegerField() class Book(models.Model): title = CharField(max_l...
{"publishers": [[1, "Aurora Press", "US"], [2, "Blue Heron", "GB"], [3, "Cedar House", "US"], [4, "Delta Books", "JP"]], "authors": [[1, "Ada Ellis", 1968], [2, "Bo Nakamura", 1975], [3, "Cleo Rivas", 1982], [4, "Dan Okafor", 1959], [5, "Eve Lindqvist", 1990]], "books": [[1, "Static Tides", 1, 1, 2011, "18.50", 320, tr...
{"rows": [["Harbour Math"], ["Lantern Grammar"], ["Nine Quiet Engines"], ["Salt and Signal"], ["Small Machines"], ["The Cartographer"], ["The Fifth Harvest"], ["The Long Ledger"]]}
django-001
filtering
Return (title, year) for every Book that is NOT in stock, ordered by year ascending.
Models (app label `bookshop`): class Publisher(models.Model): name = CharField(max_length=64) country = CharField(max_length=2) class Author(models.Model): name = CharField(max_length=64) birth_year = IntegerField() class Book(models.Model): title = CharField(max_l...
{"publishers": [[1, "Aurora Press", "US"], [2, "Blue Heron", "GB"], [3, "Cedar House", "US"], [4, "Delta Books", "JP"]], "authors": [[1, "Ada Ellis", 1968], [2, "Bo Nakamura", 1975], [3, "Cleo Rivas", 1982], [4, "Dan Okafor", 1959], [5, "Eve Lindqvist", 1990]], "books": [[1, "Static Tides", 1, 1, 2011, "18.50", 320, tr...
{"rows": [["Iron Meridian", 2012], ["Harbour Math", 2016], ["Salt and Signal", 2019]]}
django-002
filtering
Return the titles of Books whose title contains the word 'The' (case-sensitive), ordered by title.
Models (app label `bookshop`): class Publisher(models.Model): name = CharField(max_length=64) country = CharField(max_length=2) class Author(models.Model): name = CharField(max_length=64) birth_year = IntegerField() class Book(models.Model): title = CharField(max_l...
{"publishers": [[1, "Aurora Press", "US"], [2, "Blue Heron", "GB"], [3, "Cedar House", "US"], [4, "Delta Books", "JP"]], "authors": [[1, "Ada Ellis", 1968], [2, "Bo Nakamura", 1975], [3, "Cleo Rivas", 1982], [4, "Dan Okafor", 1959], [5, "Eve Lindqvist", 1990]], "books": [[1, "Static Tides", 1, 1, 2011, "18.50", 320, tr...
{"rows": [["The Cartographer"], ["The Fifth Harvest"], ["The Long Ledger"]]}
django-003
filtering
Return (title, pages) for Books with more than 400 pages, ordered by pages descending.
Models (app label `bookshop`): class Publisher(models.Model): name = CharField(max_length=64) country = CharField(max_length=2) class Author(models.Model): name = CharField(max_length=64) birth_year = IntegerField() class Book(models.Model): title = CharField(max_l...
{"publishers": [[1, "Aurora Press", "US"], [2, "Blue Heron", "GB"], [3, "Cedar House", "US"], [4, "Delta Books", "JP"]], "authors": [[1, "Ada Ellis", 1968], [2, "Bo Nakamura", 1975], [3, "Cleo Rivas", 1982], [4, "Dan Okafor", 1959], [5, "Eve Lindqvist", 1990]], "books": [[1, "Static Tides", 1, 1, 2011, "18.50", 320, tr...
{"rows": [["The Cartographer", 640], ["Lantern Grammar", 590], ["Salt and Signal", 512], ["The Long Ledger", 460], ["The Fifth Harvest", 428], ["Iron Meridian", 402]]}
django-004
filtering
Using a Q object, return the titles of Books that are either published before 2012 OR have more than 600 pages, ordered by title.
Models (app label `bookshop`): class Publisher(models.Model): name = CharField(max_length=64) country = CharField(max_length=2) class Author(models.Model): name = CharField(max_length=64) birth_year = IntegerField() class Book(models.Model): title = CharField(max_l...
{"publishers": [[1, "Aurora Press", "US"], [2, "Blue Heron", "GB"], [3, "Cedar House", "US"], [4, "Delta Books", "JP"]], "authors": [[1, "Ada Ellis", 1968], [2, "Bo Nakamura", 1975], [3, "Cleo Rivas", 1982], [4, "Dan Okafor", 1959], [5, "Eve Lindqvist", 1990]], "books": [[1, "Static Tides", 1, 1, 2011, "18.50", 320, tr...
{"rows": [["Static Tides"], ["The Cartographer"], ["Winter Protocols"]]}
django-005
filtering
Return the titles of Books that are in stock AND published before 2015, ordered by title.
Models (app label `bookshop`): class Publisher(models.Model): name = CharField(max_length=64) country = CharField(max_length=2) class Author(models.Model): name = CharField(max_length=64) birth_year = IntegerField() class Book(models.Model): title = CharField(max_l...
{"publishers": [[1, "Aurora Press", "US"], [2, "Blue Heron", "GB"], [3, "Cedar House", "US"], [4, "Delta Books", "JP"]], "authors": [[1, "Ada Ellis", 1968], [2, "Bo Nakamura", 1975], [3, "Cleo Rivas", 1982], [4, "Dan Okafor", 1959], [5, "Eve Lindqvist", 1990]], "books": [[1, "Static Tides", 1, 1, 2011, "18.50", 320, tr...
{"rows": [["Paper Orbits"], ["Static Tides"], ["Winter Protocols"]]}
django-006
filtering
Return the titles of Books whose year is one of 2011, 2016 or 2021, ordered by year ascending.
Models (app label `bookshop`): class Publisher(models.Model): name = CharField(max_length=64) country = CharField(max_length=2) class Author(models.Model): name = CharField(max_length=64) birth_year = IntegerField() class Book(models.Model): title = CharField(max_l...
{"publishers": [[1, "Aurora Press", "US"], [2, "Blue Heron", "GB"], [3, "Cedar House", "US"], [4, "Delta Books", "JP"]], "authors": [[1, "Ada Ellis", 1968], [2, "Bo Nakamura", 1975], [3, "Cleo Rivas", 1982], [4, "Dan Okafor", 1959], [5, "Eve Lindqvist", 1990]], "books": [[1, "Static Tides", 1, 1, 2011, "18.50", 320, tr...
{"rows": [["Static Tides"], ["Harbour Math"], ["Lantern Grammar"]]}
django-007
filtering
Return (title, year) for Books published between 2013 and 2018 inclusive, ordered by year then title.
Models (app label `bookshop`): class Publisher(models.Model): name = CharField(max_length=64) country = CharField(max_length=2) class Author(models.Model): name = CharField(max_length=64) birth_year = IntegerField() class Book(models.Model): title = CharField(max_l...
{"publishers": [[1, "Aurora Press", "US"], [2, "Blue Heron", "GB"], [3, "Cedar House", "US"], [4, "Delta Books", "JP"]], "authors": [[1, "Ada Ellis", 1968], [2, "Bo Nakamura", 1975], [3, "Cleo Rivas", 1982], [4, "Dan Okafor", 1959], [5, "Eve Lindqvist", 1990]], "books": [[1, "Static Tides", 1, 1, 2011, "18.50", 320, tr...
{"rows": [["Paper Orbits", 2013], ["The Long Ledger", 2015], ["Harbour Math", 2016], ["Nine Quiet Engines", 2018]]}
django-008
filtering
Return the titles of Books EXCLUDING those by the author named 'Cleo Rivas', ordered by title.
Models (app label `bookshop`): class Publisher(models.Model): name = CharField(max_length=64) country = CharField(max_length=2) class Author(models.Model): name = CharField(max_length=64) birth_year = IntegerField() class Book(models.Model): title = CharField(max_l...
{"publishers": [[1, "Aurora Press", "US"], [2, "Blue Heron", "GB"], [3, "Cedar House", "US"], [4, "Delta Books", "JP"]], "authors": [[1, "Ada Ellis", 1968], [2, "Bo Nakamura", 1975], [3, "Cleo Rivas", 1982], [4, "Dan Okafor", 1959], [5, "Eve Lindqvist", 1990]], "books": [[1, "Static Tides", 1, 1, 2011, "18.50", 320, tr...
{"rows": [["Iron Meridian"], ["Nine Quiet Engines"], ["Paper Orbits"], ["Salt and Signal"], ["Small Machines"], ["Static Tides"], ["The Fifth Harvest"], ["The Long Ledger"], ["Winter Protocols"]]}
django-009
relations
Return (book title, author name) for every Book, ordered by book title.
Models (app label `bookshop`): class Publisher(models.Model): name = CharField(max_length=64) country = CharField(max_length=2) class Author(models.Model): name = CharField(max_length=64) birth_year = IntegerField() class Book(models.Model): title = CharField(max_l...
{"publishers": [[1, "Aurora Press", "US"], [2, "Blue Heron", "GB"], [3, "Cedar House", "US"], [4, "Delta Books", "JP"]], "authors": [[1, "Ada Ellis", 1968], [2, "Bo Nakamura", 1975], [3, "Cleo Rivas", 1982], [4, "Dan Okafor", 1959], [5, "Eve Lindqvist", 1990]], "books": [[1, "Static Tides", 1, 1, 2011, "18.50", 320, tr...
{"rows": [["Harbour Math", "Cleo Rivas"], ["Iron Meridian", "Dan Okafor"], ["Lantern Grammar", "Cleo Rivas"], ["Nine Quiet Engines", "Bo Nakamura"], ["Paper Orbits", "Bo Nakamura"], ["Salt and Signal", "Ada Ellis"], ["Small Machines", "Eve Lindqvist"], ["Static Tides", "Ada Ellis"], ["The Cartographer", "Cleo Rivas"], ...
django-010
relations
Return (book title, publisher name) for Books whose publisher is in the US, ordered by title.
Models (app label `bookshop`): class Publisher(models.Model): name = CharField(max_length=64) country = CharField(max_length=2) class Author(models.Model): name = CharField(max_length=64) birth_year = IntegerField() class Book(models.Model): title = CharField(max_l...
{"publishers": [[1, "Aurora Press", "US"], [2, "Blue Heron", "GB"], [3, "Cedar House", "US"], [4, "Delta Books", "JP"]], "authors": [[1, "Ada Ellis", 1968], [2, "Bo Nakamura", 1975], [3, "Cleo Rivas", 1982], [4, "Dan Okafor", 1959], [5, "Eve Lindqvist", 1990]], "books": [[1, "Static Tides", 1, 1, 2011, "18.50", 320, tr...
{"rows": [["Nine Quiet Engines", "Cedar House"], ["Paper Orbits", "Cedar House"], ["Salt and Signal", "Aurora Press"], ["Small Machines", "Cedar House"], ["Static Tides", "Aurora Press"], ["Winter Protocols", "Aurora Press"]]}
django-011
relations
Return the names of Authors who have at least one Book that is out of stock, with no duplicates, ordered by name.
Models (app label `bookshop`): class Publisher(models.Model): name = CharField(max_length=64) country = CharField(max_length=2) class Author(models.Model): name = CharField(max_length=64) birth_year = IntegerField() class Book(models.Model): title = CharField(max_l...
{"publishers": [[1, "Aurora Press", "US"], [2, "Blue Heron", "GB"], [3, "Cedar House", "US"], [4, "Delta Books", "JP"]], "authors": [[1, "Ada Ellis", 1968], [2, "Bo Nakamura", 1975], [3, "Cleo Rivas", 1982], [4, "Dan Okafor", 1959], [5, "Eve Lindqvist", 1990]], "books": [[1, "Static Tides", 1, 1, 2011, "18.50", 320, tr...
{"rows": [["Ada Ellis"], ["Cleo Rivas"], ["Dan Okafor"]]}
django-012
relations
Return the names of Publishers that have published at least one Book with more than 500 pages, deduplicated and ordered by name.
Models (app label `bookshop`): class Publisher(models.Model): name = CharField(max_length=64) country = CharField(max_length=2) class Author(models.Model): name = CharField(max_length=64) birth_year = IntegerField() class Book(models.Model): title = CharField(max_l...
{"publishers": [[1, "Aurora Press", "US"], [2, "Blue Heron", "GB"], [3, "Cedar House", "US"], [4, "Delta Books", "JP"]], "authors": [[1, "Ada Ellis", 1968], [2, "Bo Nakamura", 1975], [3, "Cleo Rivas", 1982], [4, "Dan Okafor", 1959], [5, "Eve Lindqvist", 1990]], "books": [[1, "Static Tides", 1, 1, 2011, "18.50", 320, tr...
{"rows": [["Aurora Press"], ["Delta Books"]]}
django-013
relations
Return (author name, book title) for Books published by 'Delta Books', ordered by book title.
Models (app label `bookshop`): class Publisher(models.Model): name = CharField(max_length=64) country = CharField(max_length=2) class Author(models.Model): name = CharField(max_length=64) birth_year = IntegerField() class Book(models.Model): title = CharField(max_l...
{"publishers": [[1, "Aurora Press", "US"], [2, "Blue Heron", "GB"], [3, "Cedar House", "US"], [4, "Delta Books", "JP"]], "authors": [[1, "Ada Ellis", 1968], [2, "Bo Nakamura", 1975], [3, "Cleo Rivas", 1982], [4, "Dan Okafor", 1959], [5, "Eve Lindqvist", 1990]], "books": [[1, "Static Tides", 1, 1, 2011, "18.50", 320, tr...
{"rows": [["Cleo Rivas", "Lantern Grammar"], ["Cleo Rivas", "The Cartographer"], ["Eve Lindqvist", "The Fifth Harvest"]]}
django-014
relations
Return the names of Authors born before 1980 who have published with a publisher in GB, deduplicated and ordered by name.
Models (app label `bookshop`): class Publisher(models.Model): name = CharField(max_length=64) country = CharField(max_length=2) class Author(models.Model): name = CharField(max_length=64) birth_year = IntegerField() class Book(models.Model): title = CharField(max_l...
{"publishers": [[1, "Aurora Press", "US"], [2, "Blue Heron", "GB"], [3, "Cedar House", "US"], [4, "Delta Books", "JP"]], "authors": [[1, "Ada Ellis", 1968], [2, "Bo Nakamura", 1975], [3, "Cleo Rivas", 1982], [4, "Dan Okafor", 1959], [5, "Eve Lindqvist", 1990]], "books": [[1, "Static Tides", 1, 1, 2011, "18.50", 320, tr...
{"rows": [["Ada Ellis"], ["Dan Okafor"]]}
django-015
aggregation
Return a single 1-tuple containing the total number of Books.
Models (app label `bookshop`): class Publisher(models.Model): name = CharField(max_length=64) country = CharField(max_length=2) class Author(models.Model): name = CharField(max_length=64) birth_year = IntegerField() class Book(models.Model): title = CharField(max_l...
{"publishers": [[1, "Aurora Press", "US"], [2, "Blue Heron", "GB"], [3, "Cedar House", "US"], [4, "Delta Books", "JP"]], "authors": [[1, "Ada Ellis", 1968], [2, "Bo Nakamura", 1975], [3, "Cleo Rivas", 1982], [4, "Dan Okafor", 1959], [5, "Eve Lindqvist", 1990]], "books": [[1, "Static Tides", 1, 1, 2011, "18.50", 320, tr...
{"rows": [[12]]}
django-016
aggregation
Return (author name, number of books) for every Author, ordered by author name.
Models (app label `bookshop`): class Publisher(models.Model): name = CharField(max_length=64) country = CharField(max_length=2) class Author(models.Model): name = CharField(max_length=64) birth_year = IntegerField() class Book(models.Model): title = CharField(max_l...
{"publishers": [[1, "Aurora Press", "US"], [2, "Blue Heron", "GB"], [3, "Cedar House", "US"], [4, "Delta Books", "JP"]], "authors": [[1, "Ada Ellis", 1968], [2, "Bo Nakamura", 1975], [3, "Cleo Rivas", 1982], [4, "Dan Okafor", 1959], [5, "Eve Lindqvist", 1990]], "books": [[1, "Static Tides", 1, 1, 2011, "18.50", 320, tr...
{"rows": [["Ada Ellis", 3], ["Bo Nakamura", 2], ["Cleo Rivas", 3], ["Dan Okafor", 2], ["Eve Lindqvist", 2]]}
django-017
aggregation
Return (publisher name, number of books) for publishers with 3 or more books, ordered by publisher name.
Models (app label `bookshop`): class Publisher(models.Model): name = CharField(max_length=64) country = CharField(max_length=2) class Author(models.Model): name = CharField(max_length=64) birth_year = IntegerField() class Book(models.Model): title = CharField(max_l...
{"publishers": [[1, "Aurora Press", "US"], [2, "Blue Heron", "GB"], [3, "Cedar House", "US"], [4, "Delta Books", "JP"]], "authors": [[1, "Ada Ellis", 1968], [2, "Bo Nakamura", 1975], [3, "Cleo Rivas", 1982], [4, "Dan Okafor", 1959], [5, "Eve Lindqvist", 1990]], "books": [[1, "Static Tides", 1, 1, 2011, "18.50", 320, tr...
{"rows": [["Aurora Press", 3], ["Blue Heron", 3], ["Cedar House", 3], ["Delta Books", 3]]}
django-018
aggregation
Return (author name, total pages across their books) for every Author, ordered by author name.
Models (app label `bookshop`): class Publisher(models.Model): name = CharField(max_length=64) country = CharField(max_length=2) class Author(models.Model): name = CharField(max_length=64) birth_year = IntegerField() class Book(models.Model): title = CharField(max_l...
{"publishers": [[1, "Aurora Press", "US"], [2, "Blue Heron", "GB"], [3, "Cedar House", "US"], [4, "Delta Books", "JP"]], "authors": [[1, "Ada Ellis", 1968], [2, "Bo Nakamura", 1975], [3, "Cleo Rivas", 1982], [4, "Dan Okafor", 1959], [5, "Eve Lindqvist", 1990]], "books": [[1, "Static Tides", 1, 1, 2011, "18.50", 320, tr...
{"rows": [["Ada Ellis", 1292], ["Bo Nakamura", 598], ["Cleo Rivas", 1474], ["Dan Okafor", 570], ["Eve Lindqvist", 784]]}
django-019
aggregation
Return (author name, max book year) for every Author, ordered by author name.
Models (app label `bookshop`): class Publisher(models.Model): name = CharField(max_length=64) country = CharField(max_length=2) class Author(models.Model): name = CharField(max_length=64) birth_year = IntegerField() class Book(models.Model): title = CharField(max_l...
{"publishers": [[1, "Aurora Press", "US"], [2, "Blue Heron", "GB"], [3, "Cedar House", "US"], [4, "Delta Books", "JP"]], "authors": [[1, "Ada Ellis", 1968], [2, "Bo Nakamura", 1975], [3, "Cleo Rivas", 1982], [4, "Dan Okafor", 1959], [5, "Eve Lindqvist", 1990]], "books": [[1, "Static Tides", 1, 1, 2011, "18.50", 320, tr...
{"rows": [["Ada Ellis", 2019], ["Bo Nakamura", 2018], ["Cleo Rivas", 2021], ["Dan Okafor", 2012], ["Eve Lindqvist", 2023]]}
django-020
aggregation
Return (publisher name, average book pages rounded to 2 decimals as a float) for every Publisher, ordered by publisher name.
Models (app label `bookshop`): class Publisher(models.Model): name = CharField(max_length=64) country = CharField(max_length=2) class Author(models.Model): name = CharField(max_length=64) birth_year = IntegerField() class Book(models.Model): title = CharField(max_l...
{"publishers": [[1, "Aurora Press", "US"], [2, "Blue Heron", "GB"], [3, "Cedar House", "US"], [4, "Delta Books", "JP"]], "authors": [[1, "Ada Ellis", 1968], [2, "Bo Nakamura", 1975], [3, "Cleo Rivas", 1982], [4, "Dan Okafor", 1959], [5, "Eve Lindqvist", 1990]], "books": [[1, "Static Tides", 1, 1, 2011, "18.50", 320, tr...
{"rows": [["Aurora Press", 333.33], ["Blue Heron", 368.67], ["Cedar House", 318.0], ["Delta Books", 552.67]]}
django-021
aggregation
Return (publisher country, number of books published from that country) for every country with at least 2 books, ordered by country.
Models (app label `bookshop`): class Publisher(models.Model): name = CharField(max_length=64) country = CharField(max_length=2) class Author(models.Model): name = CharField(max_length=64) birth_year = IntegerField() class Book(models.Model): title = CharField(max_l...
{"publishers": [[1, "Aurora Press", "US"], [2, "Blue Heron", "GB"], [3, "Cedar House", "US"], [4, "Delta Books", "JP"]], "authors": [[1, "Ada Ellis", 1968], [2, "Bo Nakamura", 1975], [3, "Cleo Rivas", 1982], [4, "Dan Okafor", 1959], [5, "Eve Lindqvist", 1990]], "books": [[1, "Static Tides", 1, 1, 2011, "18.50", 320, tr...
{"rows": [["GB", 3], ["JP", 3], ["US", 6]]}
django-022
aggregation
Return a single 1-tuple with the number of DISTINCT authors that have at least one book in stock.
Models (app label `bookshop`): class Publisher(models.Model): name = CharField(max_length=64) country = CharField(max_length=2) class Author(models.Model): name = CharField(max_length=64) birth_year = IntegerField() class Book(models.Model): title = CharField(max_l...
{"publishers": [[1, "Aurora Press", "US"], [2, "Blue Heron", "GB"], [3, "Cedar House", "US"], [4, "Delta Books", "JP"]], "authors": [[1, "Ada Ellis", 1968], [2, "Bo Nakamura", 1975], [3, "Cleo Rivas", 1982], [4, "Dan Okafor", 1959], [5, "Eve Lindqvist", 1990]], "books": [[1, "Static Tides", 1, 1, 2011, "18.50", 320, tr...
{"rows": [[5]]}
django-023
expressions
Using an F expression, return the titles of Books whose pages are greater than 20 times their year's last two digits — concretely, compare pages to (year - 2000) * 20 — ordered by title. Assume every year is 2000 or later.
Models (app label `bookshop`): class Publisher(models.Model): name = CharField(max_length=64) country = CharField(max_length=2) class Author(models.Model): name = CharField(max_length=64) birth_year = IntegerField() class Book(models.Model): title = CharField(max_l...
{"publishers": [[1, "Aurora Press", "US"], [2, "Blue Heron", "GB"], [3, "Cedar House", "US"], [4, "Delta Books", "JP"]], "authors": [[1, "Ada Ellis", 1968], [2, "Bo Nakamura", 1975], [3, "Cleo Rivas", 1982], [4, "Dan Okafor", 1959], [5, "Eve Lindqvist", 1990]], "books": [[1, "Static Tides", 1, 1, 2011, "18.50", 320, tr...
{"rows": [["Iron Meridian"], ["Lantern Grammar"], ["Nine Quiet Engines"], ["Salt and Signal"], ["Static Tides"], ["The Cartographer"], ["The Long Ledger"]]}
django-024
expressions
Return (title, price as a float) for the 3 most expensive Books, ordered by price descending.
Models (app label `bookshop`): class Publisher(models.Model): name = CharField(max_length=64) country = CharField(max_length=2) class Author(models.Model): name = CharField(max_length=64) birth_year = IntegerField() class Book(models.Model): title = CharField(max_l...
{"publishers": [[1, "Aurora Press", "US"], [2, "Blue Heron", "GB"], [3, "Cedar House", "US"], [4, "Delta Books", "JP"]], "authors": [[1, "Ada Ellis", 1968], [2, "Bo Nakamura", 1975], [3, "Cleo Rivas", 1982], [4, "Dan Okafor", 1959], [5, "Eve Lindqvist", 1990]], "books": [[1, "Static Tides", 1, 1, 2011, "18.50", 320, tr...
{"rows": [["The Cartographer", 42.0], ["Lantern Grammar", 38.1], ["The Fifth Harvest", 34.5]]}
django-025
expressions
Return (title, pages) for the 5 Books with the fewest pages, ordered by pages ascending then title ascending.
Models (app label `bookshop`): class Publisher(models.Model): name = CharField(max_length=64) country = CharField(max_length=2) class Author(models.Model): name = CharField(max_length=64) birth_year = IntegerField() class Book(models.Model): title = CharField(max_l...
{"publishers": [[1, "Aurora Press", "US"], [2, "Blue Heron", "GB"], [3, "Cedar House", "US"], [4, "Delta Books", "JP"]], "authors": [[1, "Ada Ellis", 1968], [2, "Bo Nakamura", 1975], [3, "Cleo Rivas", 1982], [4, "Dan Okafor", 1959], [5, "Eve Lindqvist", 1990]], "books": [[1, "Static Tides", 1, 1, 2011, "18.50", 320, tr...
{"rows": [["Winter Protocols", 168], ["Paper Orbits", 210], ["Harbour Math", 244], ["Static Tides", 320], ["Small Machines", 356]]}
django-026
expressions
Return the titles of Books ordered by author name ascending then year descending.
Models (app label `bookshop`): class Publisher(models.Model): name = CharField(max_length=64) country = CharField(max_length=2) class Author(models.Model): name = CharField(max_length=64) birth_year = IntegerField() class Book(models.Model): title = CharField(max_l...
{"publishers": [[1, "Aurora Press", "US"], [2, "Blue Heron", "GB"], [3, "Cedar House", "US"], [4, "Delta Books", "JP"]], "authors": [[1, "Ada Ellis", 1968], [2, "Bo Nakamura", 1975], [3, "Cleo Rivas", 1982], [4, "Dan Okafor", 1959], [5, "Eve Lindqvist", 1990]], "books": [[1, "Static Tides", 1, 1, 2011, "18.50", 320, tr...
{"rows": [["Salt and Signal"], ["The Long Ledger"], ["Static Tides"], ["Nine Quiet Engines"], ["Paper Orbits"], ["Lantern Grammar"], ["The Cartographer"], ["Harbour Math"], ["Iron Meridian"], ["Winter Protocols"], ["The Fifth Harvest"], ["Small Machines"]]}
django-027
expressions
Return (author name, birth year) for Authors, ordered by birth year descending, limited to the 3 youngest.
Models (app label `bookshop`): class Publisher(models.Model): name = CharField(max_length=64) country = CharField(max_length=2) class Author(models.Model): name = CharField(max_length=64) birth_year = IntegerField() class Book(models.Model): title = CharField(max_l...
{"publishers": [[1, "Aurora Press", "US"], [2, "Blue Heron", "GB"], [3, "Cedar House", "US"], [4, "Delta Books", "JP"]], "authors": [[1, "Ada Ellis", 1968], [2, "Bo Nakamura", 1975], [3, "Cleo Rivas", 1982], [4, "Dan Okafor", 1959], [5, "Eve Lindqvist", 1990]], "books": [[1, "Static Tides", 1, 1, 2011, "18.50", 320, tr...
{"rows": [["Eve Lindqvist", 1990], ["Cleo Rivas", 1982], ["Bo Nakamura", 1975]]}
django-028
expressions
Return a single 1-tuple with the sum of all book prices as a float rounded to 2 decimals.
Models (app label `bookshop`): class Publisher(models.Model): name = CharField(max_length=64) country = CharField(max_length=2) class Author(models.Model): name = CharField(max_length=64) birth_year = IntegerField() class Book(models.Model): title = CharField(max_l...
{"publishers": [[1, "Aurora Press", "US"], [2, "Blue Heron", "GB"], [3, "Cedar House", "US"], [4, "Delta Books", "JP"]], "authors": [[1, "Ada Ellis", 1968], [2, "Bo Nakamura", 1975], [3, "Cleo Rivas", 1982], [4, "Dan Okafor", 1959], [5, "Eve Lindqvist", 1990]], "books": [[1, "Static Tides", 1, 1, 2011, "18.50", 320, tr...
{"rows": [[306.73]]}

django-tasks-v1

Task dataset for a Django RL / eval environment, in the shape used by the Prime Intellect Environments Hub.

29 Django ORM tasks against a fixed three-model schema. Each task gives the model the schema and a fixture and asks for a query; the answer is a list of rows, compared to a reference. Grading is deterministic — no LLM judge, no external API, no network.

This is a deliberate change of domain from the numeric siblings (pandas, numpy/scipy, PyTorch, JAX): an agent that can do tensor algebra may still be unable to write a correct ORM query, and ORM mistakes — a missing distinct() after a join, an aggregate that fans out, a filter applied on the wrong side of a relation — are their own skill.

Category Tasks Covers
filtering 9 __gte/__lt/__in/__range/__contains, booleans, Q objects, exclude, multi-condition filters
aggregation 8 count, Count/Sum/Max/Avg annotations, HAVING-style filters on annotations, distinct counts
relations 6 forward and reverse FK traversal, filtering across two relations, distinct() after a join
expressions 6 F expressions, ordering by a related field, slicing (top-N), aggregate

The schema

class Publisher(models.Model):
    name = CharField(max_length=64); country = CharField(max_length=2)

class Author(models.Model):
    name = CharField(max_length=64); birth_year = IntegerField()

class Book(models.Model):
    title = CharField(max_length=128)
    author = ForeignKey(Author, related_name="books")
    publisher = ForeignKey(Publisher, related_name="books")
    year = IntegerField(); price = DecimalField(6, 2); pages = IntegerField()
    in_stock = BooleanField(default=True)

4 publishers, 5 authors, 12 books — all hard-coded, carried in every row's fixture field.

Fields

Field Description
task_id stable id, e.g. django-017
category one of the four above
prompt the natural-language instruction
schema the model definitions, verbatim
fixture the full seed data as JSON, so the task is self-contained
expected_output {"rows": [[...], ...]} — the reference result

Why ORM work is gradeable at all

Three design decisions do the work:

  • One in-memory SQLite database from a hard-coded fixture. No network, no migrations on disk, no clock or randomness anywhere in the data.
  • Every reference returns a list of tuples of primitives, never a QuerySet — so the answer is compared by value, not by object identity or lazy evaluation.
  • Every task orders explicitly. SQLite promises nothing about row order without an ORDER BY, and grading a model on an unspecified order would be grading it on luck.

Verification

Every task is independently checked: it runs, is deterministic across two freshly rebuilt databases, returns a non-empty list of JSON-safe primitives, is not the trivial "return every row" answer, and survives the serialisation round-trip exactly. All 29 pass on Django 6.0.8.

The verifier earned its keep here too: it caught a task asking for "every year with at least 2 books", which returned nothing — every book in the fixture has a distinct year. It was replaced with the same GROUP BY … HAVING shape over the publisher's country, which has real duplicates and exercises a join.

Builder and verifier: build_tasks.py.

Downloads last month
-