instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
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 SUM(MED_AMOUT) FROM t_kc24 WHERE PERSON_ID = '48707633' AND CLINIC_SLT_DATE BETWEEN '2003-02-24' AND '2014-11-29' | css |
CREATE TABLE table_name_93 (
swimsuit VARCHAR,
interview INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the number for swimsuit when the interview number is less than 8.808?
| SELECT swimsuit FROM table_name_93 WHERE interview < 8.808 | sql_create_context |
CREATE TABLE table_name_66 (
date VARCHAR,
team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- I want the date for rockies
| SELECT date FROM table_name_66 WHERE team = "rockies" | sql_create_context |
CREATE TABLE table_204_9 (
id number,
"week" number,
"date" text,
"opponent" text,
"result" text,
"attendance" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- first home opponent for the dolphins in the season
| SELECT "opponent" FROM table_204_9 WHERE "opponent" = 'home' ORDER BY "date" LIMIT 1 | squall |
CREATE TABLE company (
Company_ID int,
Rank int,
Company text,
Headquarters text,
Main_Industry text,
Sales_billion real,
Profits_billion real,
Assets_billion real,
Market_Value real
)
CREATE TABLE gas_station (
Station_ID int,
Open_Year int,
Location text,
Manager_N... | SELECT Headquarters, COUNT(*) FROM company GROUP BY Headquarters ORDER BY COUNT(*) | nvbench |
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(t_kc21.IN_DIAG_DIS_CD) FROM t_kc21 WHERE t_kc21.PERSON_NM = '柳静涵' AND t_kc21.IN_HOSP_DATE BETWEEN '2002-01-29' AND '2021-09-11' | css |
CREATE TABLE table_42148 (
"Location" text,
"Aircraft" text,
"Tail number" text,
"Aircraft damage" text,
"Fatalities" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Aircraft when Kabul was the location, unknown fatalities, and the tail n... | SELECT "Aircraft" FROM table_42148 WHERE "Location" = 'kabul' AND "Fatalities" = 'unknown' AND "Tail number" = 'ya-ban' | wikisql |
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_typ... | SELECT admissions.admittime FROM admissions WHERE admissions.subject_id = 17694 AND admissions.admission_location = 'transfer from hosp/extram' AND DATETIME(admissions.admittime) >= DATETIME(CURRENT_TIME(), '-3 year') ORDER BY admissions.admittime DESC LIMIT 1 | mimic_iii |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.expire_flag = "1" AND demographic.diagnosis = "AORTIC VALVE INSUFFIENCY\AORTIC VALVE REPLACEMENT /SDA" | mimicsql_data |
CREATE TABLE PostsWithDeleted (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body text,
OwnerUserId number,
OwnerDisplayName text,
LastEditorUserId number,
LastEditorDispl... | SELECT COUNT(*) AS "Number of Users", DATEDIFF(MONTH, 'creationdate', lastaccessdate) AS "Active Period (Months)" FROM Users GROUP BY DATEDIFF(MONTH, 'creationdate', lastaccessdate) ORDER BY DATEDIFF(MONTH, 'creationdate', lastaccessdate) | sede |
CREATE TABLE table_14937957_1 (
masters VARCHAR,
martial_art_style VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which masters fought in hapkido style?
| SELECT masters FROM table_14937957_1 WHERE martial_art_style = "Hapkido" | sql_create_context |
CREATE TABLE table_44858 (
"Rank" real,
"Name" text,
"S-League" text,
"Singapore Cup" text,
"Singapore League Cup" text,
"AFC Cup" text,
"Total" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What Singapore League Cup does Masahiro Fukasawa ... | SELECT "Singapore League Cup" FROM table_44858 WHERE "Name" = 'masahiro fukasawa' | wikisql |
CREATE TABLE table_16335 (
"Season" real,
"Episodes" real,
"Time slot (EST)" text,
"Season premiere" text,
"Season finale" text,
"TV season" text,
"Rank" text,
"Viewers (in millions)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What i... | SELECT "Season finale" FROM table_16335 WHERE "Season" = '4' | wikisql |
CREATE TABLE table_name_16 (
call_sign VARCHAR,
city_of_license VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the call sign of the translator in Spring Valley, Nevada?
| SELECT call_sign FROM table_name_16 WHERE city_of_license = "spring valley, nevada" | sql_create_context |
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location t... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "CORONARY ARTERY DISEASE" AND demographic.dob_year < "2107" | mimicsql_data |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic ... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.age < "30" AND lab.flag = "abnormal" | mimicsql_data |
CREATE TABLE table_204_131 (
id number,
"tops design code" text,
"electrical system" text,
"max speed" text,
"weight" text,
"brakes" text,
"route availability" number,
"notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the to... | SELECT "max speed" FROM table_204_131 ORDER BY "max speed" DESC LIMIT 1 | squall |
CREATE TABLE table_10899 (
"Name" text,
"Years" text,
"Gender" text,
"Area" text,
"Authority" text,
"Decile" real,
"Roll" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What years does Our Lady Sacred Heart School, which is state integrated,... | SELECT "Years" FROM table_10899 WHERE "Authority" = 'state integrated' AND "Name" = 'our lady sacred heart school' | wikisql |
CREATE TABLE table_11096 (
"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 team was the host on september 11?
| SELECT "Host Team" FROM table_11096 WHERE "Date" = 'september 11' | wikisql |
CREATE TABLE mzjzjlb (
YLJGDM text,
JZLSH text,
KH text,
KLX number,
MJZH text,
HZXM text,
NLS number,
NLY number,
ZSEBZ number,
JZZTDM number,
JZZTMC text,
JZJSSJ time,
TXBZ number,
ZZBZ number,
WDBZ number,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
... | SELECT SQRGH, SQRXM FROM jybgb WHERE BGDH = '51684992743' | css |
CREATE TABLE table_27224 (
"Name" text,
"#" real,
"Position" text,
"Height" text,
"Weight ( lb. )" real,
"Year" text,
"Hometown" text,
"Previous School" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the previous school of the f... | SELECT "Previous School" FROM table_27224 WHERE "Height" = 'ft7in (m)' | wikisql |
CREATE TABLE table_36887 (
"Year" real,
"Trim" text,
"Engine" text,
"Power" text,
"Torque" text,
"EPA (2008) City" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the Year Average that has a Power of BHP (KW) and Trim of LS/2LT?
| SELECT AVG("Year") FROM table_36887 WHERE "Power" = 'bhp (kw)' AND "Trim" = 'ls/2lt' | wikisql |
CREATE TABLE table_name_25 (
time_retired VARCHAR,
grid VARCHAR,
driver VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Time/Retired when the grid is larger than 9 and Rolf Stommelen is the driver?
| SELECT time_retired FROM table_name_25 WHERE grid > 9 AND driver = "rolf stommelen" | sql_create_context |
CREATE TABLE table_67056 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Attendance" real,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which loss has an Attendance larger than 20,841, and a Date of july 9?
| SELECT "Loss" FROM table_67056 WHERE "Attendance" > '20,841' AND "Date" = 'july 9' | 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 WHERE demographic.insurance = "Government" AND demographic.admission_location = "TRANSFER FROM HOSP/EXTRAM" | mimicsql_data |
CREATE TABLE t_kc22 (
MED_EXP_DET_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
MED_CLINIC_ID text,
MED_EXP_BILL_ID text,
SOC_SRT_DIRE_CD text,
SOC_SRT_DIRE_NM text,
DIRE_TYPE number,
CHA_ITEM_LEV number,
MED_INV_ITEM_TYPE text,
MED_DIRE_CD text,
MED_DIRE_NM text,... | SELECT (SELECT OVE_PAY FROM t_kc24 WHERE MED_CLINIC_ID = '81557970327') / (SELECT MED_AMOUT FROM t_kc24 WHERE MED_CLINIC_ID = '81557970327') | css |
CREATE TABLE table_24382 (
"No." real,
"Date" text,
"Tournament" text,
"Winning score" text,
"To par" text,
"Margin of victory" text,
"Runner(s)-up" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the winning score for 8 feb 2009
| SELECT COUNT("Winning score") FROM table_24382 WHERE "Date" = '8 Feb 2009' | wikisql |
CREATE TABLE gyb (
CLINIC_ID text,
COMP_ID text,
DATA_ID text,
DIFF_PLACE_FLG number,
FERTILITY_STS number,
FLX_MED_ORG_ID text,
HOSP_LEV number,
HOSP_STS number,
IDENTITY_CARD text,
INPT_AREA_BED text,
INSURED_IDENTITY number,
INSURED_STS text,
INSU_TYPE text,
IN... | SELECT AVG(t_kc22.SELF_PAY_PRO) FROM qtb JOIN t_kc22 ON qtb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE qtb.MED_SER_ORG_NO = '0734088' AND t_kc22.STA_DATE BETWEEN '2016-12-12' AND '2020-02-04' UNION SELECT AVG(t_kc22.SELF_PAY_PRO) FROM gyb JOIN t_kc22 ON gyb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gyb.MED_SER_ORG_NO ... | css |
CREATE TABLE table_5400 (
"Goal" real,
"Date" text,
"Score" text,
"Result" text,
"Competition" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the result of the match on 16 October 2012 with less than 4 goals?
| SELECT "Result" FROM table_5400 WHERE "Goal" < '4' AND "Date" = '16 october 2012' | wikisql |
CREATE TABLE table_name_16 (
wins INTEGER,
against INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the sum of wins for teams with against under 1067?
| SELECT SUM(wins) FROM table_name_16 WHERE against < 1067 | sql_create_context |
CREATE TABLE zyb (
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 AVG(t_kc24.MED_AMOUT) FROM t_kc24 WHERE t_kc24.MED_CLINIC_ID IN (SELECT qtb.MED_CLINIC_ID FROM qtb WHERE qtb.PERSON_AGE <= 16 UNION SELECT gyb.MED_CLINIC_ID FROM gyb WHERE gyb.PERSON_AGE <= 16 UNION SELECT zyb.MED_CLINIC_ID FROM zyb WHERE zyb.PERSON_AGE <= 16 UNION SELECT mzb.MED_CLINIC_ID FROM mzb WHERE mzb.PER... | css |
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugst... | SELECT t1.drugstarttime FROM (SELECT patient.uniquepid, medication.drugstarttime FROM medication JOIN patient ON medication.patientunitstayid = patient.patientunitstayid WHERE medication.drugname = 'pantoprazole' AND patient.uniquepid = '017-83812' AND DATETIME(medication.drugstarttime, 'start of year') = DATETIME(CURR... | eicu |
CREATE TABLE CLASS (
CLASS_CODE varchar(5),
CRS_CODE varchar(10),
CLASS_SECTION varchar(2),
CLASS_TIME varchar(20),
CLASS_ROOM varchar(8),
PROF_NUM int
)
CREATE TABLE PROFESSOR (
EMP_NUM int,
DEPT_CODE varchar(10),
PROF_OFFICE varchar(50),
PROF_EXTENSION varchar(4),
PROF_HIG... | SELECT DEPT_CODE, COUNT(*) FROM CLASS AS T1 JOIN COURSE AS T2 ON T1.CRS_CODE = T2.CRS_CODE GROUP BY DEPT_CODE | nvbench |
CREATE TABLE table_60758 (
"Outcome" text,
"Date" text,
"Tournament" 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 is the total outcome for the clay surface on April ... | SELECT "Outcome" FROM table_60758 WHERE "Surface" = 'clay' AND "Date" = 'april 21, 1996' | wikisql |
CREATE TABLE table_name_37 (
opponent_number VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- WHAT OPPONENT WAS ON OCTOBER 7?
| SELECT opponent_number FROM table_name_37 WHERE date = "october 7" | sql_create_context |
CREATE TABLE student (
id text,
name text,
dept_name text,
tot_cred number
)
CREATE TABLE section (
course_id text,
sec_id text,
semester text,
year number,
building text,
room_number text,
time_slot_id text
)
CREATE TABLE instructor (
id text,
name text,
dept_n... | SELECT name FROM instructor WHERE dept_name = 'Comp. Sci.' | spider |
CREATE TABLE table_name_98 (
result VARCHAR,
category VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the result for the best musical revival category?
| SELECT result FROM table_name_98 WHERE category = "best musical revival" | sql_create_context |
CREATE TABLE table_6165 (
"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 the average overall pick number for the USF player who was picked after round 5... | SELECT AVG("Overall") FROM table_6165 WHERE "College" = 'usf' AND "Round" > '5' | wikisql |
CREATE TABLE Track (
TrackId integer,
Name varchar(200),
AlbumId integer,
MediaTypeId integer,
GenreId integer,
Composer varchar(220),
Milliseconds integer,
Bytes integer,
UnitPrice decimal(10,2)
)
CREATE TABLE PlaylistTrack (
PlaylistId integer,
TrackId integer
)
CREATE TA... | SELECT InvoiceDate, COUNT(InvoiceDate) FROM Customer AS T1 JOIN Invoice AS T2 ON T1.CustomerId = T2.CustomerId WHERE T1.FirstName = "Astrid" AND LastName = "Gruber" | nvbench |
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 mzjzjlb.JZLSH 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.RYBH = '93496868' AND hz_info.YLJGDM = '3314397' AND NOT mzjzjlb.JZKSMC LIKE '%产%' | css |
CREATE TABLE table_name_18 (
winning_driver VARCHAR,
winning_constructor VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What kind of Winning driver has a Winning constructor of mercer?
| SELECT winning_driver FROM table_name_18 WHERE winning_constructor = "mercer" | sql_create_context |
CREATE TABLE table_name_35 (
week VARCHAR,
attendance VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Week has an Attendance of 63,447?
| SELECT week FROM table_name_35 WHERE attendance = "63,447" | sql_create_context |
CREATE TABLE table_4523 (
"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.
-- Where was the game played where Collingwood was t... | SELECT "Venue" FROM table_4523 WHERE "Away team" = 'collingwood' | wikisql |
CREATE TABLE table_204_471 (
id number,
"year" number,
"title" text,
"peak chart positions\nger" number,
"label" text,
"artist" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many compilation albums were released after 2000 ?
| SELECT COUNT("title") FROM table_204_471 WHERE "year" > 2000 | squall |
CREATE TABLE table_name_22 (
laps VARCHAR,
grid VARCHAR,
driver VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many laps for alexander wurz with a grid under 12?
| SELECT COUNT(laps) FROM table_name_22 WHERE grid < 12 AND driver = "alexander wurz" | sql_create_context |
CREATE TABLE table_name_63 (
no_result INTEGER,
matches VARCHAR,
wins VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many total No Results occured when the team had less than 46 wins and more than 16 matches?
| SELECT SUM(no_result) FROM table_name_63 WHERE matches > 16 AND wins < 46 | sql_create_context |
CREATE TABLE zyb (
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 COUNT(*) FROM qtb JOIN t_kc22 ON qtb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE qtb.PERSON_NM = '柏德华' AND t_kc22.STA_DATE BETWEEN '2004-03-27' AND '2006-06-22' AND t_kc22.MED_INV_ITEM_TYPE = '西药费' UNION SELECT COUNT(*) FROM gyb JOIN t_kc22 ON gyb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gyb.PERSON_NM = '柏德华' A... | css |
CREATE TABLE table_name_38 (
round VARCHAR,
event VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- The K-1 MMA Romanex event went how many rounds?
| SELECT COUNT(round) FROM table_name_38 WHERE event = "k-1 mma romanex" | sql_create_context |
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetake... | SELECT t3.treatmentname FROM (SELECT t2.treatmentname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime, patient.patienthealthsystemstayid FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'hyper... | eicu |
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 jybgb.SQKS, jybgb.SQKSMC FROM jybgb WHERE jybgb.BGDH = '00808054413' | css |
CREATE TABLE customer_orders (
customer_id VARCHAR,
order_date VARCHAR
)
CREATE TABLE customers (
customer_name VARCHAR,
customer_id VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who made the latest order?
| SELECT t1.customer_name FROM customers AS t1 JOIN customer_orders AS t2 ON t1.customer_id = t2.customer_id ORDER BY t2.order_date DESC LIMIT 1 | sql_create_context |
CREATE TABLE table_44534 (
"Position" real,
"Name" text,
"Played" real,
"Drawn" real,
"Lost" real,
"Points" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the average number lost when points is 14 and position is more than 1?
| SELECT AVG("Lost") FROM table_44534 WHERE "Points" = '14' AND "Position" > '1' | wikisql |
CREATE TABLE table_204_395 (
id number,
"year" number,
"competition" text,
"venue" text,
"position" text,
"notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what was the venue before dakar , senegal ?
| SELECT "venue" FROM table_204_395 WHERE id = (SELECT id FROM table_204_395 WHERE "venue" = 'dakar, senegal') - 1 | squall |
CREATE TABLE table_15911 (
"Year" text,
"Typhus" real,
"Typhoid fever" real,
"Relapsing fever" real,
"Smallpox" real,
"Malaria" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What are all the typhus number when smallpox is 4
| SELECT "Typhus" FROM table_15911 WHERE "Smallpox" = '4' | wikisql |
CREATE TABLE table_48718 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Ground" text,
"Date" text,
"Crowd" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Home Team, when Away Team Score is 9.11... | SELECT "Home team" FROM table_48718 WHERE "Away team score" = '9.11 (65)' | wikisql |
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location t... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admission_type = "URGENT" AND prescriptions.drug = "Aspirin" | mimicsql_data |
CREATE TABLE table_48484 (
"Name" text,
"Country" text,
"Status" text,
"Moving to" text,
"Transfer window" text,
"Transfer fee" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- WHAT IS THE NAME WITH A SUMMER TRANSFER WINDOW, AND COUNTRY SEN?
| SELECT "Name" FROM table_48484 WHERE "Transfer window" = 'summer' AND "Country" = 'sen' | wikisql |
CREATE TABLE table_22862 (
"#" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production code" real,
"U.S. viewers (in millions)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the original air ... | SELECT "Original air date" FROM table_22862 WHERE "Title" = 'Prophecy' | wikisql |
CREATE TABLE table_name_55 (
birth VARCHAR,
spouse VARCHAR,
became_consort VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the birth of the person that has a spouse of frederick iv and became consort of 4 april 1721
| SELECT birth FROM table_name_55 WHERE spouse = "frederick iv" AND became_consort = "4 april 1721" | sql_create_context |
CREATE TABLE table_17960 (
"Year" real,
"Points" text,
"Rebounds" text,
"Assists" text,
"Steals" text,
"Blocks" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many rebounds were there in 2008?
| SELECT COUNT("Rebounds") FROM table_17960 WHERE "Year" = '2008' | wikisql |
CREATE TABLE table_name_87 (
band VARCHAR,
purpose VARCHAR,
frequency VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- The community station broadcasting at frequency 0 96.9 is in what band?
| SELECT band FROM table_name_87 WHERE purpose = "community" AND frequency = "0 96.9" | sql_create_context |
CREATE TABLE writes (
paperid int,
authorid int
)
CREATE TABLE paperfield (
fieldid int,
paperid int
)
CREATE TABLE journal (
journalid int,
journalname varchar
)
CREATE TABLE keyphrase (
keyphraseid int,
keyphrasename varchar
)
CREATE TABLE venue (
venueid int,
venuename var... | SELECT DISTINCT paper.paperid, paper.year FROM keyphrase, paper, paperkeyphrase WHERE keyphrase.keyphrasename = 'Visual Detection' AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paper.paperid = paperkeyphrase.paperid ORDER BY paper.year DESC | scholar |
CREATE TABLE table_4629 (
"Religious group" text,
"Population %" text,
"Growth (1991\u20132001)" text,
"Sex ratio (total)" real,
"Literacy (%)" text,
"Work participation (%)" text,
"Sex ratio (rural)" real,
"Sex ratio (urban)" real,
"Sex ratio (child)" real
)
-- Using valid SQLite,... | SELECT MAX("Sex ratio (child)") FROM table_4629 WHERE "Work participation (%)" = '37.7%' | 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 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.long_title = "Regional enteritis of unspecified site" AND prescriptions.route = "IH" | mimicsql_data |
CREATE TABLE table_25173505_13 (
special_edition VARCHAR,
english_version VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the special edition where the english version is nick stewart?
| SELECT special_edition FROM table_25173505_13 WHERE english_version = "Nick Stewart" | sql_create_context |
CREATE TABLE table_name_14 (
became_consort VARCHAR,
ceased_to_be_consort VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the became consort for ceased to be consort of 4 april 1588 husband's death
| SELECT became_consort FROM table_name_14 WHERE ceased_to_be_consort = "4 april 1588 husband's death" | sql_create_context |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic ... | SELECT AVG(demographic.age) FROM demographic WHERE demographic.age >= "70" AND demographic.admityear >= "2157" | mimicsql_data |
CREATE TABLE table_74056 (
"Rnd" real,
"Date" text,
"Race Name" text,
"Track" text,
"Location" text,
"Pole position" text,
"Fastest lap" text,
"Most Laps Led" text,
"Winner" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many tim... | SELECT COUNT("Pole position") FROM table_74056 WHERE "Location" = 'Homestead, Florida' | wikisql |
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 DISTINCT course_offering.friday, course_offering.monday, course_offering.saturday, course_offering.sunday, course_offering.thursday, course_offering.tuesday, course_offering.wednesday FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_i... | advising |
CREATE TABLE table_203_291 (
id number,
"round" number,
"pick" number,
"player" text,
"position" text,
"school/club team" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many players had the position of wr according to this chart ?
| SELECT COUNT("player") FROM table_203_291 WHERE "position" = 'wr' | squall |
CREATE TABLE electoral_register (
electoral_register_id number,
cmi_cross_ref_id number
)
CREATE TABLE business_rates (
business_rates_id number,
cmi_cross_ref_id number
)
CREATE TABLE rent_arrears (
council_tax_id number,
cmi_cross_ref_id number
)
CREATE TABLE benefits_overpayments (
cou... | SELECT council_tax_id, cmi_cross_ref_id FROM parking_fines | spider |
CREATE TABLE table_18200 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Status" text,
"Opponent" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What party is Sanford Bishop a member of?
| SELECT "Party" FROM table_18200 WHERE "Incumbent" = 'Sanford Bishop' | wikisql |
CREATE TABLE table_17222 (
"No. in series" real,
"No. in season" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production code" text,
"U.S. viewers (millions)" text
)
-- Using valid SQLite, answer the following questions for the tables provided a... | SELECT MIN("No. in series") FROM table_17222 WHERE "Title" = 'I Forgot to Remember to Forget' | 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 * 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 hz_info.YLJGDM = '2848267' AND zzmzjzjlb.JZZDSM LIKE '%妊娠%' UNION SELECT * FROM person_info JOIN h... | css |
CREATE TABLE table_8486 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Ground" text,
"Date" text,
"Crowd" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When the crowd was greater than 19,498 who was t... | SELECT "Away team" FROM table_8486 WHERE "Crowd" > '19,498' | 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 COUNT(DISTINCT MED_SER_ORG_NO) FROM t_kc21 WHERE PERSON_ID = '04724844' AND IN_HOSP_DATE BETWEEN '2015-02-09' AND '2015-03-31' | css |
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 MAX(demographic.age) FROM demographic WHERE demographic.language = "SPAN" AND demographic.diagnosis = "ST-SEGMENT ELEVATION MYOCARDIAL INFARCTION\CARDIAC CATH" | mimicsql_data |
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 INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.age < "81" AND diagnoses.short_title = "Hemochromatos-rbc trans" | mimicsql_data |
CREATE TABLE table_21458142_1 (
total_copies_sold VARCHAR,
release_date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many copies were sold of the game released on october 23, 2008?
| SELECT total_copies_sold FROM table_21458142_1 WHERE release_date = "October 23, 2008" | sql_create_context |
CREATE TABLE table_15040_8 (
english VARCHAR,
russian VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the English word for the Russian words loshad, kobyla ( , )?
| SELECT english FROM table_15040_8 WHERE russian = "loshad, kobyla (лошадь, кобыла)" | sql_create_context |
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE icustays (
row_id number,
subject_id number,
hadm_id number,
... | SELECT MIN(labevents.valuenum) FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 13806) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'cholesterol, ldl, measured') AND STRFTIME('%y', labevents.charttime) <= '21... | mimic_iii |
CREATE TABLE candidate (
Candidate_ID int,
People_ID int,
Poll_Source text,
Date text,
Support_rate real,
Consider_rate real,
Oppose_rate real,
Unsure_rate real
)
CREATE TABLE people (
People_ID int,
Sex text,
Name text,
Date_of_Birth text,
Height real,
Weight re... | SELECT Name, Weight FROM people ORDER BY Name DESC | nvbench |
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title 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
... | SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.dischtime IS NULL AND admissions.age BETWEEN 50 AND 59 | mimic_iii |
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.Name, T1.Manufacturer FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter, T1.Name ORDER BY T1.Name DESC | nvbench |
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location t... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.religion = "PROTESTANT QUAKER" AND demographic.dob_year < "2023" | mimicsql_data |
CREATE TABLE table_name_82 (
wins INTEGER,
matches INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many wins had Matches greater than 5?
| SELECT SUM(wins) FROM table_name_82 WHERE matches > 5 | sql_create_context |
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,0)
)
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 varc... | SELECT HIRE_DATE, SUM(MANAGER_ID) FROM employees WHERE HIRE_DATE < '2002-06-21' ORDER BY SUM(MANAGER_ID) DESC | nvbench |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.gender = "M" AND demographic.diagnosis = "ABDOMINAL PAIN" | mimicsql_data |
CREATE TABLE table_24774 (
"Candidate (Party)" text,
"Amount raised ( PHP )" text,
"Amount spent ( PHP )" text,
"Votes" real,
"Spent per vote ( PHP )" text,
"Spent per voter ( PHP )" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was spent ... | SELECT "Spent per voter ( PHP )" FROM table_24774 WHERE "Spent per vote ( PHP )" = '20.07' | wikisql |
CREATE TABLE table_39265 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Save" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the save of the game on September 15?
| SELECT "Save" FROM table_39265 WHERE "Date" = 'september 15' | wikisql |
CREATE TABLE table_1405704_1 (
team VARCHAR,
winning_driver VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What team does Al Unser drive for?
| SELECT team FROM table_1405704_1 WHERE winning_driver = "Al Unser" | sql_create_context |
CREATE TABLE table_name_91 (
wins INTEGER,
played VARCHAR,
goal_difference VARCHAR,
club VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Wins have a Goal Difference larger than 12, and a Club of granada cf, and Played larger than 30?
| SELECT AVG(wins) FROM table_name_91 WHERE goal_difference > 12 AND club = "granada cf" AND played > 30 | sql_create_context |
CREATE TABLE table_12165 (
"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 2013 in the tournament whose 2010 result was q2?
| SELECT "2013" FROM table_12165 WHERE "2010" = 'q2' | wikisql |
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 WHERE demographic.diagnosis = "MESENTERIC ISCHEMIA" AND demographic.age < "51" | mimicsql_data |
CREATE TABLE station (
station_id VARCHAR
)
CREATE TABLE train_station (
station_id VARCHAR
)
CREATE TABLE train (
name VARCHAR,
train_id VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Find the names of the trains that do not pass any station locat... | SELECT T2.name FROM train_station AS T1 JOIN train AS T2 ON T1.train_id = T2.train_id WHERE NOT T1.station_id IN (SELECT T4.station_id FROM train_station AS T3 JOIN station AS T4 ON T3.station_id = T4.station_id WHERE t4.location = "London") | sql_create_context |
CREATE TABLE zyjybgb (
BBCJBW text,
BBDM text,
BBMC text,
BBZT number,
BGDH number,
BGJGDM text,
BGJGMC text,
BGRGH text,
BGRQ time,
BGRXM text,
BGSJ time,
CJRQ time,
JSBBRQSJ time,
JSBBSJ time,
JYBBH text,
JYJGMC text,
JYJSGH text,
JYJSQM text,
... | SELECT zyjzjlb.JZLSH FROM person_info JOIN hz_info JOIN zyjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX WHERE person_info.XM = '俞德本' AND NOT zyjzjlb.JZLSH IN (SELECT zyjybgb.JZLSH FROM zyjybgb WHERE zyjybgb.BGRQ <= '2006-07-13' UNI... | css |
CREATE TABLE table_24888 (
"English short name (upper/lower case)" text,
"Alpha-2 code" text,
"Alpha-3 code" text,
"Numeric code" real,
"ISO 3166-2 codes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Alpha 2 code for the area also know... | SELECT "Alpha-2 code" FROM table_24888 WHERE "Alpha-3 code" = 'TCA' | wikisql |
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 demographic ... | SELECT prescriptions.route FROM prescriptions WHERE prescriptions.drug = "Simethicone" | mimicsql_data |
CREATE TABLE table_name_90 (
wins VARCHAR,
position VARCHAR,
conceded VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the number of wins when position was larger than 6, and conceded was smaller than 19?
| SELECT COUNT(wins) FROM table_name_90 WHERE position > 6 AND conceded < 19 | sql_create_context |
CREATE TABLE table_name_50 (
frequency VARCHAR,
power__kw_ VARCHAR,
call_sign VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the frequency of the call sign DYFR with 10KW of power?
| SELECT frequency FROM table_name_50 WHERE power__kw_ = "10kw" AND call_sign = "dyfr" | sql_create_context |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.