instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate time,
drug text,
dose_val_rx text,
dose_unit_rx text,
route text
)
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime tim... | SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, prescriptions.startdate FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE prescriptions.drug = 'nystatin oral suspension' AND DATETIME(prescriptions.startdate, '... | mimic_iii |
CREATE TABLE table_name_57 (
events INTEGER,
top_5 VARCHAR,
wins VARCHAR,
top_25 VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the sum of Events, when Wins were less than 1, when Top-25 was 3, and when Top-5 was less than 1?
| SELECT SUM(events) FROM table_name_57 WHERE wins < 1 AND top_25 = 3 AND top_5 < 1 | sql_create_context |
CREATE TABLE table_name_63 (
kit_manufacturer VARCHAR,
shirt_sponsor VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the Kit manufacturer that was has shirts sponsored by Walkers?
| SELECT kit_manufacturer FROM table_name_63 WHERE shirt_sponsor = "walkers" | sql_create_context |
CREATE TABLE player (
name_first VARCHAR,
name_last VARCHAR,
death_year VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Find all the players' first name and last name who have empty death record.
| SELECT name_first, name_last FROM player WHERE death_year = '' | sql_create_context |
CREATE TABLE jybgb (
BBCJBW text,
BBDM text,
BBMC text,
BBZT number,
BGDH text,
BGJGDM text,
BGJGMC text,
BGRGH text,
BGRQ time,
BGRXM text,
BGSJ time,
CJRQ time,
JSBBRQSJ time,
JSBBSJ time,
JYBBH text,
JYJGMC text,
JYJSGH text,
JYJSQM text,
JY... | SELECT * FROM hz_info JOIN wdmzjzjlb JOIN jybgb JOIN jyjgzbb ON hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX AND wdmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND wdmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE hz_i... | css |
CREATE TABLE table_11191 (
"Driver" text,
"Constructor" text,
"Laps" text,
"Time/Retired" text,
"Grid" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who retired at lap 77 and was grid 11?
| SELECT "Time/Retired" FROM table_11191 WHERE "Laps" = '77' AND "Grid" = '11' | wikisql |
CREATE TABLE table_25042332_16 (
median_income___intl INTEGER,
below_60_percentage_of_median_income VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the median income for the region where 24.4% pf people make below 60% of the median income?
| SELECT MIN(median_income___intl) AS $__ FROM table_25042332_16 WHERE below_60_percentage_of_median_income = "24.4%" | sql_create_context |
CREATE TABLE table_74445 (
"Series #" real,
"Title" text,
"Directed by" text,
"Written by" text,
"France air date" text,
"Canadian air date" text,
"US air date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the canadian air date whe... | SELECT "Canadian air date" FROM table_74445 WHERE "US air date" = '24 August 2012' | wikisql |
CREATE TABLE ground_service (
city_code text,
airport_code text,
transport_type text,
ground_fare int
)
CREATE TABLE code_description (
code varchar,
description text
)
CREATE TABLE food_service (
meal_code text,
meal_number int,
compartment text,
meal_description varchar
)
CR... | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'OAKLAND' AND flight.departure_time = 838 AND flight.to_airport = AIRPORT_SERVICE_1.airpo... | atis |
CREATE TABLE TRACK (
Name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Find the names of all the tracks that contain the word 'you'.
| SELECT Name FROM TRACK WHERE Name LIKE '%you%' | sql_create_context |
CREATE TABLE table_204_658 (
id number,
"week" number,
"date" text,
"kickoff" text,
"opponent" text,
"results\nfinal score" text,
"results\nteam record" text,
"game site" text,
"attendance" number
)
-- Using valid SQLite, answer the following questions for the tables provided above... | SELECT "opponent" FROM table_204_658 WHERE "date" > (SELECT "date" FROM table_204_658 WHERE "date" = 'sunday, may 20' AND "opponent" = 'frankfurt galaxy') ORDER BY "date" LIMIT 1 | squall |
CREATE TABLE PostLinks (
Id number,
CreationDate time,
PostId number,
RelatedPostId number,
LinkTypeId number
)
CREATE TABLE ReviewTasks (
Id number,
ReviewTaskTypeId number,
CreationDate time,
DeletionDate time,
ReviewTaskStateId number,
PostId number,
SuggestedEditId n... | WITH DisplayNameCount AS (SELECT COUNT(Id) OVER (PARTITION BY DisplayName) AS "count", Id, DisplayName, Id AS "user_link", Reputation, LastAccessDate, MAX(LastAccessDate) OVER (PARTITION BY DisplayName) AS MostRecent FROM Users) SELECT 'count', 'user_link', Id, Reputation, LastAccessDate FROM DisplayNameCount WHERE 'co... | sede |
CREATE TABLE table_67206 (
"Year" real,
"Denomination" text,
"Reverse" text,
"Weight" text,
"Diameter" text,
"Fineness" text,
"Series" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What denomination was produced in 2006?
| SELECT "Denomination" FROM table_67206 WHERE "Year" = '2006' | wikisql |
CREATE TABLE table_22950 (
"Round" real,
"Date" text,
"City and venue" text,
"Winner" text,
"Runner-up" text,
"3rd placed" text,
"4th placed" text,
"Results" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who came in 3rd place in Kr ko ,... | SELECT "3rd placed" FROM table_22950 WHERE "City and venue" = 'Krško , Slovenia Matije Gubca Stadium' | wikisql |
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE patients (
row_id n... | SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, prescriptions.startdate FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE prescriptions.drug = 'nystatin ointment' AND DATETIME(prescriptions.startdate) <= DATET... | mimic_iii |
CREATE TABLE table_29619494_2 (
sake_tuyas VARCHAR,
denim_demons VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What place did the Sake Tuyas come in when the Denim Demons were 4th?
| SELECT sake_tuyas FROM table_29619494_2 WHERE denim_demons = "4th" | sql_create_context |
CREATE TABLE table_name_43 (
place VARCHAR,
country VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the place ranking for the player from Australia?
| SELECT place FROM table_name_43 WHERE country = "australia" | sql_create_context |
CREATE TABLE table_name_62 (
overall INTEGER,
position VARCHAR,
round VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- During round 8 when the Position being picked was rb, what was the highest overall pick?
| SELECT MAX(overall) FROM table_name_62 WHERE position = "rb" AND round = 8 | sql_create_context |
CREATE TABLE table_name_19 (
season INTEGER,
bachelor VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What season had bachelor Byron Velvick?
| SELECT MIN(season) FROM table_name_19 WHERE bachelor = "byron velvick" | sql_create_context |
CREATE TABLE table_203_447 (
id number,
"constituency" number,
"region" text,
"name" text,
"party" text,
"last elected" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the difference in years between constiuency 1 and 2 ?
| SELECT (SELECT "last elected" FROM table_203_447 WHERE "constituency" = 1) - (SELECT "last elected" FROM table_203_447 WHERE "constituency" = 2) | squall |
CREATE TABLE table_1140111_5 (
constructor VARCHAR,
circuit VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who constructed the Syracuse circuit?
| SELECT constructor FROM table_1140111_5 WHERE circuit = "Syracuse" | sql_create_context |
CREATE TABLE management (
department_ID int,
head_ID int,
temporary_acting text
)
CREATE TABLE department (
Department_ID int,
Name text,
Creation text,
Ranking int,
Budget_in_Billions real,
Num_Employees real
)
CREATE TABLE head (
head_ID int,
name text,
born_state tex... | SELECT Name, AVG(Num_Employees) FROM department AS T1 JOIN management AS T2 ON T1.department_ID = T2.department_ID WHERE T2.temporary_acting = 'Yes' GROUP BY Name ORDER BY Name DESC | nvbench |
CREATE TABLE table_79386 (
"Year" real,
"Game" text,
"Genre" text,
"Platform(s)" text,
"Developer(s)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the genre of The Sims before 2002?
| SELECT "Genre" FROM table_79386 WHERE "Year" < '2002' AND "Game" = 'the sims' | wikisql |
CREATE TABLE university (
School_ID int,
School text,
Location text,
Founded real,
Affiliation text,
Enrollment real,
Nickname text,
Primary_conference text
)
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Per... | SELECT ACC_Road, School_ID FROM basketball_match GROUP BY ACC_Home, ACC_Road ORDER BY School_ID DESC | nvbench |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.insurance = "Medicare" AND demographic.dob_year < "2104" | mimicsql_data |
CREATE TABLE table_71918 (
"Year" real,
"Winner" text,
"Jockey" text,
"Trainer" text,
"Owner" text,
"Time" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who owned winner Blueeyesintherein after 2009?
| SELECT "Owner" FROM table_71918 WHERE "Year" > '2009' AND "Winner" = 'blueeyesintherein' | wikisql |
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetake... | SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE patient.patientunitstayid IN (SELECT medication.patientunitstayid FROM medication WHERE medication.drugname = 'nss 0.9% 1,000 ml bolus infusion' AND DATETIME(medication.drugstarttime) <= DATETIME(CURRENT_TIME(), '-3 year')) | eicu |
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE vitalperiodic (
vitalperio... | SELECT (SELECT SUM(intakeoutput.cellvaluenumeric) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-80884')) AND intakeoutput.cellpath L... | eicu |
CREATE TABLE table_44572 (
"Skip" text,
"Third" text,
"Second" text,
"Lead" text,
"City" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- WHAT IS THE THIRD WITH LEAD CINDY SIMMONS?
| SELECT "Third" FROM table_44572 WHERE "Lead" = 'cindy simmons' | wikisql |
CREATE TABLE table_name_77 (
set_1 VARCHAR,
set_2 VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Set 1 has a Set 2 of 26 24?
| SELECT set_1 FROM table_name_77 WHERE set_2 = "26–24" | sql_create_context |
CREATE TABLE t_kc21 (
MED_CLINIC_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
COMP_ID text,
PERSON_ID text,
PERSON_NM text,
IDENTITY_CARD text,
SOC_SRT_CARD text,
PERSON_SEX number,
PERSON_AGE number,
IN_HOSP_DATE time,
OUT_HOSP_DATE time,
DIFF_PLACE_FLG numb... | SELECT SUM(t_kc24.MED_AMOUT) FROM t_kc21 JOIN t_kc24 ON t_kc21.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE t_kc21.MED_SER_ORG_NO = '0148623' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2007-03-23' AND '2016-01-01' | css |
CREATE TABLE table_45370 (
"Stage" text,
"Winner" text,
"General Classification" text,
"Mountains Classification" text,
"Points Classification" text,
"Sprints classification" text,
"Team Classification" text
)
-- Using valid SQLite, answer the following questions for the tables provided ab... | SELECT "Team Classification" FROM table_45370 WHERE "Winner" = 'cyril dessel' | wikisql |
CREATE TABLE table_69631 (
"Competition" text,
"Started Round" text,
"Final Position" text,
"Final Round" text,
"First Match" text,
"Last Match" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- On what date did the first match occur for the compet... | SELECT "First Match" FROM table_69631 WHERE "Final Position" = 'winners' AND "Final Round" = 'finals' | wikisql |
CREATE TABLE table_56709 (
"Player" text,
"Nationality" text,
"Position" text,
"Years for Jazz" text,
"School/Club Team" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the nationality of the guard who played for Florida International?
| SELECT "Nationality" FROM table_56709 WHERE "Position" = 'guard' AND "School/Club Team" = 'florida international' | wikisql |
CREATE TABLE table_name_25 (
draw INTEGER,
televoting INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Televoting smaller than 2 had what highest draw?
| SELECT MAX(draw) FROM table_name_25 WHERE televoting < 2 | sql_create_context |
CREATE TABLE table_61488 (
"Clubs" text,
"Seasons at this level" text,
"Settlements" text,
"Season joined league" text,
"Position in 1959\u20131960" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the 'season joined league' for the club that ... | SELECT "Season joined league" FROM table_61488 WHERE "Seasons at this level" = '15 seasons' | wikisql |
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Percent text,
ACC_Home text,
ACC_Road text,
All_Games text,
All_Games_Percent int,
All_Home text,
All_Road text,
All_Neutral text
)
CREATE TABLE university (
Scho... | SELECT All_Games, Team_ID FROM basketball_match | nvbench |
CREATE TABLE table_59054 (
"Parish (Prestegjeld)" text,
"Sub-Parish (Sokn)" text,
"Church Name" text,
"Year Built" text,
"Location of the Church" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which parish has a church named Vangsnes Kyrkje?
| SELECT "Parish (Prestegjeld)" FROM table_59054 WHERE "Church Name" = 'vangsnes kyrkje' | wikisql |
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid number,
wardid number,
admissionheight number,
admissionweight number,
dischargeweight number,
hospitaladmittime time,
... | SELECT t1.drugname FROM (SELECT medication.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.age >= 60) AND DATETIME(medication.drugstarttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of... | eicu |
CREATE TABLE table_name_49 (
crimean_war INTEGER,
second_afghan_war VARCHAR,
school VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the average Crimean War with a Second Afghan War totaling 1, and a School of hamblin and porter's school, cork?
| SELECT AVG(crimean_war) FROM table_name_49 WHERE second_afghan_war = "1" AND school = "hamblin and porter's school, cork" | sql_create_context |
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location t... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE procedures.long_title = "Continuous invasive mechanical ventilation for less than 96 consecutive hours" AND lab."CATEGORY" = "Hematol... | mimicsql_data |
CREATE TABLE departments (
department_id number,
dept_store_id number,
department_name text
)
CREATE TABLE department_stores (
dept_store_id number,
dept_store_chain_id number,
store_name text,
store_address text,
store_phone text,
store_email text
)
CREATE TABLE suppliers (
su... | SELECT T1.staff_name, T1.staff_gender FROM staff AS T1 JOIN staff_department_assignments AS T2 ON T1.staff_id = T2.staff_id WHERE T2.job_title_code = "Sales Person" EXCEPT SELECT T1.staff_name, T1.staff_gender FROM staff AS T1 JOIN staff_department_assignments AS T2 ON T1.staff_id = T2.staff_id WHERE T2.job_title_code ... | spider |
CREATE TABLE track (
Track_ID int,
Name text,
Location text,
Seating real,
Year_Opened real
)
CREATE TABLE race (
Race_ID int,
Name text,
Class text,
Date text,
Track_ID text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Visualize a... | SELECT Class, COUNT(*) FROM race GROUP BY Class | nvbench |
CREATE TABLE t_kc24 (
ACCOUNT_DASH_DATE time,
ACCOUNT_DASH_FLG number,
CASH_PAY number,
CIVIL_SUBSIDY number,
CKC102 number,
CLINIC_ID text,
CLINIC_SLT_DATE time,
COMP_ID text,
COM_ACC_PAY number,
COM_PAY number,
DATA_ID text,
ENT_ACC_PAY number,
ENT_PAY number,
F... | SELECT AVG(t_kc24.PER_ACC_PAY) FROM t_kc21 JOIN t_kc24 JOIN t_kc21_t_kc24 ON t_kc21.MED_CLINIC_ID = t_kc21_t_kc24.MED_CLINIC_ID AND t_kc21_t_kc24.MED_SAFE_PAY_ID = t_kc24.MED_SAFE_PAY_ID WHERE t_kc21.MED_SER_ORG_NO = '3795332' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2007-03-16' AND '2007-04-28' | css |
CREATE TABLE table_22669044_9 (
team VARCHAR,
location_attendance VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the team for united center 22,147
| SELECT team FROM table_22669044_9 WHERE location_attendance = "United Center 22,147" | sql_create_context |
CREATE TABLE table_63950 (
"Name" text,
"GP-GS" text,
"Effic" real,
"Att-Cmp" text,
"TD-INT" text,
"Avg/G" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Att-Cmp has a GP-GS of 7-1?
| SELECT "Att-Cmp" FROM table_63950 WHERE "GP-GS" = '7-1' | wikisql |
CREATE TABLE table_name_63 (
torque VARCHAR,
capacity VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What torque does a 1905 cc capacity have?
| SELECT torque FROM table_name_63 WHERE capacity = "1905 cc" | sql_create_context |
CREATE TABLE table_74348 (
"Pick #" real,
"Player" text,
"Position" text,
"Nationality" text,
"NHL team" text,
"College/junior/club team" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the nationality of the player picked to go to Washin... | SELECT "Nationality" FROM table_74348 WHERE "NHL team" = 'Washington Capitals' | wikisql |
CREATE TABLE flight_fare (
flight_id int,
fare_id int
)
CREATE TABLE flight_leg (
flight_id int,
leg_number int,
leg_flight int
)
CREATE TABLE state (
state_code text,
state_name text,
country_name text
)
CREATE TABLE code_description (
code varchar,
description text
)
CREATE... | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'DENVER' AND date_day.day_number = 23 AND date_day.month_number = 4 AND d... | atis |
CREATE TABLE Documents (
document_id VARCHAR,
receipt_date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- List all document ids and receipt dates of documents.
| SELECT document_id, receipt_date FROM Documents | sql_create_context |
CREATE TABLE Skills_Required_To_Fix (
part_fault_id INTEGER,
skill_id INTEGER
)
CREATE TABLE Engineer_Skills (
engineer_id INTEGER,
skill_id INTEGER
)
CREATE TABLE Engineer_Visits (
engineer_visit_id INTEGER,
contact_staff_id INTEGER,
engineer_id INTEGER,
fault_log_entry_id INTEGER,
... | SELECT part_name, COUNT(*) FROM Parts AS T1 JOIN Asset_Parts AS T2 ON T1.part_id = T2.part_id GROUP BY T1.part_name ORDER BY part_name | nvbench |
CREATE TABLE table_37930 (
"Rank" real,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the average Total for the Rank of 6, when Silver is smaller than 0?
| SELECT AVG("Total") FROM table_37930 WHERE "Rank" = '6' AND "Silver" < '0' | wikisql |
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
eventtype text,
careunit text,
wardid number,
intime time,
outtime time
)
CR... | SELECT d_icd_diagnoses.short_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.icd9_code IN (SELECT t3.icd9_code FROM (SELECT t2.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, procedures_icd.charttime FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissi... | mimic_iii |
CREATE TABLE table_69206 (
"Year" real,
"Total Region" real,
"Rockhampton" real,
"Livingstone" real,
"Fitzroy" real,
"Mt Morgan" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many people are in Livingstone when less than 6,406 are in Firzro... | SELECT COUNT("Livingstone") FROM table_69206 WHERE "Fitzroy" < '6,406' AND "Mt Morgan" < '3,967' AND "Rockhampton" > '52,383' AND "Total Region" < '102,048' | wikisql |
CREATE TABLE table_name_72 (
icao VARCHAR,
iata VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the ICAO when the IATA shows cts?
| SELECT icao FROM table_name_72 WHERE iata = "cts" | sql_create_context |
CREATE TABLE table_8973 (
"Name" text,
"Seat" text,
"Population (2011)" real,
"Area (km 2 )" real,
"Density (inhabitants/km 2 )" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the area in km2 for Cape Agulhas, whose density is larger than 9.... | SELECT MAX("Area (km 2 )") FROM table_8973 WHERE "Density (inhabitants/km 2 )" > '9.4' AND "Name" = 'cape agulhas' AND "Population (2011)" < '33,038' | wikisql |
CREATE TABLE table_29526 (
"Episode air date" text,
"Audition city" text,
"First audition date" text,
"Audition venue" text,
"Callback audition date" text,
"Callback venue" text,
"Golden tickets" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-... | SELECT "Callback audition date" FROM table_29526 WHERE "Episode air date" = 'February 2, 2011' | wikisql |
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
)
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
)
-- Using valid SQLite, answer the following questions for the... | SELECT T1.Name, T2.Revenue FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder, T1.Name ORDER BY T1.Name | nvbench |
CREATE TABLE mzb (
CLINIC_ID text,
COMP_ID text,
DATA_ID text,
DIFF_PLACE_FLG number,
FERTILITY_STS number,
FLX_MED_ORG_ID text,
HOSP_LEV number,
HOSP_STS number,
IDENTITY_CARD text,
INPT_AREA_BED text,
INSURED_IDENTITY number,
INSURED_STS text,
INSU_TYPE text,
IN... | SELECT qtb.MED_SER_ORG_NO FROM qtb WHERE qtb.PERSON_ID = '87821381' GROUP BY qtb.MED_SER_ORG_NO ORDER BY COUNT(*) DESC UNION SELECT gyb.MED_SER_ORG_NO FROM gyb WHERE gyb.PERSON_ID = '87821381' GROUP BY gyb.MED_SER_ORG_NO ORDER BY COUNT(*) DESC UNION SELECT zyb.MED_SER_ORG_NO FROM zyb WHERE zyb.PERSON_ID = '87821381' GR... | css |
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE patient (
... | SELECT t3.drugname FROM (SELECT t2.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, medication.drugstarttime FROM medication JOIN patient ON medication.patientunitstayid = patient.patientunitstayid WHERE medication.drugname = 'morphine variable dose 2-4mg' AND STRFTIME('%y', me... | eicu |
CREATE TABLE table_name_42 (
position VARCHAR,
pick VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Position has a Pick of 74?
| SELECT position FROM table_name_42 WHERE pick = 74 | sql_create_context |
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
)
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
)
-- Using valid SQLite, answer the following questions for the... | SELECT Name, COUNT(Name) FROM Products WHERE Price <= 200 GROUP BY Name | nvbench |
CREATE TABLE table_1341453_20 (
candidates VARCHAR,
first_elected VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many candidates were elected first in 1980?
| SELECT COUNT(candidates) FROM table_1341453_20 WHERE first_elected = 1980 | sql_create_context |
CREATE TABLE table_1341395_44 (
district VARCHAR,
incumbent VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What district has Ron Paul?
| SELECT district FROM table_1341395_44 WHERE incumbent = "Ron Paul" | sql_create_context |
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
CREATE TABLE jyjgzbb (
BGDH text,
BGRQ time,
CKZFWDX text,
CKZFWSX number,
CKZFWXX number,
JCFF text,
JCRGH text,
JCRXM text,
JCXMMC text,
JCZBDM text,
JCZBJGDL number,
JCZBJGDW text,
... | SELECT jyjgzbb.CKZFWXX, jyjgzbb.CKZFWSX FROM txmzjzjlb JOIN jybgb JOIN jyjgzbb ON txmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND txmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE txmzjzjlb.JZZDSM = '结膜炎' AND jyjgzbb.JCZBMC = '尿素' UNION SELECT jyjgzbb.CKZFWXX, jyjgz... | css |
CREATE TABLE table_23095 (
"Districts of Bihar" text,
"Total Population 2001" real,
"Male Population 2001" real,
"Female Population 2001" real,
"Growth Rate 1981-91" text,
"Growth Rate 1991-01" text,
"Sex Ratio \u2021 1991" real,
"Sex Ratio \u2021 2001" real,
"Population density \u20... | SELECT "Male Population 2001" FROM table_23095 WHERE "Sex Ratio \u2021 1991" = '896' | wikisql |
CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId number
)
CREATE TABLE Comments (
Id number,
PostId number,
Score number,
Text text,
CreationDate time,
UserDisplayName text,
UserId number,
ContentLicense text
)
CREATE TABLE Posts ... | SELECT 'site://tags/' + t.TagName + '|' + t.TagName AS "tag", t.Count AS "uses", e.Body AS "excerpt", b.Body AS "wiki" FROM Tags AS t LEFT JOIN Posts AS e ON e.Id = t.ExcerptPostId LEFT JOIN Posts AS b ON b.Id = t.WikiPostId WHERE (e.Body IS NULL OR b.Body IS NULL OR LENGTH(e.Body) = 0 OR LENGTH(b.Body) = 0) AND Count ... | sede |
CREATE TABLE table_37297 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Home has a Visitor of quebec nordiques, and a Score of 3 4, and a Record of 8 8 1?
| SELECT "Home" FROM table_37297 WHERE "Visitor" = 'quebec nordiques' AND "Score" = '3–4' AND "Record" = '8–8–1' | wikisql |
CREATE TABLE table_26881 (
"Rank" real,
"Name" text,
"Nationality" text,
"1st (m)" text,
"2nd (m)" text,
"Points" text,
"Overall FHT Points" text,
"Overall WC points (Rank)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the total n... | SELECT COUNT("Overall FHT Points") FROM table_26881 WHERE "Name" = 'Simon Ammann' | wikisql |
CREATE TABLE table_name_12 (
relation VARCHAR,
year VARCHAR,
length VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Relation has a Year larger than 2000, and a Length of 8 x 20 mins?
| SELECT relation FROM table_name_12 WHERE year > 2000 AND length = "8 x 20 mins" | sql_create_context |
CREATE TABLE table_name_40 (
season VARCHAR,
team VARCHAR,
champion VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- In which season did Jimmy Eriksson win the championship for Team Lotus?
| SELECT season FROM table_name_40 WHERE team = "lotus" AND champion = "jimmy eriksson" | sql_create_context |
CREATE TABLE table_16849531_2 (
ncbi_accession_number__mrna_protein_ VARCHAR,
species VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the NCBI Accession Number of the Homo Sapiens species?
| SELECT ncbi_accession_number__mrna_protein_ FROM table_16849531_2 WHERE species = "Homo sapiens" | sql_create_context |
CREATE TABLE table_72462 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Where ... | SELECT "Location Attendance" FROM table_72462 WHERE "Team" = 'New Jersey' | wikisql |
CREATE TABLE table_test_23 (
"id" int,
"previous_mi" bool,
"anemia" bool,
"left_ventricular_ejection_fraction_lvef" int,
"tolerate_gadolinium_contrast_media" bool,
"renal_disease" bool,
"creatinine_clearance_cl" float,
"estimated_glomerular_filtration_rate_egfr" int,
"tolerate_magnet... | SELECT * FROM table_test_23 WHERE tolerate_magnetic_resonance_imaging = 0 OR body_mass_index_bmi > 35 OR tolerate_gadolinium_contrast_media = 0 OR creatinine_clearance_cl < 60 | criteria2sql |
CREATE TABLE table_26401898_2 (
attendance INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the most attendance
| SELECT MIN(attendance) FROM table_26401898_2 | sql_create_context |
CREATE TABLE table_23346983_1 (
record VARCHAR,
game VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the Orangemen record during game 3?
| SELECT record FROM table_23346983_1 WHERE game = 3 | sql_create_context |
CREATE TABLE table_name_32 (
total_atms VARCHAR,
off_site_atms VARCHAR,
number_of_branches VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the total ATMs with off-site ATMs greater than 3672, and less than 1685 as the number of branches?
| SELECT COUNT(total_atms) FROM table_name_32 WHERE off_site_atms > 3672 AND number_of_branches < 1685 | sql_create_context |
CREATE TABLE table_22447251_2 (
height VARCHAR,
contestant VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How tall is contestant Alexandra D az Bello?
| SELECT height FROM table_22447251_2 WHERE contestant = "Alexandra Díaz Bello" | sql_create_context |
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
... | SELECT d_icd_diagnoses.short_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.icd9_code IN (SELECT t3.icd9_code FROM (SELECT t2.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions... | mimic_iii |
CREATE TABLE table_name_33 (
hometown VARCHAR,
college VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the hometown of the player who went to college at USC?
| SELECT hometown FROM table_name_33 WHERE college = "usc" | sql_create_context |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
C... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_location = "EMERGENCY ROOM ADMIT" AND procedures.icd9_code = "3799" | mimicsql_data |
CREATE TABLE rating (
rid number,
mid number,
stars number,
ratingdate time
)
CREATE TABLE movie (
mid number,
title text,
year number,
director text
)
CREATE TABLE reviewer (
rid number,
name text
)
-- Using valid SQLite, answer the following questions for the tables provide... | SELECT title FROM movie WHERE year > (SELECT MAX(year) FROM movie WHERE director = "Steven Spielberg") | spider |
CREATE TABLE table_10416547_1 (
lyricist VARCHAR,
lyrics_theme_style VARCHAR,
duration VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the total number of lyricist where the lyrics theme is romance and the song lasts 3:50?
| SELECT COUNT(lyricist) FROM table_10416547_1 WHERE lyrics_theme_style = "Romance" AND duration = "3:50" | sql_create_context |
CREATE TABLE table_15219 (
"Field" text,
"Geological Trend" text,
"Reserves" text,
"Discovery" text,
"Operator(s)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Field has a Discovery of na, and an Operator(s) of woc, and a Geological Trend of... | SELECT "Field" FROM table_15219 WHERE "Discovery" = 'na' AND "Operator(s)" = 'woc' AND "Geological Trend" = 'western' | wikisql |
CREATE TABLE table_203_426 (
id number,
"year" number,
"title" text,
"peak chart positions\naus" number,
"peak chart positions\nnz" number,
"peak chart positions\nuk" number,
"album" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what was th... | SELECT "title" FROM table_203_426 WHERE NOT "peak chart positions\nnz" IS NULL ORDER BY "year" DESC LIMIT 1 | squall |
CREATE TABLE university (
School_ID int,
School text,
Location text,
Founded real,
Affiliation text,
Enrollment real,
Nickname text,
Primary_conference text
)
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Per... | SELECT All_Home, AVG(Team_ID) FROM basketball_match GROUP BY All_Home | nvbench |
CREATE TABLE table_name_55 (
year VARCHAR,
rank VARCHAR,
country VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which year's rank was #4 when the country was the US?
| SELECT year FROM table_name_55 WHERE rank = "#4" AND country = "us" | sql_create_context |
CREATE TABLE table_name_44 (
february VARCHAR,
score VARCHAR,
points VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How much February has a Score of 5 2, and Points of 70?
| SELECT COUNT(february) FROM table_name_44 WHERE score = "5–2" AND points = 70 | sql_create_context |
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
CREATE TABLE jybgb (
BBCJBW text,
BBDM text,
BBMC text,
BBZT number,
BGDH text,
BGJGDM text,
BGJGMC text,
BGRGH text,
BGRQ time,
BGRXM text,
BGSJ time,
CJRQ time,
JSBBRQSJ time,
... | SELECT mzjzjlb.JZLSH FROM hz_info JOIN mzjzjlb JOIN hz_info_mzjzjlb ON hz_info.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND hz_info_mzjzjlb.JZLSH = mzjzjlb.JZLSH AND hz_info_mzjzjlb.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info_mzjzjlb.JZLSH = mzjzjlb.JZLSH AND hz_info_mzj... | css |
CREATE TABLE table_name_95 (
ranking VARCHAR,
nationality VARCHAR,
goals VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What ranking has the nationality of spain and the goals of 26?
| SELECT ranking FROM table_name_95 WHERE nationality = "spain" AND goals = 26 | sql_create_context |
CREATE TABLE table_name_70 (
bronze VARCHAR,
rank VARCHAR,
silver VARCHAR,
nation VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How much Bronze has a Silver larger than 2, and a Nation of mixed team, and a Rank larger than 4?
| SELECT COUNT(bronze) FROM table_name_70 WHERE silver > 2 AND nation = "mixed team" AND rank > 4 | sql_create_context |
CREATE TABLE table_name_31 (
cuts_made INTEGER,
top_5 INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many cuts made when the top-5 is greater than 1?
| SELECT AVG(cuts_made) FROM table_name_31 WHERE top_5 > 1 | sql_create_context |
CREATE TABLE table_17090 (
"Player" text,
"Position" text,
"School" text,
"Hometown" text,
"College" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- who are all the players for st. thomas aquinas high school
| SELECT "Player" FROM table_17090 WHERE "School" = 'St. Thomas Aquinas High School' | wikisql |
CREATE TABLE stores (
store_id text,
address_id number,
marketing_region_code text,
store_name text,
store_phone text,
store_email_address text,
other_details text
)
CREATE TABLE invoices (
invoice_id number,
order_id number,
payment_method_code text,
product_id number,
... | SELECT store_name FROM drama_workshop_groups | spider |
CREATE TABLE table_38989 (
"Distance" text,
"10th" real,
"11th" real,
"12th" real,
"13th" real,
"14th" real,
"15th" real,
"16th" real,
"17th" real,
"18th" real,
"19th" real,
"20th" real,
"21st" real,
"22nd" real,
"23rd" real,
"24th" real,
"25th" real,
... | SELECT MAX("30th") FROM table_38989 WHERE "11th" = '26' AND "17th" > '16' | wikisql |
CREATE TABLE table_13843 (
"Model number" text,
"sSpec number" text,
"Cores" text,
"Frequency" text,
"Turbo" text,
"L2 cache" text,
"L3 cache" text,
"GPU model" text,
"GPU frequency" text,
"Socket" text,
"I/O bus" text,
"Release date" text,
"Part number(s)" text,
... | SELECT "sSpec number" FROM table_13843 WHERE "Socket" = 'standard power' | wikisql |
CREATE TABLE table_name_34 (
character VARCHAR,
actor VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who's the character when Margot Boyd was acting?
| SELECT character FROM table_name_34 WHERE actor = "margot boyd" | sql_create_context |
CREATE TABLE table_name_22 (
tournament VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What shows for 2008 at the Shanghai tournament?
| SELECT 2008 FROM table_name_22 WHERE tournament = "shanghai" | sql_create_context |
CREATE TABLE table_31889 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Venue" text,
"Attendance" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Opponent had a week of 14?
| SELECT "Opponent" FROM table_31889 WHERE "Week" = '14' | wikisql |
CREATE TABLE table_1223 (
"Round #" real,
"Pick #" real,
"Player" text,
"Position" text,
"College" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which college did Dean Kirkland go to
| SELECT "College" FROM table_1223 WHERE "Player" = 'Dean Kirkland' | wikisql |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.