instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE prescribes (
physician number,
patient number,
medication number,
date time,
appointment number,
dose text
)
CREATE TABLE nurse (
employeeid number,
name text,
position text,
registered boolean,
ssn number
)
CREATE TABLE physician (
employeeid number,
n... | SELECT T1.name FROM physician AS T1 JOIN patient AS T2 ON T1.employeeid = T2.pcp GROUP BY T1.employeeid HAVING COUNT(*) > 1 | spider |
CREATE TABLE table_32981 (
"Chapter" text,
"Colonized" text,
"Chartered" text,
"School" text,
"State" text,
"Status" text,
"Charter Range" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the colonized date for Michigan?
| SELECT "Colonized" FROM table_32981 WHERE "State" = 'michigan' | wikisql |
CREATE TABLE PlaylistTrack (
PlaylistId integer,
TrackId integer
)
CREATE TABLE MediaType (
MediaTypeId integer,
Name varchar(120)
)
CREATE TABLE Customer (
CustomerId integer,
FirstName varchar(40),
LastName varchar(20),
Company varchar(80),
Address varchar(70),
City varchar(4... | SELECT T1.Title, T1.AlbumId FROM Album AS T1 JOIN Track AS T2 ON T1.AlbumId = T2.AlbumId WHERE T2.UnitPrice > 1 | nvbench |
CREATE TABLE table_78754 (
"Year (Ceremony)" text,
"Film title used in nomination" text,
"Original title" text,
"Director" text,
"Result" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the year when not nominated was the result, and In the N... | SELECT "Year (Ceremony)" FROM table_78754 WHERE "Result" = 'not nominated' AND "Film title used in nomination" = 'in the navel of the sea' | wikisql |
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 outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_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_44890 (
"Year" text,
"Gold" text,
"Silver" text,
"Bronze" text,
"Total" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many gold medals were won in 1970?
| SELECT "Gold" FROM table_44890 WHERE "Year" = '1970' | wikisql |
CREATE TABLE table_28939145_2 (
Literate VARCHAR,
_percentage_of_district_population VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many literate males are there that has a district population of 6.65?
| SELECT Literate AS male FROM table_28939145_2 WHERE _percentage_of_district_population = "6.65" | sql_create_context |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admityear < "2145" AND diagnoses.short_title = "Syncope and collapse" | mimicsql_data |
CREATE TABLE table_79022 (
"Position" real,
"Club" text,
"Played" real,
"Points" real,
"Wins" real,
"Draws" real,
"Losses" real,
"Goals for" real,
"Goals against" real,
"Goal Difference" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.... | SELECT COUNT("Draws") FROM table_79022 WHERE "Played" < '30' | wikisql |
CREATE TABLE t_kc22 (
AMOUNT number,
CHA_ITEM_LEV number,
DATA_ID text,
DIRE_TYPE number,
DOSE_FORM text,
DOSE_UNIT text,
EACH_DOSAGE text,
EXP_OCC_DATE time,
FLX_MED_ORG_ID text,
FXBZ number,
HOSP_DOC_CD text,
HOSP_DOC_NM text,
MED_DIRE_CD text,
MED_DIRE_NM text,... | SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_NM = '曹云飞' AND NOT t_kc21.MED_CLINIC_ID IN (SELECT t_kc21_t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT >= 6638.96) | css |
CREATE TABLE table_204_197 (
id number,
"date" text,
"time" text,
"opponent#" text,
"site" text,
"tv" text,
"result" text,
"attendance" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many wins did the red raiders have ?
| SELECT COUNT(*) FROM table_204_197 WHERE "result" = 'w' | squall |
CREATE TABLE table_29770377_1 (
route_via VARCHAR,
train_name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many route/via's are there for the ernad express?
| SELECT COUNT(route_via) FROM table_29770377_1 WHERE train_name = "Ernad Express" | sql_create_context |
CREATE TABLE table_name_51 (
opponents_in_the_final VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Opponents in the final have a Date of june 10, 1996?
| SELECT opponents_in_the_final FROM table_name_51 WHERE date = "june 10, 1996" | sql_create_context |
CREATE TABLE table_name_93 (
visitor VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the visitor for the April 17 game?
| SELECT visitor FROM table_name_93 WHERE date = "april 17" | sql_create_context |
CREATE TABLE table_73827 (
"Settlement" text,
"Cyrillic Name Other Names" text,
"Type" text,
"Population (2011)" text,
"Largest ethnic group (2002)" text,
"Dominant religion (2002)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the ethn... | SELECT "Largest ethnic group (2002)" FROM table_73827 WHERE "Cyrillic Name Other Names" = 'Конак' | wikisql |
CREATE TABLE teachers (
lastname text,
firstname text,
classroom number
)
CREATE TABLE list (
lastname text,
firstname text,
grade number,
classroom number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what are the last names of the teachers wh... | SELECT DISTINCT T2.lastname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE grade = 5 | spider |
CREATE TABLE candidate (
Candidate_ID int,
People_ID int,
Poll_Source text,
Date text,
Support_rate real,
Consider_rate real,
Oppose_rate real,
Unsure_rate real
)
CREATE TABLE people (
People_ID int,
Sex text,
Name text,
Date_of_Birth text,
Height real,
Weight re... | SELECT Date_of_Birth, Height FROM people ORDER BY Height | nvbench |
CREATE TABLE table_name_24 (
gender VARCHAR,
roll VARCHAR,
name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Makarora primary school has a roll less than 141 and what gender?
| SELECT gender FROM table_name_24 WHERE roll < 141 AND name = "makarora primary school" | sql_create_context |
CREATE TABLE table_75424 (
"Country" text,
"Skip" text,
"Third" text,
"Second" text,
"Lead" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the second that has jordan moulton as the lead?
| SELECT "Second" FROM table_75424 WHERE "Lead" = 'jordan moulton' | wikisql |
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,
JCZBJGDX text,
JCZBMC text,
JLDW text,
JYRQ time,
JYZBLSH text,
... | SELECT jyjgzbb.JCRGH, jyjgzbb.JCRXM FROM jyjgzbb WHERE jyjgzbb.JYZBLSH = '06175030615' | css |
CREATE TABLE Order_items (
product_id VARCHAR,
order_id VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Show the product ids and the number of unique orders containing each product.
| SELECT product_id, COUNT(DISTINCT order_id) FROM Order_items GROUP BY product_id | sql_create_context |
CREATE TABLE table_51466 (
"Driver" text,
"Constructor" text,
"Laps" text,
"Time/Retired" text,
"Grid" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the grid of Alex Yoong?
| SELECT "Grid" FROM table_51466 WHERE "Driver" = 'alex yoong' | wikisql |
CREATE TABLE table_20887670_1 (
affiliation VARCHAR,
colors VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the affiliation of the colors maroon and white?
| SELECT affiliation FROM table_20887670_1 WHERE colors = "Maroon and White" | sql_create_context |
CREATE TABLE table_name_44 (
home_team VARCHAR,
away_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which home team played Hawthorn as the away team?
| SELECT home_team FROM table_name_44 WHERE away_team = "hawthorn" | sql_create_context |
CREATE TABLE table_1523 (
"Poll Source" text,
"Dates administered" text,
"Democrat: Jim Martin" text,
"Republican: Saxby Chambliss" text,
"Lead Margin" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the date administered where Saxby Chamblis... | SELECT "Dates administered" FROM table_1523 WHERE "Republican: Saxby Chambliss" = '54%' AND "Democrat: Jim Martin" = '36%' | wikisql |
CREATE TABLE table_name_45 (
bronze INTEGER,
gold VARCHAR,
rank VARCHAR,
total VARCHAR,
silver VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the smallest bronze value for countries with totals over 2, golds of 0, silvers under 1, and ran... | SELECT MIN(bronze) FROM table_name_45 WHERE total > 2 AND silver < 1 AND rank > 10 AND gold < 0 | sql_create_context |
CREATE TABLE table_25730123_2 (
points INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What are the most points listed?
| SELECT MAX(points) FROM table_25730123_2 | sql_create_context |
CREATE TABLE table_29141354_7 (
first_broadcast VARCHAR,
andrew_and_jacks_guest VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When was the episode with Amy Williams as Andrew and Jack's guest broadcast?
| SELECT first_broadcast FROM table_29141354_7 WHERE andrew_and_jacks_guest = "Amy Williams" | sql_create_context |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
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
)
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.diagnosis = "COMPLETE HEART BLOCK" AND procedures.icd9_code = "3512" | mimicsql_data |
CREATE TABLE table_train_255 (
"id" int,
"ldl_cholesterol" int,
"hemoglobin_a1c_hba1c" float,
"body_weight" float,
"urine_albumin_to_creatinine_ratio_uacr" int,
"hba1c" float,
"body_mass_index_bmi" float,
"triglyceride_tg" float,
"age" float,
"NOUSE" float
)
-- Using valid SQLi... | SELECT * FROM table_train_255 WHERE urine_albumin_to_creatinine_ratio_uacr < 300 | criteria2sql |
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 MIN(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 = '016-18575')) AND intakeoutput.celllabel = 'chest... | eicu |
CREATE TABLE table_name_9 (
crowd VARCHAR,
ground VARCHAR,
home_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How much is the crowd attending at colonial stadium where Hawthorn plays?
| SELECT crowd FROM table_name_9 WHERE ground = "colonial stadium" AND home_team = "hawthorn" | sql_create_context |
CREATE TABLE financial_transactions (
transaction_id number,
previous_transaction_id number,
account_id number,
card_id number,
transaction_type text,
transaction_date time,
transaction_amount number,
transaction_comment text,
other_transaction_details text
)
CREATE TABLE accounts (... | SELECT transaction_type FROM financial_transactions GROUP BY transaction_type ORDER BY SUM(transaction_amount) DESC LIMIT 1 | spider |
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 SUM(t_kc24.PER_ACC_PAY) FROM qtb JOIN t_kc24 ON qtb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE qtb.PERSON_NM = '柏良骏' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2014-09-29' AND '2015-12-20' UNION SELECT SUM(t_kc24.PER_ACC_PAY) FROM gyb JOIN t_kc24 ON gyb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE gyb.PERSON_NM = '柏良骏' A... | css |
CREATE TABLE table_2562572_33 (
largest_ethnic_group__2002_ VARCHAR,
settlement VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the largest ethnic group in doline?
| SELECT largest_ethnic_group__2002_ FROM table_2562572_33 WHERE settlement = "Doline" | sql_create_context |
CREATE TABLE table_75552 (
"Driver" text,
"Seasons" text,
"Entries" real,
"Wins" real,
"Percentage" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which driver has less than 37 wins and at 14.12%?
| SELECT AVG("Entries") FROM table_75552 WHERE "Wins" < '37' AND "Percentage" = '14.12%' | wikisql |
CREATE TABLE table_72958 (
"Name" text,
"GP-GS" text,
"Solo" real,
"Ast" real,
"Total" real,
"TFL-Yds" text,
"No-Yds" text,
"BrUp" real,
"QBH" real,
"No.-Yds" text,
"Avg" text,
"TD" real,
"Long" real,
"Rcv-Yds" text,
"FF" real,
"Blkd Kick" real
)
-- Usin... | SELECT MAX("TD") FROM table_72958 | wikisql |
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 lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "COMPLETE HEART BLOCK" AND demographic.dod_year <= "2138.0" | mimicsql_data |
CREATE TABLE voting_record (
stuid number,
registration_date text,
election_cycle text,
president_vote number,
vice_president_vote number,
secretary_vote number,
treasurer_vote number,
class_president_vote number,
class_senator_vote number
)
CREATE TABLE student (
stuid number,
... | SELECT advisor, COUNT(*) FROM student GROUP BY advisor | spider |
CREATE TABLE furniture (
Num_of_Component INTEGER,
name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Find the component amounts and names of all furnitures that have more than 10 components.
| SELECT Num_of_Component, name FROM furniture WHERE Num_of_Component > 10 | sql_create_context |
CREATE TABLE table_42072 (
"Region" text,
"Province" text,
"Capital" text,
"No. of Communes" real,
"Area" real,
"2002 Population" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the average area with valpara so as the capital?
| SELECT AVG("Area") FROM table_42072 WHERE "Capital" = 'valparaíso' | wikisql |
CREATE TABLE table_name_36 (
attendance VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Attendance of the game September 21, 2003?
| SELECT attendance FROM table_name_36 WHERE date = "september 21, 2003" | sql_create_context |
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE prescriptions (
... | SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, COUNT(*) AS c1 FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'hrt revas byps anas n... | mimic_iii |
CREATE TABLE Projects (
project_id INTEGER,
organisation_id INTEGER,
project_details VARCHAR(255)
)
CREATE TABLE Staff_Roles (
role_code VARCHAR(10),
role_description VARCHAR(255)
)
CREATE TABLE Grants (
grant_id INTEGER,
organisation_id INTEGER,
grant_amount DECIMAL(19,4),
grant_s... | SELECT SUM(grant_amount), organisation_id FROM Grants GROUP BY organisation_id | nvbench |
CREATE TABLE table_name_93 (
egypt_cup INTEGER,
total VARCHAR,
caf_champions_league VARCHAR,
egyptian_premier_league VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the aveage Egypt Cup value for players with 0 CAF Champions League goals, 6 Eg... | SELECT AVG(egypt_cup) FROM table_name_93 WHERE caf_champions_league = 0 AND egyptian_premier_league = 6 AND total < 6 | 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 outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
... | SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'depress psychosis-... | mimic_iii |
CREATE TABLE allergy_type (
allergy text,
allergytype text
)
CREATE TABLE student (
stuid number,
lname text,
fname text,
age number,
sex text,
major number,
advisor number,
city_code text
)
CREATE TABLE has_allergy (
stuid number,
allergy text
)
-- Using valid SQLite... | SELECT major, COUNT(*) FROM student GROUP BY major | spider |
CREATE TABLE table_77682 (
"Model number" text,
"sSpec number" text,
"Frequency" text,
"L2 cache" text,
"Mult." text,
"Voltage" text,
"Socket" text,
"Release date" text,
"Part number(s)" text,
"Release price ( USD )" text
)
-- Using valid SQLite, answer the following questions ... | SELECT "Release price ( USD )" FROM table_77682 WHERE "Part number(s)" = 'hh80557pg0491m' | wikisql |
CREATE TABLE table_name_41 (
league VARCHAR,
club VARCHAR,
apps VARCHAR,
goals VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which league has less than 15 apps and 0 goals with sparta prague?
| SELECT league FROM table_name_41 WHERE apps < 15 AND goals = 0 AND club = "sparta prague" | sql_create_context |
CREATE TABLE table_204_379 (
id number,
"year" text,
"title" text,
"hangul" text,
"network" text,
"further info" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- is year 2008 or 2009 viewed on network mnet ?
| SELECT "year" FROM table_204_379 WHERE "year" IN (2008, 2009) AND "network" = 'mnet' | squall |
CREATE TABLE t_kc22 (
AMOUNT number,
CHA_ITEM_LEV number,
DATA_ID text,
DIRE_TYPE number,
DOSE_FORM text,
DOSE_UNIT text,
EACH_DOSAGE text,
EXP_OCC_DATE time,
FLX_MED_ORG_ID text,
FXBZ number,
HOSP_DOC_CD text,
HOSP_DOC_NM text,
MED_CLINIC_ID text,
MED_DIRE_CD tex... | SELECT COUNT(*) FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '3199188' AND t_kc21.IN_HOSP_DATE BETWEEN '2001-05-16' AND '2019-07-23' AND t_kc21.INSURED_STS = '未就业' AND t_kc21.MED_AMOUT >= 559.51 | css |
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId number,
UserId number,
CreationDate time,
BountyAmount number
)
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefined boolean,
PostNoticeDurationId number... | SELECT c.Id AS "comment_link", c.Score, c.CreationDate FROM Comments AS c INNER JOIN Posts AS q ON q.Id = c.PostId WHERE q.PostTypeId = 1 AND q.ViewCount > 200 AND c.Text LIKE '%accept rate%' COLLATE SQL_Latin1_General_CP1_CI_AS ORDER BY c.Score DESC, q.ViewCount DESC | sede |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.dod_year <= "2155.0" AND procedures.long_title = "Allogeneic hematopoietic stem cell transpant without purging" | mimicsql_data |
CREATE TABLE event (
ID int,
Name text,
Stadium_ID int,
Year text
)
CREATE TABLE swimmer (
ID int,
name text,
Nationality text,
meter_100 real,
meter_200 text,
meter_300 text,
meter_400 text,
meter_500 text,
meter_600 text,
meter_700 text,
Time text
)
CREATE... | SELECT meter_500, meter_100 FROM swimmer | nvbench |
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
... | SELECT microlab.culturesite FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-4423')) AND STRFTIME('%y-%m', microlab.culturetakentime) <= '2104-... | eicu |
CREATE TABLE table_name_89 (
player VARCHAR,
county VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which player is from County Dublin?
| SELECT player FROM table_name_89 WHERE county = "dublin" | sql_create_context |
CREATE TABLE table_30120559_1 (
barony VARCHAR,
townland VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the total number of barony for kilmore
| SELECT COUNT(barony) FROM table_30120559_1 WHERE townland = "Kilmore" | sql_create_context |
CREATE TABLE table_name_90 (
race_name VARCHAR,
constructor VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which race was Matra the constructor?
| SELECT race_name FROM table_name_90 WHERE constructor = "matra" | sql_create_context |
CREATE TABLE table_16249 (
"Season" text,
"Series" text,
"Team Name" text,
"Races" real,
"Poles" real,
"Wins" real,
"Points" real,
"Position" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many points for 2005?
| SELECT COUNT("Points") FROM table_16249 WHERE "Season" = '2005' | wikisql |
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 t_kc21.OUT_DIAG_DIS_CD, t_kc21.OUT_DIAG_DIS_NM FROM t_kc21 WHERE t_kc21.PERSON_NM = '周和美' AND t_kc21.MED_CLINIC_ID IN (SELECT t_kc21_t_kc24.MED_CLINIC_ID FROM t_kc24 WHERE t_kc24.MED_AMOUT >= 9771.74) | css |
CREATE TABLE people (
is_male VARCHAR,
age VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many female people are older than 30 in our record?
| SELECT COUNT(*) FROM people WHERE is_male = 'F' AND age > 30 | sql_create_context |
CREATE TABLE table_23389 (
"Team & Boat name" text,
"Sail no." text,
"Flag" text,
"Design Firm" text,
"Builder" text,
"Skipper" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who were the builders of the boat designed by Botin Carkeek?
| SELECT "Builder" FROM table_23389 WHERE "Design Firm" = 'Botin Carkeek' | wikisql |
CREATE TABLE table_50938 (
"Position" real,
"Team" text,
"Played" real,
"Wins" real,
"Draws" real,
"Losses" real,
"Scored" real,
"Conceded" real,
"Points" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- The highest draws with smaller ... | SELECT MAX("Draws") FROM table_50938 WHERE "Played" < '9' | wikisql |
CREATE TABLE table_72195 (
"No. in series" real,
"No. in season" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what's the title where original air date is january18,... | SELECT "Title" FROM table_72195 WHERE "Original air date" = 'January18,2009' | wikisql |
CREATE TABLE airport_service (
city_code varchar,
airport_code varchar,
miles_distant int,
direction varchar,
minutes_distant int
)
CREATE TABLE airline (
airline_code varchar,
airline_name text,
note text
)
CREATE TABLE time_interval (
period text,
begin_time int,
end_time... | 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, days, flight WHERE (((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN FRANCISCO' AND days.day_name = 'THURSDAY' AND flight.flight_days = days.days_... | atis |
CREATE TABLE table_27973624_1 (
number_of_fixtures VARCHAR,
new_entries_this_round VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many times is the new entries this round is none?
| SELECT COUNT(number_of_fixtures) FROM table_27973624_1 WHERE new_entries_this_round = "none" | sql_create_context |
CREATE TABLE table_name_58 (
year INTEGER,
award VARCHAR,
work VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Where Award is best actress and Work is first kiss, what is the average Year?
| SELECT AVG(year) FROM table_name_58 WHERE award = "best actress" AND work = "first kiss" | sql_create_context |
CREATE TABLE table_72661 (
"Year" text,
"Best Film" text,
"Best Director" text,
"Best Actor" text,
"Best Actress" text,
"Best Supporting Actor" text,
"Best Supporting Actress" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the best supp... | SELECT "Best Supporting Actress" FROM table_72661 WHERE "Best Supporting Actor" = 'Sun Honglei for Mongol' | wikisql |
CREATE TABLE table_67400 (
"Rank" text,
"Bowling" text,
"Player" text,
"Venue" text,
"Date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What bowler has a record of 4-15?
| SELECT "Player" FROM table_67400 WHERE "Bowling" = '4-15' | wikisql |
CREATE TABLE gyb (
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 SUM(mzb.MED_CLINIC_ID) FROM mzb WHERE mzb.PERSON_SEX = '严虹雨' | css |
CREATE TABLE checking (
custid number,
balance number
)
CREATE TABLE savings (
custid number,
balance number
)
CREATE TABLE accounts (
custid number,
name text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What are the names of customers with a hi... | SELECT T1.name FROM accounts AS T1 JOIN checking AS T2 ON T1.custid = T2.custid JOIN savings AS T3 ON T1.custid = T3.custid WHERE T2.balance > T3.balance | spider |
CREATE TABLE table_16140 (
"No." real,
"#" real,
"Title" text,
"Director" text,
"Writer" text,
"US air date" text,
"Storyteller" text,
"Villains" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who is the director and what number is the e... | SELECT COUNT("Director") FROM table_16140 WHERE "#" = '1' | wikisql |
CREATE TABLE requirement (
requirement_id int,
requirement varchar,
college varchar
)
CREATE TABLE program_requirement (
program_id int,
category varchar,
min_credit int,
additional_req varchar
)
CREATE TABLE course_offering (
offering_id int,
course_id int,
semester int,
s... | SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN student_record ON student_record.course_id = course.course_id INNER JOIN area ON student_record.course_id = area.course_id WHERE area.area LIKE '%software%' AND student_record.student_id = 1 | advising |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE prescription... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admityear < "2154" AND diagnoses.short_title = "Abn reac-organ rem NEC" | mimicsql_data |
CREATE TABLE t_kc21_t_kc22 (
MED_CLINIC_ID text,
MED_EXP_DET_ID number
)
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,
C... | SELECT COUNT(*) FROM t_kc21 JOIN t_kc22 JOIN t_kc21_t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc21_t_kc22.MED_CLINIC_ID AND t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID WHERE t_kc21.PERSON_ID = '64675893' AND t_kc22.STA_DATE BETWEEN '2006-03-30' AND '2013-06-05' AND t_kc21.MED_SER_ORG_NO = '0643879' AND t_kc22.MED_INV... | css |
CREATE TABLE table_3347 (
"Urban settlement" text,
"Cyrillic Name" text,
"City / municipality" text,
"District" text,
"Population (1991)" real,
"Population (2002)" real,
"Population (2011)" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name... | SELECT "City / municipality" FROM table_3347 WHERE "Urban settlement" = 'Kanjiža' | wikisql |
CREATE TABLE trip (
id number,
duration number,
start_date text,
start_station_name text,
start_station_id number,
end_date text,
end_station_name text,
end_station_id number,
bike_id number,
subscription_type text,
zip_code number
)
CREATE TABLE weather (
date text,
... | SELECT city, COUNT(*) FROM station GROUP BY city HAVING COUNT(*) >= 15 | spider |
CREATE TABLE table_name_98 (
developer_s_ VARCHAR,
game VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the developer of XCom: Enemy Unknown?
| SELECT developer_s_ FROM table_name_98 WHERE game = "xcom: enemy unknown" | sql_create_context |
CREATE TABLE zyjybgb (
BBCJBW text,
BBDM text,
BBMC text,
BBZT number,
BGDH number,
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,
... | SELECT jyjgzbb.JCFF FROM hz_info JOIN mzjzjlb JOIN zyjybgb JOIN jyjgzbb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = zyjybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = zyjybgb.JZLSH_MZJZJLB AND zyjybgb.YLJGDM = jyjgzbb.YLJGDM AND zyjybgb.BGDH = jyjgzbb.BGDH W... | css |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
... | SELECT AVG(demographic.age) FROM demographic WHERE demographic.gender = "M" AND demographic.ethnicity = "HISPANIC OR LATINO" | mimicsql_data |
CREATE TABLE table_73223 (
"County" text,
"Obama%" text,
"Obama#" real,
"McCain%" text,
"McCain#" real,
"Others%" text,
"Others#" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What were the number of voters McCain had when Obama had 895?
| SELECT "McCain#" FROM table_73223 WHERE "Obama#" = '895' | wikisql |
CREATE TABLE grapes (
ID INTEGER,
Grape TEXT,
Color TEXT
)
CREATE TABLE wine (
No INTEGER,
Grape TEXT,
Winery TEXT,
Appelation TEXT,
State TEXT,
Name TEXT,
Year INTEGER,
Price INTEGER,
Score INTEGER,
Cases INTEGER,
Drink TEXT
)
CREATE TABLE appellations (
No... | SELECT Year, AVG(Price) FROM wine GROUP BY Year | nvbench |
CREATE TABLE table_2147 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Result" text,
"Candidates" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- In what district is the incumbent John Linder?
| SELECT "District" FROM table_2147 WHERE "Incumbent" = 'John Linder' | wikisql |
CREATE TABLE table_1342198_13 (
first_elected VARCHAR,
incumbent VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What year was incumbent barratt o'hara first elected?
| SELECT first_elected FROM table_1342198_13 WHERE incumbent = "Barratt O'Hara" | sql_create_context |
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE transfers (
row_id number... | SELECT transfers.careunit FROM transfers WHERE transfers.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 28020 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1) AND NOT transfers.careunit IS NULL ORDER BY transfers.intime DESC LIMIT 1 | mimic_iii |
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 COUNT(*) FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-3355')) AND microlab.culturesite = 'other' AND DATETIME(microlab.culturetakent... | eicu |
CREATE TABLE table_46085 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Visitor of the Montreal Canadiens Home game with a Record of 6 4 4?
| SELECT "Visitor" FROM table_46085 WHERE "Home" = 'montreal canadiens' AND "Record" = '6–4–4' | wikisql |
CREATE TABLE table_name_81 (
date VARCHAR,
away_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- On what date the footscray's away game?
| SELECT date FROM table_name_81 WHERE away_team = "footscray" | sql_create_context |
CREATE TABLE player (
player_id number,
name text,
position text,
club_id number,
apps number,
tries number,
goals text,
points number
)
CREATE TABLE competition_result (
competition_id number,
club_id_1 number,
club_id_2 number,
score text
)
CREATE TABLE club (
clu... | SELECT competition_type, country FROM competition | spider |
CREATE TABLE student (
stuid number,
lname text,
fname text,
age number,
sex text,
major number,
advisor number,
city_code text
)
CREATE TABLE member_of (
facid number,
dno number,
appt_type text
)
CREATE TABLE minor_in (
stuid number,
dno number
)
CREATE TABLE gra... | SELECT dphone FROM department WHERE room = 268 | spider |
CREATE TABLE products (
Manufacturer VARCHAR,
name VARCHAR
)
CREATE TABLE manufacturers (
name VARCHAR,
code VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Find the name of companies that do not make DVD drive.
| SELECT name FROM manufacturers EXCEPT SELECT T2.name FROM products AS T1 JOIN manufacturers AS T2 ON T1.Manufacturer = T2.code WHERE T1.name = 'DVD drive' | sql_create_context |
CREATE TABLE table_203_837 (
id number,
"rank" number,
"name" text,
"height\nft / m" text,
"floors" number,
"year" number,
"notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many buildings on this table are taller than 450 feet ?
| SELECT COUNT("name") FROM table_203_837 WHERE "height\nft / m" > 450 | squall |
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 CHA_ITEM_LEV FROM t_kc22 WHERE MED_CLINIC_ID = '69850313527' AND SOC_SRT_DIRE_NM = '瑞舒伐他汀钙片' | css |
CREATE TABLE table_name_63 (
comp VARCHAR,
games INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the comp for games less than 2?
| SELECT comp FROM table_name_63 WHERE games < 2 | sql_create_context |
CREATE TABLE table_name_12 (
position VARCHAR,
goal_difference VARCHAR,
played VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Tell me the total number of positions with goal difference more than -17 and played less than 38
| SELECT COUNT(position) FROM table_name_12 WHERE goal_difference > -17 AND played < 38 | sql_create_context |
CREATE TABLE customer_orders (
order_id number,
customer_id number,
store_id number,
order_date time,
planned_delivery_date time,
actual_delivery_date time,
other_order_details text
)
CREATE TABLE services (
service_id number,
service_type_code text,
workshop_group_id number,
... | SELECT DISTINCT product_name FROM products WHERE product_price > (SELECT AVG(product_price) FROM products) | spider |
CREATE TABLE table_1342292_4 (
party VARCHAR,
incumbent VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many parties does william b. cravens represent?
| SELECT COUNT(party) FROM table_1342292_4 WHERE incumbent = "William B. Cravens" | sql_create_context |
CREATE TABLE table_49244 (
"Date" text,
"Tournament" text,
"Surface" text,
"Opponent" text,
"Score" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- For the game played on 31 July 2007 on clay what was the score?
| SELECT "Score" FROM table_49244 WHERE "Surface" = 'clay' AND "Date" = '31 july 2007' | wikisql |
CREATE TABLE people (
People_ID int,
District text,
Name text,
Party text,
Age int
)
CREATE TABLE debate_people (
Debate_ID int,
Affirmative int,
Negative int,
If_Affirmative_Win bool
)
CREATE TABLE debate (
Debate_ID int,
Date text,
Venue text,
Num_of_Audience int
... | SELECT Venue, COUNT(Venue) FROM debate_people AS T1 JOIN debate AS T2 ON T1.Debate_ID = T2.Debate_ID JOIN people AS T3 ON T1.Affirmative = T3.People_ID GROUP BY Venue ORDER BY Venue | nvbench |
CREATE TABLE table_77345 (
"Res." text,
"Record" text,
"Opponent" text,
"Method" text,
"Event" text,
"Round" text,
"Location" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the result for the Call to Arms I event?
| SELECT "Res." FROM table_77345 WHERE "Event" = 'call to arms i' | wikisql |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.