Dludora/Bird-minidev-sqlserver-oracle huggingface dataset:
Database: toxicology

Question: What is the composition of element chlorine in percentage among the single bond molecules?
Evidence: element chlorine refers to element = 'cl'; single bond refers to bond_type = '-'; percentage = DIVIDE(SUM(element = 'cl'), COUNT(atom_id)) as percent where bond_type = '-'
SQL (SQLite): SELECT CAST(COUNT(CASE WHEN T.element = 'cl' THEN T.atom_id ELSE NULL END) AS REAL) * 100 / COUNT(T.atom_id) FROM ( SELECT T1.atom_id, T1.element FROM atom AS T1 INNER JOIN molecule AS T2 ON T1.molecule_id = T2.molecule_id INNER JOIN bond AS T3 ON T2.molecule_id = T3.molecule_id WHERE T3.bond_type = '-' ) AS T
SQL (SQL Server): SELECT TRY_CAST(COUNT(CASE WHEN T.element = 'cl' THEN T.atom_id ELSE NULL END) AS FLOAT) * 100 / COUNT(T.atom_id) AS _agg1 FROM ( SELECT T1.atom_id, T1.element FROM atom AS T1 INNER JOIN molecule AS T2 ON T1.molecule_id = T2.molecule_id INNER JOIN bond AS T3 ON T2.molecule_id = T3.molecule_id WHERE T3.bond_type = '-' ) AS T
SQL (Oracle): SELECT CAST(COUNT(CASE WHEN T.element = 'cl' THEN T.atom_id ELSE NULL END) AS BINARY_DOUBLE) * 100 / COUNT(T.atom_id) FROM ( SELECT T1.atom_id, T1.element FROM atom T1 INNER JOIN molecule T2 ON T1.molecule_id = T2.molecule_id INNER JOIN bond T3 ON T2.molecule_id = T3.molecule_id WHERE T3.bond_type = '-' ) T

Question: What are the elements for bond id TR001_10_11?
Evidence: TR001_10_11 is the bond id;
SQL (SQLite): SELECT T2.element FROM connected AS T1 INNER JOIN atom AS T2 ON T1.atom_id = T2.atom_id WHERE T1.bond_id = 'TR001_10_11'
SQL (SQL Server): SELECT T2.element FROM connected AS T1 INNER JOIN atom AS T2 ON T1.atom_id = T2.atom_id WHERE T1.bond_id = 'TR001_10_11'
SQL (Oracle): SELECT T2.element FROM connected T1 INNER JOIN atom T2 ON T1.atom_id = T2.atom_id WHERE T1.bond_id = 'TR001_10_11'

Question: What is the percentage of element chlorine in carcinogenic molecules?
Evidence: chlorine refers to element = 'cl'; label = '+' mean molecules are carcinogenic; percentage = DIVIDE(SUM(element = 'pb'); COUNT(molecule_id)) as percentage where label = '+'
SQL (SQLite): SELECT CAST(COUNT( CASE WHEN T1.element = 'cl' THEN T1.element ELSE NULL END) AS REAL) * 100 / COUNT(T1.element) FROM atom AS T1 INNER JOIN molecule AS T2 ON T1.molecule_id = T2.molecule_id WHERE T2.label = '+'
SQL (SQL Server): SELECT TRY_CAST(COUNT( CASE WHEN T1.element = 'cl' THEN T1.element ELSE NULL END) AS FLOAT) * 100 / COUNT(T1.element) AS _agg1 FROM atom AS T1 INNER JOIN molecule AS T2 ON T1.molecule_id = T2.molecule_id WHERE T2.label = '+'
SQL (Oracle): SELECT CAST(COUNT( CASE WHEN T1.element = 'cl' THEN T1.element ELSE NULL END) AS BINARY_DOUBLE) * 100 / COUNT(T1.element) FROM atom T1 INNER JOIN molecule T2 ON T1.molecule_id = T2.molecule_id WHERE T2.label = '+'
Database: toxicology

Question: Tally the toxicology element of the 4th atom of each molecule that was carcinogenic.
Evidence: label = '+' means molecules are carcinogenic; 4th atom of each molecule refers to substr(atom_id, 7, 1) = '4'; 
SQL (SQLite): SELECT DISTINCT T1.element FROM atom AS T1 INNER JOIN molecule AS T2 ON T1.molecule_id = T2.molecule_id WHERE T2.label = '+' AND SUBSTR(T1.atom_id, -1) = '4' AND LENGTH(T1.atom_id) = 7
SQL (SQL Server): SELECT DISTINCT T1.element FROM atom AS T1 INNER JOIN molecule AS T2 ON T1.molecule_id = T2.molecule_id WHERE T2.label = '+' AND RIGHT(T1.atom_id, 1) = '4' AND LEN(T1.atom_id) = 7
SQL (Oracle): SELECT DISTINCT T1.element FROM atom T1 INNER JOIN molecule T2 ON T1.molecule_id = T2.molecule_id WHERE T2.label = '+' AND SUBSTR(T1.atom_id, -1) = '4' AND LENGTH(T1.atom_id) = 7

Question: What is the ratio of Hydrogen elements in molecule ID TR006? List the ratio with its label.
Evidence: hydrogen refers to element = 'h'; ratio = DIVIDE(SUM(element = 'h'), count(element)) where molecule_id = 'TR006' ; label = '+' mean molecules are carcinogenic; label = '-' means molecules are non-carcinogenic
SQL (SQLite): WITH SubQuery AS (SELECT DISTINCT T1.atom_id, T1.element, T1.molecule_id, T2.label FROM atom AS T1 INNER JOIN molecule AS T2 ON T1.molecule_id = T2.molecule_id WHERE T2.molecule_id = 'TR006') SELECT CAST(COUNT(CASE WHEN element = 'h' THEN atom_id ELSE NULL END) AS REAL) / (CASE WHEN COUNT(atom_id) = 0 THEN NULL ELSE COUNT(atom_id) END) AS ratio, label FROM SubQuery GROUP BY label
SQL (SQL Server): WITH SubQuery AS (SELECT DISTINCT T1.atom_id, T1.element, T1.molecule_id, T2.label FROM atom AS T1 INNER JOIN molecule AS T2 ON T1.molecule_id = T2.molecule_id WHERE T2.molecule_id = 'TR006') SELECT TRY_CAST(COUNT(CASE WHEN element = 'h' THEN atom_id ELSE NULL END) AS FLOAT) / (CASE WHEN COUNT(atom_id) = 0 THEN NULL ELSE COUNT(atom_id) END) AS ratio, label FROM SubQuery GROUP BY label
SQL (Oracle): WITH SubQuery AS (SELECT DISTINCT T1.atom_id, T1.element, T1.molecule_id, T2.label FROM atom T1 INNER JOIN molecule T2 ON T1.molecule_id = T2.molecule_id WHERE T2.molecule_id = 'TR006') SELECT CAST(COUNT(CASE WHEN element = 'h' THEN atom_id ELSE NULL END) AS BINARY_DOUBLE) / (CASE WHEN COUNT(atom_id) = 0 THEN NULL ELSE COUNT(atom_id) END) ratio, label FROM SubQuery GROUP BY label
Database: toxicology

Question: Which non-carcinogenic molecules consisted more than 5 atoms?
Evidence: label = '-' means molecules are non-carcinogenic; molecules consisted more than 5 atoms refers to COUNT(molecule_id) > 5
SQL (SQLite): SELECT T.molecule_id FROM ( SELECT T1.molecule_id, COUNT(T2.atom_id) FROM molecule AS T1 INNER JOIN atom AS T2 ON T1.molecule_id = T2.molecule_id WHERE T1.label = '-' GROUP BY T1.molecule_id HAVING COUNT(T2.atom_id) > 5 ) t
SQL (SQL Server): SELECT T.molecule_id FROM ( SELECT T1.molecule_id, COUNT(T2.atom_id) AS _agg1 FROM molecule AS T1 INNER JOIN atom AS T2 ON T1.molecule_id = T2.molecule_id WHERE T1.label = '-' GROUP BY T1.molecule_id HAVING COUNT(T2.atom_id) > 5 ) t
SQL (Oracle): SELECT T.molecule_id FROM ( SELECT T1.molecule_id, COUNT(T2.atom_id) FROM molecule T1 INNER JOIN atom T2 ON T1.molecule_id = T2.molecule_id WHERE T1.label = '-' GROUP BY T1.molecule_id HAVING COUNT(T2.atom_id) > 5 ) t
Database: california_schools

Question: How many schools with an average score in Math greater than 400 in the SAT test are exclusively virtual?
Evidence: Exclusively virtual refers to Virtual = 'F'
SQL (SQLite): 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
SQL (SQL Server): SELECT COUNT(DISTINCT T2.School) AS _agg1 FROM satscores AS T1 INNER JOIN schools AS T2 ON T1.cds = T2.CDSCode WHERE T2.Virtual = 'F' AND T1.AvgScrMath > 400
SQL (Oracle): SELECT COUNT(DISTINCT T2.School) FROM satscores T1 INNER JOIN schools T2 ON T1.cds = T2.CDSCode WHERE T2.Virtual = 'F' AND T1.AvgScrMath > 400

Question: Please list the codes of the schools with a total enrollment of over 500.
Evidence: Total enrollment can be represented by `Enrollment (K-12)` + `Enrollment (Ages 5-17)`
SQL (SQLite): 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
SQL (SQL Server): 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
SQL (Oracle): SELECT T2.CDSCode FROM schools T1 INNER JOIN frpm T2 ON T1.CDSCode = T2.CDSCode WHERE T2."ENROLLMENT (K-12)" + T2."ENROLLMENT (AGES 5-17)" > 500

Question: Among the schools with an SAT excellence rate of over 0.3, what is the highest eligible free rate for students aged 5-17?
Evidence: Excellence rate = NumGE1500 / NumTstTakr; Eligible free rates for students aged 5-17 = `Free Meal Count (Ages 5-17)` / `Enrollment (Ages 5-17)`
SQL (SQLite): 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
SQL (SQL Server): SELECT MAX(TRY_CAST(T1.[Free Meal Count (Ages 5-17)] AS FLOAT) / T1.[Enrollment (Ages 5-17)]) AS _agg1 FROM frpm AS T1 INNER JOIN satscores AS T2 ON T1.CDSCode = T2.cds WHERE TRY_CAST(T2.NumGE1500 AS FLOAT) / T2.NumTstTakr > 0.3
SQL (Oracle): SELECT MAX(CAST(T1."FREE MEAL COUNT (AGES 5-17)" AS BINARY_DOUBLE) / T1."ENROLLMENT (AGES 5-17)") FROM frpm T1 INNER JOIN satscores T2 ON T1.CDSCode = T2.cds WHERE CAST(T2.NumGE1500 AS BINARY_DOUBLE) / T2.NumTstTakr > 0.3
Database: california_schools

Question: Rank schools by their average score in Writing where the score is greater than 499, showing their charter numbers.
Evidence: Valid charter number means the number is not null
SQL (SQLite): 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
SQL (SQL Server): 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
SQL (Oracle): SELECT CharterNum, AvgScrWrite, RANK() OVER (ORDER BY AvgScrWrite DESC NULLS LAST) WritingScoreRank FROM schools T1  INNER JOIN satscores T2 ON T1.CDSCode = T2.cds WHERE T2.AvgScrWrite > 499 AND CharterNum is not null

Question: List the names of schools with more than 30 difference in enrollements between K-12 and ages 5-17? Please also give the full street adress of the schools.
Evidence: Diffrence in enrollement = `Enrollment (K-12)` - `Enrollment (Ages 5-17)`
SQL (SQLite): SELECT T1.School, T1.Street FROM schools AS T1 INNER JOIN frpm AS T2 ON T1.CDSCode = T2.CDSCode WHERE T2.`Enrollment (K-12)` - T2.`Enrollment (Ages 5-17)` > 30
SQL (SQL Server): SELECT T1.School, T1.Street FROM schools AS T1 INNER JOIN frpm AS T2 ON T1.CDSCode = T2.CDSCode WHERE T2.[Enrollment (K-12)] - T2.[Enrollment (Ages 5-17)] > 30
SQL (Oracle): SELECT T1.School, T1.Street FROM schools T1 INNER JOIN frpm T2 ON T1.CDSCode = T2.CDSCode WHERE T2."ENROLLMENT (K-12)" - T2."ENROLLMENT (AGES 5-17)" > 30

Question: Give the names of the schools with the percent eligible for free meals in K-12 is more than 0.1 and test takers whose test score is greater than or equal to 1500?
Evidence: Percent eligible for free meals = Free Meal Count (K-12) / Total (Enrollment (K-12)
SQL (SQLite): SELECT T2.`School Name` FROM satscores AS T1 INNER JOIN frpm AS T2 ON T1.cds = T2.CDSCode WHERE CAST(T2.`Free Meal Count (K-12)` AS REAL) / T2.`Enrollment (K-12)` > 0.1 AND T1.NumGE1500 > 0
SQL (SQL Server): SELECT T2.[School Name] FROM satscores AS T1 INNER JOIN frpm AS T2 ON T1.cds = T2.CDSCode WHERE TRY_CAST(T2.[Free Meal Count (K-12)] AS FLOAT) / T2.[Enrollment (K-12)] > 0.1 AND T1.NumGE1500 > 0
SQL (Oracle): SELECT T2."SCHOOL NAME" FROM satscores T1 INNER JOIN frpm T2 ON T1.cds = T2.CDSCode WHERE CAST(T2."FREE MEAL COUNT (K-12)" AS BINARY_DOUBLE) / T2."ENROLLMENT (K-12)" > 0.1 AND T1.NumGE1500 > 0
Database: california_schools

Question: Name schools in Riverside which the average of average math score for SAT is grater than 400, what is the funding type of these schools?
Evidence: Average of average math = sum(average math scores) / count(schools).
SQL (SQLite): SELECT T1.sname, T2.`Charter Funding Type` FROM satscores AS T1 INNER JOIN frpm AS T2 ON T1.cds = T2.CDSCode WHERE T2.`District Name` LIKE 'Riverside%' GROUP BY T1.sname, T2.`Charter Funding Type` HAVING CAST(SUM(T1.AvgScrMath) AS REAL) / COUNT(T1.cds) > 400
SQL (SQL Server): SELECT T1.sname, T2.[Charter Funding Type] FROM satscores AS T1 INNER JOIN frpm AS T2 ON T1.cds = T2.CDSCode WHERE T2.[District Name] LIKE 'Riverside%' GROUP BY T1.sname, T2.[Charter Funding Type] HAVING TRY_CAST(SUM(T1.AvgScrMath) AS FLOAT) / COUNT(T1.cds) > 400
SQL (Oracle): SELECT T1.sname, T2."CHARTER FUNDING TYPE" FROM satscores T1 INNER JOIN frpm T2 ON T1.cds = T2.CDSCode WHERE T2."DISTRICT NAME" LIKE 'Riverside%' GROUP BY T1.sname, T2."CHARTER FUNDING TYPE" HAVING CAST(SUM(T1.AvgScrMath) AS BINARY_DOUBLE) / COUNT(T1.cds) > 400

Question: State the names and full communication address of high schools in Monterey which has more than 800 free or reduced price meals for ages 15-17?
Evidence: Full communication address should include Street, City, State and zip code if any.
SQL (SQLite): SELECT T1.`School Name`, T2.Street, T2.City, T2.State, T2.Zip FROM frpm AS T1 INNER JOIN schools AS T2 ON T1.CDSCode = T2.CDSCode WHERE T2.County = 'Monterey' AND T1.`Free Meal Count (Ages 5-17)` > 800 AND T1.`School Type` = 'High Schools (Public)'
SQL (SQL Server): SELECT T1.[School Name], T2.Street, T2.City, T2.State, T2.Zip FROM frpm AS T1 INNER JOIN schools AS T2 ON T1.CDSCode = T2.CDSCode WHERE T2.County = 'Monterey' AND T1.[Free Meal Count (Ages 5-17)] > 800 AND T1.[School Type] = 'High Schools (Public)'
SQL (Oracle): SELECT T1."SCHOOL NAME", T2.Street, T2.City, T2.State, T2.Zip FROM frpm T1 INNER JOIN schools T2 ON T1.CDSCode = T2.CDSCode WHERE T2.County = 'Monterey' AND T1."FREE MEAL COUNT (AGES 5-17)" > 800 AND T1."SCHOOL TYPE" = 'High Schools (Public)'

Question: What is the average score in writing for the schools that were opened after 1991 or closed before 2000? List the school names along with the score. Also, list the communication number of the schools if there is any.
Evidence: Communication number refers to phone number.
SQL (SQLite): SELECT T2.School, T1.AvgScrWrite, T2.Phone FROM schools AS T2 LEFT JOIN satscores AS T1 ON T2.CDSCode = T1.cds WHERE strftime('%Y', T2.OpenDate) > '1991' OR strftime('%Y', T2.ClosedDate) < '2000'
SQL (SQL Server): SELECT T2.School, T1.AvgScrWrite, T2.Phone FROM schools AS T2 LEFT JOIN satscores AS T1 ON T2.CDSCode = T1.cds WHERE YEAR(T2.OpenDate) > '1991' OR YEAR(T2.ClosedDate) < '2000'
SQL (Oracle): SELECT T2.School, T1.AvgScrWrite, T2.Phone FROM schools T2 LEFT JOIN satscores T1 ON T2.CDSCode = T1.cds WHERE SUBSTR(T2.OpenDate, 1, 4) > '1991' OR SUBSTR(T2.ClosedDate, 1, 4) < '2000'
Database: california_schools

Question: Consider the average difference between K-12 enrollment and 15-17 enrollment of schools that are locally funded, list the names and DOC type of schools which has a difference above this average.
Evidence: Difference between K-12 enrollment and 15-17 enrollment can be computed by `Enrollment (K-12)` - `Enrollment (Ages 5-17)`
SQL (SQLite): SELECT T2.School, T2.DOC FROM frpm AS T1 INNER JOIN schools AS T2 ON T1.CDSCode = T2.CDSCode WHERE T2.FundingType = 'Locally funded' AND (T1.`Enrollment (K-12)` - T1.`Enrollment (Ages 5-17)`) > (SELECT AVG(T3.`Enrollment (K-12)` - T3.`Enrollment (Ages 5-17)`) FROM frpm AS T3 INNER JOIN schools AS T4 ON T3.CDSCode = T4.CDSCode WHERE T4.FundingType = 'Locally funded')
SQL (SQL Server): SELECT T2.School, T2.DOC FROM frpm AS T1 INNER JOIN schools AS T2 ON T1.CDSCode = T2.CDSCode WHERE T2.FundingType = 'Locally funded' AND (T1.[Enrollment (K-12)] - T1.[Enrollment (Ages 5-17)]) > (SELECT AVG(TRY_CAST(T3.[Enrollment (K-12)] - T3.[Enrollment (Ages 5-17)] AS FLOAT)) AS _agg1 FROM frpm AS T3 INNER JOIN schools AS T4 ON T3.CDSCode = T4.CDSCode WHERE T4.FundingType = 'Locally funded')
SQL (Oracle): SELECT T2.School, T2.DOC FROM frpm T1 INNER JOIN schools T2 ON T1.CDSCode = T2.CDSCode WHERE T2.FundingType = 'Locally funded' AND (T1."ENROLLMENT (K-12)" - T1."ENROLLMENT (AGES 5-17)") > (SELECT AVG(T3."ENROLLMENT (K-12)" - T3."ENROLLMENT (AGES 5-17)") FROM frpm T3 INNER JOIN schools T4 ON T3.CDSCode = T4.CDSCode WHERE T4.FundingType = 'Locally funded')

Question: What is the eligible free rate of the 10th and 11th schools with the highest enrolment for students in grades 1 through 12?
Evidence: K-12 refers to students in grades 1 through 12; Eligible free rate for K-12 = `Free Meal Count (K-12)` / `Enrollment (K-12)`
SQL (SQLite): SELECT CAST(`Free Meal Count (K-12)` AS REAL) / `Enrollment (K-12)` FROM frpm ORDER BY `Enrollment (K-12)` DESC LIMIT 9, 2
SQL (SQL Server): SELECT TRY_CAST([Free Meal Count (K-12)] AS FLOAT) / [Enrollment (K-12)] FROM frpm ORDER BY [Enrollment (K-12)] DESC OFFSET 9 ROWS FETCH NEXT 2 ROWS ONLY
SQL (Oracle): SELECT CAST("FREE MEAL COUNT (K-12)" AS BINARY_DOUBLE) / "ENROLLMENT (K-12)" FROM frpm ORDER BY "ENROLLMENT (K-12)" DESC NULLS LAST OFFSET 9 ROWS FETCH NEXT 2 ROWS ONLY
Database: california_schools

Question: What is the eligible free or reduced price meal rate for the top 5 schools in grades 1-12 with the highest free or reduced price meal count of the schools with the ownership code 66?
Evidence: grades 1-12 means K-12; Eligible free or reduced price meal rate for K-12 = `FRPM Count (K-12)` / `Enrollment (K-12)`
SQL (SQLite): SELECT CAST(T1.`FRPM Count (K-12)` AS REAL) / T1.`Enrollment (K-12)` FROM frpm AS T1 INNER JOIN schools AS T2 ON T1.CDSCode = T2.CDSCode WHERE T2.SOC = 66 ORDER BY T1.`FRPM Count (K-12)` DESC LIMIT 5
SQL (SQL Server): SELECT TRY_CAST(T1.[FRPM Count (K-12)] AS FLOAT) / T1.[Enrollment (K-12)] FROM frpm AS T1 INNER JOIN schools AS T2 ON T1.CDSCode = T2.CDSCode WHERE T2.SOC = 66 ORDER BY T1.[FRPM Count (K-12)] DESC OFFSET 0 ROWS FETCH NEXT 5 ROWS ONLY
SQL (Oracle): SELECT CAST(T1."FRPM COUNT (K-12)" AS BINARY_DOUBLE) / T1."ENROLLMENT (K-12)" FROM frpm T1 INNER JOIN schools T2 ON T1.CDSCode = T2.CDSCode WHERE T2.SOC = 66 ORDER BY T1."FRPM COUNT (K-12)" DESC NULLS LAST FETCH FIRST 5 ROWS ONLY

Question: What is the complete address of the school with the lowest excellence rate? Indicate the Street, City, Zip and State.
Evidence: Execellence Rate = NumGE1500 / NumTstTakr; complete address has Street, City, State, Zip code
SQL (SQLite): SELECT T2.Street, T2.City, T2.State, T2.Zip FROM satscores AS T1 INNER JOIN schools AS T2 ON T1.cds = T2.CDSCode ORDER BY CAST(T1.NumGE1500 AS REAL) / T1.NumTstTakr ASC LIMIT 1
SQL (SQL Server): SELECT T2.Street, T2.City, T2.State, T2.Zip FROM satscores AS T1 INNER JOIN schools AS T2 ON T1.cds = T2.CDSCode ORDER BY TRY_CAST(T1.NumGE1500 AS FLOAT) / T1.NumTstTakr ASC OFFSET 0 ROWS FETCH NEXT 1 ROWS ONLY
SQL (Oracle): SELECT T2.Street, T2.City, T2.State, T2.Zip FROM satscores T1 INNER JOIN schools T2 ON T1.cds = T2.CDSCode ORDER BY CAST(T1.NumGE1500 AS BINARY_DOUBLE) / T1.NumTstTakr ASC NULLS FIRST FETCH FIRST 1 ROWS ONLY

Question: Under whose administration is the school with the highest number of students scoring 1500 or more on the SAT? Indicate their full names.
Evidence: full name means first name, last name; There are at most 3 administrators for each school; SAT Scores are greater or equal to 1500 refers to NumGE1500
SQL (SQLite): SELECT T2.AdmFName1, T2.AdmLName1, T2.AdmFName2, T2.AdmLName2, T2.AdmFName3, T2.AdmLName3 FROM satscores AS T1 INNER JOIN schools AS T2 ON T1.cds = T2.CDSCode ORDER BY T1.NumGE1500 DESC LIMIT 1
SQL (SQL Server): SELECT T2.AdmFName1, T2.AdmLName1, T2.AdmFName2, T2.AdmLName2, T2.AdmFName3, T2.AdmLName3 FROM satscores AS T1 INNER JOIN schools AS T2 ON T1.cds = T2.CDSCode ORDER BY T1.NumGE1500 DESC OFFSET 0 ROWS FETCH NEXT 1 ROWS ONLY
SQL (Oracle): SELECT T2.AdmFName1, T2.AdmLName1, T2.AdmFName2, T2.AdmLName2, T2.AdmFName3, T2.AdmLName3 FROM satscores T1 INNER JOIN schools T2 ON T1.cds = T2.CDSCode ORDER BY T1.NumGE1500 DESC NULLS LAST FETCH FIRST 1 ROWS ONLY
Database: california_schools

Question: What is the average number of test takers from Fresno schools that opened between 1/1/1980 and 12/31/1980?
Evidence: between 1/1/1980 and 12/31/1980 means the year = 1980
SQL (SQLite): SELECT AVG(T1.NumTstTakr) FROM satscores AS T1 INNER JOIN schools AS T2 ON T1.cds = T2.CDSCode WHERE strftime('%Y', T2.OpenDate) = '1980' AND T2.County = 'Fresno'
SQL (SQL Server): SELECT AVG(TRY_CAST(T1.NumTstTakr AS FLOAT)) AS _agg1 FROM satscores AS T1 INNER JOIN schools AS T2 ON T1.cds = T2.CDSCode WHERE YEAR(T2.OpenDate) = '1980' AND T2.County = 'Fresno'
SQL (Oracle): SELECT AVG(T1.NumTstTakr) FROM satscores T1 INNER JOIN schools T2 ON T1.cds = T2.CDSCode WHERE SUBSTR(T2.OpenDate, 1, 4) = '1980' AND T2.County = 'Fresno'

Question: What is the telephone number for the school with the lowest average score in reading in Fresno Unified?
Evidence: Fresno Unified is a name of district;
SQL (SQLite): SELECT T2.Phone FROM satscores AS T1 INNER JOIN schools AS T2 ON T1.cds = T2.CDSCode WHERE T2.District = 'Fresno Unified' AND T1.AvgScrRead IS NOT NULL ORDER BY T1.AvgScrRead ASC LIMIT 1
SQL (SQL Server): SELECT T2.Phone FROM satscores AS T1 INNER JOIN schools AS T2 ON T1.cds = T2.CDSCode WHERE T2.District = 'Fresno Unified' AND T1.AvgScrRead IS NOT NULL ORDER BY T1.AvgScrRead ASC OFFSET 0 ROWS FETCH NEXT 1 ROWS ONLY
SQL (Oracle): SELECT T2.Phone FROM satscores T1 INNER JOIN schools T2 ON T1.cds = T2.CDSCode WHERE T2.District = 'Fresno Unified' AND T1.AvgScrRead IS NOT NULL ORDER BY T1.AvgScrRead ASC NULLS FIRST FETCH FIRST 1 ROWS ONLY

Question: List the names of virtual schools that are among the top 5 in their respective counties based on average reading scores.
Evidence: Exclusively virtual refers to Virtual = 'F'; respective counties means PARTITION BY County
SQL (SQLite): SELECT School FROM (SELECT T2.School,T1.AvgScrRead, RANK() OVER (PARTITION BY T2.County ORDER BY T1.AvgScrRead DESC) AS rnk FROM satscores AS T1 INNER JOIN schools AS T2 ON T1.cds = T2.CDSCode WHERE T2.Virtual = 'F' ) ranked_schools WHERE rnk <= 5
SQL (SQL Server): SELECT School FROM (SELECT T2.School, T1.AvgScrRead, RANK() OVER (PARTITION BY T2.County ORDER BY T1.AvgScrRead DESC) AS rnk FROM satscores AS T1 INNER JOIN schools AS T2 ON T1.cds = T2.CDSCode WHERE T2.Virtual = 'F' ) ranked_schools WHERE rnk <= 5
SQL (Oracle): SELECT School FROM (SELECT T2.School, T1.AvgScrRead, RANK() OVER (PARTITION BY T2.County ORDER BY T1.AvgScrRead DESC NULLS LAST) rnk FROM satscores T1 INNER JOIN schools T2 ON T1.cds = T2.CDSCode WHERE T2.Virtual = 'F' ) ranked_schools WHERE rnk <= 5