instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE table_name_59 (
home_team VARCHAR,
away_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What team played Geelong at their away game?
| SELECT home_team FROM table_name_59 WHERE away_team = "geelong" | sql_create_context |
CREATE TABLE table_1498589_1 (
archive VARCHAR,
run_time VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many episodes in history have a running time of 24:06?
| SELECT COUNT(archive) FROM table_1498589_1 WHERE run_time = "24:06" | sql_create_context |
CREATE TABLE weather (
date VARCHAR,
max_temperature_f INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Give me the dates when the max temperature was higher than 85.
| SELECT date FROM weather WHERE max_temperature_f > 85 | sql_create_context |
CREATE TABLE race (
Race_ID int,
Name text,
Class text,
Date text,
Track_ID text
)
CREATE TABLE track (
Track_ID int,
Name text,
Location text,
Seating real,
Year_Opened real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Show the na... | SELECT T2.Name, COUNT(*) FROM race AS T1 JOIN track AS T2 ON T1.Track_ID = T2.Track_ID GROUP BY T1.Track_ID ORDER BY T2.Name DESC | nvbench |
CREATE TABLE table_24915964_4 (
minutes INTEGER,
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many minutes were played by Sue Bird?
| SELECT MIN(minutes) FROM table_24915964_4 WHERE player = "Sue Bird" | sql_create_context |
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 mzjzjlb.YLJGDM FROM hz_info JOIN mzjzjlb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX WHERE hz_info.person_info_XM = '朱湛英' UNION SELECT zyjzjlb.YLJGDM FROM hz_info JOIN zyjzjlb ON hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb... | css |
CREATE TABLE table_42787 (
"Tie no" text,
"Home team" text,
"Score" text,
"Away team" text,
"Attendance" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What shows for Tie no when Sheffield United was the Away team?
| SELECT "Tie no" FROM table_42787 WHERE "Away team" = 'sheffield united' | wikisql |
CREATE TABLE table_37700 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" text,
"Result" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the first person elected from Democratic GAIN?
| SELECT "First elected" FROM table_37700 WHERE "Result" = 'democratic gain' | wikisql |
CREATE TABLE person_info (
CSD text,
CSRQ time,
GJDM text,
GJMC text,
JGDM text,
JGMC text,
MZDM text,
MZMC text,
RYBH text,
XBDM number,
XBMC text,
XLDM text,
XLMC text,
XM text,
ZYLBDM text,
ZYMC text
)
CREATE TABLE hz_info (
KH text,
KLX number... | SELECT jyjgzbb.JYZBLSH FROM hz_info JOIN zzmzjzjlb JOIN jybgb JOIN jyjgzbb ON hz_info.YLJGDM = zzmzjzjlb.YLJGDM AND hz_info.KH = zzmzjzjlb.KH AND hz_info.KLX = zzmzjzjlb.KLX AND zzmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND zzmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.B... | css |
CREATE TABLE Person (
name varchar(20),
age INTEGER,
city TEXT,
gender TEXT,
job TEXT
)
CREATE TABLE PersonFriend (
name varchar(20),
friend varchar(20),
year INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Draw a bar chart for what i... | SELECT job, AVG(age) FROM Person WHERE gender = 'male' GROUP BY job ORDER BY AVG(age) | nvbench |
CREATE TABLE school (
School_ID int,
Grade text,
School text,
Location text,
Type text
)
CREATE TABLE school_bus (
School_ID int,
Driver_ID int,
Years_Working int,
If_full_time bool
)
CREATE TABLE driver (
Driver_ID int,
Name text,
Party text,
Home_city text,
Ag... | SELECT Party, COUNT(*) FROM driver GROUP BY Party ORDER BY COUNT(*) | nvbench |
CREATE TABLE table_name_63 (
plant_patent_number VARCHAR,
habit VARCHAR,
mutated_from VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the patent number when it was mutated from Yakata 7001 and a standard habit?
| SELECT plant_patent_number FROM table_name_63 WHERE habit = "standard" AND mutated_from = "yakata 7001" | sql_create_context |
CREATE TABLE Projects (
Project_ID INTEGER,
Project_Details VARCHAR(255)
)
CREATE TABLE Ref_Document_Types (
Document_Type_Code CHAR(15),
Document_Type_Name VARCHAR(255),
Document_Type_Description VARCHAR(255)
)
CREATE TABLE Documents_with_Expenses (
Document_ID INTEGER,
Budget_Type_Code C... | SELECT Budget_Type_Code, COUNT(*) FROM Documents_with_Expenses GROUP BY Budget_Type_Code ORDER BY COUNT(*) | nvbench |
CREATE TABLE table_204_416 (
id number,
"chip" text,
"flash size" text,
"eeprom" number,
"sram" number,
"frequency\n[mhz]" number,
"package" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- which chip has the larger flash size , at90s/ls4434 o... | SELECT "chip" FROM table_204_416 WHERE "chip" IN ('at90s/ls4434', 'at90s8515') ORDER BY "flash size" DESC LIMIT 1 | squall |
CREATE TABLE table_train_137 (
"id" int,
"hbv" bool,
"systolic_blood_pressure_sbp" int,
"hemoglobin_a1c_hba1c" float,
"substance_dependence" bool,
"hcv" bool,
"schizophrenia" bool,
"neutrophil_count" int,
"renal_disease" bool,
"creatinine_clearance_cl" float,
"platelet_count"... | SELECT * FROM table_train_137 WHERE alcohol_abuse = 1 OR substance_dependence = 1 OR substance_dependence = 1 | criteria2sql |
CREATE TABLE table_name_86 (
launched VARCHAR,
fleet VARCHAR,
number VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- when was the number l6, with a fleet of black sea, launched?
| SELECT launched FROM table_name_86 WHERE fleet = "black sea" AND number = "l6" | sql_create_context |
CREATE TABLE paperdataset (
paperid int,
datasetid int
)
CREATE TABLE cite (
citingpaperid int,
citedpaperid int
)
CREATE TABLE writes (
paperid int,
authorid int
)
CREATE TABLE paperkeyphrase (
paperid int,
keyphraseid int
)
CREATE TABLE paperfield (
fieldid int,
paperid int... | SELECT DISTINCT author.authorid, paper.paperid FROM author, keyphrase, paper, paperkeyphrase, writes WHERE author.authorname = 'li dong' AND keyphrase.keyphrasename = 'semantic parsing' AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paper.paperid = paperkeyphrase.paperid AND writes.authorid = author.authori... | scholar |
CREATE TABLE table_73758 (
"Season" real,
"Winner" text,
"Runner-Up" text,
"Third Place" text,
"Contestants" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who finished in third place when the winner was Karina Bacchi?
| SELECT "Third Place" FROM table_73758 WHERE "Winner" = 'Karina Bacchi' | wikisql |
CREATE TABLE table_30544 (
"#" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text,
"Winnings ($)" real,
"After" real,
"Before" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the to par when the after is 33?
| SELECT "To par" FROM table_30544 WHERE "After" = '33' | 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 demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob te... | SELECT MIN(demographic.age) FROM demographic WHERE demographic.gender = "M" AND demographic.discharge_location = "DISCH-TRAN TO PSYCH HOSP" | mimicsql_data |
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 WHERE demographic.expire_flag = "1" AND demographic.days_stay > "1" | mimicsql_data |
CREATE TABLE table_203_410 (
id number,
"game" number,
"date" text,
"opponent" text,
"location" text,
"score" text,
"attendance" number,
"record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- which month had the least amount of games ?
| SELECT "date" FROM table_203_410 GROUP BY "date" ORDER BY COUNT("game") LIMIT 1 | squall |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE procedures (
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.discharge_location = "REHAB/DISTINCT PART HOSP" AND demographic.age < "54" | mimicsql_data |
CREATE TABLE aircraft (
Aircraft_ID int(11),
Aircraft varchar(50),
Description varchar(50),
Max_Gross_Weight varchar(50),
Total_disk_area varchar(50),
Max_disk_Loading varchar(50)
)
CREATE TABLE airport (
Airport_ID int,
Airport_Name text,
Total_Passengers real,
%_Change_2007 te... | SELECT Aircraft, COUNT(Aircraft) FROM aircraft AS T1 JOIN match AS T2 ON T1.Aircraft_ID = T2.Winning_Aircraft GROUP BY Aircraft ORDER BY COUNT(Aircraft) DESC | nvbench |
CREATE TABLE table_76048 (
"Round" text,
"Main date" text,
"Number of fixtures" real,
"Clubs" text,
"New entries this round" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Clubs when there are 4 for the number of fixtures?
| SELECT "Clubs" FROM table_76048 WHERE "Number of fixtures" = '4' | wikisql |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
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... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.icd9_code = "2930" AND lab."CATEGORY" = "Chemistry" | mimicsql_data |
CREATE TABLE table_17485 (
"Rd." real,
"Grand Prix" text,
"Pole position" text,
"Fastest lap" text,
"Winning driver" text,
"Winning constructor" text,
"Report" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- who is the the pole position with ... | SELECT "Pole position" FROM table_17485 WHERE "Grand Prix" = 'Italian Grand Prix' | wikisql |
CREATE TABLE table_name_96 (
caps INTEGER,
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many caps does stephen hoiles have?
| SELECT SUM(caps) FROM table_name_96 WHERE player = "stephen hoiles" | sql_create_context |
CREATE TABLE table_name_86 (
time VARCHAR,
opponent VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the time when the opponent is phil collins?
| SELECT time FROM table_name_86 WHERE opponent = "phil collins" | sql_create_context |
CREATE TABLE table_2140071_12 (
episode VARCHAR,
coach VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the episode for travis brown
| SELECT episode FROM table_2140071_12 WHERE coach = "Travis Brown" | sql_create_context |
CREATE TABLE table_name_8 (
game VARCHAR,
field_judge VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What game had Al Jury as field judge?
| SELECT game FROM table_name_8 WHERE field_judge = "al jury" | sql_create_context |
CREATE TABLE table_3329 (
"Settlement" text,
"Cyrillic Name Other Names" text,
"Type" text,
"Population (2011)" real,
"Largest ethnic group (2002)" text,
"Dominant religion (2002)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the number o... | SELECT COUNT("Population (2011)") FROM table_3329 WHERE "Cyrillic Name Other Names" = 'Врбас' | wikisql |
CREATE TABLE table_16357 (
"Rank" real,
"English title" text,
"Chinese title" text,
"Average" real,
"Peak" real,
"Premiere" real,
"Finale" real,
"HK viewers" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many are listed under
| SELECT COUNT("Peak") FROM table_16357 WHERE "Chinese title" = '潮爆大狀' | wikisql |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE intakeoutput (
intakeoutput... | SELECT medication.drugname FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.uniquepid = '013-30085') AND DATETIME(medication.drugstarttime, 'start of day') = DATETIME(CURRENT_TIME(), 'start of day', '-0 day') EXCEPT SELECT medication.drugname FROM medica... | eicu |
CREATE TABLE table_3623 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" text,
"Result" text,
"Candidates" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When was someone first elected in the district with incumbent john smith?... | SELECT "First elected" FROM table_3623 WHERE "Incumbent" = 'John Smith' | wikisql |
CREATE TABLE table_70075 (
"Goal" text,
"Location" text,
"Lineup" text,
"Assist/pass" text,
"Score" text,
"Result" text,
"Competition" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Assist/pass has a Result of 6-2?
| SELECT "Assist/pass" FROM table_70075 WHERE "Result" = '6-2' | wikisql |
CREATE TABLE table_2668199_2 (
incumbent VARCHAR,
candidates VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the incumbent when the candidates were John banks (am) 52.2% samuel power (j) 47.8%?
| SELECT incumbent FROM table_2668199_2 WHERE candidates = "John Banks (AM) 52.2% Samuel Power (J) 47.8%" | sql_create_context |
CREATE TABLE COURSE (
CRS_CODE varchar(10),
DEPT_CODE varchar(10),
CRS_DESCRIPTION varchar(35),
CRS_CREDIT float(8)
)
CREATE TABLE DEPARTMENT (
DEPT_CODE varchar(10),
DEPT_NAME varchar(30),
SCHOOL_CODE varchar(8),
EMP_NUM int,
DEPT_ADDRESS varchar(20),
DEPT_EXTENSION varchar(4)
... | SELECT STU_FNAME, COUNT(STU_FNAME) FROM STUDENT AS T1 JOIN ENROLL AS T2 ON T1.STU_NUM = T2.STU_NUM WHERE T2.ENROLL_GRADE = 'C' OR T2.ENROLL_GRADE = 'A' GROUP BY STU_FNAME ORDER BY STU_FNAME | nvbench |
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE... | SELECT admissions.admission_type FROM admissions WHERE admissions.subject_id = 5849 ORDER BY admissions.admittime LIMIT 1 | mimic_iii |
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE vitalperiodic (
... | SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, treatment.treatmenttime, patient.patienthealthsystemstayid FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'ultrasonography') AS t1 JOIN (SELECT patient.uniquepid, medication.drugst... | eicu |
CREATE TABLE table_12444503_1 (
season VARCHAR,
runner_up VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- In which season was Jeanne d'Arc (Bamako) the runner-up?
| SELECT season FROM table_12444503_1 WHERE runner_up = "Jeanne d'Arc (Bamako)" | sql_create_context |
CREATE TABLE hz_info (
KH text,
KLX number,
YLJGDM text,
RYBH text
)
CREATE TABLE jyjgzbb (
JYZBLSH text,
YLJGDM text,
BGDH text,
BGRQ time,
JYRQ time,
JCRGH text,
JCRXM text,
SHRGH text,
SHRXM text,
JCXMMC text,
JCZBDM text,
JCFF text,
JCZBMC text,
... | SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB ... | css |
CREATE TABLE degrees (
year number,
campus number,
degrees number
)
CREATE TABLE faculty (
campus number,
year number,
faculty number
)
CREATE TABLE enrollments (
campus number,
year number,
totalenrollment_ay number,
fte_ay number
)
CREATE TABLE csu_fees (
campus number,
... | SELECT COUNT(*) FROM csu_fees WHERE campusfee > (SELECT AVG(campusfee) FROM csu_fees) | spider |
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 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', lab.labresulttime)) FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-157753' AND patient.hos... | eicu |
CREATE TABLE table_15739098_1 (
episode VARCHAR,
story VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the number of episodes for alan nourse
| SELECT COUNT(episode) FROM table_15739098_1 WHERE story = "Alan Nourse" | sql_create_context |
CREATE TABLE table_name_43 (
home_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What did Richmond score as the home team?
| SELECT home_team AS score FROM table_name_43 WHERE home_team = "richmond" | sql_create_context |
CREATE TABLE ground_service (
city_code text,
airport_code text,
transport_type text,
ground_fare int
)
CREATE TABLE class_of_service (
booking_class varchar,
rank int,
class_description text
)
CREATE TABLE date_day (
month_number int,
day_number int,
year int,
day_name var... | 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 ((flight.departure_time >= 2330 OR flight.departure_time < 30) AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'OAKLAND' AND flight.to_... | atis |
CREATE TABLE table_79118 (
"Season" text,
"Team" text,
"Country" text,
"Division" real,
"Goals" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the lowest Division, when Goals is less than 5, and when Season is '2002-03'?
| SELECT MIN("Division") FROM table_79118 WHERE "Goals" < '5' AND "Season" = '2002-03' | wikisql |
CREATE TABLE table_75503 (
"Season" text,
"Competition" text,
"Round" text,
"Club" text,
"Home result" text,
"Away result" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Away result of 1-2 has what season?
| SELECT "Season" FROM table_75503 WHERE "Away result" = '1-2' | wikisql |
CREATE TABLE table_name_65 (
year INTEGER,
event VARCHAR,
championship VARCHAR,
nation VARCHAR,
result VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What year did Canada get a silver in the olympics in the Men's Coxless Pair event?
| SELECT MIN(year) FROM table_name_65 WHERE nation = "canada" AND result = "silver" AND championship = "olympics" AND event = "men's coxless pair" | sql_create_context |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE diagnoses (
... | SELECT demographic.days_stay, procedures.long_title FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.name = "Dona Cole" | mimicsql_data |
CREATE TABLE Purchases (
purchase_transaction_id INTEGER,
purchase_details VARCHAR(255)
)
CREATE TABLE Sales (
sales_transaction_id INTEGER,
sales_details VARCHAR(255)
)
CREATE TABLE Transactions_Lots (
transaction_id INTEGER,
lot_id INTEGER
)
CREATE TABLE Ref_Transaction_Types (
transact... | SELECT Investor_details, COUNT(Investor_details) FROM Investors AS T1 JOIN Transactions AS T2 ON T1.investor_id = T2.investor_id WHERE T2.share_count > 100 GROUP BY Investor_details ORDER BY Investor_details | nvbench |
CREATE TABLE table_204_861 (
id number,
"tie no" number,
"home team" text,
"score" text,
"away team" text,
"date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what was the number of games that occurred on 14 february 1976 ?
| SELECT COUNT(*) FROM table_204_861 WHERE "date" = '14 february 1976' | squall |
CREATE TABLE table_16846 (
"Player" text,
"No." real,
"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 player that played 2004-05?
| SELECT "Player" FROM table_16846 WHERE "Years for Jazz" = '2004-05' | wikisql |
CREATE TABLE table_204_139 (
id number,
"community" text,
"airport name" text,
"type" text,
"coordinates" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the total number of airports in townsville ?
| SELECT COUNT("airport name") FROM table_204_139 WHERE "community" = 'townsville' | squall |
CREATE TABLE diagnoses (
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 procedures (
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.gender = "F" AND procedures.short_title = "Abdomen artery incision" | mimicsql_data |
CREATE TABLE PostHistoryTypes (
Id number,
Name text
)
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,
TargetRepChange number
)
CREATE TABLE ReviewRejectionReasons (
Id number,
Na... | SELECT FLOOR(0.5 + Reputation / 1000 / DATEDIFF(day, CreationDate, LastAccessDate + 1)) * '##step##' AS "userreputationperdayactive", COUNT(Id) AS "usercount", MAX(DisplayName) FROM Users GROUP BY FLOOR(0.5 + Reputation / 1000 / DATEDIFF(day, CreationDate, LastAccessDate + 1)) * 1000 ORDER BY 'userreputationperdayactiv... | sede |
CREATE TABLE table_201_1 (
id number,
"from" number,
"to" number,
"name" text,
"party" text,
"position" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- which person had the position of a farmer ?
| SELECT "name" FROM table_201_1 WHERE "position" = 'farmer' | squall |
CREATE TABLE table_name_37 (
league VARCHAR,
home VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the league with a 0:1 home?
| SELECT league FROM table_name_37 WHERE home = "0:1" | sql_create_context |
CREATE TABLE table_6889 (
"Tournament" text,
"Wins" real,
"Top-5" real,
"Top-10" real,
"Top-25" real,
"Events" real,
"Cuts made" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the highest Top-10, when the Top-5 was greater than 3, w... | SELECT MAX("Top-10") FROM table_6889 WHERE "Top-5" > '3' AND "Cuts made" = '20' AND "Top-25" > '10' | wikisql |
CREATE TABLE races (
raceId INTEGER,
year INTEGER,
round INTEGER,
circuitId INTEGER,
name TEXT,
date TEXT,
time TEXT,
url TEXT
)
CREATE TABLE pitStops (
raceId INTEGER,
driverId INTEGER,
stop INTEGER,
lap INTEGER,
time TEXT,
duration TEXT,
milliseconds INTEGE... | SELECT name, COUNT(name) FROM constructors AS T1 JOIN constructorStandings AS T2 ON T1.constructorId = T2.constructorId WHERE T1.nationality = "Japanese" AND T2.points > 5 GROUP BY name | nvbench |
CREATE TABLE table_56255 (
"Played in" text,
"Matches" text,
"Lost" text,
"Drawn" text,
"Points for" text,
"Points against" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Where were 16 matches played?
| SELECT "Played in" FROM table_56255 WHERE "Matches" = '16' | wikisql |
CREATE TABLE table_204_258 (
id number,
"location" text,
"frequency" number,
"call sign" text,
"network" text,
"call sign meaning" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- name the only station from minot public radio .
| SELECT "call sign" FROM table_204_258 WHERE "call sign meaning" = 'minot public radio' | squall |
CREATE TABLE table_27114708_2 (
date_of_appointment VARCHAR,
replaced_by VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Please mention those appointment dates those are replaced by alfredo aglietti
| SELECT date_of_appointment FROM table_27114708_2 WHERE replaced_by = "Alfredo Aglietti" | sql_create_context |
CREATE TABLE table_11622255_1 (
purse__ VARCHAR,
winner VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the total number of purse( $ ) where winner is jimmy powell (2)
| SELECT COUNT(purse__) AS $__ FROM table_11622255_1 WHERE winner = "Jimmy Powell (2)" | sql_create_context |
CREATE TABLE t_kc21_t_kc22 (
MED_CLINIC_ID text,
MED_EXP_DET_ID number
)
CREATE TABLE t_kc21 (
CLINIC_ID text,
CLINIC_TYPE 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 ... | SELECT t_kc21.IN_DIAG_DIS_CD, t_kc21.IN_DIAG_DIS_NM FROM t_kc21 WHERE t_kc21.PERSON_ID = '55178621' AND t_kc21.MED_CLINIC_ID IN (SELECT t_kc24.MED_CLINIC_ID FROM t_kc24 WHERE t_kc24.MED_AMOUT > 9322.98) | css |
CREATE TABLE table_203_387 (
id number,
"parish est" number,
"church" text,
"city" text,
"current bldg begun" number,
"weekly collections" text,
"notes" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- which church not in atlanta has weekly ... | SELECT "church" FROM table_203_387 WHERE "city" <> 'atlanta' AND "weekly collections" > 25000 | squall |
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 BETWEEN 30 AND 39) AND DATETIME(medication.drugstarttime, 'start of year') = DATETIME(CURRENT_TIME(... | eicu |
CREATE TABLE table_71869 (
"Year" text,
"xDSL" text,
"Cable" text,
"FTTx" text,
"Other" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the year when cable was 4.6%?
| SELECT "Year" FROM table_71869 WHERE "Cable" = '4.6%' | wikisql |
CREATE TABLE journalist (
Name VARCHAR,
journalist_ID VARCHAR
)
CREATE TABLE news_report (
Event_ID VARCHAR,
journalist_ID VARCHAR
)
CREATE TABLE event (
Event_ID VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Show the names of journalists that... | SELECT T3.Name FROM news_report AS T1 JOIN event AS T2 ON T1.Event_ID = T2.Event_ID JOIN journalist AS T3 ON T1.journalist_ID = T3.journalist_ID GROUP BY T3.Name HAVING COUNT(*) > 1 | sql_create_context |
CREATE TABLE table_5175 (
"Rank" text,
"Film" text,
"Director(s)" text,
"Writer(s)" text,
"Production Company" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the production company for the film directed by Daniel Cormack?
| SELECT "Production Company" FROM table_5175 WHERE "Director(s)" = 'daniel cormack' | wikisql |
CREATE TABLE table_18552 (
"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.
-- What year was incumbent Michael A. Feighan first elected?
| SELECT MIN("First elected") FROM table_18552 WHERE "Incumbent" = 'Michael A. Feighan' | wikisql |
CREATE TABLE table_22580855_1 (
title VARCHAR,
written_by VARCHAR,
directed_by VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the name of the episode whose writer is Timothy J. Lea and the director is Norberto Barba?
| SELECT title FROM table_22580855_1 WHERE written_by = "Timothy J. Lea" AND directed_by = "Norberto Barba" | sql_create_context |
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttim... | SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', admissions.admittime)) FROM admissions WHERE admissions.subject_id = 99883 AND admissions.dischtime IS NULL | mimic_iii |
CREATE TABLE table_name_16 (
date VARCHAR,
format VARCHAR,
country VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the date when the format is cd (limited edition steel-box) from united kingdom?
| SELECT date FROM table_name_16 WHERE format = "cd (limited edition steel-box)" AND country = "united kingdom" | sql_create_context |
CREATE TABLE captain (
captain_id number,
name text,
ship_id number,
age text,
class text,
rank text
)
CREATE TABLE ship (
ship_id number,
name text,
type text,
built_year number,
class text,
flag text
)
-- Using valid SQLite, answer the following questions for the tab... | SELECT name, class FROM ship WHERE NOT ship_id IN (SELECT ship_id FROM captain) | spider |
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
... | SELECT t2.drug FROM (SELECT admissions.subject_id, diagnoses_icd.charttime, admissions.hadm_id FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE admissions.subject_id = 52647 AND diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.s... | mimic_iii |
CREATE TABLE table_68448 (
"Need" text,
"Being (qualities)" text,
"Having (things)" text,
"Doing (actions)" text,
"Interacting (settings)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the interacting settings for co-operate, plan, take care o... | SELECT "Interacting (settings)" FROM table_68448 WHERE "Doing (actions)" = 'co-operate, plan, take care of, help' | wikisql |
CREATE TABLE table_2290 (
"No. in series" real,
"No. in season" real,
"Title" text,
"Directedby" text,
"Writtenby" text,
"Originalairdate" text,
"Production code" text,
"U.S. viewers (million)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
... | SELECT "Directedby" FROM table_2290 WHERE "Production code" = '4WAB05' | wikisql |
CREATE TABLE table_47689 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the to par for Hale Irwin of the United States?
| SELECT "To par" FROM table_47689 WHERE "Country" = 'united states' AND "Player" = 'hale irwin' | wikisql |
CREATE TABLE table_38707 (
"Call sign" text,
"Frequency MHz" real,
"City of license" text,
"ERP W" real,
"Class" text,
"FCC info" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which FCC info has a Frequency MHz of 100.7?
| SELECT "FCC info" FROM table_38707 WHERE "Frequency MHz" = '100.7' | wikisql |
CREATE TABLE t_kc21 (
CLINIC_ID text,
CLINIC_TYPE 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,
... | SELECT SUM(t_kc22.AMOUNT) FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.MED_SER_ORG_NO = '3297791' AND t_kc22.STA_DATE BETWEEN '2015-06-21' AND '2021-03-18' AND t_kc22.MED_INV_ITEM_TYPE = '检查费' | css |
CREATE TABLE wdmzjzjlb (
CYBQDM text,
CYBQMC text,
CYCWH text,
CYKSDM text,
CYKSMC text,
CYSJ time,
CYZTDM number,
HZXM text,
JZKSDM text,
JZKSMC text,
JZLSH number,
KH text,
KLX number,
MZBMLX number,
MZJZLSH text,
MZZDBM text,
MZZDMC text,
MZZYZD... | SELECT * FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM... | css |
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 AVG(demographic.age) FROM demographic WHERE demographic.admission_type = "EMERGENCY" AND demographic.diagnosis = "ST-SEGMENT ELEVATION MYOCARDIAL INFARCTION\CARDIAC CATH" | mimicsql_data |
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_type text,
admission_location text,
discharge_location text,
insurance text,
language text,
marital_status text,
ethnicity text,
age number
)
CREATE ... | SELECT admissions.dischtime FROM admissions WHERE admissions.subject_id = 11322 AND DATETIME(admissions.dischtime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') ORDER BY admissions.dischtime LIMIT 1 | mimic_iii |
CREATE TABLE table_39188 (
"Round" real,
"Player" text,
"Position" text,
"Nationality" text,
"College/Junior/Club Team (League)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who is the player that is part of the team Shawinigan Dynamos (Qmjhl)?
| SELECT "Player" FROM table_39188 WHERE "College/Junior/Club Team (League)" = 'shawinigan dynamos (qmjhl)' | wikisql |
CREATE TABLE student (
stuid number,
lname text,
fname text,
age number,
sex text,
major number,
advisor number,
city_code text
)
CREATE TABLE voting_record (
stuid number,
registration_date text,
election_cycle text,
president_vote number,
vice_president_vote number... | SELECT DISTINCT T1.lname FROM student AS T1 JOIN voting_record AS T2 ON T1.stuid = president_vote EXCEPT SELECT DISTINCT lname FROM student WHERE advisor = "2192" | spider |
CREATE TABLE table_26368963_2 (
under_13 VARCHAR,
under_15 VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is every value for Under-13 when value for Under-15 is Maria Elena Ubina?
| SELECT under_13 FROM table_26368963_2 WHERE under_15 = "Maria Elena Ubina" | 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 WHERE demographic.diagnosis = "ST ELEVATED MYOCARDIAL INFARCTION\CARDIAC CATH" AND demographic.admityear < "2197" | mimicsql_data |
CREATE TABLE table_41446 (
"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 average rank that has a silver less than 0?
| SELECT AVG("Rank") FROM table_41446 WHERE "Silver" < '0' | wikisql |
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 WHERE demographic.age < "72" AND demographic.days_stay > "17" | mimicsql_data |
CREATE TABLE table_name_52 (
player VARCHAR,
total VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What golfer has 281 as their total?
| SELECT player FROM table_name_52 WHERE total = 281 | sql_create_context |
CREATE TABLE table_name_64 (
grid INTEGER,
rider VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the grid when the rider is mika kallio?
| SELECT MAX(grid) FROM table_name_64 WHERE rider = "mika kallio" | sql_create_context |
CREATE TABLE table_name_73 (
away_team VARCHAR,
venue VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the away team's score at western oval?
| SELECT away_team AS score FROM table_name_73 WHERE venue = "western oval" | sql_create_context |
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 jybgb.BGRQ FROM jybgb WHERE jybgb.BGDH = '51074072254' | css |
CREATE TABLE table_79877 (
"Tournament" text,
"Wins" real,
"Top-10" real,
"Events" real,
"Cuts made" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- For majors with 8 events played and more than 1 made cut, what is the most top-10s recorded?
| SELECT MAX("Top-10") FROM table_79877 WHERE "Cuts made" > '1' AND "Events" = '8' | wikisql |
CREATE TABLE table_56204 (
"Year" text,
"Date" text,
"Venue" text,
"Winner" text,
"Country" text,
"Score" text,
"To par" text,
"Margin of victory" text,
"Runner(s)-up" text,
"Winner's share ( \u20ac )" text
)
-- Using valid SQLite, answer the following questions for the tables ... | SELECT "Margin of victory" FROM table_56204 WHERE "Winner" = 'nikki garrett' | wikisql |
CREATE TABLE table_7611 (
"Name" text,
"GP-GS" real,
"Effic" text,
"Att-Cmp-Int" text,
"Avg/G" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the lowest gp-gs that has an avg/g less than 234.3, with 410.80 as the effic?
| SELECT MIN("GP-GS") FROM table_7611 WHERE "Avg/G" < '234.3' AND "Effic" = '410.80' | wikisql |
CREATE TABLE course (
crs_code text,
dept_code text,
crs_description text,
crs_credit number
)
CREATE TABLE employee (
emp_num number,
emp_lname text,
emp_fname text,
emp_initial text,
emp_jobcode text,
emp_hiredate time,
emp_dob time
)
CREATE TABLE department (
dept_co... | SELECT DISTINCT stu_fname FROM student AS T1 JOIN enroll AS T2 ON T1.stu_num = T2.stu_num WHERE enroll_grade = 'C' | spider |
CREATE TABLE table_name_85 (
wins INTEGER,
losses VARCHAR,
division VARCHAR,
reds_season VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many wins were there in the 2000 season in the central division with less than 81 losses?
| SELECT AVG(wins) FROM table_name_85 WHERE division = "central" AND reds_season < 2000 AND losses < 81 | sql_create_context |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.