instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
systemicsystolic number,
systemicdiastolic number,
systemicmean number,
observationtime time
)
CREATE TABLE lab (
labid numbe... | SELECT COUNT(*) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '021-80293')) AND intakeoutput.cellpath LIKE '%intake%' AND intakeoutput.ce... | eicu |
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 COUNT(mzjzjlb.ZZYSGH) 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 = '奚冰蓝' AND mzjzjlb.JZKSRQ BETWEEN '2010-01-26' AND '2013-12-18' | css |
CREATE TABLE table_34624 (
"Award" text,
"Year" real,
"Category" text,
"Work" text,
"Result" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Work has a Result of nominated, and an Award of contigo award, and a Year smaller than 2002?
| SELECT "Work" FROM table_34624 WHERE "Result" = 'nominated' AND "Award" = 'contigo award' AND "Year" < '2002' | wikisql |
CREATE TABLE table_name_88 (
service VARCHAR,
language VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What network is in the language of Bengali?
| SELECT service FROM table_name_88 WHERE language = "bengali" | sql_create_context |
CREATE TABLE table_name_74 (
draw INTEGER,
artist VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the draw of Maggie Toal?
| SELECT AVG(draw) FROM table_name_74 WHERE artist = "maggie toal" | sql_create_context |
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CRE... | SELECT intakeoutput.intakeoutputtime FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '030-42006')) AND intakeoutput.cellpath LIKE '%intake%... | eicu |
CREATE TABLE Apartment_Buildings (
building_id INTEGER,
building_short_name CHAR(15),
building_full_name VARCHAR(80),
building_description VARCHAR(255),
building_address VARCHAR(255),
building_manager VARCHAR(50),
building_phone VARCHAR(80)
)
CREATE TABLE Apartments (
apt_id INTEGER,
... | SELECT booking_start_date, COUNT(booking_start_date) FROM Apartment_Bookings AS T1 JOIN Apartments AS T2 ON T1.apt_id = T2.apt_id WHERE T2.bedroom_count > 2 ORDER BY COUNT(booking_start_date) | nvbench |
CREATE TABLE table_16811 (
"Series" real,
"Year" text,
"Winner" text,
"Runner-up" text,
"Third place" text,
"Fourth place" text,
"Fifth place" text,
"Sixth place" text,
"Host" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many p... | SELECT COUNT("Host") FROM table_16811 WHERE "Fourth place" = 'Chenoa' | wikisql |
CREATE TABLE products (
product_name VARCHAR,
typical_buying_price VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What are the names and buying prices of all the products?
| SELECT product_name, typical_buying_price FROM products | sql_create_context |
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Percent text,
ACC_Home text,
ACC_Road text,
All_Games text,
All_Games_Percent int,
All_Home text,
All_Road text,
All_Neutral text
)
CREATE TABLE university (
Scho... | SELECT All_Home, COUNT(All_Home) FROM basketball_match GROUP BY All_Home | nvbench |
CREATE TABLE table_name_39 (
win__percentage INTEGER,
record VARCHAR,
apps VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the lowest win % with a 0-2 record and more than 2 apps?
| SELECT MIN(win__percentage) FROM table_name_39 WHERE record = "0-2" AND apps > 2 | sql_create_context |
CREATE TABLE table_12094300_1 (
average VARCHAR,
swimsuit VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the average score when the swimsuit score is 8.503?
| SELECT average FROM table_12094300_1 WHERE swimsuit = "8.503" | sql_create_context |
CREATE TABLE table_15165 (
"Representative" text,
"Title" text,
"Presentation of Credentials" text,
"Termination of Mission" text,
"Appointed by" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Presentation of Credentials has a Terminatio... | SELECT "Presentation of Credentials" FROM table_15165 WHERE "Termination of Mission" = 'august 15, 2000' | wikisql |
CREATE TABLE Students (
student_id INTEGER,
date_of_registration DATETIME,
date_of_latest_logon DATETIME,
login_name VARCHAR(40),
password VARCHAR(10),
personal_name VARCHAR(40),
middle_name VARCHAR(40),
family_name VARCHAR(40)
)
CREATE TABLE Student_Tests_Taken (
registration_id IN... | SELECT login_name, gender_mf FROM Course_Authors_and_Tutors ORDER BY personal_name | nvbench |
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_type text,
admission_location text,
d... | SELECT STRFTIME('%j', admissions.dischtime) - STRFTIME('%j', admissions.admittime) FROM admissions WHERE admissions.subject_id = 74716 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1 | mimic_iii |
CREATE TABLE table_name_38 (
nation VARCHAR,
total VARCHAR,
bronze VARCHAR,
gold VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What nation had more than 3 bronze, 0 gold, and a total of 9?
| SELECT nation FROM table_name_38 WHERE bronze > 3 AND gold = 0 AND total = 9 | sql_create_context |
CREATE TABLE table_name_81 (
l_100km_combined INTEGER,
mpg_uk_extra_urban VARCHAR,
l_100km_urban__cold_ VARCHAR,
mpg_uk_combined VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the average L/km combines when the L/100km Urban is 13.9, the mpg-U... | SELECT AVG(l_100km_combined) FROM table_name_81 WHERE l_100km_urban__cold_ = 13.9 AND mpg_uk_combined > 28.5 AND mpg_uk_extra_urban < 38.7 | sql_create_context |
CREATE TABLE t_kc24 (
MED_SAFE_PAY_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
MED_CLINIC_ID text,
REF_SLT_FLG number,
CLINIC_SLT_DATE time,
COMP_ID text,
PERSON_ID text,
FLX_MED_ORG_ID text,
INSU_TYPE text,
MED_AMOUT number,
PER_ACC_PAY number,
OVE_PAY numb... | SELECT t_kc21.MED_ORG_DEPT_CD, AVG(t_kc24.OVE_PAY / t_kc24.MED_AMOUT) FROM t_kc21 JOIN t_kc24 ON t_kc21.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE t_kc21.MED_SER_ORG_NO = '5365915' GROUP BY t_kc21.MED_ORG_DEPT_CD | css |
CREATE TABLE FlagTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationDate time,
CloseReasonTypeId number,
CloseAsOffTopicReasonTypeId number,
Du... | SELECT TagName FROM Tags ORDER BY Count DESC | sede |
CREATE TABLE table_67571 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which player has the score 72-67-69=208?
| SELECT "Player" FROM table_67571 WHERE "Score" = '72-67-69=208' | wikisql |
CREATE TABLE table_name_97 (
winning_constructor VARCHAR,
name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What Winning constructor has a Name of grand prix de la marne?
| SELECT winning_constructor FROM table_name_97 WHERE name = "grand prix de la marne" | sql_create_context |
CREATE TABLE table_204_739 (
id number,
"districts" text,
"ubigeo" number,
"area\n(km2)" number,
"population" number,
"population density\n(/km2)" number,
"created" text,
"postal\ncode" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- ho... | SELECT COUNT("districts") FROM table_204_739 WHERE "population density\n(/km2)" >= 1000.0 | squall |
CREATE TABLE fare_basis (
fare_basis_code text,
booking_class text,
class_type text,
premium text,
economy text,
discounted text,
night text,
season text,
basis_days text
)
CREATE TABLE aircraft (
aircraft_code varchar,
aircraft_description varchar,
manufacturer varchar,... | SELECT DISTINCT fare.fare_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_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'DALLAS' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.cit... | atis |
CREATE TABLE table_name_44 (
week__number VARCHAR,
theme VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- In which week was the Theme 1960s?
| SELECT week__number FROM table_name_44 WHERE theme = "1960s" | sql_create_context |
CREATE TABLE time_slot (
time_slot_id varchar(4),
day varchar(1),
start_hr numeric(2),
start_min numeric(2),
end_hr numeric(2),
end_min numeric(2)
)
CREATE TABLE advisor (
s_ID varchar(5),
i_ID varchar(5)
)
CREATE TABLE prereq (
course_id varchar(8),
prereq_id varchar(8)
)
CRE... | SELECT year, COUNT(*) FROM section GROUP BY semester ORDER BY year | nvbench |
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, AVG(SALARY) FROM employees WHERE HIRE_DATE < '2002-06-21' GROUP BY JOB_ID | nvbench |
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id n... | SELECT (SELECT chartevents.valuenum FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 10855) AND icustays.outtime IS NULL) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_i... | mimic_iii |
CREATE TABLE table_203_98 (
id number,
"title" text,
"year" number,
"director" text,
"budget" text,
"gross (worldwide)" text,
"notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the number of films directed by david s. ward ?
| SELECT COUNT("title") FROM table_203_98 WHERE "director" = 'david s. ward' | 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 t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM, t_kc22.QTY, t_kc22.UNIVALENT, t_kc22.AMOUNT FROM gwyjzb JOIN t_kc22 ON gwyjzb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gwyjzb.PERSON_NM = '吕问筠' AND gwyjzb.IN_HOSP_DATE BETWEEN '2003-03-18' AND '2004-01-26' UNION SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_... | css |
CREATE TABLE table_49752 (
"Months in Malayalam Era" text,
"In Malayalam" text,
"Gregorian Calendar" text,
"Tamil calendar" text,
"Saka era" text,
"Sign of Zodiac" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- WHAT IS THE IN MALAYALAM WITH kart... | SELECT "In Malayalam" FROM table_49752 WHERE "Saka era" = 'kartika–agrahayana' | wikisql |
CREATE TABLE table_21001903_2 (
tour VARCHAR,
mixed_doubles VARCHAR,
womens_singles VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- when mixed doubles is zheng bo ma jin and womens singles is wang yihan, what was the tour?
| SELECT tour FROM table_21001903_2 WHERE mixed_doubles = "Zheng Bo Ma Jin" AND womens_singles = "Wang Yihan" | sql_create_context |
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 SUM(t_kc24.PER_ACC_PAY) FROM gwyjzb JOIN t_kc24 ON gwyjzb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE gwyjzb.PERSON_NM = '戚凯泽' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2014-06-30' AND '2015-06-30' UNION SELECT SUM(t_kc24.PER_ACC_PAY) FROM fgwyjzb JOIN t_kc24 ON fgwyjzb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE fgwyjz... | css |
CREATE TABLE table_name_41 (
silver INTEGER,
bronze VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the silver medal count of the team that finished with 8 bronze medals?
| SELECT SUM(silver) FROM table_name_41 WHERE bronze = 8 | sql_create_context |
CREATE TABLE appellations (
no number,
appelation text,
county text,
state text,
area text,
isava text
)
CREATE TABLE grapes (
id number,
grape text,
color text
)
CREATE TABLE wine (
no number,
grape text,
winery text,
appelation text,
state text,
name text,... | SELECT T2.winery FROM grapes AS T1 JOIN wine AS T2 ON T1.grape = T2.grape WHERE T1.color = "White" GROUP BY T2.winery ORDER BY COUNT(*) DESC LIMIT 3 | spider |
CREATE TABLE table_name_34 (
laps INTEGER,
driver VARCHAR,
grid VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what's the highest lap that contains the driver of graham hill and a grid that is larger than 18?
| SELECT MAX(laps) FROM table_name_34 WHERE driver = "graham hill" AND grid > 18 | sql_create_context |
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 t_kc21.IN_DIAG_DIS_CD, t_kc21.IN_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 > 5656.54) | css |
CREATE TABLE t_kc21_t_kc24 (
MED_CLINIC_ID text,
MED_SAFE_PAY_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.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_ID = '44236721' AND NOT t_kc21.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT > 2819.61) | css |
CREATE TABLE table_name_23 (
stage_reached VARCHAR,
venue VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the stage reached for venue edmonton green?
| SELECT stage_reached FROM table_name_23 WHERE venue = "edmonton green" | sql_create_context |
CREATE TABLE table_12991 (
"Nat." text,
"Name" text,
"Moving from" text,
"Type" text,
"Transfer window" text,
"Ends" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the transfer window for the moving from of S o Paulo?
| SELECT "Transfer window" FROM table_12991 WHERE "Moving from" = 'são paulo' | wikisql |
CREATE TABLE table_79794 (
"Rank" real,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the gold medal count for the country with a total greater than 32 and more than 128 ... | SELECT AVG("Gold") FROM table_79794 WHERE "Total" > '32' AND "Silver" > '128' | wikisql |
CREATE TABLE table_60316 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- For which to par was the score 71-74-68=213?
| SELECT "To par" FROM table_60316 WHERE "Score" = '71-74-68=213' | wikisql |
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
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... | SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM person_info JOIN hz_info JOIN mzjzjlb JOIN zyjybgb 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 = zyjybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = zyjybgb.JZLSH_MZ... | css |
CREATE TABLE table_29871617_1 (
name VARCHAR,
family_name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What are the names listed in the family il-1f2?
| SELECT name FROM table_29871617_1 WHERE family_name = "IL-1F2" | sql_create_context |
CREATE TABLE table_1971074_1 (
enrollment VARCHAR,
nickname VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many different enrollment numbers are there for the school whose students are nicknamed Barons?
| SELECT COUNT(enrollment) FROM table_1971074_1 WHERE nickname = "Barons" | sql_create_context |
CREATE TABLE table_38544 (
"Island's Name" text,
"Area (sq mi)" real,
"Area (km 2 )" real,
"Location" text,
"Population (2000)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the average area in New York that is larger than 55 sq mi?
| SELECT AVG("Area (km 2 )") FROM table_38544 WHERE "Area (sq mi)" > '55' AND "Location" = 'new york' | wikisql |
CREATE TABLE table_name_96 (
position VARCHAR,
pick VARCHAR,
team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the position of the player picked after 94, by the Boston Patriots?
| SELECT position FROM table_name_96 WHERE pick > 94 AND team = "boston patriots" | sql_create_context |
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 AVG(t_kc24.MED_AMOUT) FROM t_kc24 WHERE t_kc24.MED_CLINIC_ID IN (SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_AGE > 21) | css |
CREATE TABLE table_17686 (
"Track Name" text,
"Location" text,
"Length" text,
"Seating" real,
"Year Opened" real,
"Year Acquired [A ]" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the location of the daytona international speedway?
| SELECT "Location" FROM table_17686 WHERE "Track Name" = 'Daytona International Speedway' | wikisql |
CREATE TABLE table_51237 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What t... | SELECT "Team" FROM table_51237 WHERE "Game" < '78' AND "High rebounds" = 'perkins (9)' | wikisql |
CREATE TABLE table_44764 (
"Round" real,
"Pick" real,
"Overall" real,
"Name" text,
"Position" text,
"College" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Position, when Overallis less than 314, and when Pick is less than 8?
| SELECT "Position" FROM table_44764 WHERE "Overall" < '314' AND "Pick" < '8' | wikisql |
CREATE TABLE storm (
Storm_ID int,
Name text,
Dates_active text,
Max_speed int,
Damage_millions_USD real,
Number_Deaths int
)
CREATE TABLE region (
Region_id int,
Region_code text,
Region_name text
)
CREATE TABLE affected_region (
Region_id int,
Storm_ID int,
Number_cit... | SELECT Dates_active, Number_Deaths FROM storm WHERE Number_Deaths >= 1 | nvbench |
CREATE TABLE table_55990 (
"School's name" text,
"School's namesake" text,
"Year opened" text,
"Principal" text,
"Mascot" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the namesake of the school whose mascot is the patriots?
| SELECT "School's namesake" FROM table_55990 WHERE "Mascot" = 'patriots' | wikisql |
CREATE TABLE table_204_295 (
id number,
"model" text,
"origin" text,
"type" text,
"version" text,
"in service" number,
"notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many utility vehicles used by the philippine marines have their... | SELECT COUNT("model") FROM table_204_295 WHERE "origin" = 'united states' | 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 lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.age < "59" AND lab."CATEGORY" = "Blood Gas" | mimicsql_data |
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,0)
)
CREATE TABLE job_history (
EMPLOYEE_ID decimal(6,0),
START_DATE date,
END_DATE date,
JOB_ID varchar(10),
DEPARTMENT_ID decimal(4,0)
)
CREATE TABLE departments (
DEP... | SELECT HIRE_DATE, DEPARTMENT_ID FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 | nvbench |
CREATE TABLE table_32002 (
"Rank" real,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which nation has more than 6 Silver medals and fewer than 8 Gold medals?
| SELECT AVG("Total") FROM table_32002 WHERE "Silver" > '6' AND "Gold" < '8' | wikisql |
CREATE TABLE table_name_41 (
geological_trend VARCHAR,
operator_s_ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Geological Trend has an Operator(s) of woc?
| SELECT geological_trend FROM table_name_41 WHERE operator_s_ = "woc" | sql_create_context |
CREATE TABLE stadium (
ID int,
name text,
Capacity int,
City text,
Country text,
Opening_year int
)
CREATE TABLE record (
ID int,
Result text,
Swimmer_ID int,
Event_ID int
)
CREATE TABLE swimmer (
ID int,
name text,
Nationality text,
meter_100 real,
meter_20... | SELECT meter_700, meter_100 FROM swimmer | nvbench |
CREATE TABLE table_49497 (
"Issued" real,
"Type" text,
"Design" text,
"Serial format" text,
"Serials issued" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What serial format was issued in 1972?
| SELECT "Serial format" FROM table_49497 WHERE "Issued" = '1972' | wikisql |
CREATE TABLE journal_committee (
Editor_ID int,
Journal_ID int,
Work_Type text
)
CREATE TABLE journal (
Journal_ID int,
Date text,
Theme text,
Sales int
)
CREATE TABLE editor (
Editor_ID int,
Name text,
Age real
)
-- Using valid SQLite, answer the following questions for the ... | SELECT T1.Theme, T1.Sales FROM journal EXCEPT SELECT T1.Date, T1.Theme, T1.Sales FROM journal AS T1 JOIN journal_committee AS T2 ON T1.Journal_ID = T2.Journal_ID ORDER BY T1.Sales DESC | nvbench |
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 COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.age < "51" AND diagnoses.short_title = "Preterm NEC 2500+g" | mimicsql_data |
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location t... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.discharge_location = "DEAD/EXPIRED" AND procedures.icd9_code = "3491" | mimicsql_data |
CREATE TABLE table_13753 (
"Round" real,
"Opposition Team" text,
"Venue" text,
"Result" text,
"Report" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What venue was round 20 held at?
| SELECT "Venue" FROM table_13753 WHERE "Round" = '20' | wikisql |
CREATE TABLE table_name_28 (
grid INTEGER,
time_retired VARCHAR,
laps VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the top grid that laps less than 66 and a retried engine?
| SELECT MAX(grid) FROM table_name_28 WHERE time_retired = "engine" AND laps < 66 | sql_create_context |
CREATE TABLE table_204_72 (
id number,
"election year" number,
"# of\nconstituency votes" number,
"# of\nparty list votes" number,
"% of\nparty list votes" number,
"# of\noverall seats won" text,
"+/-" number
)
-- Using valid SQLite, answer the following questions for the tables provided a... | SELECT (SELECT "% of\nparty list votes" FROM table_204_72 WHERE "election year" = 1976) > 30 | squall |
CREATE TABLE airline (
airline_code varchar,
airline_name text,
note text
)
CREATE TABLE days (
days_code varchar,
day_name varchar
)
CREATE TABLE city (
city_code varchar,
city_name varchar,
state_code varchar,
country_name varchar,
time_zone_code varchar
)
CREATE TABLE fligh... | SELECT DISTINCT CITY_0.city_code, FLIGHT_STOP_0.arrival_time FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, airport_service AS AIRPORT_SERVICE_2, airport_service AS AIRPORT_SERVICE_3, city AS CITY_0, city AS CITY_1, city AS CITY_2, flight, flight_stop AS FLIGHT_STOP_0, flight_stop AS F... | atis |
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 prescriptions... | 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.long_title = "Streptococcal septicemia" AND lab."CATEGORY" = "Blood Gas" | mimicsql_data |
CREATE TABLE table_55515 (
"Year" real,
"Tournament" text,
"Venue" text,
"Result" text,
"Extra" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When is the latest year the venue is in gothenburg, sweden?
| SELECT MAX("Year") FROM table_55515 WHERE "Venue" = 'gothenburg, sweden' | wikisql |
CREATE TABLE table_name_76 (
championships INTEGER,
club VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the most championships for club of erie seawolves
| SELECT MAX(championships) FROM table_name_76 WHERE club = "erie seawolves" | sql_create_context |
CREATE TABLE table_18733814_2 (
general_classification VARCHAR,
winner VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When danilo di luca is the winner who is the general classification?
| SELECT general_classification FROM table_18733814_2 WHERE winner = "Danilo Di Luca" | sql_create_context |
CREATE TABLE table_1341672_10 (
incumbent VARCHAR,
candidates VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- who is the incumbent where the candidates is william v. chappell, jr. (d) unopposed?
| SELECT incumbent FROM table_1341672_10 WHERE candidates = "William V. Chappell, Jr. (D) Unopposed" | sql_create_context |
CREATE TABLE table_27507 (
"Song" text,
"Singer" text,
"Co-Singers" text,
"Music Director" text,
"Lyricist" text,
"Co-Stars" text,
"Movie/Album" text,
"Year" text,
"Additional Info" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Whic... | SELECT "Co-Singers" FROM table_27507 WHERE "Movie/Album" = 'Pyaasa' | wikisql |
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE presc... | SELECT COUNT(DISTINCT t1.subject_id) 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 diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title =... | mimic_iii |
CREATE TABLE table_name_18 (
device VARCHAR,
carrier VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- WHAT IS THE DEVICE WITH MTS MOBILITY?
| SELECT device FROM table_name_18 WHERE carrier = "mts mobility" | sql_create_context |
CREATE TABLE table_name_74 (
grid VARCHAR,
time_retired VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What grad has a Time/Retired of + 1:24.3?
| SELECT grid FROM table_name_74 WHERE time_retired = "+ 1:24.3" | sql_create_context |
CREATE TABLE table_44335 (
"Edition" text,
"Round" text,
"Date" text,
"Partnering" text,
"Against" text,
"Surface" text,
"Opponents" text,
"Result" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the round when nueza silva played... | SELECT "Round" FROM table_44335 WHERE "Against" = 'greece' | wikisql |
CREATE TABLE table_11097 (
"Date" text,
"Visiting Team" text,
"Final Score" text,
"Host Team" text,
"Stadium" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What stadium was the game played in on november 20?
| SELECT "Stadium" FROM table_11097 WHERE "Date" = 'november 20' | 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 COUNT(mzjzjlb.ZZYSGH) FROM person_info JOIN hz_info JOIN mzjzjlb 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 WHERE person_info.XM = '戚俊晤' AND mzjzjlb.JZKSRQ BETWEEN '2006-06-17' AND '2011-04-28' | css |
CREATE TABLE table_8493 (
"Game" real,
"Date" text,
"Opponent" text,
"Score" text,
"Location" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- On what date is the Score 94-109?
| SELECT "Date" FROM table_8493 WHERE "Score" = '94-109' | wikisql |
CREATE TABLE table_204_524 (
id number,
"season" text,
"tier" number,
"division" text,
"place" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- when was the only 8th place ?
| SELECT "season" FROM table_204_524 WHERE "place" = 8 | squall |
CREATE TABLE table_45326 (
"Ceremony" text,
"Date" text,
"Host(s)" text,
"Venue" text,
"Film of the Year" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which movie was awarded Film of the Year on May 8, 1964?
| SELECT "Film of the Year" FROM table_45326 WHERE "Date" = 'may 8, 1964' | wikisql |
CREATE TABLE table_62504 (
"Player" text,
"Country" text,
"Year(s) won" text,
"Total" real,
"To par" real,
"Finish" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is total number of the to par of player john mahaffey, who has a total less t... | SELECT COUNT("To par") FROM table_62504 WHERE "Player" = 'john mahaffey' AND "Total" < '298' | wikisql |
CREATE TABLE table_1162 (
"Year" real,
"Mens singles" text,
"Womens singles" text,
"Mens doubles" text,
"Womens doubles" text,
"Mixed doubles" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who won the mixed doubles in 1998?
| SELECT "Mixed doubles" FROM table_1162 WHERE "Year" = '1998' | wikisql |
CREATE TABLE table_name_88 (
round2 INTEGER,
round5 VARCHAR,
round4 VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the lowest round2 when round5 is 71 and round4 is more than 64?
| SELECT MIN(round2) FROM table_name_88 WHERE round5 = 71 AND round4 > 64 | sql_create_context |
CREATE TABLE table_name_90 (
stage VARCHAR,
route VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which stage took the tour through Boulogne-Billancourt?
| SELECT stage FROM table_name_90 WHERE route = "boulogne-billancourt" | sql_create_context |
CREATE TABLE table_23285761_7 (
record VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the record of the game played on January 5?
| SELECT record FROM table_23285761_7 WHERE date = "January 5" | sql_create_context |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "BLACK/AFRICAN AMERICAN" AND demographic.days_stay > "3" | mimicsql_data |
CREATE TABLE table_204_567 (
id number,
"team" text,
"location" text,
"stadium" text,
"capacity" number,
"manager" text,
"captain" text,
"kit manufacturer" text,
"shirt sponsor" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many... | SELECT COUNT("stadium") FROM table_204_567 WHERE "capacity" >= 8000 | squall |
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 COUNT(*) FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.PERSON_ID = '72214494' AND t_kc22.STA_DATE BETWEEN '2003-07-26' AND '2015-04-29' AND t_kc22.MED_INV_ITEM_TYPE = '西药费' | css |
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_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM t_kc22 JOIN t_kc21_t_kc22 JOIN t_kc21 ON t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID AND t_kc21_t_kc22.MED_CLINIC_ID = t_kc21.MED_CLINIC_ID WHERE t_kc21.MED_CLINIC_ID = '90378777250' AND t_kc22.UP_LIMIT_AMO > 8247.29 | css |
CREATE TABLE table_78585 (
"Season" text,
"Division North" text,
"Division South" text,
"Division East" text,
"Division West" text,
"Division Southwest" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who won Division Southwest when the winner of... | SELECT "Division Southwest" FROM table_78585 WHERE "Division North" = 'lepenec' AND "Division South" = '11 oktomvri' | wikisql |
CREATE TABLE table_59644 (
"Golden Rivers" text,
"Wins" real,
"Byes" real,
"Losses" real,
"Draws" real,
"Against" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the greatest number of losses when the against is 1465 and there are more th... | SELECT MAX("Losses") FROM table_59644 WHERE "Against" = '1465' AND "Wins" > '7' | wikisql |
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,
TargetRepChange number
)
CREATE TABLE TagSynonyms (
Id number,
SourceTagName text,
TargetTagName text,
CreationDate time,
OwnerU... | SELECT p.Id AS "post_link", p.Tags, p.ViewCount FROM Posts AS p INNER JOIN PostTags ON p.Id = PostTags.PostId WHERE PostTags.TagId = (SELECT Id FROM Tags WHERE TagName = 'fun') ORDER BY p.ViewCount DESC | sede |
CREATE TABLE table_203_201 (
id number,
"class" text,
"type" text,
"ships" text,
"displacement" text,
"note" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the difference in tonnes between the malabar class and the ut507 class ?
| SELECT ABS((SELECT "displacement" FROM table_203_201 WHERE "class" = 'malabar class') - (SELECT "displacement" FROM table_203_201 WHERE "class" = 'ut507 class')) | squall |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid number,
wa... | SELECT 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 = '028-22327' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospitala... | eicu |
CREATE TABLE table_2850912_5 (
pick__number INTEGER,
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Timo Lehkonen's highest pick number?
| SELECT MAX(pick__number) FROM table_2850912_5 WHERE player = "Timo Lehkonen" | sql_create_context |
CREATE TABLE table_26257223_13 (
sprints_classification VARCHAR,
winner VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many sprints classifications were associated with an overall winner of Joaquin Rodriguez?
| SELECT COUNT(sprints_classification) FROM table_26257223_13 WHERE winner = "Joaquin Rodriguez" | sql_create_context |
CREATE TABLE table_name_67 (
circuit VARCHAR,
winning_constructor VARCHAR,
winning_drivers VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the race that was won by a Maserati being driven by Giuseppe Campari?
| SELECT circuit FROM table_name_67 WHERE winning_constructor = "maserati" AND winning_drivers = "giuseppe campari" | sql_create_context |
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 t3.spec_type_desc FROM (SELECT t2.spec_type_desc, 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.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_... | mimic_iii |
CREATE TABLE table_18002 (
"K\u014dhaku #" real,
"Date" text,
"Red Team Host" text,
"White Team Host" text,
"Mediator" text,
"Winning Team" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- On what date was Keiichi Ubukata the mediator and Mitsuko ... | SELECT "Date" FROM table_18002 WHERE "Mediator" = 'Keiichi Ubukata' AND "Red Team Host" = 'Mitsuko Mori' | wikisql |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.