instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE table_test_8 (
"id" int,
"anemia" bool,
"intra_aortic_balloon_pump_iabp" bool,
"systolic_blood_pressure_sbp" int,
"intravenous_pressors" bool,
"fever" bool,
"hemoglobin_a1c_hba1c" float,
"heart_disease" bool,
"vasopressors" bool,
"renal_disease" bool,
"temperatur... | SELECT * FROM table_test_8 WHERE hypotension = 1 OR systolic_blood_pressure_sbp < 90 | criteria2sql |
CREATE TABLE table_17605 (
"#" real,
"Nation" text,
"Winners" real,
"Runners-up" real,
"3rd Place" real,
"4th Place" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many maximum winners
| SELECT MAX("Winners") FROM table_17605 | wikisql |
CREATE TABLE table_62119 (
"Outcome" text,
"Date" text,
"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.
-- What was the score of the match played on 18 January 1... | SELECT "Outcome" FROM table_62119 WHERE "Date" = '18 january 1999' | wikisql |
CREATE TABLE table_name_31 (
week INTEGER,
opponent VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What week did Cleveland Browns played?
| SELECT AVG(week) FROM table_name_31 WHERE opponent = "cleveland browns" | sql_create_context |
CREATE TABLE table_203_482 (
id number,
"year" number,
"award" text,
"result" text,
"category" text,
"series" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- in what year was the last nomination received ?
| SELECT MAX("year") FROM table_203_482 | squall |
CREATE TABLE table_name_40 (
player VARCHAR,
year_born VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who is the Player born in 1981?
| SELECT player FROM table_name_40 WHERE year_born = 1981 | sql_create_context |
CREATE TABLE locations (
LOCATION_ID decimal(4,0),
STREET_ADDRESS varchar(40),
POSTAL_CODE varchar(12),
CITY varchar(30),
STATE_PROVINCE varchar(25),
COUNTRY_ID varchar(2)
)
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25),
EMAIL v... | SELECT CITY, COUNT(CITY) FROM locations GROUP BY CITY | nvbench |
CREATE TABLE table_203_175 (
id number,
"rank" text,
"nation" text,
"gold" number,
"silver" number,
"bronze" number,
"total" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what was the total number of medals won by united states ?
| SELECT "total" FROM table_203_175 WHERE "nation" = 'united states' | squall |
CREATE TABLE table_34426 (
"Player" text,
"Hometown" text,
"Occupation" text,
"Education" text,
"Game Status" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is listed under occupation for someone from Santa Monica, California?
| SELECT "Occupation" FROM table_34426 WHERE "Hometown" = 'santa monica, california' | wikisql |
CREATE TABLE table_name_15 (
attendance VARCHAR,
opponent VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many people attended the game against the cincinnati bengals?
| SELECT COUNT(attendance) FROM table_name_15 WHERE opponent = "cincinnati bengals" | sql_create_context |
CREATE TABLE table_42894 (
"Year" real,
"Award" text,
"Category" text,
"Recipient" text,
"Result" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which award show nominated The Suite Life on Deck for the Teen Pick Show: Comedy category?
| SELECT "Award" FROM table_42894 WHERE "Category" = 'teen pick show: comedy' | wikisql |
CREATE TABLE time_zone (
time_zone_code text,
time_zone_name text,
hours_from_gmt int
)
CREATE TABLE food_service (
meal_code text,
meal_number int,
compartment text,
meal_description varchar
)
CREATE TABLE state (
state_code text,
state_name text,
country_name text
)
CREATE T... | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE (CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'BOSTON' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'PHILAD... | atis |
CREATE TABLE Has_Allergy (
StuID INTEGER,
Allergy VARCHAR(20)
)
CREATE TABLE Student (
StuID INTEGER,
LName VARCHAR(12),
Fname VARCHAR(12),
Age INTEGER,
Sex VARCHAR(1),
Major INTEGER,
Advisor INTEGER,
city_code VARCHAR(3)
)
CREATE TABLE Allergy_Type (
Allergy VARCHAR(20),
... | SELECT city_code, COUNT(*) FROM Student GROUP BY city_code ORDER BY COUNT(*) | nvbench |
CREATE TABLE church (
name VARCHAR,
open_date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Show the name and opening year for three churches that opened most recently.
| SELECT name, open_date FROM church ORDER BY open_date DESC LIMIT 3 | sql_create_context |
CREATE TABLE table_33298 (
"Call sign" text,
"Frequency MHz" real,
"City of license" text,
"Facility ID" real,
"ERP W" real,
"Height m ( ft )" text,
"Class" text,
"FCC info" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the clas... | SELECT "Class" FROM table_33298 WHERE "Call sign" = 'w267an' | wikisql |
CREATE TABLE table_33635 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Stadium" text,
"Record" text,
"Attendance" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which week was the October 17, 2004 game played?
| SELECT "Week" FROM table_33635 WHERE "Date" = 'october 17, 2004' | wikisql |
CREATE TABLE table_1663 (
"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.
-- Name th... | SELECT "Date" FROM table_1663 WHERE "Score" = 'L 92–103 (OT)' | wikisql |
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id n... | SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', inputevents_cv.charttime)) FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 15794) AND icustays.outtime IS NULL)... | mimic_iii |
CREATE TABLE roller_coaster (
Roller_Coaster_ID int,
Name text,
Park text,
Country_ID int,
Length real,
Height real,
Speed text,
Opened text,
Status text
)
CREATE TABLE country (
Country_ID int,
Name text,
Population int,
Area int,
Languages text
)
-- Using val... | SELECT T1.Name, AVG(T2.Speed) FROM country AS T1 JOIN roller_coaster AS T2 ON T1.Country_ID = T2.Country_ID GROUP BY T1.Name | nvbench |
CREATE TABLE table_name_48 (
year INTEGER,
venue VARCHAR,
score VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Year is the highest one that has a Venue of blackwolf run, composite course, and a Score of 281?
| SELECT MAX(year) FROM table_name_48 WHERE venue = "blackwolf run, composite course" AND score = "281" | 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 mzjzjlb (
HXPLC number,
HZXM ... | SELECT COUNT(*) FROM zyjybgb WHERE zyjybgb.YLJGDM = '6570884' AND zyjybgb.BGRQ BETWEEN '2004-06-22' AND '2018-08-12' UNION SELECT COUNT(*) FROM mzjybgb WHERE mzjybgb.YLJGDM = '6570884' AND mzjybgb.BGRQ BETWEEN '2004-06-22' AND '2018-08-12' | css |
CREATE TABLE table_25800134_3 (
writer_s_ VARCHAR,
season__number VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many writers were for season #1?
| SELECT COUNT(writer_s_) FROM table_25800134_3 WHERE season__number = 1 | 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 zzmzjzjlb.JZLSH FROM person_info JOIN hz_info JOIN zzmzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = zzmzjzjlb.YLJGDM AND hz_info.KH = zzmzjzjlb.KH AND hz_info.KLX = zzmzjzjlb.KLX WHERE person_info.XM = '柏婉娜' AND NOT zzmzjzjlb.JZLSH IN (SELECT jybgb.JZLSH FROM jybgb WHERE jybgb.BGRQ <= '2006-07-0... | css |
CREATE TABLE table_72395 (
"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.
-- Name the candidates for illinois 15
| SELECT "Candidates" FROM table_72395 WHERE "District" = 'Illinois 15' | wikisql |
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
CREATE TABLE jybgb (
BBCJBW text,
BBDM text,
BBMC text,
BBZT number,
BGDH text,
BGJGDM text,
BGJGMC text,
BGRGH text,
BGRQ time,
BGRXM text,
BGSJ time,
CJRQ time,
JSBBRQSJ time,
... | SELECT jyjgzbb.JYZBLSH FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN mzjzjlb_jybgb 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 = mzjzjlb_jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_... | css |
CREATE TABLE table_name_70 (
time_retired VARCHAR,
driver VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Tell me the time/retired for riccardo patrese
| SELECT time_retired FROM table_name_70 WHERE driver = "riccardo patrese" | sql_create_context |
CREATE TABLE table_name_54 (
draw INTEGER,
points VARCHAR,
language VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the highest draw when points is less than 11 and language is norwegian?
| SELECT MAX(draw) FROM table_name_54 WHERE points < 11 AND language = "norwegian" | sql_create_context |
CREATE TABLE table_name_46 (
band INTEGER,
power__w_ INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What Band number has a Power (W) of 400 or less?
| SELECT SUM(band) FROM table_name_46 WHERE power__w_ < 400 | sql_create_context |
CREATE TABLE table_2839 (
"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.
-- Who did... | SELECT "High assists" FROM table_2839 WHERE "High rebounds" = 'Amar''e Stoudemire (10)' | wikisql |
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 INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_location = "EMERGENCY ROOM ADMIT" AND lab.label = "Mesothelial Cells" | mimicsql_data |
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeri... | SELECT MIN(t1.c1) FROM (SELECT COUNT(DISTINCT diagnosis.patientunitstayid) AS c1 FROM diagnosis WHERE diagnosis.diagnosisname = 'bacteremia' GROUP BY STRFTIME('%y', diagnosis.diagnosistime)) AS t1 | eicu |
CREATE TABLE table_45647 (
"Position" real,
"best year" text,
"best 2-year period" text,
"best 3-year period" text,
"best 5-year period" text,
"best 10-year period" text,
"best 15-year period" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- W... | SELECT MAX("Position") FROM table_45647 WHERE "best 3-year period" = 'petrosian' | wikisql |
CREATE TABLE table_dev_56 (
"id" int,
"anemia" bool,
"gender" string,
"white_blood_cell_count_wbc" int,
"hemoglobinopathy" bool,
"major_hematological_conditions" bool,
"laboratory_abnormality" bool,
"hemoglobin_a1c_hba1c" float,
"renal_disease" bool,
"hematocrit_hct" float,
"... | SELECT * FROM table_dev_56 WHERE hemoglobinopathy = 1 OR anemia = 1 OR (hemoglobin_concentration < 11.5 AND gender = 'male') OR (hemoglobin_concentration < 10.5 AND gender = 'female') | criteria2sql |
CREATE TABLE gwyjzb (
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 gwyjzb.PERSON_NM, gwyjzb.PERSON_SEX, gwyjzb.PERSON_AGE, gwyjzb.IDENTITY_CARD FROM gwyjzb WHERE gwyjzb.MED_CLINIC_ID = '65250841483' UNION SELECT fgwyjzb.PERSON_NM, fgwyjzb.PERSON_SEX, fgwyjzb.PERSON_AGE, fgwyjzb.IDENTITY_CARD FROM fgwyjzb WHERE fgwyjzb.MED_CLINIC_ID = '65250841483' | css |
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
RejectionReasonId number,
Comment text
)
CREATE TABLE FlagTypes (
Id number,
Name text,
Description text
)
CREATE TABLE SuggestedEdits (
Id number,
PostId numb... | SELECT PostId AS "post_link", UserId AS "user_link", pho.CreationDate FROM PostHistory AS pho INNER JOIN Users ON UserId = Users.Id INNER JOIN Posts ON OwnerUserId = Users.Id AND Posts.Id = PostId WHERE PostHistoryTypeId BETWEEN 4 AND 9 AND pho.CreationDate > Posts.CommunityOwnedDate AND Users.Reputation < 100 | sede |
CREATE TABLE functional_areas (
functional_area_code text,
parent_functional_area_code text,
functional_area_description text
)
CREATE TABLE users (
user_id number,
role_code text,
user_name text,
user_login text,
password text
)
CREATE TABLE document_structures (
document_structur... | SELECT document_name, access_count FROM documents ORDER BY access_count DESC LIMIT 1 | spider |
CREATE TABLE table_204_186 (
id number,
"season" text,
"tier" number,
"division" text,
"place" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the total number of divisions on the chart ?
| SELECT COUNT(DISTINCT "division") FROM table_204_186 | squall |
CREATE TABLE Behavior_Incident (
incident_id INTEGER,
incident_type_code VARCHAR(10),
student_id INTEGER,
date_incident_start DATETIME,
date_incident_end DATETIME,
incident_summary VARCHAR(255),
recommendations VARCHAR(255),
other_details VARCHAR(255)
)
CREATE TABLE Addresses (
addr... | SELECT date_incident_end, COUNT(date_incident_end) FROM Behavior_Incident WHERE incident_type_code = "NOISE" GROUP BY date_incident_end ORDER BY date_incident_end | nvbench |
CREATE TABLE table_56411 (
"Judge" text,
"State" text,
"Born/Died" text,
"Active service" text,
"Chief Judge" text,
"Senior status" text,
"Appointed by" text,
"Reason for termination" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who ap... | SELECT "Appointed by" FROM table_56411 WHERE "Judge" = 'edward e. cushman' | wikisql |
CREATE TABLE table_name_65 (
round VARCHAR,
college VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- College of villanova has what round?
| SELECT round FROM table_name_65 WHERE college = "villanova" | sql_create_context |
CREATE TABLE projects (
code text,
name text,
hours number
)
CREATE TABLE scientists (
ssn number,
name text
)
CREATE TABLE assignedto (
scientist number,
project text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Find the name of scientists w... | SELECT T2.name FROM assignedto AS T1 JOIN scientists AS T2 ON T1.scientist = T2.ssn | spider |
CREATE TABLE table_name_66 (
week VARCHAR,
opponent VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What week did they have a bye?
| SELECT week FROM table_name_66 WHERE opponent = "bye" | sql_create_context |
CREATE TABLE Characteristics (
characteristic_id INTEGER,
characteristic_type_code VARCHAR(15),
characteristic_data_type VARCHAR(10),
characteristic_name VARCHAR(80),
other_characteristic_details VARCHAR(255)
)
CREATE TABLE Ref_Characteristic_Types (
characteristic_type_code VARCHAR(15),
ch... | SELECT product_category_description, COUNT(product_category_description) FROM Ref_Product_Categories AS T1 JOIN Products AS T2 ON T1.product_category_code = T2.product_category_code WHERE T2.product_description LIKE '%t%' GROUP BY product_category_description | nvbench |
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.
-- Draw a bar ... | SELECT Class, COUNT(*) FROM race GROUP BY Class ORDER BY COUNT(*) DESC | nvbench |
CREATE TABLE table_73250 (
"Conference" text,
"Regular Season Winner" text,
"Conference Player of the Year" text,
"Conference Tournament" text,
"Tournament Venue (City)" text,
"Tournament Winner" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Wh... | SELECT "Tournament Venue (City)" FROM table_73250 WHERE "Conference" = 'Ivy League' | wikisql |
CREATE TABLE table_name_98 (
competition VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the competition that occured on 27 July 2004?
| SELECT competition FROM table_name_98 WHERE date = "27 july 2004" | sql_create_context |
CREATE TABLE person_info (
RYBH text,
XBDM number,
XBMC text,
XM text,
CSRQ time,
CSD text,
MZDM text,
MZMC text,
GJDM text,
GJMC text,
JGDM text,
JGMC text,
XLDM text,
XLMC text,
ZYLBDM text,
ZYMC text
)
CREATE TABLE hz_info (
KH text,
KLX number... | SELECT COUNT(*) FROM zyjzjlb WHERE YLJGDM = '0598399' AND RYDJSJ BETWEEN '2007-02-14' AND '2021-02-04' AND WDBZ > 0 | css |
CREATE TABLE table_78519 (
"Driver" text,
"Constructor" text,
"Laps" real,
"Time/Retired" text,
"Grid" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When grid is less than 7, laps are greater than 17, and time/retired is + 1:35.6, who is the constr... | SELECT "Constructor" FROM table_78519 WHERE "Laps" > '17' AND "Grid" < '7' AND "Time/Retired" = '+ 1:35.6' | wikisql |
CREATE TABLE table_26281 (
"Level" text,
"Luma samples/s" real,
"Macroblocks/s" real,
"Luma samples" real,
"Macroblocks" real,
"Baseline, Extended and Main Profiles" real,
"High Profile" real,
"High 10 Profile" real,
"Examples for high resolution @ highest frame rate (max stored fram... | SELECT "Luma samples/s" FROM table_26281 WHERE "Level" = '1.3' | wikisql |
CREATE TABLE table_name_81 (
year INTEGER,
top_goalscorer VARCHAR,
goals VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the least year for goalscore of ortiz and goals more than 25
| SELECT MIN(year) FROM table_name_81 WHERE top_goalscorer = "ortiz" AND goals > 25 | sql_create_context |
CREATE TABLE mzb (
CLINIC_ID text,
COMP_ID text,
DATA_ID text,
DIFF_PLACE_FLG number,
FERTILITY_STS number,
FLX_MED_ORG_ID text,
HOSP_LEV number,
HOSP_STS number,
IDENTITY_CARD text,
INPT_AREA_BED text,
INSURED_IDENTITY number,
INSURED_STS text,
INSU_TYPE text,
IN... | SELECT qtb.MED_SER_ORG_NO FROM qtb WHERE qtb.PERSON_NM = '秦雅惠' AND qtb.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.SOC_SRT_DIRE_NM = '多糖铁复合物胶囊') UNION SELECT gyb.MED_SER_ORG_NO FROM gyb WHERE gyb.PERSON_NM = '秦雅惠' AND gyb.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.... | css |
CREATE TABLE jyjgzbb (
BGDH text,
BGRQ time,
CKZFWDX text,
CKZFWSX number,
CKZFWXX number,
JCFF text,
JCRGH text,
JCRXM text,
JCXMMC text,
JCZBDM text,
JCZBJGDL number,
JCZBJGDW text,
JCZBJGDX text,
JCZBMC text,
JLDW text,
JYRQ time,
JYZBLSH text,
... | SELECT jyjgzbb.JCRGH, jyjgzbb.JCRXM FROM 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 jy... | css |
CREATE TABLE table_70352 (
"Year" real,
"Entrant" text,
"Chassis" text,
"Engine" text,
"Points" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the average year for Maserati Straight-4 Engines?
| SELECT AVG("Year") FROM table_70352 WHERE "Engine" = 'maserati straight-4' | wikisql |
CREATE TABLE table_12167 (
"Tournament" text,
"2010" text,
"2011" text,
"2012" text,
"2013" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the result in 2011 for the French Open tournament?
| SELECT "2011" FROM table_12167 WHERE "Tournament" = 'french open' | wikisql |
CREATE TABLE table_name_92 (
team VARCHAR,
replaced_by VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Team, when Replaced By is 'Jes s Ram rez'?
| SELECT team FROM table_name_92 WHERE replaced_by = "jesús ramírez" | sql_create_context |
CREATE TABLE VoteTypes (
Id number,
Name text
)
CREATE TABLE PostHistoryTypes (
Id number,
Name text
)
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostHistory (
Id number,
PostHistoryTypeId number,
PostId number,
RevisionGUID other,... | SELECT * FROM Posts WHERE Id = 1 | sede |
CREATE TABLE table_20005 (
"Year" real,
"Dates" text,
"Champion" text,
"Country" text,
"Score" text,
"Tournament location" text,
"Purse ($)" real,
"Winners share ($)" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the maximum pur... | SELECT MAX("Purse ($)") FROM table_20005 | wikisql |
CREATE TABLE table_29391 (
"Province" text,
"Registered voters" real,
"People voted" real,
"Valid votes" real,
"Invalid votes" real,
"Yes" real,
"Yes (%)" text,
"No" real,
"No (%)" text,
"Turnout (%)" text
)
-- Using valid SQLite, answer the following questions for the tables p... | SELECT MAX("Yes") FROM table_29391 WHERE "Yes (%)" = '95.17' | wikisql |
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 AVG(IN_HOSP_DAYS) FROM t_kc21 WHERE MED_SER_ORG_NO = '0953235' AND IN_HOSP_DATE BETWEEN '2007-03-17' AND '2019-09-21' | css |
CREATE TABLE PostLinks (
Id number,
CreationDate time,
PostId number,
RelatedPostId number,
LinkTypeId number
)
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationDate time,
CloseReasonTypeId number,
CloseAsOffTopicReasonTypeId number,
Dupli... | SELECT PostId, RelatedPostId FROM PostLinks AS pl WHERE pl.RelatedPostId = 21895756 AND pl.LinkTypeId = 3 | sede |
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE outputeven... | SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT t3.icd9_code FROM (SELECT t2.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, procedures_icd.charttime FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admi... | mimic_iii |
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 WHERE demographic.ethnicity = "BLACK/HAITIAN" AND demographic.dob_year < "2175" | mimicsql_data |
CREATE TABLE table_829 (
"County" text,
"Bush #" real,
"Bush %" text,
"Kerry #" real,
"Kerry %" text,
"Others #" real,
"Others %" text,
"Total" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the minimum total with kerry % being 1... | SELECT MIN("Total") FROM table_829 WHERE "Kerry %" = '16.71%' | wikisql |
CREATE TABLE table_name_46 (
date VARCHAR,
opponent_in_final VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What date was the opponent in the final Virginie Pichet?
| SELECT date FROM table_name_46 WHERE opponent_in_final = "virginie pichet" | sql_create_context |
CREATE TABLE table_44672 (
"Date" text,
"Time" text,
"Home" text,
"Geust" text,
"Result" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Home, when Time is 18:00, and when Geust is Servette FC (CHL)?
| SELECT "Home" FROM table_44672 WHERE "Time" = '18:00' AND "Geust" = 'servette fc (chl)' | wikisql |
CREATE TABLE table_name_47 (
constructor VARCHAR,
laps VARCHAR,
time_retired VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who built the car that ran out of fuel before 28 laps?
| SELECT constructor FROM table_name_47 WHERE laps < 28 AND time_retired = "out of fuel" | sql_create_context |
CREATE TABLE table_name_86 (
attendance INTEGER,
loss VARCHAR,
points VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How much Attendance has a Loss of divis (0 3 0), and Points smaller than 38?
| SELECT SUM(attendance) FROM table_name_86 WHERE loss = "divis (0–3–0)" AND points < 38 | sql_create_context |
CREATE TABLE advisor (
i_id VARCHAR,
s_id VARCHAR
)
CREATE TABLE instructor (
name VARCHAR,
id VARCHAR
)
CREATE TABLE student (
id VARCHAR,
tot_cred VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Find the name of instructor who is the advis... | SELECT T2.name FROM advisor AS T1 JOIN instructor AS T2 ON T1.i_id = T2.id JOIN student AS T3 ON T1.s_id = T3.id ORDER BY T3.tot_cred DESC LIMIT 1 | sql_create_context |
CREATE TABLE station (
id INTEGER,
name TEXT,
lat NUMERIC,
long NUMERIC,
dock_count INTEGER,
city TEXT,
installation_date TEXT
)
CREATE TABLE trip (
id INTEGER,
duration INTEGER,
start_date TEXT,
start_station_name TEXT,
start_station_id INTEGER,
end_date TEXT,
e... | SELECT date, COUNT(date) FROM weather WHERE min_dew_point_f < (SELECT MIN(min_dew_point_f) FROM weather WHERE zip_code = 94107) GROUP BY date ORDER BY COUNT(date) DESC | nvbench |
CREATE TABLE table_27988281_1 (
production_code INTEGER,
written_by VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the production code of the episode written by Jeff Filgo?
| SELECT MAX(production_code) FROM table_27988281_1 WHERE written_by = "Jeff Filgo" | sql_create_context |
CREATE TABLE table_57451 (
"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.
-- When the home team scored 9.17 (71), what did th... | SELECT "Away team score" FROM table_57451 WHERE "Home team score" = '9.17 (71)' | wikisql |
CREATE TABLE table_57658 (
"Date" text,
"Location" text,
"Opponent" text,
"Score" text,
"Competition" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When was the event that had Liberia as an opponent and resulted in a 1-0 score?
| SELECT "Date" FROM table_57658 WHERE "Opponent" = 'liberia' AND "Score" = '1-0' | wikisql |
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE labevents (
row_id number,
... | SELECT DISTINCT cost.cost FROM cost WHERE cost.event_type = 'prescriptions' AND cost.event_id IN (SELECT prescriptions.row_id FROM prescriptions WHERE prescriptions.drug = 'oxybutynin') | mimic_iii |
CREATE TABLE table_17327458_1 (
outgoing_manager VARCHAR,
date_of_vacancy VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who left a position on 29 May?
| SELECT outgoing_manager FROM table_17327458_1 WHERE date_of_vacancy = "29 May" | sql_create_context |
CREATE TABLE table_27114708_2 (
replaced_by VARCHAR,
outgoing_manager VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- For outgoing manager is alberto malesani mention all the applicable replaced by person
| SELECT replaced_by FROM table_27114708_2 WHERE outgoing_manager = "Alberto Malesani" | sql_create_context |
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_type t... | SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'crnry athrscl natv... | mimic_iii |
CREATE TABLE documents_with_expenses (
document_id number,
budget_type_code text,
document_details text
)
CREATE TABLE ref_document_types (
document_type_code text,
document_type_name text,
document_type_description text
)
CREATE TABLE statements (
statement_id number,
statement_detail... | SELECT document_type_code, document_type_name, document_type_description FROM ref_document_types | spider |
CREATE TABLE table_44867 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" real,
"Money ( $ )" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the lowest amount of money a player from South Africa with a to par less th... | SELECT MIN("Money ( $ )") FROM table_44867 WHERE "Country" = 'south africa' AND "To par" < '8' | wikisql |
CREATE TABLE table_56159 (
"Rd #" real,
"Pick #" real,
"Player" text,
"Team (League)" text,
"Reg GP" real,
"Pl GP" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the total PI GP that a Reg GP has larger than 3?
| SELECT COUNT("Pl GP") FROM table_56159 WHERE "Reg GP" > '3' | wikisql |
CREATE TABLE table_name_48 (
total VARCHAR,
round_1_ VARCHAR,
_2a_points VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the total number of total when round 1 +2A points of 19.620
| SELECT COUNT(total) FROM table_name_48 WHERE round_1_ + _2a_points = "19.620" | sql_create_context |
CREATE TABLE student (
student_id int,
lastname varchar,
firstname varchar,
program_id int,
declare_major varchar,
total_credit int,
total_gpa float,
entered_as varchar,
admit_term int,
predicted_graduation_semester int,
degree varchar,
minor varchar,
internship varch... | SELECT DISTINCT department, name, number FROM course WHERE (description LIKE '%Eur Leg Comp w/ US%' OR name LIKE '%Eur Leg Comp w/ US%') AND credits = 2 | advising |
CREATE TABLE table_15592 (
"Year" real,
"Entrant" text,
"Chassis" text,
"Engine" text,
"Pts." real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the latest year that has an engine of cosworth v8, with a chassis of hesketh 308e?
| SELECT MAX("Year") FROM table_15592 WHERE "Engine" = 'cosworth v8' AND "Chassis" = 'hesketh 308e' | wikisql |
CREATE TABLE table_name_50 (
exit_date VARCHAR,
transfer_fee VARCHAR,
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When was the exit date KiatPrawut Saiwaeo who had a transfer fee of released?
| SELECT exit_date FROM table_name_50 WHERE transfer_fee = "released" AND player = "kiatprawut saiwaeo" | sql_create_context |
CREATE TABLE customers (
customer_id number,
customer_first_name text,
customer_last_name text,
customer_address text,
customer_phone text,
customer_email text,
other_customer_details text
)
CREATE TABLE financial_transactions (
transaction_id number,
previous_transaction_id number,... | SELECT other_account_details FROM accounts WHERE account_name = "338" | spider |
CREATE TABLE zzmzjzjlb (
HXPLC number,
HZXM text,
JLSJ time,
JZJSSJ time,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
JZLSH number,
JZZDBM text,
JZZDSM text,
JZZTDM number,
JZZTMC text,
KH text,
KLX number,
MJZH text,
ML number,
MZZYZDZZBM text,
MZZYZDZ... | SELECT * FROM person_info JOIN hz_info JOIN zzmzjzjlb JOIN jybgb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND 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 = jy... | css |
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 text,
KLX number,
MJZH text,
ML number,
MZZYZDZZBM text,
MZZYZDZZMC ... | SELECT jyjgzbb.CKZFWXX, jyjgzbb.CKZFWSX FROM mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN hz_info_mzjzjlb ON hz_info_mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH AND hz_info_mzjzjlb.JZLSH = mzjzjlb.JZLSH AND hz_info_mzjzjlb.YLJGDM ... | css |
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
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 pat... | SELECT COUNT(*) 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 = 82132)) AND outputevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'chest tubes right ... | mimic_iii |
CREATE TABLE table_58854 (
"Drug" text,
"Mean" real,
"Pleasure" real,
"Psychological dependence" real,
"Physical dependence" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the sum of Pleasure, when Drug is 'LSD', and when Psychological Depen... | SELECT SUM("Pleasure") FROM table_58854 WHERE "Drug" = 'lsd' AND "Psychological dependence" > '1.1' | wikisql |
CREATE TABLE table_name_32 (
venue VARCHAR,
opponents VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What venue held that game against the Queens Park Rangers?
| SELECT venue FROM table_name_32 WHERE opponents = "queens park rangers" | sql_create_context |
CREATE TABLE table_39541 (
"Wind Farm" text,
"Capacity (MW)" real,
"Turbines" real,
"Turbine Vendor" text,
"Size (MW)" text,
"County" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who is the turbine vendor for Meenadreen in Donegal county with ... | SELECT "Turbine Vendor" FROM table_39541 WHERE "Turbines" < '6' AND "County" = 'donegal' AND "Size (MW)" = '0.85' AND "Wind Farm" = 'meenadreen' | wikisql |
CREATE TABLE table_38424 (
"Party" text,
"Votes cast" real,
"Percentage" real,
"Seats won" real,
"Percent of seats" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the percentage of the liberal party with less than 25 percent of seats?
| SELECT COUNT("Percentage") FROM table_38424 WHERE "Party" = 'liberal' AND "Percent of seats" < '25' | wikisql |
CREATE TABLE table_74415 (
"Rd." text,
"Race" text,
"Pole position" text,
"Fastest lap" text,
"Most laps led" text,
"Winning driver" text,
"Winning team" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What race did josef newgarden have the f... | SELECT "Race" FROM table_74415 WHERE "Fastest lap" = 'Josef Newgarden' AND "Most laps led" = 'Josef Newgarden' | wikisql |
CREATE TABLE table_78140 (
"Round" real,
"Pick" real,
"Player" text,
"Position" text,
"School/Club Team" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the highest round that louisville drafted into when their pick was over 75?
| SELECT MAX("Round") FROM table_78140 WHERE "School/Club Team" = 'louisville' AND "Pick" > '75' | wikisql |
CREATE TABLE table_27116 (
"Afghan" text,
"Albanian" text,
"Arabic" text,
"Bangladeshi" text,
"Bosnian" text,
"Chinese" text,
"Colombian" text,
"Cook Islands" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many afghan in banglash is ... | SELECT "Afghan" FROM table_27116 WHERE "Bangladeshi" = 'Hungarian' | wikisql |
CREATE TABLE table_66907 (
"Year" real,
"Chassis" text,
"Engine(s)" text,
"Tyres" text,
"Points" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What are the engines for 1983?
| SELECT "Engine(s)" FROM table_66907 WHERE "Year" = '1983' | wikisql |
CREATE TABLE table_75964 (
"Tournament" text,
"2005" text,
"2006" text,
"2007" text,
"2008" text,
"2009" text,
"2010" text,
"2011" text,
"2012" text,
"2013" text,
"Win %" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What in... | SELECT "2007" FROM table_75964 WHERE "2010" = 'qf' AND "2012" = 'w' | wikisql |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.discharge_location = "SNF" AND procedures.icd9_code = "17" | mimicsql_data |
CREATE TABLE table_2668254_17 (
incumbent VARCHAR,
first_elected VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the ran as an incumbent leader first in 1818?
| SELECT incumbent FROM table_2668254_17 WHERE first_elected = "1818" | sql_create_context |
CREATE TABLE table_1008653_1 (
capital___endonym__ VARCHAR,
capital___exonym__ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the local name given to the city of Canberra?
| SELECT capital___endonym__ FROM table_1008653_1 WHERE capital___exonym__ = "Canberra" | sql_create_context |
CREATE TABLE table_1022 (
"Player" text,
"Position" text,
"Starter" text,
"Touchdowns" real,
"Extra points" real,
"Field goals" real,
"Points" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which position did Redden play?
| SELECT "Position" FROM table_1022 WHERE "Player" = 'Redden' | wikisql |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.