Dataset Viewer
Auto-converted to Parquet Duplicate
question_id
int64
0
88
db_id
stringclasses
1 value
question
stringlengths
63
286
evidence
stringlengths
37
183
SQL
stringlengths
43
368
difficulty
stringclasses
3 values
input_seq
stringlengths
7.31k
7.71k
output_seq
stringlengths
812
2.76k
generate_sql
stringlengths
43
393
0
california_schools
What is the highest eligible free rate for K-12 students in the schools in Alameda County?
Eligible free rate for K-12 = `Free Meal Count (K-12)` / `Enrollment (K-12)`
SELECT `Free Meal Count (K-12)` / `Enrollment (K-12)` FROM frpm WHERE `County Name` = 'Alameda' ORDER BY (CAST(`Free Meal Count (K-12)` AS REAL) / `Enrollment (K-12)`) DESC LIMIT 1
simple
Task Overview: You are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question. Database Engine: SQLite Database Schema: --- Schema for table: frpm --- CREATE TABLE frpm ( `CDSCo...
### Step-by-Step Solution: 1. **Understand the Question**: - We need to find the highest eligible free rate for K-12 students in the schools located in Alameda County. - The eligible free rate is calculated as `Free Meal Count (K-12)` divided by `Enrollment (K-12)`. 2. **Identify the Relevant Table**: - The ...
SELECT MAX("Free Meal Count (K-12)" / "Enrollment (K-12)") AS HighestEligibleFreeRate FROM frpm WHERE "County Name" = 'Alameda'
1
california_schools
Please list the lowest three eligible free rates for students aged 5-17 in continuation schools.
Eligible free rates for students aged 5-17 = `Free Meal Count (Ages 5-17)` / `Enrollment (Ages 5-17)`
SELECT `Free Meal Count (Ages 5-17)` / `Enrollment (Ages 5-17)` FROM frpm WHERE `Educational Option Type` = 'Continuation School' AND `Free Meal Count (Ages 5-17)` / `Enrollment (Ages 5-17)` IS NOT NULL ORDER BY `Free Meal Count (Ages 5-17)` / `Enrollment (Ages 5-17)` ASC LIMIT 3
moderate
Task Overview: You are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question. Database Engine: SQLite Database Schema: --- Schema for table: frpm --- CREATE TABLE frpm ( `CDSCo...
### Step-by-Step Solution: 1. **Understand the Question**: - We need to find the lowest three eligible free rates for students aged 5-17 in continuation schools. - The eligible free rate is calculated as `Free Meal Count (Ages 5-17)` divided by `Enrollment (Ages 5-17)`. 2. **Identify the Relevant Table**: - ...
SELECT `Free Meal Count (Ages 5-17)` / `Enrollment (Ages 5-17)` AS EligibleFreeRate FROM frpm WHERE `Educational Option Type` = 'Continuation School' AND `Free Meal Count (Ages 5-17)` IS NOT NULL AND `Enrollment (Ages 5-17)` != 0 ORDER BY EligibleFreeRate ASC LIMIT 3
2
california_schools
Please list the zip code of all the charter schools in Fresno County Office of Education.
Charter schools refers to `Charter School (Y/N)` = 1 in the table fprm
SELECT T2.Zip FROM frpm AS T1 INNER JOIN schools AS T2 ON T1.CDSCode = T2.CDSCode WHERE T1.`District Name` = 'Fresno County Office of Education' AND T1.`Charter School (Y/N)` = 1
simple
Task Overview: You are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question. Database Engine: SQLite Database Schema: --- Schema for table: frpm --- CREATE TABLE frpm ( `CDSCo...
### Step-by-Step Solution: 1. **Understand the Question**: - We need to find the zip codes of all charter schools in the "Fresno County Office of Education". 2. **Identify the Relevant Table**: - The `frpm` table contains information about whether a school is a charter school (`Charter School (Y/N)`). - The ...
SELECT T2.Zip FROM frpm AS T1 INNER JOIN schools AS T2 ON T1.CDSCode = T2.CDSCode WHERE T1.`District Name` = 'Fresno County Office of Education' AND T1.`Charter School (Y/N)` = 1
3
california_schools
What is the unabbreviated mailing street address of the school with the highest FRPM count for K-12 students?
null
SELECT T2.MailStreet FROM frpm AS T1 INNER JOIN schools AS T2 ON T1.CDSCode = T2.CDSCode ORDER BY T1.`FRPM Count (K-12)` DESC LIMIT 1
simple
Task Overview: You are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question. Database Engine: SQLite Database Schema: --- Schema for table: frpm --- CREATE TABLE frpm ( `CDSCo...
### Step-by-Step Solution: 1. **Understand the Question**: - We need to find the unabbreviated mailing street address (`MailStreet`) of the school with the highest FRPM count for K-12 students. 2. **Identify the Relevant Tables**: - The `frpm` table contains the FRPM count data. - The `schools` table contain...
SELECT T2.MailStreet FROM frpm AS T1 INNER JOIN schools AS T2 ON T1.CDSCode = T2.CDSCode ORDER BY T1.`FRPM Count (K-12)` DESC LIMIT 1
4
california_schools
Please list the phone numbers of the direct charter-funded schools that are opened after 2000/1/1.
Charter schools refers to `Charter School (Y/N)` = 1 in the frpm
SELECT T2.Phone FROM frpm AS T1 INNER JOIN schools AS T2 ON T1.CDSCode = T2.CDSCode WHERE T1.`Charter Funding Type` = 'Directly funded' AND T1.`Charter School (Y/N)` = 1 AND T2.OpenDate > '2000-01-01'
moderate
Task Overview: You are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question. Database Engine: SQLite Database Schema: --- Schema for table: frpm --- CREATE TABLE frpm ( `CDSCo...
### Step-by-Step Solution: 1. **Understand the Question**: - We need to find the phone numbers of schools that are charter-funded directly (`Charter Funding Type` = 'Directly funded') and are opened after January 1, 2000. 2. **Identify the Relevant Tables and Columns**: - The `frpm` table contains information a...
SELECT T2.Phone FROM frpm AS T1 INNER JOIN schools AS T2 ON T1.CDSCode = T2.CDSCode WHERE T1.`Charter Funding Type` = 'Directly funded' AND T1.`Charter School (Y/N)` = 1 AND T2.OpenDate > '2000-01-01'
5
california_schools
How many schools with an average score in Math greater than 400 in the SAT test are exclusively virtual?
Exclusively virtual refers to Virtual = 'F'
SELECT COUNT(DISTINCT T2.School) FROM satscores AS T1 INNER JOIN schools AS T2 ON T1.cds = T2.CDSCode WHERE T2.Virtual = 'F' AND T1.AvgScrMath > 400
simple
Task Overview: You are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question. Database Engine: SQLite Database Schema: --- Schema for table: frpm --- CREATE TABLE frpm ( `CDSCo...
### Step-by-Step Solution: 1. **Understand the Question**: - We need to count the number of schools that have an average SAT Math score greater than 400. - Additionally, these schools must be exclusively virtual, which means `Virtual` = 'F' (as per the hint). 2. **Identify the Relevant Tables and Columns**: ...
SELECT COUNT(T2.CDSCode) FROM satscores AS T1 INNER JOIN schools AS T2 ON T1.cds = T2.CDSCode WHERE T1.AvgScrMath > 400 AND T2.Virtual = 'F'
6
california_schools
Among the schools with the SAT test takers of over 500, please list the schools that are magnet schools or offer a magnet program.
Magnet schools or offer a magnet program means that Magnet = 1
SELECT T2.School FROM satscores AS T1 INNER JOIN schools AS T2 ON T1.cds = T2.CDSCode WHERE T2.Magnet = 1 AND T1.NumTstTakr > 500
simple
Task Overview: You are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question. Database Engine: SQLite Database Schema: --- Schema for table: frpm --- CREATE TABLE frpm ( `CDSCo...
### Step-by-Step Solution: 1. **Understand the Question**: - We need to identify schools that have more than 500 SAT test takers. - Among these schools, we need to list those that are magnet schools or offer a magnet program. 2. **Identify the Relevant Tables and Columns**: - The `satscores` table contains i...
SELECT T2.School FROM satscores AS T1 INNER JOIN schools AS T2 ON T1.cds = T2.CDSCode WHERE T1.NumTstTakr > 500 AND T2.Magnet = 1
7
california_schools
What is the phone number of the school that has the highest number of test takers with an SAT score of over 1500?
null
SELECT T2.Phone FROM satscores AS T1 INNER JOIN schools AS T2 ON T1.cds = T2.CDSCode ORDER BY T1.NumGE1500 DESC LIMIT 1
simple
Task Overview: You are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question. Database Engine: SQLite Database Schema: --- Schema for table: frpm --- CREATE TABLE frpm ( `CDSCo...
### Step-by-Step Solution: 1. **Understand the Question**: - We need to find the phone number of the school with the highest number of students who scored 1500 or higher on the SAT. 2. **Identify the Relevant Tables**: - The `satscores` table contains information about the number of test takers and the number o...
SELECT T2.Phone FROM satscores AS T1 INNER JOIN schools AS T2 ON T1.cds = T2.CDSCode ORDER BY T1.NumGE1500 DESC LIMIT 1
8
california_schools
What is the number of SAT test takers of the schools with the highest FRPM count for K-12 students?
null
SELECT NumTstTakr FROM satscores WHERE cds = ( SELECT CDSCode FROM frpm ORDER BY `FRPM Count (K-12)` DESC LIMIT 1 )
simple
Task Overview: You are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question. Database Engine: SQLite Database Schema: --- Schema for table: frpm --- CREATE TABLE frpm ( `CDSCo...
### Step-by-Step Solution: 1. **Understand the Question**: - We need to find the number of SAT test takers for schools that have the highest FRPM count (Free or Reduced Price Meals) for K-12 students. 2. **Identify the Relevant Tables and Columns**: - The `frpm` table contains information about the FRPM count f...
SELECT T2.NumTstTakr FROM frpm AS T1 INNER JOIN satscores AS T2 ON T1.CDSCode = T2.cds WHERE T1."FRPM Count (K-12)" = ( SELECT MAX("FRPM Count (K-12)") FROM frpm )
9
california_schools
Among the schools with the average score in Math over 560 in the SAT test, how many schools are directly charter-funded?
null
SELECT COUNT(T2.`School Code`) FROM satscores AS T1 INNER JOIN frpm AS T2 ON T1.cds = T2.CDSCode WHERE T1.AvgScrMath > 560 AND T2.`Charter Funding Type` = 'Directly funded'
simple
Task Overview: You are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question. Database Engine: SQLite Database Schema: --- Schema for table: frpm --- CREATE TABLE frpm ( `CDSCo...
### Step-by-Step Solution: 1. **Understand the Question**: - We need to find the count of schools that have an average Math SAT score greater than 560. - Among these schools, we are specifically interested in those that are directly charter-funded. 2. **Identify the Relevant Tables and Columns**: - The `sats...
SELECT COUNT(T2.`School Code`) FROM satscores AS T1 INNER JOIN frpm AS T2 ON T1.cds = T2.CDSCode WHERE T1.AvgScrMath > 560 AND T2.`Charter Funding Type` = 'Directly funded'
10
california_schools
For the school with the highest average score in Reading in the SAT test, what is its FRPM count for students aged 5-17?
null
SELECT T2.`FRPM Count (Ages 5-17)` FROM satscores AS T1 INNER JOIN frpm AS T2 ON T1.cds = T2.CDSCode ORDER BY T1.AvgScrRead DESC LIMIT 1
simple
Task Overview: You are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question. Database Engine: SQLite Database Schema: --- Schema for table: frpm --- CREATE TABLE frpm ( `CDSCo...
### Step-by-Step Solution: 1. **Understand the Question**: - We need to identify the school with the highest average reading score from the `satscores` table. - For that school, we need to retrieve its FRPM count for students aged 5-17 from the `frpm` table. 2. **Identify Relevant Tables and Columns**: - The...
SELECT T2.`FRPM Count (Ages 5-17)` FROM satscores AS T1 INNER JOIN frpm AS T2 ON T1.cds = T2.CDSCode ORDER BY T1.AvgScrRead DESC LIMIT 1;
11
california_schools
Please list the codes of the schools with a total enrollment of over 500.
Total enrollment can be represented by `Enrollment (K-12)` + `Enrollment (Ages 5-17)`
SELECT T2.CDSCode FROM schools AS T1 INNER JOIN frpm AS T2 ON T1.CDSCode = T2.CDSCode WHERE T2.`Enrollment (K-12)` + T2.`Enrollment (Ages 5-17)` > 500
simple
Task Overview: You are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question. Database Engine: SQLite Database Schema: --- Schema for table: frpm --- CREATE TABLE frpm ( `CDSCo...
### Step-by-Step Solution: 1. **Understand the Question**: - We need to find the codes of schools that have a total enrollment over 500. - The total enrollment is calculated as the sum of `Enrollment (K-12)` and `Enrollment (Ages 5-17)`. 2. **Identify the Relevant Table**: - The `frpm` table contains both `E...
SELECT CDSCode FROM frpm WHERE `Enrollment (K-12)` + `Enrollment (Ages 5-17)` > 500
12
california_schools
Among the schools with an SAT excellence rate of over 0.3, what is the highest eligible free rate for students aged 5-17?
Excellence rate = NumGE1500 / NumTstTakr; Eligible free rates for students aged 5-17 = `Free Meal Count (Ages 5-17)` / `Enrollment (Ages 5-17)`
SELECT MAX(CAST(T1.`Free Meal Count (Ages 5-17)` AS REAL) / T1.`Enrollment (Ages 5-17)`) FROM frpm AS T1 INNER JOIN satscores AS T2 ON T1.CDSCode = T2.cds WHERE CAST(T2.NumGE1500 AS REAL) / T2.NumTstTakr > 0.3
moderate
Task Overview: You are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question. Database Engine: SQLite Database Schema: --- Schema for table: frpm --- CREATE TABLE frpm ( `CDSCo...
### Step-by-Step Solution: 1. **Understand the Question**: - We need to find the highest eligible free rate for students aged 5-17 among schools with an SAT excellence rate of over 0.3. - The SAT excellence rate is defined as `NumGE1500 / NumTstTakr`. - The eligible free rate for students aged 5-17 is defined...
SELECT MAX(T2.`Free Meal Count (Ages 5-17)` / T2.`Enrollment (Ages 5-17)`) AS HighestEligibleFreeRate FROM satscores AS T1 INNER JOIN frpm AS T2 ON T1.cds = T2.CDSCode WHERE (T1.NumGE1500 * 1.0 / T1.NumTstTakr) > 0.3
13
california_schools
Please list the phone numbers of the schools with the top 3 SAT excellence rate.
Excellence rate = NumGE1500 / NumTstTakr
SELECT T1.Phone FROM schools AS T1 INNER JOIN satscores AS T2 ON T1.CDSCode = T2.cds ORDER BY CAST(T2.NumGE1500 AS REAL) / T2.NumTstTakr DESC LIMIT 3
simple
Task Overview: You are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question. Database Engine: SQLite Database Schema: --- Schema for table: frpm --- CREATE TABLE frpm ( `CDSCo...
### Step-by-Step Solution: 1. **Understand the Question**: - We need to list the phone numbers of schools that have the top 3 SAT excellence rates. - The excellence rate is defined as `NumGE1500 / NumTstTakr`. 2. **Identify the Relevant Tables**: - The `satscores` table contains information about the number ...
WITH RankedSchools AS ( SELECT T2.Phone, (T1.NumGE1500 * 1.0 / T1.NumTstTakr) AS ExcellenceRate FROM satscores AS T1 INNER JOIN schools AS T2 ON T1.cds = T2.CDSCode WHERE T1.NumTstTakr > 0 ORDER BY ExcellenceRate DESC LIMIT 3 ) SELECT Phone FROM RankedSchools;
14
california_schools
List the top five schools, by descending order, from the highest to the lowest, the most number of Enrollment (Ages 5-17). Please give their NCES school identification number.
null
SELECT T1.NCESSchool FROM schools AS T1 INNER JOIN frpm AS T2 ON T1.CDSCode = T2.CDSCode ORDER BY T2.`Enrollment (Ages 5-17)` DESC LIMIT 5
simple
Task Overview: You are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question. Database Engine: SQLite Database Schema: --- Schema for table: frpm --- CREATE TABLE frpm ( `CDSCo...
### Step-by-Step Solution: 1. **Understand the Question**: - We need to list the top five schools based on their `Enrollment (Ages 5-17)` in descending order. - The required output is the NCES school identification number (`NCESSchool`). 2. **Identify the Relevant Table and Columns**: - The `frpm` table cont...
SELECT T2.NCESSchool FROM frpm AS T1 INNER JOIN schools AS T2 ON T1.CDSCode = T2.CDSCode ORDER BY T1.`Enrollment (Ages 5-17)` DESC LIMIT 5
15
california_schools
Which active district has the highest average score in Reading?
null
SELECT T1.District FROM schools AS T1 INNER JOIN satscores AS T2 ON T1.CDSCode = T2.cds WHERE T1.StatusType = 'Active' ORDER BY T2.AvgScrRead DESC LIMIT 1
simple
Task Overview: You are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question. Database Engine: SQLite Database Schema: --- Schema for table: frpm --- CREATE TABLE frpm ( `CDSCo...
### Step-by-Step Solution: 1. **Understand the Question**: - We need to find the name of the active district with the highest average reading score from the SAT scores. 2. **Identify the Relevant Tables and Columns**: - The `satscores` table contains the `AvgScrRead` column, which holds the average reading scor...
SELECT T1.District FROM schools AS T1 INNER JOIN satscores AS T2 ON T1.CDSCode = T2.cds WHERE T1.StatusType = 'Active' ORDER BY T2.AvgScrRead DESC LIMIT 1
16
california_schools
How many schools in merged Alameda have number of test takers less than 100?
null
SELECT COUNT(T1.CDSCode) FROM schools AS T1 INNER JOIN satscores AS T2 ON T1.CDSCode = T2.cds WHERE T1.StatusType = 'Merged' AND T2.NumTstTakr < 100 AND T1.County = 'Lake'
simple
Task Overview: You are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question. Database Engine: SQLite Database Schema: --- Schema for table: frpm --- CREATE TABLE frpm ( `CDSCo...
Let's carefully break down the problem and construct the SQL query step by step. ### Step-by-Step Solution: 1. **Understand the Question**: - We need to find the number of schools in "Merged Alameda" that have fewer than 100 test takers. - Note: There is a discrepancy in the hint provided ("merged Alameda") and...
SELECT COUNT(T1.CDSCode) FROM schools AS T1 INNER JOIN satscores AS T2 ON T1.CDSCode = T2.cds WHERE T1.StatusType = 'Merged' AND T2.NumTstTakr < 100 AND T1.County = 'Lake'
17
california_schools
Rank schools by their average score in Writing where the score is greater than 499, showing their charter numbers.
Valid charter number means the number is not null
SELECT CharterNum, AvgScrWrite, RANK() OVER (ORDER BY AvgScrWrite DESC) AS WritingScoreRank FROM schools AS T1 INNER JOIN satscores AS T2 ON T1.CDSCode = T2.cds WHERE T2.AvgScrWrite > 499 AND CharterNum is not null
simple
Task Overview: You are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question. Database Engine: SQLite Database Schema: --- Schema for table: frpm --- CREATE TABLE frpm ( `CDSCo...
### Step-by-Step Solution: 1. **Understand the Question**: - We need to rank schools by their average SAT Writing score where the score is greater than 499. - We also need to show the charter numbers of these schools, and only include valid charter numbers (i.e., non-null). 2. **Identify the Relevant Tables and...
SELECT T1.CharterNum, T2.AvgScrWrite, RANK() OVER (ORDER BY T2.AvgScrWrite DESC) AS WritingScoreRank FROM schools AS T1 INNER JOIN satscores AS T2 ON T1.CDSCode = T2.cds WHERE T2.AvgScrWrite > 499 AND T1.CharterNum IS NOT NULL
18
california_schools
How many schools in Fresno (directly funded) have number of test takers not more than 250?
null
SELECT COUNT(T1.CDSCode) FROM frpm AS T1 INNER JOIN satscores AS T2 ON T1.CDSCode = T2.cds WHERE T1.`Charter Funding Type` = 'Directly funded' AND T1.`County Name` = 'Fresno' AND T2.NumTstTakr <= 250
simple
Task Overview: You are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question. Database Engine: SQLite Database Schema: --- Schema for table: frpm --- CREATE TABLE frpm ( `CDSCo...
### Step-by-Step Solution: 1. **Understand the Question**: - We need to find the count of schools in Fresno that are directly funded and have a number of test takers not more than 250. 2. **Identify the Relevant Tables and Columns**: - The `frpm` table contains information about the funding type, county name, a...
SELECT COUNT(T1.CDSCode) FROM frpm AS T1 INNER JOIN satscores AS T2 ON T1.CDSCode = T2.cds WHERE T1.`County Name` = 'Fresno' AND T1.`Charter Funding Type` = 'Directly funded' AND T2.NumTstTakr <= 250
19
california_schools
What is the phone number of the school that has the highest average score in Math?
null
SELECT T1.Phone FROM schools AS T1 INNER JOIN satscores AS T2 ON T1.CDSCode = T2.cds ORDER BY T2.AvgScrMath DESC LIMIT 1
simple
Task Overview: You are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question. Database Engine: SQLite Database Schema: --- Schema for table: frpm --- CREATE TABLE frpm ( `CDSCo...
### Step-by-Step Solution: 1. **Understand the Question**: - We need to find the phone number of the school that has the highest average SAT Math score. 2. **Identify the Relevant Tables**: - The `satscores` table contains information about the average SAT scores. - The `schools` table contains information a...
SELECT T2.Phone FROM satscores AS T1 INNER JOIN schools AS T2 ON T1.cds = T2.CDSCode ORDER BY T1.AvgScrMath DESC LIMIT 1
End of preview. Expand in Data Studio

No dataset card yet

Downloads last month
8