instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
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 MED_CLINIC_ID FROM t_kc21 WHERE PERSON_ID = '97657668' AND NOT MED_CLINIC_ID IN (SELECT MED_CLINIC_ID FROM t_kc22 WHERE AMOUNT < 9132.88) | css |
CREATE TABLE table_42820 (
"Date" text,
"Home captain" text,
"Away captain" text,
"Venue" text,
"Result" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the result of the game that was played on 3,4,5 Jul 1902?
| SELECT "Result" FROM table_42820 WHERE "Date" = '3,4,5 jul 1902' | wikisql |
CREATE TABLE program (
program_id int,
name varchar,
college varchar,
introduction varchar
)
CREATE TABLE requirement (
requirement_id int,
requirement varchar,
college varchar
)
CREATE TABLE gsi (
course_offering_id int,
student_id int
)
CREATE TABLE area (
course_id int,
... | SELECT DISTINCT student_record.grade FROM student_record INNER JOIN offering_instructor ON student_record.offering_id = offering_instructor.offering_id INNER JOIN instructor ON offering_instructor.instructor_id = instructor.instructor_id WHERE LOWER(instructor.name) LIKE '%Alston%' AND student_record.student_id = 1 | advising |
CREATE TABLE table_26591 (
"#" real,
"Player" text,
"Country" text,
"Points" real,
"Reset points" real,
"Events" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the least points for number 6
| SELECT MIN("Points") FROM table_26591 WHERE "#" = '6' | wikisql |
CREATE TABLE news_report (
journalist_ID int,
Event_ID int,
Work_Type text
)
CREATE TABLE event (
Event_ID int,
Date text,
Venue text,
Name text,
Event_Attendance int
)
CREATE TABLE journalist (
journalist_ID int,
Name text,
Nationality text,
Age text,
Years_working... | SELECT Nationality, AVG(Age) FROM journalist GROUP BY Nationality ORDER BY Nationality | nvbench |
CREATE TABLE asset_parts (
asset_id number,
part_id number
)
CREATE TABLE staff (
staff_id number,
staff_name text,
gender text,
other_staff_details text
)
CREATE TABLE part_faults (
part_fault_id number,
part_id number,
fault_short_name text,
fault_description text,
other_... | SELECT T1.company_id, T1.company_name FROM third_party_companies AS T1 JOIN maintenance_engineers AS T2 ON T1.company_id = T2.company_id GROUP BY T1.company_id HAVING COUNT(*) >= 2 UNION SELECT T3.company_id, T3.company_name FROM third_party_companies AS T3 JOIN maintenance_contracts AS T4 ON T3.company_id = T4.mainten... | spider |
CREATE TABLE diagnoses (
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
)
C... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dob_year < "2056" AND lab.fluid = "Cerebrospinal Fluid (CSF)" | mimicsql_data |
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
... | SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, treatment.treatmenttime FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'glucocorticoid administration - inhaled' AND DATETIME(treatment.treatmenttime, 'start of year') = DATETIME(C... | eicu |
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
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,
... | SELECT diagnoses_icd.charttime FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'sed,hyp,anxiolytc ab-con') AND diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 1232) AND STRFTIM... | mimic_iii |
CREATE TABLE table_204_862 (
id number,
"rank" number,
"bib" number,
"athlete" text,
"country" text,
"run 1" text,
"run 2" text,
"total" text,
"behind" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- who finished before samuel edney... | SELECT "athlete" FROM table_204_862 WHERE "rank" = (SELECT "rank" FROM table_204_862 WHERE "athlete" = 'samuel edney') - 1 | squall |
CREATE TABLE table_13070 (
"Actor/actress" text,
"Character" text,
"Rank" text,
"Tenure" text,
"Episodes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What Character has a Rank of intelligence officer?
| SELECT "Character" FROM table_13070 WHERE "Rank" = 'intelligence officer' | wikisql |
CREATE TABLE table_name_20 (
party VARCHAR,
election VARCHAR,
inhabitants VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What party has more than 241,310 inhabitants after 2012?
| SELECT party FROM table_name_20 WHERE election > 2012 AND inhabitants > 241 OFFSET 310 | sql_create_context |
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime ... | SELECT d_labitems.label FROM d_labitems WHERE d_labitems.itemid IN (SELECT labevents.itemid FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 63537) AND DATETIME(labevents.charttime) >= DATETIME(CURRENT_TIME(), '-40 month') ORDER BY labevents.charttime LI... | mimic_iii |
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,0)
)
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(2... | SELECT HIRE_DATE, AVG(SALARY) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) | nvbench |
CREATE TABLE member (
address VARCHAR,
Membership_card VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which address do not have any member with the black membership card?
| SELECT address FROM member EXCEPT SELECT address FROM member WHERE Membership_card = 'Black' | 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 T1.Code, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code | nvbench |
CREATE TABLE table_38044 (
"Game" real,
"April" real,
"Opponent" text,
"Score" text,
"Record" text,
"Points" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many days in April has a record of 42 22 12 3, and less than 99 points?
| SELECT COUNT("April") FROM table_38044 WHERE "Record" = '42–22–12–3' AND "Points" < '99' | 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 (SELECT t_kc22.QTY * t_kc22.UNIVALENT FROM t_kc22 WHERE t_kc22.MED_EXP_DET_ID = '82601093874') = (SELECT t_kc22.AMOUNT FROM t_kc22 WHERE t_kc22.MED_EXP_DET_ID = '82601093874') | css |
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25),
EMAIL varchar(25),
PHONE_NUMBER varchar(20),
HIRE_DATE date,
JOB_ID varchar(10),
SALARY decimal(8,2),
COMMISSION_PCT decimal(2,2),
MANAGER_ID decimal(6,0),
DEPARTMENT_ID decimal(... | SELECT JOB_ID, COUNT(JOB_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 GROUP BY JOB_ID ORDER BY JOB_ID | nvbench |
CREATE TABLE table_name_18 (
away_team VARCHAR,
venue VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What home team played at MCG?
| SELECT away_team FROM table_name_18 WHERE venue = "mcg" | sql_create_context |
CREATE TABLE table_name_98 (
crowd VARCHAR,
home_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the crowd size when Essendon was the home team?
| SELECT crowd FROM table_name_98 WHERE home_team = "essendon" | sql_create_context |
CREATE TABLE table_20462 (
"Member State sorted by GDP" text,
"GDP in s billion of USD (2012)" text,
"GDP % of EU (2012)" text,
"Annual change % of GDP (2012)" text,
"GDP per capita in PPP US$ (2012)" real,
"Public Debt % of GDP (2013 Q1)" text,
"Deficit (-)/ Surplus (+) % of GDP (2012)" tex... | SELECT "Inflation % Annual (2012)" FROM table_20462 WHERE "GDP per capita in PPP US$ (2012)" = '24505' | 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, SUM(School_ID) FROM basketball_match GROUP BY ACC_Road ORDER BY ACC_Road | nvbench |
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
)
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
)
-- Using valid SQLite, answer the following questions for the... | SELECT T1.Name, T1.Price FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder, T1.Name ORDER BY T1.Price | nvbench |
CREATE TABLE table_5120 (
"Date" text,
"City" text,
"Opponent" text,
"Results\u00b9" text,
"Type of game" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What city has march 30 as the date?
| SELECT "City" FROM table_5120 WHERE "Date" = 'march 30' | wikisql |
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
CREATE TABLE mzjzjlb (
HXPLC number,
HZXM text,
JLSJ time,
JZJSSJ time,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
JZLSH text,
JZZDBM text,
JZZDSM text,
JZZTDM number,
JZZTMC text,
KH te... | 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 table_42119 (
"Position" real,
"Channel" text,
"Launch date" real,
"Owner" text,
"2005" text,
"2006" text,
"2007" text,
"2008" text,
"2009" text,
"2010" text,
"2011" text,
"2012" text,
"2013 (p)" real
)
-- Using valid SQLite, answer the following questi... | SELECT "Channel" FROM table_42119 WHERE "2011" = '8.5' | wikisql |
CREATE TABLE table_36425 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Save" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the loss on September 2?
| SELECT "Loss" FROM table_36425 WHERE "Date" = 'september 2' | wikisql |
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREAT... | SELECT COUNT(*) FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '021-49082')) AND treatment.treatmentname = 'pulmonary/ccm consultation' AND DATE... | eicu |
CREATE TABLE rating (
rid number,
mid number,
stars number,
ratingdate time
)
CREATE TABLE reviewer (
rid number,
name text
)
CREATE TABLE movie (
mid number,
title text,
year number,
director text
)
-- Using valid SQLite, answer the following questions for the tables provide... | SELECT director FROM movie WHERE title = 'Avatar' | spider |
CREATE TABLE course_offering (
offering_id int,
course_id int,
semester int,
section_number int,
start_time time,
end_time time,
monday varchar,
tuesday varchar,
wednesday varchar,
thursday varchar,
friday varchar,
saturday varchar,
sunday varchar,
has_final_proje... | SELECT COUNT(*) > 0 FROM course, course_offering, semester WHERE (course.description LIKE '%lab%' OR course.name LIKE '%lab%') AND (course.description LIKE '%Nuclear Waste Management%' OR course.name LIKE '%Nuclear Waste Management%') AND course.course_id = course_offering.course_id AND semester.semester_id = course_of... | advising |
CREATE TABLE film (
Film_ID int,
Rank_in_series int,
Number_in_season int,
Title text,
Directed_by text,
Original_air_date text,
Production_code text
)
CREATE TABLE cinema (
Cinema_ID int,
Name text,
Openning_year int,
Capacity int,
Location text
)
CREATE TABLE schedule... | SELECT Date, AVG(Price) FROM schedule AS T1 JOIN film AS T2 ON T1.Film_ID = T2.Film_ID JOIN cinema AS T3 ON T1.Cinema_ID = T3.Cinema_ID GROUP BY Date ORDER BY AVG(Price) | nvbench |
CREATE TABLE table_72796 (
"Pick #" real,
"CFL Team" text,
"Player" text,
"Position" text,
"College" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What pick # did Western Illinois have?
| SELECT "Pick #" FROM table_72796 WHERE "College" = 'Western Illinois' | wikisql |
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 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.PERSON_NM = '严美丽' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2013-12-25' AND '2021-12-14' | css |
CREATE TABLE table_26387382_1 (
year_operational INTEGER,
location__county_ VARCHAR,
capacity__mw_ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What year was Fayette operational at 46?
| SELECT MIN(year_operational) FROM table_26387382_1 WHERE location__county_ = "Fayette" AND capacity__mw_ = "46" | sql_create_context |
CREATE TABLE table_60669 (
"State" text,
"GR\u00dcNE" text,
"FRITZ" text,
"RETT\u00d6" text,
"LINKE" text,
"STARK" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What percent did LINKE get in Tyrol?
| SELECT "LINKE" FROM table_60669 WHERE "State" = 'tyrol' | wikisql |
CREATE TABLE table_name_61 (
tournament VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Tournament when the 1990 is Olympic Games?
| SELECT tournament FROM table_name_61 WHERE 1990 = "olympic games" | sql_create_context |
CREATE TABLE table_20719 (
"English Name" text,
"Simplified" text,
"Traditional" text,
"Pinyin" text,
"Area" text,
"Population" real,
"Density" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the number of pinyin where simplified is
| SELECT COUNT("Pinyin") FROM table_20719 WHERE "Simplified" = '河西区' | wikisql |
CREATE TABLE schedule (
Cinema_ID int,
Film_ID int,
Date text,
Show_times_per_day int,
Price float
)
CREATE TABLE cinema (
Cinema_ID int,
Name text,
Openning_year int,
Capacity int,
Location text
)
CREATE TABLE film (
Film_ID int,
Rank_in_series int,
Number_in_seaso... | SELECT Openning_year, SUM(Capacity) FROM cinema | nvbench |
CREATE TABLE table_name_64 (
no_8 VARCHAR,
no_9 VARCHAR,
no_7 VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the No. 8 name when Chloe was No. 9 and Abigail was No. 7?
| SELECT no_8 FROM table_name_64 WHERE no_9 = "chloe" AND no_7 = "abigail" | sql_create_context |
CREATE TABLE table_11884814_3 (
average VARCHAR,
swimsuit VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the average for the country with the swimsuit score of 9.57?
| SELECT average FROM table_11884814_3 WHERE swimsuit = "9.57" | sql_create_context |
CREATE TABLE table_58561 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the average crowd size for the home team... | SELECT AVG("Crowd") FROM table_58561 WHERE "Home team" = 'hawthorn' | wikisql |
CREATE TABLE table_24561550_1 (
result VARCHAR,
record VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- List all results from the 3-3 scoring game.
| SELECT result FROM table_24561550_1 WHERE record = "3-3" | sql_create_context |
CREATE TABLE table_name_87 (
rank VARCHAR,
seasons VARCHAR,
losses VARCHAR,
college VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the total number of rank with losses less than 992, North Carolina State College and a season greater than 101?... | SELECT COUNT(rank) FROM table_name_87 WHERE losses < 992 AND college = "north carolina state" AND seasons > 101 | sql_create_context |
CREATE TABLE PostHistory (
Id number,
PostHistoryTypeId number,
PostId number,
RevisionGUID other,
CreationDate time,
UserId number,
UserDisplayName text,
Comment text,
Text text,
ContentLicense text
)
CREATE TABLE ReviewTasks (
Id number,
ReviewTaskTypeId number,
Cr... | SELECT Votes.CreationDate, VoteTypes.Name, Votes.UserId AS "user_link", Posts.Id AS "post_link" FROM Votes LEFT JOIN VoteTypes ON Votes.VoteTypeId = VoteTypes.Id LEFT JOIN Posts ON Votes.PostId = Posts.Id WHERE NOT Votes.UserId IS NULL AND Posts.OwnerUserId = '##UserId##' | sede |
CREATE TABLE instructor (
instructor_id int,
name varchar,
uniqname varchar
)
CREATE TABLE course_prerequisite (
pre_course_id int,
course_id int
)
CREATE TABLE student (
student_id int,
lastname varchar,
firstname varchar,
program_id int,
declare_major varchar,
total_credi... | SELECT DISTINCT COURSEalias0.department, COURSEalias0.name, COURSEalias0.number, SEMESTERalias0.semester FROM (SELECT course_id FROM student_record WHERE earn_credit = 'Y' AND student_id = 1) AS DERIVED_TABLEalias0, course AS COURSEalias0, course_offering AS COURSE_OFFERINGalias0, semester AS SEMESTERalias0 WHERE ((SEM... | advising |
CREATE TABLE table_36608 (
"Rank" real,
"Country" text,
"1st place" real,
"2nd place" real,
"3rd place" real,
"Total" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Rank is the Country of soviet union with a Total smaller than 19?
| SELECT MIN("Rank") FROM table_36608 WHERE "Country" = 'soviet union' AND "Total" < '19' | wikisql |
CREATE TABLE table_53080 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What team was the away team when the home team s... | SELECT "Away team" FROM table_53080 WHERE "Home team score" = '20.18 (138)' | wikisql |
CREATE TABLE instructor (
instructor_id int,
name varchar,
uniqname varchar
)
CREATE TABLE course_prerequisite (
pre_course_id int,
course_id int
)
CREATE TABLE course_tags_count (
course_id int,
clear_grading int,
pop_quiz int,
group_projects int,
inspirational int,
long_l... | SELECT DISTINCT instructor.name, program_course.workload FROM instructor INNER JOIN offering_instructor ON offering_instructor.instructor_id = instructor.instructor_id INNER JOIN course_offering ON offering_instructor.offering_id = course_offering.offering_id INNER JOIN program_course ON program_course.course_id = cour... | advising |
CREATE TABLE table_2923917_4 (
distance VARCHAR,
brisbane VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the distance when brisbane is $5.20?
| SELECT distance FROM table_2923917_4 WHERE brisbane = "$5.20" | sql_create_context |
CREATE TABLE VOTING_RECORD (
Registration_Date VARCHAR,
Election_Cycle VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Report the distinct registration date and the election cycle.
| SELECT DISTINCT Registration_Date, Election_Cycle FROM VOTING_RECORD | sql_create_context |
CREATE TABLE table_name_71 (
year INTEGER,
location VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the earliest year that the tournament was played in Cape Town, South Africa?
| SELECT MIN(year) FROM table_name_71 WHERE location = "cape town, south africa" | sql_create_context |
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE d_icd_procedures ... | SELECT labevents.charttime FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 46802) ORDER BY labevents.charttime LIMIT 1 | mimic_iii |
CREATE TABLE table_name_14 (
rank VARCHAR,
definition VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the rank of the Province-Level Municipality?
| SELECT rank FROM table_name_14 WHERE definition = "province-level municipality" | sql_create_context |
CREATE TABLE table_72787 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Ground" text,
"Crowd" real,
"Date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What score did the away team receive against ho... | SELECT "Away team score" FROM table_72787 WHERE "Home team" = 'Port Adelaide' | wikisql |
CREATE TABLE table_12773 (
"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 AVG("Played") FROM table_12773 WHERE "Goals against" > '34' AND "Wins" < '12' AND "Goals for" < '50' AND "Losses" > '15' | 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 Team_ID, ACC_Percent FROM basketball_match GROUP BY Team_Name | nvbench |
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 prescriptions... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_type = "ELECTIVE" AND procedures.icd9_code = "40" | mimicsql_data |
CREATE TABLE table_4472 (
"Year" real,
"Leader" text,
"Team" text,
"League" text,
"Runner-up" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the runner-up in 1887 competition for 'Articles with HCards'?
| SELECT "Runner-up" FROM table_4472 WHERE "Year" = '1887' | wikisql |
CREATE TABLE table_name_2 (
gold INTEGER,
silver VARCHAR,
bronze VARCHAR,
total VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the gold when the bronze is 1, total is 6 and silver is less than 3?
| SELECT SUM(gold) FROM table_name_2 WHERE bronze = 1 AND total = "6" AND silver < 3 | sql_create_context |
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 diagnoses (
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.dob_year < "2103" AND prescriptions.drug_type = "ADDITIVE" | mimicsql_data |
CREATE TABLE table_13559 (
"Year" text,
"1851" text,
"1861" text,
"1871" text,
"1881" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the 1851 when 1881 had 764?
| SELECT "1851" FROM table_13559 WHERE "1881" = '764' | wikisql |
CREATE TABLE table_name_19 (
teams INTEGER,
season VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the total teams during the 2012-13 season?
| SELECT SUM(teams) FROM table_name_19 WHERE season = "2012-13" | sql_create_context |
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 zyjzjlb (
CYBQDM text,
CYBQMC... | SELECT zzmzjzjlb.MZZYZDZZBM, zzmzjzjlb.MZZYZDZZMC FROM zzmzjzjlb WHERE zzmzjzjlb.JZLSH = '35311934275' UNION SELECT fzzmzjzjlb.MZZYZDZZBM, fzzmzjzjlb.MZZYZDZZMC FROM fzzmzjzjlb WHERE fzzmzjzjlb.JZLSH = '35311934275' | css |
CREATE TABLE table_52385 (
"Hand" text,
"1 credit" text,
"2 credits" text,
"3 credits" text,
"4 credits" text,
"5 credits" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What would be the 4 credits result of a straight?
| SELECT "4 credits" FROM table_52385 WHERE "Hand" = 'straight' | wikisql |
CREATE TABLE table_name_90 (
date VARCHAR,
opponent VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the date of the game where Inter Milan was the opponent.
| SELECT date FROM table_name_90 WHERE opponent = "inter milan" | sql_create_context |
CREATE TABLE table_25343 (
"Series #" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Prod. code" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the original air date of the episode titled 'Pilot'?
| SELECT "Original air date" FROM table_25343 WHERE "Title" = 'Pilot' | wikisql |
CREATE TABLE table_23286158_10 (
location_attendance VARCHAR,
high_assists VARCHAR,
game VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When 78 is the game and brandon roy (6) has the highest amount of assists how many locations/attendances are there?
| SELECT COUNT(location_attendance) FROM table_23286158_10 WHERE high_assists = "Brandon Roy (6)" AND game = 78 | sql_create_context |
CREATE TABLE table_17772 (
"Day: (see Irregularities )" text,
"Sunday S\u014dl (Sun)" text,
"Monday Luna (Moon)" text,
"Tuesday Mars (Mars)" text,
"Wednesday Mercurius (Mercury)" text,
"Thursday Iuppiter (Jupiter)" text,
"Friday Venus (Venus)" text,
"Saturday Saturnus ( Saturn)" text
)
... | SELECT "Thursday Iuppiter (Jupiter)" FROM table_17772 WHERE "Saturday Saturnus ( Saturn)" = 'Jesarn' | wikisql |
CREATE TABLE table_4354 (
"Pick" text,
"Player" text,
"Position" text,
"Nationality" text,
"NHL team" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Tell me the NHL team for mike gaffney
| SELECT "NHL team" FROM table_4354 WHERE "Player" = 'mike gaffney' | wikisql |
CREATE TABLE table_name_6 (
nationality VARCHAR,
time VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Nationality of the swimmer with a Time of 1:08.80?
| SELECT nationality FROM table_name_6 WHERE time = "1:08.80" | sql_create_context |
CREATE TABLE table_train_184 (
"id" int,
"gender" string,
"systolic_blood_pressure_sbp" int,
"heart_disease" bool,
"renal_disease" bool,
"hematocrit_hct" float,
"allergy_to_insulin_lispro" bool,
"diastolic_blood_pressure_dbp" int,
"serum_creatinine" float,
"hypertension" bool,
... | SELECT * FROM table_train_184 WHERE hypertension = 1 OR systolic_blood_pressure_sbp > 140 OR diastolic_blood_pressure_dbp > 90 | criteria2sql |
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 COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_type = "URGENT" AND lab.itemid = "50803" | mimicsql_data |
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 jyjgzbb.JCFF FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN hz_info_mzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND hz_info_mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb... | css |
CREATE TABLE table_20628 (
"No." real,
"Name" text,
"Mi from Kingston" text,
"Km from Kingston" text,
"Parish" text,
"Length feet" real,
"Length meters" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which parishes have the highworth railroa... | SELECT "Parish" FROM table_20628 WHERE "Name" = 'Highworth' | wikisql |
CREATE TABLE table_name_60 (
overall_rank VARCHAR,
heat_rank VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Tell me the overall rank for heat rank of 8
| SELECT overall_rank FROM table_name_60 WHERE heat_rank = 8 | sql_create_context |
CREATE TABLE table_name_42 (
spartak INTEGER,
played VARCHAR,
dynamo VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the highest spartak when played is less than 15 and dynamo is less than 3?
| SELECT MAX(spartak) FROM table_name_42 WHERE played < 15 AND dynamo < 3 | sql_create_context |
CREATE TABLE table_51707 (
"Year" real,
"Category" text,
"Character" text,
"For The Show" text,
"Result" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What category was Kasautii Zindagii Kay nominated for after 2005?
| SELECT "Category" FROM table_51707 WHERE "Year" > '2005' AND "For The Show" = 'kasautii zindagii kay' | 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 procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
... | SELECT demographic.gender FROM demographic WHERE demographic.subject_id = "76446" | mimicsql_data |
CREATE TABLE table_67460 (
"Minister" text,
"Party" text,
"Governments" text,
"Term start" text,
"Term end" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which party has 24 governments?
| SELECT "Party" FROM table_67460 WHERE "Governments" = '24' | wikisql |
CREATE TABLE table_name_40 (
adam INTEGER,
jade VARCHAR,
peter VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's Adam's score when Jade's score is greater than 5 and Peter's score is less than 0?
| SELECT AVG(adam) FROM table_name_40 WHERE jade > 5 AND peter < 0 | sql_create_context |
CREATE TABLE t_kc21_t_kc24 (
MED_CLINIC_ID text,
MED_SAFE_PAY_ID number
)
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,
... | SELECT COUNT(*) FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '5969189' AND t_kc21.IN_HOSP_DATE BETWEEN '2004-04-09' AND '2013-04-12' AND t_kc21.SERVANT_FLG = '公务员' | css |
CREATE TABLE table_203_166 (
id number,
"pos" text,
"no" number,
"rider" text,
"manufacturer" text,
"laps" number,
"time" text,
"grid" number,
"points" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- which rider rode a suzuki and ha... | SELECT "rider" FROM table_203_166 WHERE "manufacturer" = 'suzuki' AND "points" = 9 | squall |
CREATE TABLE table_68475 (
"Team 1" text,
"Agg." text,
"Team 2" text,
"1st leg" text,
"2nd leg" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the score of the 1st leg when Water Corporation was Team 1?
| SELECT "1st leg" FROM table_68475 WHERE "Team 1" = 'water corporation' | wikisql |
CREATE TABLE table_203_775 (
id number,
"week" number,
"date" text,
"opponent" text,
"result" text,
"game site" text,
"attendance" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- which date had the highest attendance ?
| SELECT "date" FROM table_203_775 ORDER BY "attendance" DESC LIMIT 1 | squall |
CREATE TABLE table_name_73 (
year VARCHAR,
entrant VARCHAR,
points VARCHAR,
engine VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When were there less than 1 point with a cosworth v8 engine in jolly club switzerland?
| SELECT year FROM table_name_73 WHERE points < 1 AND engine = "cosworth v8" AND entrant = "jolly club switzerland" | sql_create_context |
CREATE TABLE table_57605 (
"Country" text,
"Abbreviation" text,
"Assets US$Billion" text,
"Inception" text,
"Origin" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which country has assets of x, an inception of 2007, and an abbreviation of adic?
| SELECT "Country" FROM table_57605 WHERE "Assets US$Billion" = 'x' AND "Inception" = '2007' AND "Abbreviation" = 'adic' | 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 All_Neutral, ACC_Percent FROM basketball_match | nvbench |
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 INTEGER,
Appelation TEXT,
County TEXT,
State TEXT,
Area... | SELECT Year, MAX(Price) FROM wine GROUP BY Year ORDER BY Year | nvbench |
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE prescriptions (
... | SELECT COUNT(*) > 0 FROM outputevents WHERE outputevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 24921 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1)) AND outputevents.itemid I... | mimic_iii |
CREATE TABLE FlagTypes (
Id number,
Name text,
Description text
)
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
InputTitle text,
MarkdownInputGuidance text,
MarkdownPostOwnerGuidance text,
MarkdownPrivilegedUserGuidance text,
MarkdownConcensusDescript... | SELECT Id, Title FROM Posts WHERE PostTypeId = 1 AND Tags LIKE '%status-completed%' AND Tags LIKE '%burninate-request%' | sede |
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_Road, All_Games_Percent FROM basketball_match ORDER BY All_Games_Percent | nvbench |
CREATE TABLE table_10177 (
"Role" text,
"Original Broadway production" text,
"First US National Tour" text,
"Second US National Tour" text,
"Original Italian production" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Original Broadway producti... | SELECT "Original Broadway production" FROM table_10177 WHERE "First US National Tour" = 'roger bart' | wikisql |
CREATE TABLE restriction (
restriction_code text,
advance_purchase int,
stopovers text,
saturday_stay_required text,
minimum_stay int,
maximum_stay int,
application text,
no_discounts text
)
CREATE TABLE aircraft (
aircraft_code varchar,
aircraft_description varchar,
manufac... | 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, fare, flight, flight_fare WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'DALLAS' AND NOT fare.round_trip_cost IS NULL AND flight_fare.fare_id =... | atis |
CREATE TABLE table_74803 (
"Air Date" text,
"Challenge" text,
"Winner" text,
"Test-taker" text,
"Passed?" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What air date has a red winner and an emergency braking challenge?
| SELECT "Air Date" FROM table_74803 WHERE "Winner" = 'red' AND "Challenge" = 'emergency braking' | 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 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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.short_title = "Rec depr psych-psychotic" AND prescriptions.drug_type = "BASE" | mimicsql_data |
CREATE TABLE table_73489 (
"Outcome" text,
"Year" real,
"Championship" text,
"Surface" text,
"Opponent in the final" text,
"Score in the final" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the number of year for 6 3, 6 2 hard surface
| SELECT COUNT("Year") FROM table_73489 WHERE "Score in the final" = '6–3, 6–2' AND "Surface" = 'Hard' | wikisql |
CREATE TABLE table_37834 (
"Year" real,
"Class" text,
"Team" text,
"Points" real,
"Wins" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is listed for the Wins with a Year of 1989?
| SELECT "Wins" FROM table_37834 WHERE "Year" = '1989' | wikisql |
CREATE TABLE table_name_24 (
march VARCHAR,
points VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How much March has Points of 85?
| SELECT COUNT(march) FROM table_name_24 WHERE points = 85 | sql_create_context |
CREATE TABLE table_21395 (
"Name" text,
"Model" text,
"Max FS" text,
"Tested FS" text,
"Short description" text,
"Publication" text,
"Method" text,
"Output" text,
"Status" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what ist he ou... | SELECT "Output" FROM table_21395 WHERE "Short description" = 'massive' | wikisql |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.