Dataset Viewer
Auto-converted to Parquet Duplicate
question_id
int64
0
499
db_id
stringclasses
11 values
question
stringlengths
54
1.57k
evidence
stringlengths
0
418
SQL
stringlengths
41
2.22k
difficulty
stringclasses
3 values
0
california_schools
Among schools with a school-level SAT excellence rate above 0.3, what is the highest ages-5-17 free-meal eligibility rate?
SAT excellence rate is the share of test takers scoring at least 1500.
SELECT MAX(1.0 * f.`Free Meal Count (Ages 5-17)` / f.`Enrollment (Ages 5-17)`) FROM frpm AS f JOIN satscores AS s ON s.cds = f.CDSCode WHERE s.rtype = 'S' AND s.NumTstTakr > 0 AND f.`Enrollment (Ages 5-17)` > 0 AND 1.0 * s.NumGE1500 / s.NumTstTakr > 0.3
moderate
1
california_schools
For locally funded schools whose K-12 minus ages-5-17 enrollment difference exceeds the average such difference among locally funded schools, list each school's directory-listed name and DOC type.
SELECT s.School, s.DOCTYPE FROM frpm AS f JOIN schools AS s ON f.CDSCode = s.CDSCode WHERE s.FundingType = 'Locally funded' AND (f."Enrollment (K-12)" - f."Enrollment (Ages 5-17)") > ( SELECT AVG(f2."Enrollment (K-12)" - f2."Enrollment (Ages 5-17)") FROM frpm AS f2 JOIN schools AS s2 ON f2.CDSCode = s2.CDSCode WHERE s2...
challenging
2
california_schools
For the five schools with ownership code 66 and the largest K-12 free-or-reduced-price meal counts, give each school's K-12 eligible meal rate rounded to six decimal places.
SELECT ROUND(1.0 * f."FRPM Count (K-12)" / NULLIF(f."Enrollment (K-12)", 0), 6) FROM frpm AS f JOIN schools AS s ON s.CDSCode = f.CDSCode WHERE s.SOC = '66' AND f."FRPM Count (K-12)" IS NOT NULL AND f."Enrollment (K-12)" > 0 ORDER BY f."FRPM Count (K-12)" DESC, s.CDSCode LIMIT 5
moderate
3
california_schools
What is the ratio of merged Unified School District schools in Orange County to merged Elementary School District schools?
SELECT CAST(SUM(CASE WHEN DOC = 54 THEN 1 ELSE 0 END) AS REAL) / SUM(CASE WHEN DOC = 52 THEN 1 ELSE 0 END) FROM schools WHERE StatusType = 'Merged' AND County = 'Orange'
moderate
4
california_schools
What are the mailing street address and name of the school with the seventh-highest recorded average mathematics score?
SELECT sc.MailStreet, sc.School FROM satscores AS sat JOIN schools AS sc ON sc.CDSCode = sat.cds WHERE sat.rtype = 'S' AND sat.AvgScrMath IS NOT NULL ORDER BY sat.AvgScrMath DESC, sat.cds LIMIT 1 OFFSET 6
simple
5
california_schools
How many non-charter schools in Los Angeles County have a K-12 free-meal percentage below 0.18%?
SELECT COUNT(T2.School) FROM frpm AS T1 INNER JOIN schools AS T2 ON T1.CDSCode = T2.CDSCode WHERE T2.County = 'Los Angeles' AND T2.Charter = 0 AND CAST(T1.`Free Meal Count (K-12)` AS REAL) * 100 / T1.`Enrollment (K-12)` < 0.18
challenging
6
california_schools
Which schools served a grade span of Kindergarten to 9th grade in the county of Los Angeles and what is its Percent (%) Eligible FRPM (Ages 5-17)?
FRPM eligibility percentage is free-or-reduced-price meal recipients divided by same-age-band enrollment, times 100.
SELECT T2.School, T1.`FRPM Count (Ages 5-17)` * 100 / T1.`Enrollment (Ages 5-17)` FROM frpm AS T1 INNER JOIN schools AS T2 ON T1.CDSCode = T2.CDSCode WHERE T2.County = 'Los Angeles' AND T2.GSserved = 'K-9'
moderate
7
california_schools
What is the Percent (%) Eligible Free (K-12) in the school administered by an administrator whose first name is Alusine. List the district code of the school.
K-12 free-meal eligibility percentage is K-12 free-meal recipients divided by K-12 enrollment, times 100.
SELECT T1.`Free Meal Count (K-12)` * 100 / T1.`Enrollment (K-12)`, T1.`District Code` FROM frpm AS T1 INNER JOIN schools AS T2 ON T1.CDSCode = T2.CDSCode WHERE T2.AdmFName1 = 'Alusine'
moderate
8
california_schools
List the distinct available administrator email addresses for public intermediate/middle schools in San Bernardino city and county, in a unified school district, opened during 2009 or 2010.
WITH matched AS (SELECT AdmEmail1, AdmEmail2, AdmEmail3 FROM schools WHERE County = 'San Bernardino' AND City = 'San Bernardino' AND DOCType = 'Unified School District' AND SOCType = 'Intermediate/Middle Schools (Public)' AND OpenDate >= '2009-01-01' AND OpenDate < '2011-01-01') SELECT AdmEmail1 AS email FROM matched W...
challenging
9
california_schools
I'm comparing three high schools in Alameda County and want to focus on the one with the biggest student body. The schools have these CDS codes: 1751010130583, 1612910137588, and 1611760134270. Which of these three schools has the highest enrollment of students aged 5-17? Please give me the 5-digit NCES school identifi...
NCES school identification number: the 5-digit school-level NCES identifier. Enrollment (Ages 5-17): the number of students aged 5 through 17 enrolled at the school.
SELECT T1.NCESSchool FROM schools AS T1 INNER JOIN frpm AS T2 ON T1.CDSCode = T2.CDSCode WHERE CAST(T2.CDSCode AS INTEGER) IN (1751010130583, 1612910137588, 1611760134270) AND T2.`Enrollment (Ages 5-17)` = (SELECT MAX(f.`Enrollment (Ages 5-17)`) FROM frpm AS f WHERE CAST(f.CDSCode AS INTEGER) IN (1751010130583, 1612910...
challenging
10
california_schools
I'm profiling the High Tech High charter network in San Diego. For charter number 756, what is the average number of SAT test takers per school across all of its schools with a San Diego mailing city? Count every school regardless of operational status, and treat a school with no SAT record as having zero test takers. ...
Charter number 756 is the state-issued charter number.
SELECT ROUND(SUM(COALESCE(sc.NumTstTakr, 0)) * 1.0 / COUNT(*), 2) AS avg_sat_test_takers_per_school FROM schools s LEFT JOIN satscores sc ON sc.cds = s.CDSCode WHERE CAST(s.CharterNum AS INTEGER) = 756 AND s.MailCity = 'San Diego'
challenging
11
california_schools
Following up on the SAT participation review: among the currently operating high schools in the district with NCES identification number 0613360 that had no SAT test takers, which one begins serving students at the earliest grade? Please give me each such school's name and grade span served. Note that a high school mus...
NCES identification number 0613360 is the school district identification number assigned by the National Center for Education Statistics.
WITH cohort AS (SELECT s.School AS school_name, s.GSserved AS grade_span_served, CASE WHEN SUBSTR(s.GSserved,1,INSTR(s.GSserved||'-','-')-1) = 'P' THEN -1 WHEN SUBSTR(s.GSserved,1,INSTR(s.GSserved||'-','-')-1) = 'K' THEN 0 ELSE CAST(SUBSTR(s.GSserved,1,INSTR(s.GSserved||'-','-')-1) AS INTEGER) END AS start_rank FROM sc...
challenging
12
california_schools
I'm profiling schools run directly by the California State Board of Education. Which of those schools has the highest average SAT reading score? If several tie for the highest, give me all of them. For each school, I need its name and its full mailing street address - the complete address, not an abbreviated one. Only ...
State Board of Education: the state authority that directly runs and oversees certain California schools.
SELECT s.School, s.MailStreet FROM satscores AS t JOIN schools AS s ON t.cds = s.CDSCode WHERE s.DOCType = 'State Board of Education' AND t.sname IS NOT NULL AND t.AvgScrRead IS NOT NULL AND t.AvgScrRead = (SELECT MAX(t2.AvgScrRead) FROM satscores AS t2 JOIN schools AS s2 ON t2.cds = s2.CDSCode WHERE s2.DOCType = 'Stat...
challenging
13
california_schools
I'm trying to verify where a school I was told about is located. It's a high school in Alameda County with Breakfast Provision 2 status, serving grades 9 through 12, and its identification number is 1611920113902. What city is this school in?
The identification number is the school's CDS code; Educational Instruction Level Code 'HS' identifies a high school; grades 9 through 12 means lowest grade 9 and highest grade 12; Breakfast Provision 2 is a National School Lunch Program provision status.
SELECT s.City FROM schools AS s INNER JOIN frpm AS f ON s.CDSCode = f.CDSCode WHERE CAST(s.CDSCode AS INTEGER) = 1611920113902 AND f.`NSLP Provision Status` = 'Breakfast Provision 2' AND s.County = 'Alameda' AND f.`Low Grade` = '9' AND f.`High Grade` = '12' AND s.EILCode = 'HS'
challenging
14
california_schools
I'm reviewing NSLP Provision 2 schools. Can you give me the name and city of every high school (educational instruction level code HS) whose meal-program status is exactly Provision 2 and whose lowest grade served is above ninth grade? One row per school, ordered by school name. Note: only the status named Provision 2 ...
SELECT T2.School AS school, T2.City AS city FROM frpm AS T1 INNER JOIN schools AS T2 ON T1.CDSCode = T2.CDSCode WHERE T1.`NSLP Provision Status` = 'Provision 2' AND T2.EILCode = 'HS' AND CAST(T1.`Low Grade` AS INTEGER) > 9 ORDER BY T2.School
challenging
15
california_schools
I'm profiling California's statewide benefit charter networks. Among the schools run by a statewide benefit charter network, which single school had the highest number of SAT test takers who scored 1500 or above? Please give me that school's name and its phone number. If several schools tie for the highest count, list ...
Statewide benefit charter: a charter school network authorized directly by the California State Board of Education to operate schools throughout the state; charter schools authorized by a school district or county office of education are not statewide benefit charters.
SELECT s.School AS school_name, s.Phone AS phone FROM satscores AS t INNER JOIN schools AS s ON t.cds = s.CDSCode WHERE s.DOCType = 'Statewide Benefit Charter' AND t.rtype = 'S' AND t.NumGE1500 = (SELECT MAX(t2.NumGE1500) FROM satscores AS t2 INNER JOIN schools AS s2 ON t2.cds = s2.CDSCode WHERE s2.DOCType = 'Statewide...
challenging
16
california_schools
I'm looking at a directly-funded charter high school in California with CDS code 1611190130609. Could you tell me its average SAT math score and how many students took the SAT there? Just that one school's figures. If the school with that CDS code turns out not to be directly funded, then there's no answer.
CDS code: the identification number the California Department of Education assigns to a county, district, or school. Directly-funded charter school: a charter school that receives its funding directly from the state rather than through its district.
SELECT T1.AvgScrMath AS average_math_score, T1.NumTstTakr AS number_of_test_takers FROM satscores AS T1 INNER JOIN frpm AS T2 ON T1.cds = T2.CDSCode WHERE CAST(T1.cds AS INTEGER) = 1611190130609 AND T2.`Charter Funding Type` = 'Directly funded'
challenging
17
california_schools
I'm looking at SAT participation in Contra Costa County. How many schools in the county had more SAT test takers than the school with CDS code 7618040730051? That school is itself a Contra Costa County school, so I just want the count of schools strictly ahead of it by number of SAT test takers, based on the SAT result...
CDS code: the County-District-School identifier that the California Department of Education assigns to each school and district in the state.
SELECT COUNT(*) AS school_count FROM satscores WHERE cname = 'Contra Costa' AND sname IS NOT NULL AND NumTstTakr > (SELECT NumTstTakr FROM satscores WHERE CAST(cds AS INTEGER) = 7618040730051)
challenging
18
california_schools
I'm comparing schools in San Francisco. How many public schools with a San Francisco mailing city had an average total SAT score of at least 1500? Please count only schools whose district type is 'Unified School District', 'High School District', 'Elementary School District', or 'County Office of Education (COE)' - exc...
A school's total SAT score is the sum of its average reading, average math, and average writing scores; a school's mailing city is the city in its mailing address.
SELECT COUNT(*) AS n FROM satscores AS T1 INNER JOIN schools AS T2 ON T1.cds = T2.CDSCode WHERE T2.MailCity = 'San Francisco' AND T2.DOCType IN ('Unified School District', 'High School District', 'Elementary School District', 'County Office of Education (COE)') AND (T1.AvgScrRead + T1.AvgScrMath + T1.AvgScrWrite) >= 15...
challenging
19
california_schools
What is the lowest grade level at which any school in our district begins serving students? If several schools tie at the lowest grade, just report that single grade level for the whole district. Our district is NCES district ID 0632640.
'P' stands for preschool.
SELECT T1.`Low Grade` AS lowest_grade FROM frpm AS T1 INNER JOIN schools AS T2 ON T1.CDSCode = T2.CDSCode WHERE T2.NCESDist = '0632640' ORDER BY (T1.`Low Grade` = 'P') DESC, (T1.`Low Grade` = 'K') DESC, CAST(T1.`Low Grade` AS INTEGER), T1.`Low Grade` LIMIT 1
challenging
20
california_schools
I'm reviewing administrator coverage across Amador and Madera counties, and I want to see which administrator first names actually cover the most schools. For the two administrator first names whose holders run the most schools across the two counties (ranking names by the number of schools their holders run, with the ...
WITH scope AS ( SELECT CDSCode, District, AdmFName1 AS fn FROM schools WHERE County IN ('Amador','Madera') AND DOCType IN ('Unified School District','Elementary School District','High School District','County Office of Education (COE)') AND AdmFName1 IS NOT NULL UNION SELECT CDSCode, District, AdmFName2 FROM schools WH...
challenging
21
california_schools
For the 2014-2015 academic year, what was the average number of enrolled students aged 5 to 17 eligible for free or reduced price meals per Youth Authority school? Count every Youth Authority school regardless of its status (active, closed, or merged), and treat a Youth Authority school with no meal-program record as z...
A Youth Authority school is a school the state directory classifies as a Youth Authority Facility.
SELECT ROUND(SUM(COALESCE(T1.`FRPM Count (Ages 5-17)`, 0.0)) * 1.0 / COUNT(T2.CDSCode), 2) AS avg_frpm_ages_5_17 FROM schools AS T2 LEFT JOIN frpm AS T1 ON T1.CDSCode = T2.CDSCode WHERE T2.SOCType LIKE '%Youth Authority%'
challenging
22
california_schools
I have a school's CDS code from a separate list of Alameda County schools on Breakfast Provision 2, and I need to confirm which school it is. For the school with CDS code 1612590136051, please give me the school name and the educational instruction level name. This CDS code identifies exactly one school, so return only...
Breakfast Provision 2: the NSLP provision status category the school participates in. CDS code 1612590136051: the school identifier being asked about.
SELECT s.School, s.EILName FROM schools AS s INNER JOIN frpm AS f ON s.CDSCode = f.CDSCode WHERE f.`NSLP Provision Status` = 'Breakfast Provision 2' AND f.`County Name` = 'Alameda' AND CAST(s.CDSCode AS INTEGER) = 1612590136051
challenging
23
california_schools
I'm looking at the schools that the State Board of Education directly runs or charters. Which individual school among them had the most students score at least 1500 on the SAT? Please give me that school's name and its administrator's email address. If two schools tie on that count, list both.
Schools run or chartered by the State Board of Education are identified by their district ownership type.
SELECT T2.School, T2.AdmEmail1 FROM satscores AS T1 INNER JOIN schools AS T2 ON T1.cds = T2.CDSCode WHERE T2.DOCType = 'State Board of Education' AND T1.rtype = 'S' AND T1.NumGE1500 = (SELECT MAX(T3.NumGE1500) FROM satscores AS T3 INNER JOIN schools AS T4 ON T3.cds = T4.CDSCode WHERE T4.DOCType = 'State Board of Educat...
challenging
24
california_schools
We're relocating to far Northern California and want to know how far north California's middle schools reach. A middle school means a school serving the middle grades, the level between elementary school and high school — count it as a middle school if either its school type or its school name marks it as serving the m...
middle school: a school serving the middle grades, the level between elementary school and high school
SELECT T1.`School Type`, T1.`School Name`, T2.Latitude FROM frpm AS T1 INNER JOIN schools AS T2 ON T1.CDSCode = T2.CDSCode WHERE (T1.`School Type` LIKE '%Middle%' OR T1.`School Name` LIKE '%Middle%') AND T2.Latitude = (SELECT MAX(T2b.Latitude) FROM frpm AS T1b INNER JOIN schools AS T2b ON T1b.CDSCode = T2b.CDSCode WHER...
challenging
25
california_schools
I'm working on a story about campuses Los Angeles County opened during 2007 and the SAT participation they drew. What was the average number of SAT test takers per school across Los Angeles County schools that opened during 2007 and are run by a school district? Please give me that single number, rounded to two decimal...
SAT test takers: the number of test takers recorded for the school.
SELECT ROUND(SUM(COALESCE(sat.NumTstTakr, 0)) * 1.0 / COUNT(*), 2) AS avg_sat_test_takers FROM schools AS s LEFT JOIN satscores AS sat ON sat.cds = s.CDSCode WHERE s.County = 'Los Angeles' AND strftime('%Y', s.OpenDate) = '2007' AND (s.DOCType LIKE '%school district%' OR s.DOCType LIKE '%county office of education%')
challenging
26
california_schools
I'm reviewing charter school funding models and want to compare the directly funded and locally funded charters that are currently in operation. For each of the two funding categories, please give me: (1) the number of charter schools currently in operation, counting only schools the directory lists as active (open), n...
Directly funded and locally funded are the two charter funding categories. Free or reduced-price meal eligibility is measured by the K-12 eligible percentage. Combined SAT score is the sum of the average reading, math and writing scores.
SELECT s.FundingType AS funding_category, COUNT(*) AS operating_charter_schools, SUM(f.`Enrollment (K-12)`) AS total_k12_enrollment, ROUND(AVG(f.`Percent (%) Eligible FRPM (K-12)`)*100, 2) AS avg_frpm_percentage, ROUND(AVG(sat.AvgScrRead + sat.AvgScrMath + sat.AvgScrWrite), 2) AS avg_combined_sat FROM schools s LEFT JO...
challenging
27
california_schools
Among California's state special schools, which one begins enrolling students at the latest grade level? Please give me: the school's name, the earliest grade level covered by its K-12 enrollment, its K-12 enrollment, and how many SAT test takers it had. In the grade-level codes, P means pre-kindergarten and K means ki...
A state special school is a school operated by the state of California that serves students with special needs, such as the schools for the deaf or the blind.
SELECT s.School AS school_name, f.`Low Grade` AS starting_grade, f.`Enrollment (K-12)` AS k12_enrollment, COALESCE(t.NumTstTakr, 0) AS sat_test_takers FROM schools s JOIN frpm f ON f.CDSCode = s.CDSCode LEFT JOIN satscores t ON t.cds = s.CDSCode WHERE s.DOCTYPE = 'State Special Schools' ORDER BY CASE f.`Low Grade` WHEN...
challenging
28
california_schools
I'm putting together a brief on SAT participation among California's larger public schools. How many individual named school sites in the state with a K-12 enrollment over 500 and a highest grade served of 8 or below had no SAT test takers? I just need the school_count, a single whole number. Please count a school as a...
SELECT COUNT(*) AS school_count FROM schools AS s JOIN frpm AS f ON f.CDSCode = s.CDSCode LEFT JOIN satscores AS t ON t.cds = s.CDSCode WHERE s.School IS NOT NULL AND f.`Enrollment (K-12)` > 500 AND CAST(f.`High Grade` AS INTEGER) BETWEEN 1 AND 8 AND COALESCE(t.NumTstTakr, 0) = 0
challenging
29
california_schools
I'm studying charter schools run by county offices of education. Using the K-12 school meal program records, for the charter schools these county offices operate, broken down by charter funding type (directly funded and locally funded only), I'd like to know: how many are currently operating, their total K-12 enrollmen...
FRPM means free or reduced price meal eligibility.
SELECT f.`Charter Funding Type` AS funding_type, COUNT(*) AS active_charter_schools, SUM(f.`Enrollment (K-12)`) AS total_k12_enrollment, SUM(f.`FRPM Count (K-12)`) AS total_frpm_students FROM frpm f INNER JOIN schools s ON f.CDSCode = s.CDSCode WHERE f.`Charter School (Y/N)` = 1 AND f.`District Type` = 'County Office o...
challenging
30
california_schools
I'm documenting now-closed California schools whose students performed best on the SAT writing section, and I need the runner-up. Among schools whose status is Closed (not Active, Merged or Pending), and which have an average SAT writing score, can you tell me which school had the second-highest average SAT writing sco...
SAT writing score: the average writing score of the school's SAT test takers.
WITH j AS (SELECT T2.School AS School, T2.District AS District, T2.County AS County, T1.AvgScrWrite AS AvgScrWrite FROM satscores AS T1 INNER JOIN schools AS T2 ON T1.cds = T2.CDSCode WHERE T2.StatusType = 'Closed' AND T1.AvgScrWrite IS NOT NULL AND T1.sname IS NOT NULL) SELECT School, District, County, AvgScrWrite FRO...
challenging
31
california_schools
I'm a parent looking at high schools in California, and I want to know how often a school that's still open has no seniors taking the SAT at all. How many currently open public high schools in California had zero students take the SAT? By 'currently open' I mean the school's status is Active, not closed or merged. By '...
SAT test takers: the number of test takers recorded for the school in the SAT scores data.
SELECT COUNT(*) AS zero_taker_open_high_schools FROM schools AS sc LEFT JOIN satscores AS s ON sc.CDSCode = s.cds WHERE sc.StatusType = 'Active' AND sc.EILName = 'High School' AND COALESCE(s.NumTstTakr, 0) = 0
challenging
32
california_schools
I'm planning a targeted meal-support pilot and want to compare one school against similar schools in our county. The county I mean is the one where Fremont High (CDS code 1612590125716) is located - please identify the county by that CDS code, not by the school name. For that county, please look at all K-12 schools wit...
Free meal percentage = free meal count (K-12) / enrollment (K-12) * 100; FRPM percentage = FRPM count (K-12) / enrollment (K-12) * 100; charter school = charter indicator 1, non-charter = charter indicator 0.
WITH TargetCounty AS (SELECT `County Name` AS CountyName FROM frpm WHERE CAST(CDSCode AS INTEGER) = 1612590125716), Cohort AS (SELECT f.CDSCode, ROUND(f.`Free Meal Count (K-12)`/f.`Enrollment (K-12)`*100, 2) AS FreePct, ROUND(f.`FRPM Count (K-12)`/f.`Enrollment (K-12)`*100, 2) AS FRPMPct, f.`Charter School (Y/N)` AS Ch...
challenging
33
california_schools
I'm studying the 1980 growth of public schooling in San Diego County. What was the average number of schools per month that opened in San Diego County in 1980 under a school district's jurisdiction? I need just that single number. Please average over all 12 months of 1980 (months with no openings count as zero), and gi...
A school district is a local education agency that runs K-12 public schools; it is an elementary school district, a high school district, or a unified school district.
SELECT CAST(COUNT(*) AS REAL) / 12 AS monthly_average FROM schools WHERE County = 'San Diego' AND strftime('%Y', OpenDate) = '1980' AND DOCType IN ('Elementary School District', 'High School District', 'Unified School District');
challenging
34
california_schools
Among California schools whose students have an average SAT Math score above 400, what percentage offer virtual instruction, either exclusively or in part? Please give me a single percentage value rounded to one decimal place.
In the school directory, the exclusive-virtual category is coded 'F' and the partial-virtual category is coded 'P'.
SELECT ROUND(100.0 * SUM(CASE WHEN s.Virtual IN ('F','P') THEN 1 ELSE 0 END) / COUNT(*), 1) AS pct FROM satscores AS sat JOIN schools AS s ON sat.cds = s.CDSCode WHERE sat.rtype = 'S' AND sat.AvgScrMath > 400
challenging
35
california_schools
A parent is asking about a school and could only give me the CDS code 1612590137943. Can you look up that school and give me its name, county, district, and city; its K-12 enrollment; the number of K-12 students eligible for free or reduced price meals and the percentage eligible (report the percentage exactly as it ap...
CDS code: the state's County-District-School identification code assigned to each school; FRPM: the Free or Reduced Price Meal program, where the FRPM count is the number of students eligible.
SELECT s.School AS school_name, s.County AS county, s.District AS district, s.City AS city, f.`Enrollment (K-12)` AS enrollment_k12, f.`FRPM Count (K-12)` AS frpm_count, f.`Percent (%) Eligible FRPM (K-12)` AS pct_eligible_frpm, sat.NumTstTakr AS num_sat_takers, sat.AvgScrRead AS avg_reading, sat.AvgScrMath AS avg_math...
challenging
36
california_schools
I'm putting together a profile of Alameda County high schools, focusing on economic disadvantage among schools that serve up through 12th grade. Among those schools, can you tell me which one has the highest free meal rate? For each school you identify, give me one line with: the school name, its free meal rate to 4 de...
Free meal rate = Free Meal Count (K-12) / Enrollment (K-12). SAT performance level is based on the SAT total (Reading + Math + Writing): Below Average if below 1200, Average if 1200 to 1500, Above Average if above 1500, and 'No SAT Data' if no SAT scores are available.
WITH cohort AS (SELECT f.`School Name` AS school_name, f.`Free Meal Count (K-12)`*1.0/f.`Enrollment (K-12)` AS free_rate, sc.Charter, sc.GSserved, s.AvgScrRead, s.AvgScrMath, s.AvgScrWrite FROM frpm f LEFT JOIN schools sc ON sc.CDSCode = f.CDSCode LEFT JOIN satscores s ON s.cds = f.CDSCode WHERE f.`County Name` = 'Alam...
challenging
37
california_schools
Could you pull a full profile for the school with CDS code 7618040113118? I need its name, phone number, website, average SAT reading, math and writing scores, whether it is a charter school, its K-12 enrollment for the 2014-2015 academic year, and the percentage of its students eligible for free or reduced price meals...
CDS code is the California Department of Education's school identifier; a charter school is one with charter status recorded as 1.
WITH Benchmark AS (SELECT MAX(t.AvgScrMath) AS TopMath FROM satscores AS t INNER JOIN schools AS s ON s.CDSCode = t.cds WHERE s.StatusType = 'Active' AND t.NumTstTakr >= 10) SELECT s.School AS "School Name", s.Phone AS "Phone Number", s.Website AS "Website", t.AvgScrRead AS "Average SAT Reading Score", t.AvgScrMath AS ...
challenging
38
california_schools
I'm mapping where exclusively virtual schools are concentrated. For the five counties with the most exclusively virtual schools - if several counties tie with the fifth-highest count, include all of them - please give me for each county: the county name, how many exclusively virtual schools it has, and the name of the ...
An exclusively virtual school is one whose Virtual field holds the code 'F'.
WITH virtual_counts AS ( SELECT County, COUNT(*) AS virtual_schools FROM schools WHERE Virtual = 'F' GROUP BY County ), top_counties AS ( SELECT County, virtual_schools FROM virtual_counts WHERE virtual_schools >= ( SELECT MIN(virtual_schools) FROM ( SELECT virtual_schools FROM virtual_counts ORDER BY virtual_schools D...
challenging
39
california_schools
I'm comparing online-only schooling options. I'd like to know, for Santa Barbara County and for the county that contains the school with CDS code 1100170109835 (which identifies one school), how many exclusive-virtual schools are in each county. Please give me each county's name with its number of exclusive-virtual sch...
A school counts as exclusive-virtual only if its virtual-instruction category is coded 'F'.
WITH target AS (SELECT County FROM schools WHERE CAST(CDSCode AS INTEGER) = 1100170109835), cands AS (SELECT County FROM target UNION SELECT 'Santa Barbara') SELECT c.County AS County, (SELECT COUNT(*) FROM schools s WHERE s.County = c.County AND s.Virtual = 'F') AS num FROM cands c ORDER BY num DESC, c.County;
challenging
40
california_schools
I'm studying how concentrated economic need relates to SAT outcomes in California public schools. Among regular, non-charter schools with more than 100 K-12 students, I'd like two extremes plus one benchmark school: the school with the largest count of FRPM-eligible students, the school with the smallest FRPM share (th...
CDS code: the California Department of Education's identification code for a school; the benchmark school in my notes is identified by CDS code 4615150435602.
WITH cohort AS (SELECT f.CDSCode, f.`School Name` AS SchoolName, f.`FRPM Count (K-12)` AS FRPMCount, f.`Enrollment (K-12)` AS Enrollment, f.`FRPM Count (K-12)` * 1.0 / f.`Enrollment (K-12)` AS FRPMShare, CAST(f.CDSCode AS INTEGER) AS code_num FROM frpm f WHERE f.`Charter School (Y/N)` = 0 AND f.`Enrollment (K-12)` > 10...
challenging
41
california_schools
I'm auditing FRPM enrollment reporting and need to contact some elementary and middle schools. Please list the name and street address of every named school whose K-12 enrollment exceeds its enrollment of students aged 5-17 by more than 30 students, and whose highest grade of enrollment is grade 8 or below. Kindergarte...
K-12 enrollment is enrollment counted for kindergarten through grade 12. Enrollment of ages 5-17 is enrollment counted for students aged 5 through 17. Highest grade of enrollment is the highest grade level the school enrolls students in (e.g., grade 8 for a school serving kindergarten through grade 8).
SELECT s.School, s.Street FROM schools AS s JOIN frpm AS f ON f.`CDSCode` = s.`CDSCode` WHERE s.School IS NOT NULL AND f.`Enrollment (K-12)` - f.`Enrollment (Ages 5-17)` > 30 AND (f.`High Grade` = 'K' OR (f.`High Grade` = CAST(CAST(f.`High Grade` AS INTEGER) AS TEXT) AND CAST(f.`High Grade` AS INTEGER) <= 8)) ORDER BY ...
challenging
42
california_schools
I'm auditing high-school-level campuses that draw enrollments beyond their surrounding school-age population. Can you give me a list of schools where the K-12 enrollment exceeds the ages-5-17 enrollment by more than 30, limited to schools whose lowest served grade is grade 9 or a later grade (a school's lowest served g...
CDS code: a school's identifier in the California schools data.
SELECT s.School, s.Street FROM schools AS s JOIN frpm AS f ON f.`CDSCode` = s.`CDSCode` WHERE s.School IS NOT NULL AND f.`Enrollment (K-12)` - f.`Enrollment (Ages 5-17)` > 30 AND CAST(f.`Low Grade` AS INTEGER) BETWEEN 9 AND 12 ORDER BY s.CDSCode
challenging
43
california_schools
I'm researching where high SAT performance coexists with concentrated poverty, to help target college-access support by county. For the 2014-15 academic year, for each county, how many schools had both a K-12 free-meal eligibility rate above 0.1 and at least one SAT taker scoring 1500 or higher on the school's own SAT ...
K-12 free-meal eligibility rate: the share of a school's K-12 enrollment that is eligible for free meals (free meal count divided by K-12 enrollment).
SELECT s.cname AS county, COUNT(*) AS qualifying_schools FROM satscores AS s JOIN frpm AS f ON f.CDSCode = s.cds WHERE s.rtype = 'S' AND s.NumGE1500 > 0 AND f.`Enrollment (K-12)` > 0 AND 1.0 * f.`Free Meal Count (K-12)` / f.`Enrollment (K-12)` > 0.1 GROUP BY s.cname ORDER BY qualifying_schools DESC, county ASC
challenging
44
california_schools
I have a school on file with CDS code 1611430131177. Find the school in the same county as that school whose own SAT record shows the most students scoring at least 1500 (not a district-wide roll-up). If two schools tie on that count, use the one with the smaller CDS code. Send me that school's administrator's first an...
CDS code: the County-District-School identifier assigned to each school; scoring at least 1500: a test taker whose combined SAT score is 1500 or higher.
SELECT s.AdmFName1, s.AdmLName1 FROM satscores x JOIN schools s ON s.CDSCode = x.cds JOIN frpm f ON f.CDSCode = x.cds WHERE x.rtype = 'S' AND s.County = (SELECT County FROM schools WHERE CAST(CDSCode AS INTEGER) = 1611430131177) ORDER BY x.NumGE1500 DESC, CAST(f.`School Code` AS INTEGER) LIMIT 1
challenging
45
california_schools
I'm working on a story about the largest schools in the state with the worst SAT excellence rates. Among schools where at least 700 students took the SAT, can you find the school with the lowest SAT excellence rate? If several schools tie for the lowest rate, go with the one with the smallest school code. I just need t...
The SAT excellence rate is the share of SAT test takers scoring at least 1500. A school code is a number.
SELECT s.Street, s.City, s.Zip, s.State FROM satscores AS sat JOIN schools AS s ON s.CDSCode = sat.cds LEFT JOIN frpm AS f ON f.CDSCode = sat.cds WHERE sat.rtype = 'S' AND sat.NumGE1500 IS NOT NULL AND sat.NumTstTakr >= 700 ORDER BY 1.0 * sat.NumGE1500 / sat.NumTstTakr ASC, CAST(f.`School Code` AS INTEGER) ASC LIMIT 1
challenging
46
california_schools
I'm planning reviews of Provision 2 meal programs under the NSLP and want to see which cities concentrate magnet schools under that provision. For each city that has at least one, can you give me the number of the city's magnet schools that run a Provision 2 meal program? Use the city where the school is located, not i...
NSLP is the National School Lunch Program. Provision 2 is a federal provision under the NSLP that lets a school serve meals at no charge to all students regardless of family income.
SELECT s.City AS City, COUNT(*) AS magnet_schools FROM frpm AS f JOIN schools AS s ON f.CDSCode = s.CDSCode WHERE s.Magnet = 1 AND f.`NSLP Provision Status` LIKE '%Provision 2%' GROUP BY s.City ORDER BY magnet_schools DESC, City
challenging
47
california_schools
I'm preparing a mailing campaign and need a list of public high schools in Los Angeles County that have more than 500 free or reduced-price meal recipients ages 5-17. By public high schools I mean every public high-school category in the meal program report - regular high schools, continuation high schools, and high sc...
'Free or reduced-price meal recipients ages 5-17' refers to the count reported in the meal program report for students ages 5-17 receiving free or reduced-price meals.
SELECT s.School AS school_name, s.Street, s.City, s.State, s.Zip FROM frpm f JOIN schools s ON f.CDSCode = s.CDSCode WHERE f."County Name" = 'Los Angeles' AND f."School Type" LIKE '%High School%' AND f."School Type" NOT LIKE '%Junior%' AND f."FRPM Count (Ages 5-17)" > 500 ORDER BY s.School, s.CDSCode
challenging
48
california_schools
I'd like to compare SAT participation across counties in California that run magnet schools under Provision 2 of the National School Lunch Program. For every county with at least one Provision 2 magnet school, can you give me the county name and the total number of SAT test takers from those schools? Please include eve...
Provision 2 school: a school whose NSLP Provision Status is Provision 2. Magnet school: a school identified as a magnet school or providing a magnet program.
SELECT s.County AS county, SUM(COALESCE(sc.NumTstTakr, 0)) AS total_sat_test_takers FROM schools AS s INNER JOIN frpm AS f ON s.CDSCode = f.CDSCode LEFT JOIN satscores AS sc ON sc.cds = s.CDSCode WHERE s.Magnet = 1 AND f.`NSLP Provision Status` = 'Provision 2' GROUP BY s.County ORDER BY total_sat_test_takers DESC, s.Co...
challenging
49
card_games
List the IDs of borderless card printings for which Card Kingdom lacks a regular-version listing or a foil-version listing.
SELECT id FROM cards WHERE borderColor = 'borderless' AND (cardKingdomId IS NULL OR cardKingdomFoilId IS NULL) ORDER BY id
simple
50
card_games
Which distinct combinations of card name, artist, and promotional-printing flag occur among the printings tied for the most rulings?
WITH ruling_counts AS ( SELECT uuid, COUNT(*) AS n FROM rulings GROUP BY uuid ), max_count AS ( SELECT MAX(n) AS n FROM ruling_counts ) SELECT DISTINCT c.name, c.artist, c.isPromo FROM cards AS c JOIN ruling_counts AS rc ON c.uuid = rc.uuid JOIN max_count AS mx ON rc.n = mx.n ORDER BY c.name, c.artist, c.isPromo
moderate
51
card_games
What percentage of all card printings have a Simplified Chinese translation? Round to two decimals.
SELECT ROUND(100.0 * (SELECT COUNT(DISTINCT c.uuid) FROM cards AS c JOIN foreign_data AS f ON f.uuid = c.uuid WHERE f.language = 'Chinese Simplified') / NULLIF((SELECT COUNT(*) FROM cards), 0), 2)
moderate
52
card_games
What rules text is printed on Benalish Knight? Return the distinct text as one line.
SELECT DISTINCT REPLACE(text, CHAR(10), ' ') FROM cards WHERE name = 'Benalish Knight' AND text IS NOT NULL
simple
53
card_games
Among all Story Spotlight card printings, what percentage have a French translation? Round to two decimals.
SELECT ROUND(100.0 * (SELECT COUNT(DISTINCT c.uuid) FROM cards AS c JOIN foreign_data AS f ON f.uuid = c.uuid WHERE c.isStorySpotlight = 1 AND f.language = 'French') / NULLIF((SELECT COUNT(*) FROM cards WHERE isStorySpotlight = 1), 0), 2)
challenging
54
card_games
What are the cards belong to duel deck a? List the ID.
SELECT id FROM cards WHERE duelDeck = 'a'
simple
55
card_games
How many distinct white-bordered card printings are banned in at least one play format?
SELECT COUNT(DISTINCT c.id) FROM cards AS c JOIN legalities AS l ON l.uuid = c.uuid WHERE l.status = 'Banned' AND c.borderColor = 'white'
simple
56
card_games
How many distinct card printings with no recorded power value or a variable power expression have at least one ruling mentioning 'triggered ability'?
An asterisk anywhere in a power expression denotes variable power.
SELECT Count(DISTINCT T1.id) FROM cards AS T1 INNER JOIN rulings AS T2 ON T1.uuid = T2.uuid WHERE (T1.power IS NULL OR T1.power LIKE '%*%') AND T2.text LIKE '%triggered ability%'
moderate
57
card_games
What percentage of cards with format commander and legal status do not have a content warning?
SELECT CAST(SUM(CASE WHEN T1.hasContentWarning = 0 THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.id) FROM cards AS T1 INNER JOIN legalities AS T2 ON T1.uuid = T2.uuid WHERE T2.format = 'commander' AND T2.status = 'Legal'
challenging
58
card_games
Among card printings with no recorded power value or a variable power expression, what percentage have a French translation? Round to two decimals.
An asterisk anywhere in a power expression denotes variable power.
SELECT ROUND(100.0 * (SELECT COUNT(DISTINCT c.uuid) FROM cards AS c JOIN foreign_data AS f ON f.uuid = c.uuid WHERE (c.power IS NULL OR c.power LIKE '%*%') AND f.language = 'French') / NULLIF((SELECT COUNT(*) FROM cards WHERE power IS NULL OR power LIKE '%*%'), 0), 2)
challenging
59
card_games
Among the sets in the block "Ice Age", how many of them have an Italian translation?
SELECT COUNT(DISTINCT T1.id) FROM sets AS T1 INNER JOIN set_translations AS T2 ON T2.setCode = T1.code WHERE T1.block = 'Ice Age' AND T2.language = 'Italian' AND T2.translation IS NOT NULL
moderate
60
card_games
What percentage of Coldsnap card printings have both a Card Kingdom regular-product ID and foil-product ID recorded?
SELECT CAST(SUM(CASE WHEN T1.cardKingdomFoilId IS NOT NULL AND T1.cardKingdomId IS NOT NULL THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.id) FROM cards AS T1 INNER JOIN sets AS T2 ON T2.code = T1.setCode WHERE T2.name = 'Coldsnap'
challenging
61
card_games
Which play format has the most banned card-printing records? Give that format and the distinct names of its banned cards.
SELECT format, name FROM ( SELECT l.format, c.name, MIN(c.uuid) AS sort_uuid FROM legalities AS l JOIN cards AS c ON c.uuid = l.uuid WHERE l.status = 'Banned' AND l.format = ( SELECT format FROM legalities WHERE status = 'Banned' GROUP BY format ORDER BY COUNT(*) DESC, format LIMIT 1 ) GROUP BY l.format, c.name ) AS ba...
moderate
62
card_games
I collect promotional printings and play Brawl. How many different creature cards that have a promotional printing can serve as a Brawl commander? I just want a single number back.
A promotional printing is a printing of a card made as a promotion, as opposed to a regular set printing. Brawl is a Magic: The Gathering format; the deck's commander is the card that leads it, and only certain cards are legal as a Brawl commander.
SELECT COUNT(DISTINCT name) AS creature_cards_legal_brawl_commanders FROM cards WHERE isPromo = 1 AND instr(types, 'Creature') > 0 AND instr(leadershipSkills, '''brawl'': True') > 0
challenging
63
card_games
I'm cataloguing how the frame styles on Tarmogoyf's printings evolved over time. What is the number of years between the oldest and the newest frame style used on the printings of Tarmogoyf? The span in years is the newer year minus the older year.
Frame style version means the year a card's frame style dates from.
SELECT MAX(CAST(frameVersion AS INTEGER)) - MIN(CAST(frameVersion AS INTEGER)) AS years_between FROM cards WHERE name = 'Tarmogoyf' AND frameVersion = CAST(CAST(frameVersion AS INTEGER) AS TEXT)
challenging
64
card_games
How many black-border cards with power 10 or greater are available on Magic: The Gathering Online? I just want a single number.
Black-border cards are the tournament-legal Magic cards, excluding the joke silver-bordered sets. Power is the first number in the lower-right corner of a creature card.
SELECT COUNT(id) FROM cards WHERE borderColor = 'black' AND availability LIKE '%mtgo%' AND CAST(power AS INTEGER) >= 10
challenging
65
card_games
I have the count of sets with fewer than five translations of their name — now I need the gap in cards to size the translation budget. Can you give me the total number of cards contained in those sets? A few things to keep in mind: 'fewer than five' is strict, so a set with exactly five translations doesn't count. All ...
A 'translation of a set's name' means the localized name of the set in another language, e.g. its French or Simplified Chinese name.
SELECT SUM(totalSetSize) AS total_cards FROM sets WHERE (SELECT COUNT(DISTINCT translation) FROM set_translations WHERE setCode = sets.code) < 5
challenging
66
card_games
I'm preparing a multilingual catalog and want to gauge how much localizable content exists per kind of set. For every set type, I need the number of sets of that type that have an officially translated name, and the total number of cards in those sets. Please include every set type in the results, even ones where no se...
Set type: the expansion type of a set, such as core, expansion or promo. Officially translated name: the set's name rendered in another language, such as Italian or Chinese Traditional.
SELECT s.type, SUM(CASE WHEN EXISTS (SELECT 1 FROM set_translations t WHERE t.setCode = s.code) THEN 1 ELSE 0 END) AS sets_with_translation, SUM(CASE WHEN EXISTS (SELECT 1 FROM set_translations t WHERE t.setCode = s.code) THEN s.totalSetSize ELSE 0 END) AS total_cards FROM sets s GROUP BY s.type ORDER BY s.type
challenging
67
card_games
How many rulings were issued for Mishra's Factory on the latest date any ruling for it exists? By "latest date" I mean the most recent calendar date on which any ruling for the card exists, and by Mishra's Factory I mean the card by that name across all of its printings. I only want that count.
ruling: an official rules statement issued for a card on a given date
SELECT COUNT(DISTINCT T2.text) AS ruling_count FROM cards AS T1 INNER JOIN rulings AS T2 ON T1.uuid = T2.uuid WHERE T1.name = 'Mishra''s Factory' AND T2.date = (SELECT MAX(T4.date) FROM cards AS T3 INNER JOIN rulings AS T4 ON T3.uuid = T4.uuid WHERE T3.name = 'Mishra''s Factory')
challenging
68
card_games
Which artist has illustrated the most different creature cards, and how many different creature cards is that? I'd like each artist's name along with their count of different creature cards. If two artists are tied for the most, list both.
A creature card is a card whose card types include Creature.
SELECT artist, COUNT(DISTINCT name) AS distinct_creatures FROM cards WHERE types LIKE '%Creature%' GROUP BY artist HAVING COUNT(DISTINCT name) = (SELECT MAX(cnt) FROM (SELECT COUNT(DISTINCT name) AS cnt FROM cards WHERE types LIKE '%Creature%' GROUP BY artist)) ORDER BY artist
challenging
69
card_games
I'm putting together a showcase of zero-mana-cost cards. What is the newest frame version used by any card with a converted mana cost of 0? Please give me that frame version value, and the number of cards in the database that use that frame version. The count should cover all cards in the database, not just the zero-co...
Frame version: the edition of the card frame style a printing uses.
SELECT frameVersion, COUNT(*) AS card_count FROM cards WHERE CAST(frameVersion AS REAL) = (SELECT MAX(CAST(frameVersion AS REAL)) FROM cards WHERE convertedManaCost = 0) GROUP BY frameVersion
challenging
70
card_games
I'm tracking printings of Tarmogoyf. Of all its printings, which frame version is the newest? Please give me the year that identifies that latest frame version, and the percentage of the card's printings that use it, rounded to two decimal places. The percentage should be over all printings of the card.
A printing is an occurrence of the card in a set; a frame version is the version of the card frame style of a printing.
WITH target AS (SELECT MAX(CAST(frameVersion AS INTEGER)) AS yr FROM cards WHERE name = 'Tarmogoyf') SELECT t.yr AS frame_version_year, ROUND(CAST(SUM(CASE WHEN CAST(c.frameVersion AS INTEGER) = t.yr THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(c.id), 2) AS percentage FROM cards AS c, target AS t WHERE c.name = 'Tarmogoyf...
challenging
71
card_games
I'm building an artifact-heavy Commander deck and want to know the size of the pool of zero-cost cards available to me. How many different cards have a printed mana cost of {0} and are legal in Commander? A card is legal in Commander if its Commander legality entry is marked Legal.
Printed mana cost of 0 means the cost shown on the card is {0}. Commander is a format of play in which any card marked Legal for that format is playable.
SELECT COUNT(DISTINCT c.name) AS different_cards FROM cards c JOIN legalities l ON c.uuid = l.uuid WHERE c.manaCost = '{0}' AND l.format = 'commander' AND l.status = 'Legal'
challenging
72
card_games
I'm brewing and looking for cards that combine two keyword abilities. How many cards in the collection have both Flying and Cycling? Note that each printing counts as its own card, and a card only counts if it has both keywords.
Flying and Cycling are keyword abilities in Magic: The Gathering.
SELECT COUNT(*) AS card_count FROM cards WHERE instr(',' || keywords || ',', ',' || 'Flying' || ',') > 0 AND instr(',' || keywords || ',', ',' || 'Cycling' || ',') > 0
challenging
73
card_games
I'm comparing how mana-cheap Magic: The Gathering sets have become over time. For two sets — the set where Abyssal Horror was first printed, and the most recently released set in the database — I want one row per set with the set name and the percentage of that set's cards that have a mana cost whose converted mana cos...
Converted mana cost means the card's mana value; a card has a mana cost when a mana cost is printed on the card.
WITH first_set AS (SELECT s.code, s.name, s.releaseDate FROM sets s WHERE s.code IN (SELECT c.setCode FROM cards c WHERE c.name = 'Abyssal Horror') ORDER BY s.releaseDate ASC, s.code ASC LIMIT 1), latest_set AS (SELECT s.code, s.name, s.releaseDate FROM sets s ORDER BY s.releaseDate DESC, s.code ASC LIMIT 1), chosen AS...
challenging
74
card_games
How many different cards have ever been printed as a release promotion? I just need a single number, covering all printings across the game's entire history with no time restriction. Note that a prerelease printing is a different promotion type and shouldn't be counted as a release promotion.
A release promotion is a promotional printing whose promotion type is 'release'.
SELECT COUNT(DISTINCT name) AS release_promo_cards FROM cards WHERE REPLACE(promoTypes, 'prerelease', '') LIKE '%release%'
challenging
75
card_games
I'm cataloguing the Abzan clan's cards and need this: among the cards with the Abzan watermark, which one comes last in its set's numbering - i.e. has the highest collector number? Please give me the card's name, its collector number, and how many foreign-language printings exist for that card. If several Abzan-waterma...
Abzan watermark: the clan mark printed on the card. Collector number: the number of the card within the set it was printed in. Foreign-language printing: the foreign-language edition record of a card.
SELECT c.name AS card_name, c.number AS collector_number, COUNT(f.id) AS foreign_printings FROM cards c LEFT JOIN foreign_data f ON f.uuid = c.uuid WHERE c.watermark = 'abzan' AND CAST(c.number AS INTEGER) = (SELECT MAX(CAST(number AS INTEGER)) FROM cards WHERE watermark = 'abzan') GROUP BY c.uuid, c.name, c.number OR...
challenging
76
card_games
I'm profiling the weak end of the white-bordered printings. How many white-bordered cards have a power less than 3? I just need that single count - only white-bordered cards are in scope, and please don't include anything else in the answer.
Power is a card's combat strength. A card whose power is shown as * has no known power.
SELECT COUNT(*) AS weak_attackers FROM cards WHERE borderColor = 'white' AND power IS NOT NULL AND power <> '*' AND power = CAST(CAST(power AS INTEGER) AS TEXT) AND CAST(power AS INTEGER) < 3
challenging
77
card_games
I'm putting together a showcase of instant-speed cards from Magic: The Gathering. Which cards in the Dark Ascension set have the Flash keyword and, among those, the highest converted mana cost? Please list just the card names, one row per card, alphabetically by name, and include every card that ties on that highest co...
Dark Ascension is the Magic: The Gathering set named 'Dark Ascension'. Flash is the keyword that lets a card be cast any time you could cast an instant. Converted mana cost is the total amount of mana a card costs to cast.
SELECT T1.name FROM cards AS T1 INNER JOIN sets AS T2 ON T2.code = T1.setCode WHERE T2.name = 'Dark Ascension' AND instr(',' || T1.keywords || ',', ',' || 'Flash' || ',') > 0 AND T1.convertedManaCost = (SELECT MAX(T3.convertedManaCost) FROM cards AS T3 INNER JOIN sets AS T4 ON T4.code = T3.setCode WHERE T4.name = 'Dark...
challenging
78
card_games
I'm preparing localized set icon assets and need to know the foreign-language name coverage of every Magic: The Gathering set released in 2020. For each set released in 2020 (meaning its release date falls within the calendar year 2020), please give me the set's name, its keyrune code, and the number of languages in wh...
keyrune code: the code for the set's image icon; official translated name: the set's name rendered in a foreign language by the game's publisher.
SELECT s.name, s.keyruneCode, COUNT(DISTINCT st.language) AS translated_languages FROM sets s LEFT JOIN set_translations st ON st.setCode = s.code AND st.translation IS NOT NULL WHERE strftime('%Y', s.releaseDate) = '2020' GROUP BY s.id, s.name, s.keyruneCode ORDER BY s.name
challenging
79
card_games
I'm sizing a catalogue page of 2017 sets that were localized for international markets. How many cards were there in total across the Magic: The Gathering sets released in 2017 (between January 1 and December 31, 2017) that have a name in a language other than English? A set counts as localized if its name has a foreig...
A foreign-language translation is a set's name rendered in a language other than English (e.g. Chinese Simplified, German, Spanish).
SELECT SUM(s.totalSetSize) AS total_cards FROM sets s WHERE s.releaseDate BETWEEN '2017-01-01' AND '2017-12-31' AND EXISTS (SELECT 1 FROM set_translations t WHERE t.setCode = s.code)
challenging
80
card_games
I've already looked at the heavy hitters in duel deck B (the 'b' deck). Now I want to check the light end: how many cards in duel deck B are not available in foil and have attack power below 3? Note that 'below 3' means strictly below 3 — a power of exactly 3 doesn't count.
SELECT COUNT(*) AS card_count FROM cards WHERE duelDeck = 'b' AND hasFoil = 0 AND power IS NOT NULL AND power = TRIM(CAST(power AS INTEGER)) AND CAST(power AS REAL) < 3
challenging
81
card_games
I'm writing a spotlight piece on card artists, and I need to know: among black-bordered cards that are obtainable on Magic Arena and have a printed power of 10 or greater, which artist illustrated the most of them? Please give me the artist's name and the number of those cards they illustrated. A card counts even if it...
Black border means the card's border color is black; power is the combat strength printed on a creature card, and '10 or greater' means the printed power reads as a number that is at least 10 (10, 11, 12, and so on).
WITH counts AS (SELECT artist, COUNT(*) AS card_count FROM cards WHERE borderColor='black' AND LOWER(availability) LIKE '%arena%' AND CAST(power AS INTEGER) >= 10 GROUP BY artist) SELECT artist, card_count FROM counts WHERE card_count=(SELECT MAX(card_count) FROM counts)
challenging
82
card_games
I'm going through my paper collection before sharing it publicly, and I want to check something about the cards Wizards of the Coast has flagged. How many different cards are there that carry a sensitive content warning, are available in paper form, and have never been available on Magic Online (MTGO)? I just need that...
MTGO means Magic: The Gathering Online, the official online version of the game. A sensitive content warning means Wizards of the Coast has marked the card for having sensitive content.
SELECT COUNT(*) AS card_count FROM (SELECT name FROM cards WHERE hasContentWarning = 1 GROUP BY name HAVING MAX(CASE WHEN availability LIKE '%paper%' THEN 1 ELSE 0 END) = 1 AND MAX(CASE WHEN availability LIKE '%mtgo%' THEN 1 ELSE 0 END) = 0)
challenging
83
card_games
Hi! I'm preparing a licensing brief for our Japanese partner about Magic: The Gathering localization coverage. Could you pull a report of every expansion type (core, expansion, promo, etc.), showing for each one how many sets of that type carry a Japanese name entry? A Japanese name entry means the set's name-translati...
Japanese name entry: an entry in the set's name-translations whose language is Japanese and which gives the set's name in Japanese.
SELECT s.type AS expansion_type, COUNT(DISTINCT CASE WHEN st.language = 'Japanese' AND st.translation IS NOT NULL AND TRIM(st.translation) <> '' THEN s.code END) AS japanese_named_sets FROM sets s LEFT JOIN set_translations st ON st.setCode = s.code GROUP BY s.type ORDER BY s.type
challenging
84
card_games
I'm cataloguing Arena-exclusive illustrated art of big creatures. How many artists have illustrated at least one black-bordered card that is available on Arena but never on Magic Online and has a fixed printed power of at least 5? I want just the number of artists, nothing else. Count across all printings in the collec...
Arena and Magic Online are online platforms; a card's availability lists every platform it can be played on: 'arena' is Arena and 'mtgo' is Magic Online. Power is the attack strength printed on a creature card. Black-bordered refers to the standard card border color black.
SELECT COUNT(DISTINCT artist) AS artists FROM cards WHERE borderColor = 'black' AND availability LIKE '%arena%' AND availability NOT LIKE '%mtgo%' AND CAST(power AS REAL) >= 5
challenging
85
card_games
I collect trading cards, and one of my favorites is Ancestor's Chosen. Of all the sets that include this card, look at the one released most recently - if several sets share that latest release date, consider them together. How many creature cards in that set (or sets) have power greater than toughness? I just want tha...
Power is the attack strength printed on a creature card; toughness is the defense strength printed on a creature card.
SELECT COUNT(*) AS power_over_toughness FROM cards WHERE types LIKE '%Creature%' AND CAST(power AS REAL) > CAST(toughness AS REAL) AND setCode IN (SELECT c2.setCode FROM cards AS c2 JOIN sets AS s2 ON s2.code = c2.setCode WHERE c2.name = 'Ancestor''s Chosen' AND s2.releaseDate = (SELECT MAX(s3.releaseDate) FROM sets AS...
challenging
86
card_games
Among the Commander-leadable cards that the Card Kingdom catalog lists for both a foil printing and a regular non-foil printing – cards listed for only one of the two printings don't count – I want the single most recent card frame year (the latest calendar year among the frame versions), and the count of cards in that...
A card 'may lead a Commander deck' if it can be the deck's commander – the one card that leads the deck and sets its color identity – not merely be included among the deck's other cards.
WITH cmd AS (SELECT frameVersion, substr(leadershipSkills, instr(leadershipSkills, 'commander')) AS tail FROM cards WHERE cardKingdomId IS NOT NULL AND cardKingdomFoilId IS NOT NULL) SELECT frameVersion AS frame_year, COUNT(*) AS card_count FROM cmd WHERE substr(tail, length('commander') + length('True'), length('True'...
challenging
87
card_games
I'm compiling the official rulings archive for the Magic: The Gathering card Fireball. How many official rulings have ever been issued for Fireball? I need the total across all time, with no date restriction.
A ruling is an official clarification issued by Wizards of the Coast about how a card works.
SELECT COUNT(*) AS ruling_count FROM (SELECT DISTINCT r.date, r.text FROM rulings AS r INNER JOIN cards AS c ON r.uuid = c.uuid WHERE c.name = 'Fireball')
challenging
88
card_games
Which card whose original type is 'Creature - Elf' has received the most rulings, and how many rulings has it received? I want the card name and the number of rulings. A card and all of its printings/reprints count as one and the same card. If several cards tie for the most rulings, list every one of them.
A ruling is an official rules clarification issued for a card, on the date it was issued.
WITH elf_cards AS (SELECT DISTINCT name FROM cards WHERE originalType = 'Creature - Elf'), elf_rulings AS (SELECT c.name, r.date, r.text FROM cards c JOIN rulings r ON c.uuid = r.uuid WHERE c.name IN (SELECT name FROM elf_cards) GROUP BY c.name, r.date, r.text), counts AS (SELECT name, COUNT(*) AS ruling_count FROM elf...
challenging
89
card_games
I'm reviewing the very first cards in the database and want to compare how widely accepted white cards are versus black cards across play formats. For each card color that appears among the cards with ID 1 through 20, please tell me the card color and the number of play formats in which cards of that color are legal. A...
Formats of play: the game formats a card is permitted in, such as commander or vintage.
SELECT T1.colors AS color, COUNT(DISTINCT T2.format) AS format_count FROM cards AS T1 INNER JOIN legalities AS T2 ON T1.uuid = T2.uuid WHERE T1.id BETWEEN 1 AND 20 AND T2.status = 'Legal' GROUP BY T1.colors ORDER BY T1.colors
challenging
90
card_games
I'm tracking John Avon's artwork. Among his cards that exist as powerful foils, what is the most recent frame year, and how many of those cards carry it? If several years are tied for most recent, give each year with its own count. Match John Avon on the illustrator's name.
powerful foil: a card whose Card Kingdom identifiers are both present – the regular identifier and the foil identifier.
SELECT frameVersion AS frame_year, COUNT(id) AS card_count FROM cards WHERE artist = 'John Avon' AND cardKingdomId IS NOT NULL AND cardKingdomFoilId IS NOT NULL GROUP BY frameVersion HAVING CAST(frameVersion AS INTEGER) = (SELECT MAX(CAST(frameVersion AS INTEGER)) FROM cards WHERE artist = 'John Avon' AND cardKingdomId...
challenging
91
card_games
I play paper Magic and I'm building a pauper deck. How many printings of cards illustrated by Erica Yang are legal in the pauper format and exist as paper (physically printed) cards? I want just a single count of printings, with each printing counted separately.
Pauper is a Magic: The Gathering format where only common-rarity cards are legal; a printing is a specific physical or digital release of a card in a set; 'legal in pauper' means the card's pauper legality status is Legal; 'paper' means a physical printed card.
SELECT COUNT(*) AS paper_pauper_printings FROM cards AS c INNER JOIN legalities AS l ON c.uuid = l.uuid WHERE c.artist = 'Erica Yang' AND l.format = 'pauper' AND l.status = 'Legal' AND c.availability LIKE '%paper%'
challenging
92
card_games
I keep a Card Kingdom catalogue and want to list the creature cards that Card Kingdom stocks in both foil and non-foil printings. A card counts as stocked in both printings when both its Card Kingdom Foil id and its Card Kingdom id are present. Please give me one row per card, with each card's Card Kingdom Foil id and ...
Card Kingdom Foil id: the retailer's identifier for the foil printing; Card Kingdom id: the retailer's identifier for the non-foil printing.
SELECT cardKingdomFoilId, cardKingdomId FROM cards WHERE cardKingdomFoilId IS NOT NULL AND cardKingdomId IS NOT NULL AND types LIKE '%Creature%' ORDER BY cardKingdomFoilId, cardKingdomId LIMIT 3
challenging
93
card_games
Among the cards carrying the boros watermark that were printed in a foreign language, which card type is the most common, and how many of those cards have that type? If several types tie for the most, list all of them with their counts.
"Boros watermark" refers to the guild watermark appearing on cards of the Boros guild; "printed in a foreign language" means the card was printed in any language other than English.
WITH counted AS (SELECT T1.type AS card_type, COUNT(DISTINCT T1.uuid) AS card_count FROM cards AS T1 INNER JOIN foreign_data AS T2 ON T1.uuid = T2.uuid WHERE T1.watermark = 'boros' GROUP BY T1.type) SELECT card_type, card_count FROM counted WHERE card_count = (SELECT MAX(card_count) FROM counted) ORDER BY card_type
challenging
94
card_games
Among the Magic: The Gathering cards whose watermark is one of the ten Ravnica guild symbols (Azorius, Boros, Dimir, Golgari, Gruul, Izzet, Orzhov, Rakdos, Selesnya, Simic), which guild has the most cards that were printed in another language, and how many of that guild's cards is that? If several guilds tie for the mo...
A Ravnica guild is the guild a card's watermark belongs to; a card 'printed in another language' is a card that exists in a language edition other than English.
WITH counted AS (SELECT c.watermark AS guild, COUNT(DISTINCT c.uuid) AS number_of_cards FROM cards AS c INNER JOIN foreign_data AS f ON f.uuid = c.uuid WHERE c.watermark IN ('azorius','boros','dimir','golgari','gruul','izzet','orzhov','rakdos','selesnya','simic') GROUP BY c.watermark) SELECT guild, number_of_cards FROM...
challenging
95
card_games
I'm cataloguing the guild cards. Among the cards that carry the Azorius watermark and were printed in at least one foreign language, how many cards are there of each card type? For each card type, please give me the card type exactly as printed, including any supertypes and subtypes, along with the number of cards of t...
SELECT c.type, COUNT(DISTINCT c.uuid) AS number_of_cards FROM cards c INNER JOIN foreign_data f ON f.uuid = c.uuid WHERE c.watermark = 'azorius' GROUP BY c.type ORDER BY number_of_cards DESC, c.type ASC
challenging
96
card_games
I'm cataloguing modern-frame printings. How many different cards that have a text box were printed with a frame version of 2015 or a later year? I just need that single count.
Frame version: the version of the card frame style, given as the year the frame style was introduced.
SELECT COUNT(DISTINCT name) AS number_of_cards FROM cards WHERE isTextless = 0 AND CAST(frameVersion AS INTEGER) >= 2015
challenging
97
card_games
I'm putting together a showcase of promotional cards and need a list of card names. I want the names of the cards that have a promotional printing and have multiple faces on the same card, but only those printed in the most recent card frame version. A card's frame version is the year its frame style was introduced, so...
A promotional printing is a printing of a card that was given out for promotional purposes. A card with multiple faces has multiple faces printed on the same card.
SELECT DISTINCT name FROM cards WHERE isPromo = 1 AND side IS NOT NULL AND CAST(frameVersion AS INTEGER) = (SELECT MAX(CAST(frameVersion AS INTEGER)) FROM cards)
challenging
98
card_games
I'm putting together a retrospective of promotional cards. Can you get me the card name of every promotional card that has multiple faces printed on it (like split, transform, or adventure cards) and was originally released in 2019? By "originally released" I mean the card's own first-release date, not the release date...
SELECT DISTINCT name FROM cards WHERE isPromo = 1 AND side IS NOT NULL AND substr(originalReleaseDate, 1, 4) = '2019'
challenging
99
card_games
I'm researching printings of the Magic: The Gathering card Tarmogoyf. I want to identify every reprint of Tarmogoyf that was published in a card frame style that was already at least 10 full years old when the set came out. Please give me the set name and release date of every set that qualifies, not just one. Two rule...
Frame version: the year the card frame style of a printing dates from.
SELECT s.name AS set_name, s.releaseDate AS release_date FROM cards AS c INNER JOIN sets AS s ON s.code = c.setCode WHERE c.name = 'Tarmogoyf' AND CAST(c.frameVersion AS INTEGER) = c.frameVersion AND CAST(strftime('%Y', s.releaseDate) AS INTEGER) - CAST(c.frameVersion AS INTEGER) >= 10
challenging
End of preview. Expand in Data Studio

BIRD SQL Mini-Dev

2026 update

This update provides 500 aligned question IDs for SQLite, MySQL and PostgreSQL. It revises the annotations from the last update after community feedback and a systematic, human-in-the-loop review of questions, evidence and gold SQL.

Our aim is a benchmark that requires an agent to understand the request, explore the permitted database and construct the query. We clarified materially ambiguous output contracts, corrected reference SQL and replaced selected instances, while removing evidence that supplied unnecessary schema links, query plans or answers. We carefully considered each suggestion against the question's intended meaning and the underlying database, and incorporated changes where the evidence supported them.

Moving forward

BIRD 1.0 achieved broad adoption and helped shape text-to-SQL research and industry development by establishing standardized task formats and realistic database environments, unlocking technological advances in RAG, multi-agent systems, and knowledge generation. Building on this success and sustained community enthusiasm, we are developing BIRD 2.0 to extend evaluation beyond text-to-SQL into developing, testing, and maintaining real-world data workflows. Our goal is to better measure frontier models' data intelligence and their reliability in realistic environments, including enterprise and personal use.

Follow the BIRD website for updates on our next-generation benchmarks: LiveSQLBench 2.0, BIRD 2.0, and DII v1.0.

All contributions, real-world samples, and suggestions of any kind are welcome; get in touch with the BIRD Team (bird.bench25@gmail.com) to collaborate.

We sincerely thank OpenAI, Amazon, and Google Cloud for their early support and collaboration.

Repository layout

Directory Contents
data/ Current annotations for all three SQL dialects
baseline_inference/ Ready-to-use baseline prompts and supporting schemas
archive/ Historical 2025 release

Interactive tasks are hosted separately on Harbor Hub.

Load the current data

from datasets import load_dataset

mini_dev = load_dataset("birdsql/bird_mini_dev")
print({name: len(split) for name, split in mini_dev.items()})
# {'mini_dev_sqlite': 500, 'mini_dev_mysql': 500, 'mini_dev_pg': 500}

Each split contains 500 instances, IDs 0–499. Question and evidence text match across dialects; reference SQL is dialect-specific. Match records by question_id and dialect.

Baseline results

Fixed-prompt baseline execution accuracy (EX, %) on 500 questions per dialect. Model rows are sorted by Overall EX, from highest to lowest.

Model SQLite MySQL PostgreSQL Overall
Empirical Upper Bound 99.60 93.80 97.00 96.80
GPT-6.1 Sol 88.00 84.80 89.00 87.27
Claude Opus 5.5 90.00 84.40 87.00 87.13
Claude Sonnet 5.5 86.60 80.40 85.60 84.20
Qwen3.8-Flash-Next 70.20 67.00 67.80 68.33
DeepSeek-V4.1-Flash 61.00 55.80 62.20 59.67
Claude Haiku 5.5 59.60 55.20 58.60 57.80
GPT-6 Luna 54.00 51.00 51.80 52.27
GLM-5.3 51.40 48.40 48.40 49.40
Qwen3.6-35B-A3B 21.20 22.20 20.00 21.13

Overall is EX across all 1,500 dialect-specific answers, equivalent to the mean of the three dialect scores. Empirical Upper Bound counts a question as correct within each dialect if at least one evaluated model answers it correctly.

Baseline and Harbor

  • Baseline: use each row's prompt in baseline_inference/ as model input. The separate gold SQL field is for evaluation only. See the baseline guide.
  • Harbor: use BIRD Mini-Dev on Harbor Hub for interactive evaluation. Submit the final query to /app/answer.sql. The Harbor dataset includes the local isolation provider; solver and verifier environments have network access disabled.

Database images are available for SQLite, MySQL, and PostgreSQL, with amd64 and arm64 support.

Acknowledgements

Thank you to the BIRD community for careful reports on question wording, evidence, gold SQL and database consistency. We retain our thanks to the NVIDIA researchers and Thinking Machines Lab for their detailed benchmark reports and discussions, and to GitHub community reporters @ivermin1123, @christian-gheorghe, @headinthebox, @tejusarora, @gkorland, @tohpinren, and @MichaelBruwerSwartz.

Previous release and citation

The original 2025-07-04 release remains in archive/bird_mini_dev_2025-07-04/. Its annotations and baseline tables are historical, not current results.

@article{li2024can,
  title={Can llm already serve as a database interface? a big bench for large-scale database grounded text-to-sqls},
  author={Li, Jinyang and Hui, Binyuan and Qu, Ge and Yang, Jiaxi and Li, Binhua and Li, Bowen and Wang, Bailin and Qin, Bowen and Geng, Ruiying and Huo, Nan and others},
  journal={Advances in Neural Information Processing Systems},
  volume={36},
  year={2024}
}
Downloads last month
3,268

Models trained or fine-tuned on birdsql/bird_mini_dev

Space using birdsql/bird_mini_dev 1

Collection including birdsql/bird_mini_dev