instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE Order_Items (
order_item_id INTEGER,
product_id INTEGER,
order_id INTEGER,
order_item_status VARCHAR(10),
order_item_details VARCHAR(255)
)
CREATE TABLE Shipment_Items (
shipment_id INTEGER,
order_item_id INTEGER
)
CREATE TABLE Orders (
order_id INTEGER,
customer_id IN... | SELECT date_order_placed, COUNT(date_order_placed) FROM Customers AS T1 JOIN Orders AS T2 ON T1.customer_id = T2.customer_id WHERE T1.customer_name = "Jeramie" | nvbench |
CREATE TABLE table_8911 (
"Round" real,
"Pick" real,
"Overall" real,
"Name" text,
"Position" text,
"College" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Overall has a Round larger than 7, a Pick larger than 13, and a Name of tony hall?
| SELECT AVG("Overall") FROM table_8911 WHERE "Round" > '7' AND "Pick" > '13' AND "Name" = 'tony hall' | wikisql |
CREATE TABLE table_1284347_2 (
distance VARCHAR,
race VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many races is different distances does Rosehill Guineas compete in?
| SELECT COUNT(distance) FROM table_1284347_2 WHERE race = "Rosehill Guineas" | sql_create_context |
CREATE TABLE table_65788 (
"Rank" real,
"Summit" text,
"Country" text,
"Island" text,
"Col (m)" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the island with a summit of Haleakal ?
| SELECT "Island" FROM table_65788 WHERE "Summit" = 'haleakalā' | 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 lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,... | SELECT prescriptions.route FROM prescriptions WHERE prescriptions.subject_id = "6983" | mimicsql_data |
CREATE TABLE airline (
airline_code varchar,
airline_name text,
note text
)
CREATE TABLE compartment_class (
compartment varchar,
class_type varchar
)
CREATE TABLE equipment_sequence (
aircraft_code_sequence varchar,
aircraft_code varchar
)
CREATE TABLE flight_leg (
flight_id int,
... | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, airport_service AS AIRPORT_SERVICE_2, city AS CITY_0, city AS CITY_1, city AS CITY_2, fare, flight, flight_fare, flight_stop WHERE ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'PI... | atis |
CREATE TABLE table_19321 (
"Rank" real,
"Name" text,
"Nationality" text,
"1st (m)" text,
"2nd (m)" text,
"Points" text,
"Overall NT points" text,
"Overall WC points (Rank)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the overall ... | SELECT "Overall WC points (Rank)" FROM table_19321 WHERE "2nd (m)" = '122.5' | wikisql |
CREATE TABLE table_47759 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Attendance" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Date of Week 9?
| SELECT "Date" FROM table_47759 WHERE "Week" = '9' | wikisql |
CREATE TABLE table_28431 (
"Specimen weight/size" text,
"Calculated activity ( Bq )" real,
"Calculated activity ( Ci )" text,
"Estimated activity GR(api)" text,
"Estimated exposure ( mRem )/hr*" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- If the ... | SELECT "Estimated exposure ( mRem )/hr*" FROM table_28431 WHERE "Specimen weight/size" = '1000 g / 8.79 cm' | wikisql |
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 SOC_SRT_DIRE_NM, EACH_DOSAGE, USE_FRE FROM t_kc22 WHERE MED_CLINIC_ID = '99340869748' | css |
CREATE TABLE table_16788123_5 (
points VARCHAR,
team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many points scored by sportivo luque o
| SELECT COUNT(points) FROM table_16788123_5 WHERE team = "Sportivo Luqueño" | sql_create_context |
CREATE TABLE table_name_3 (
investment_earnings VARCHAR,
year VARCHAR,
other_local_sources VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What were the investment earnings in a year when other local sources were $2,670,060 after 2001?
| SELECT investment_earnings FROM table_name_3 WHERE year > 2001 AND other_local_sources = "$2,670,060" | 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 demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob te... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.age < "47" AND lab.fluid = "Ascites" | mimicsql_data |
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,... | 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 = 8562)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'admit ht' ... | mimic_iii |
CREATE TABLE table_203_321 (
id number,
"sheriff" text,
"start of term" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- which sheriff came before thomas wickes ?
| SELECT "sheriff" FROM table_203_321 WHERE "start of term" < (SELECT "start of term" FROM table_203_321 WHERE "sheriff" = 'thomas wickes') ORDER BY "start of term" DESC LIMIT 1 | squall |
CREATE TABLE table_62014 (
"Outcome" text,
"Edition" real,
"Round" text,
"Opponent Team" text,
"Surface" text,
"Opponent" text,
"Score" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Surface, when Edition is 2012, and when Outcome is... | SELECT "Surface" FROM table_62014 WHERE "Edition" = '2012' AND "Outcome" = 'winner' | wikisql |
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_type text,
admission_location text,
discharge_location text,
insurance text,
language text,
marital_status text,
ethnicity text,
age number
)
CREATE ... | SELECT chartevents.charttime 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 = 27451)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'arterial... | mimic_iii |
CREATE TABLE table_name_10 (
goals_for VARCHAR,
lost VARCHAR,
position VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many times is lost less than 7 and the position 2?
| SELECT COUNT(goals_for) FROM table_name_10 WHERE lost < 7 AND position = 2 | sql_create_context |
CREATE TABLE semester (
semester_id int,
semester varchar,
year int
)
CREATE TABLE gsi (
course_offering_id int,
student_id int
)
CREATE TABLE program_requirement (
program_id int,
category varchar,
min_credit int,
additional_req varchar
)
CREATE TABLE requirement (
requiremen... | SELECT COUNT(*) > 0 FROM course WHERE department = 'EECS' AND has_lab = 'Y' AND number = 523 | advising |
CREATE TABLE table_name_76 (
pick VARCHAR,
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which pick's player was Marc Lewis (lhp)?
| SELECT pick FROM table_name_76 WHERE player = "marc lewis (lhp)" | sql_create_context |
CREATE TABLE table_72869 (
"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 ha... | SELECT "High points" FROM table_72869 WHERE "Game" = '72' | wikisql |
CREATE TABLE t_kc22 (
AMOUNT number,
CHA_ITEM_LEV number,
DATA_ID text,
DIRE_TYPE number,
DOSE_FORM text,
DOSE_UNIT text,
EACH_DOSAGE text,
EXP_OCC_DATE time,
FLX_MED_ORG_ID text,
FXBZ number,
HOSP_DOC_CD text,
HOSP_DOC_NM text,
MED_DIRE_CD text,
MED_DIRE_NM text,... | SELECT AVG(t_kc21.MED_AMOUT) FROM t_kc21 WHERE t_kc21.MED_ORG_DEPT_CD = '55664' AND t_kc21.IN_HOSP_DATE BETWEEN '2016-03-08' AND '2016-07-24' AND t_kc21.IN_DIAG_DIS_NM = '糖尿病' AND t_kc21.CLINIC_TYPE = '住院' | css |
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
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 jobs (
JOB_ID varchar(... | SELECT HIRE_DATE, AVG(DEPARTMENT_ID) FROM employees WHERE HIRE_DATE < '2002-06-21' ORDER BY AVG(DEPARTMENT_ID) | nvbench |
CREATE TABLE table_1481 (
"Player" text,
"Team" text,
"Matches" real,
"Innings" real,
"Runs" real,
"Average" text,
"Highest Score" text,
"100s" real,
"50s" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many teams were there with... | SELECT COUNT("Team") FROM table_1481 WHERE "Highest Score" = '143' | wikisql |
CREATE TABLE fzzmzjzjlb (
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,
MZZYZD... | SELECT * FROM hz_info JOIN zzmzjzjlb JOIN jybgb JOIN jyjgzbb ON hz_info.YLJGDM = zzmzjzjlb.YLJGDM AND hz_info.KH = zzmzjzjlb.KH AND hz_info.KLX = zzmzjzjlb.KLX AND zzmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND zzmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE hz_i... | css |
CREATE TABLE month (
month_number int,
month_name text
)
CREATE TABLE flight_fare (
flight_id int,
fare_id int
)
CREATE TABLE time_zone (
time_zone_code text,
time_zone_name text,
hours_from_gmt int
)
CREATE TABLE state (
state_code text,
state_name text,
country_name text
)
... | 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, date_day, days, flight WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'PHOENIX' AND date_day.day_number = 26 AND date_day.month_number = 7 AND d... | atis |
CREATE TABLE table_3704 (
"Team" text,
"Outgoing manager" text,
"Manner of departure" text,
"Date of vacancy" text,
"Replaced by" text,
"Date of appointment" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- For livorno team mention all the manner ... | SELECT "Manner of departure" FROM table_3704 WHERE "Team" = 'Livorno' | wikisql |
CREATE TABLE instructor (
instructor_id int,
name varchar,
uniqname varchar
)
CREATE TABLE course_tags_count (
course_id int,
clear_grading int,
pop_quiz int,
group_projects int,
inspirational int,
long_lectures int,
extra_credit int,
few_tests int,
good_feedback int,
... | SELECT DISTINCT instructor.name FROM instructor INNER JOIN offering_instructor ON offering_instructor.instructor_id = instructor.instructor_id INNER JOIN course_offering ON offering_instructor.offering_id = course_offering.offering_id INNER JOIN course ON course.course_id = course_offering.course_id WHERE course.name L... | advising |
CREATE TABLE table_name_45 (
class VARCHAR,
city_of_license VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What class is the city of black mountain, north carolina?
| SELECT class FROM table_name_45 WHERE city_of_license = "black mountain, north carolina" | sql_create_context |
CREATE TABLE table_49787 (
"Tournament" text,
"2008" text,
"2010" text,
"2011" text,
"2012" text,
"2013" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What tournament shows 2013 as 2r, and a 2010 as 1r?
| SELECT "Tournament" FROM table_49787 WHERE "2013" = '2r' AND "2010" = '1r' | wikisql |
CREATE TABLE table_203_618 (
id number,
"pick" number,
"player" text,
"team" text,
"position" text,
"school" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- picked after ryan mills ?
| SELECT "player" FROM table_203_618 WHERE "pick" = (SELECT "pick" FROM table_203_618 WHERE "player" = 'ryan mills') + 1 | squall |
CREATE TABLE track (
name VARCHAR,
LOCATION VARCHAR,
year_opened VARCHAR,
seating INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Show the name, location, open year for all tracks with a seating higher than the average.
| SELECT name, LOCATION, year_opened FROM track WHERE seating > (SELECT AVG(seating) FROM track) | sql_create_context |
CREATE TABLE table_64252 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Attendance" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who were the opponents on Week 8?
| SELECT "Opponent" FROM table_64252 WHERE "Week" = '8' | wikisql |
CREATE TABLE table_52323 (
"Player" text,
"Height" text,
"School" text,
"Hometown" text,
"College" text,
"NBA Draft" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What school has the player of mike rosario?
| SELECT "School" FROM table_52323 WHERE "Player" = 'mike rosario' | wikisql |
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
systemics... | SELECT COUNT(*) > 0 FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-3355')) AND DATETIME(microlab.culturetakentime, 'start of year') = DATETIM... | eicu |
CREATE TABLE table_32967 (
"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.
-- hat was Hawthorn's score as the away team?
| SELECT "Away team score" FROM table_32967 WHERE "Away team" = 'hawthorn' | wikisql |
CREATE TABLE table_name_45 (
laps INTEGER,
time VARCHAR,
grid VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the fewest amount of laps when the grid was larger than 1 and 42:31.153?
| SELECT MIN(laps) FROM table_name_45 WHERE time = "42:31.153" AND grid > 1 | sql_create_context |
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
)
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
)
-- Using valid SQLite, answer the following questions for the... | SELECT Headquarter, SUM(Revenue) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter ORDER BY Headquarter | nvbench |
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 demographic.religion, demographic.days_stay FROM demographic WHERE demographic.subject_id = "29961" | mimicsql_data |
CREATE TABLE Affiliated_With (
Physician INTEGER,
Department INTEGER,
PrimaryAffiliation BOOLEAN
)
CREATE TABLE Patient (
SSN INTEGER,
Name VARCHAR(30),
Address VARCHAR(30),
Phone VARCHAR(30),
InsuranceID INTEGER,
PCP INTEGER
)
CREATE TABLE Department (
DepartmentID INTEGER,
... | SELECT T3.Name, COUNT(T3.Name) FROM Physician AS T1 JOIN Affiliated_With AS T2 ON T1.EmployeeID = T2.Physician JOIN Department AS T3 ON T2.Department = T3.DepartmentID WHERE T2.PrimaryAffiliation = 1 GROUP BY T3.Name | nvbench |
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime ... | SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', icustays.intime)) FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 31854) AND icustays.outtime IS NULL | mimic_iii |
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.diagnosis = "LEFT COLON CANCER" AND demographic.dod_year <= "2138.0" | mimicsql_data |
CREATE TABLE table_22514845_5 (
race_caller VARCHAR,
s_host VARCHAR,
reporters VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the race caller for jim mckay and howard cosell
| SELECT race_caller FROM table_22514845_5 WHERE s_host = "Jim McKay" AND reporters = "Howard Cosell" | sql_create_context |
CREATE TABLE table_1277350_7 (
saturday_day_seven VARCHAR,
thursday_day_five VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is saturday day seven when thursday day five is hamus?
| SELECT saturday_day_seven FROM table_1277350_7 WHERE thursday_day_five = "ሐሙስ hamus" | sql_create_context |
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 OUT_DIAG_DIS_CD, OUT_DIAG_DIS_NM FROM t_kc21 WHERE MED_CLINIC_ID = '78262122998' | css |
CREATE TABLE table_61808 (
"Tournament" text,
"2009" text,
"2010" text,
"2011" text,
"2012" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is 2009, when Tournament is 'Year-End Ranking'?
| SELECT "2009" FROM table_61808 WHERE "Tournament" = 'year-end ranking' | wikisql |
CREATE TABLE table_1973729_2 (
current_conference VARCHAR,
nickname VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which conference has the nickname Lions?
| SELECT current_conference FROM table_1973729_2 WHERE nickname = "Lions" | sql_create_context |
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code tex... | SELECT COUNT(*) > 0 FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-19622')) AND DATETIME(microlab.culturetakentime) >= DATETIME(CURRENT_TIME(... | eicu |
CREATE TABLE table_204_268 (
id number,
"album/single" text,
"performer" text,
"year" number,
"variant" text,
"notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- who was the performer on the last album released ?
| SELECT "performer" FROM table_204_268 ORDER BY id DESC LIMIT 1 | squall |
CREATE TABLE table_43728 (
"Stage" real,
"Start" text,
"Arrival" text,
"Duration" text,
"Difficulty" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How long does the one that stars with son bou of middle difficulty, and on a stage number larger than... | SELECT "Duration" FROM table_43728 WHERE "Stage" > '13' AND "Difficulty" = 'middle' AND "Start" = 'son bou' | 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 procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescription... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.discharge_location = "DISC-TRAN CANCER/CHLDRN H" AND procedures.short_title = "Lap periton adhesiolysis" | mimicsql_data |
CREATE TABLE table_37070 (
"Season" real,
"Team" text,
"Games" real,
"Wins" real,
"Losses" real,
"Ties" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many Ties have Wins smaller than 1, and Games of 6, and Losses of 6, and a Season larger t... | SELECT COUNT("Ties") FROM table_37070 WHERE "Wins" < '1' AND "Games" = '6' AND "Losses" = '6' AND "Season" > '1941' | wikisql |
CREATE TABLE fgwyjzb (
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.OUT_DIAG_DOC_CD, gwyjzb.OUT_DIAG_DOC_NM FROM gwyjzb WHERE gwyjzb.PERSON_ID = '02315348' AND gwyjzb.IN_HOSP_DATE BETWEEN '2010-02-02' AND '2010-12-21' GROUP BY gwyjzb.OUT_DIAG_DOC_CD ORDER BY COUNT(*) DESC LIMIT 1 UNION SELECT fgwyjzb.OUT_DIAG_DOC_CD, fgwyjzb.OUT_DIAG_DOC_NM FROM fgwyjzb WHERE fgwyjzb.PERS... | css |
CREATE TABLE table_name_63 (
team VARCHAR,
pos VARCHAR,
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What team does F Trey Gilder play for?
| SELECT team FROM table_name_63 WHERE pos = "f" AND player = "trey gilder" | sql_create_context |
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 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 j... | css |
CREATE TABLE table_14345690_4 (
finished VARCHAR,
celebrity VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the finished for kerry katona
| SELECT COUNT(finished) FROM table_14345690_4 WHERE celebrity = "Kerry Katona" | sql_create_context |
CREATE TABLE table_21536557_2 (
time__cet_ VARCHAR,
time VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is every time(cet) for a time of 5:04.8?
| SELECT time__cet_ FROM table_21536557_2 WHERE time = "5:04.8" | sql_create_context |
CREATE TABLE table_52602 (
"Stage" text,
"Winner" text,
"General classification" text,
"Points classification" text,
"Trofeo Fast Team" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Winner has a Trofeo Fast Team of metauro mobili-pinarello, a... | SELECT "Winner" FROM table_52602 WHERE "Trofeo Fast Team" = 'metauro mobili-pinarello' AND "General classification" = 'giuseppe saronni' | wikisql |
CREATE TABLE table_204_321 (
id number,
"community" text,
"currency" text,
"region" text,
"target date" number,
"notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many communities are based in africa ?
| SELECT COUNT("community") FROM table_204_321 WHERE "region" = 'africa' | squall |
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,... | SELECT COUNT(*) > 0 FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.uniquepid = '005-69376' AND patient.hospitalid <> (SELECT DISTINCT patient.hospitalid FROM patient WHERE patient.uniquepid = '005-69376' AND patient.hospitaldischargetime IS NULL)) AND tr... | eicu |
CREATE TABLE table_77428 (
"Year" real,
"Player" text,
"Position" text,
"Nationality" text,
"Team" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the position when the player was Justin Mapp Category:articles with hcards with a United States ... | SELECT "Position" FROM table_77428 WHERE "Nationality" = 'united states' AND "Player" = 'justin mapp category:articles with hcards' | wikisql |
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuo... | SELECT admissions.dischtime FROM admissions WHERE admissions.subject_id = 27599 AND DATETIME(admissions.dischtime) <= DATETIME(CURRENT_TIME(), '-3 year') ORDER BY admissions.dischtime DESC LIMIT 1 | mimic_iii |
CREATE TABLE table_2102782_1 (
episode VARCHAR,
run_time VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the episode for run time 25:05
| SELECT episode FROM table_2102782_1 WHERE run_time = "25:05" | sql_create_context |
CREATE TABLE table_60776 (
"Date" text,
"Nationality / Opponent" text,
"Ground" text,
"Result" text,
"Competition" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the Nationality / Opponent of rosario?
| SELECT "Competition" FROM table_60776 WHERE "Nationality / Opponent" = 'rosario' | wikisql |
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 Headquarter, SUM(Manufacturer) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter ORDER BY SUM(Manufacturer) | nvbench |
CREATE TABLE table_name_70 (
state VARCHAR,
interview VARCHAR,
evening_gown VARCHAR,
average VARCHAR,
swimsuit VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which state had an average of less than 8.67, a swimsuit score of 8.27, an evening gown ... | SELECT state FROM table_name_70 WHERE average < 8.67 AND swimsuit = 8.27 AND evening_gown = 8.78 AND interview = 8.52 | sql_create_context |
CREATE TABLE table_75423 (
"Year" real,
"Event" text,
"Venue" text,
"Driver" text,
"Result" text,
"Category" text,
"Report" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When did Hans Hartmann drive?
| SELECT COUNT("Year") FROM table_75423 WHERE "Driver" = 'hans hartmann' | wikisql |
CREATE TABLE swimmer (
ID int,
name text,
Nationality text,
meter_100 real,
meter_200 text,
meter_300 text,
meter_400 text,
meter_500 text,
meter_600 text,
meter_700 text,
Time text
)
CREATE TABLE record (
ID int,
Result text,
Swimmer_ID int,
Event_ID int
)
... | SELECT Time, meter_100 FROM swimmer | nvbench |
CREATE TABLE table_name_67 (
result VARCHAR,
week INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the outcome of the game that had a week number of less than 2?
| SELECT result FROM table_name_67 WHERE week < 2 | sql_create_context |
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
h... | SELECT MIN(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.patientunitstayid IN (SELECT medication.patientunitstayid FROM medication WHERE medication.drugname = 'propofol 1000 mg/100 ml')) GROUP BY cost.patie... | eicu |
CREATE TABLE table_54838 (
"Block A" text,
"Antonio Thomas" text,
"Hikaru Sato" text,
"Hiroshi Yamato" text,
"Kaz Hayashi" text,
"Minoru" text,
"Super Crazy" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the antonio thomas for Hikaru S... | SELECT "Antonio Thomas" FROM table_54838 WHERE "Hikaru Sato" = 'tanaka (8:09)' | wikisql |
CREATE TABLE table_2190919_1 (
year INTEGER,
avg_start VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the most recent year where the average start is 8.5?
| SELECT MAX(year) FROM table_2190919_1 WHERE avg_start = "8.5" | sql_create_context |
CREATE TABLE table_name_95 (
crowd VARCHAR,
home_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the total crowd size for the him team footscray?
| SELECT COUNT(crowd) FROM table_name_95 WHERE home_team = "footscray" | sql_create_context |
CREATE TABLE table_64261 (
"Class" text,
"Railway number(s)" text,
"Quantity" text,
"Year(s) of manufacture" text,
"Type" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the class with 1 quantity?
| SELECT "Class" FROM table_64261 WHERE "Quantity" = '1' | wikisql |
CREATE TABLE table_51330 (
"CERCLIS ID" text,
"Name" text,
"Municipality" text,
"Proposed" text,
"Listed" text,
"Construction completed" text,
"Partially deleted" text,
"Deleted" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- The propose... | SELECT "Municipality" FROM table_51330 WHERE "Proposed" = '03/08/2004' | wikisql |
CREATE TABLE table_name_98 (
date VARCHAR,
winning_driver VARCHAR,
name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When did Gaspare Bona win the Pozzo Circuit?
| SELECT date FROM table_name_98 WHERE winning_driver = "gaspare bona" AND name = "pozzo circuit" | sql_create_context |
CREATE TABLE flight_fare (
flight_id int,
fare_id int
)
CREATE TABLE date_day (
month_number int,
day_number int,
year int,
day_name varchar
)
CREATE TABLE airport_service (
city_code varchar,
airport_code varchar,
miles_distant int,
direction varchar,
minutes_distant int
)... | 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, date_day, days, flight WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BOSTON' AND date_day.day_number = 23 AND date_day.month_number = 4 AND da... | atis |
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 MED_CLINIC_ID FROM t_kc21 WHERE PERSON_ID = '94878508' AND MED_SER_ORG_NO = '4527027' AND IN_DIAG_DIS_NM LIKE '%2%' | css |
CREATE TABLE table_name_73 (
date_enacted VARCHAR,
ns VARCHAR,
normal_total VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the date enacted for N.S. of 10 and normal total of 104
| SELECT date_enacted FROM table_name_73 WHERE ns = "10" AND normal_total = "104" | sql_create_context |
CREATE TABLE table_35269 (
"Outcome" text,
"Date" text,
"Tournament" text,
"Surface" text,
"Partner" text,
"Opponents in the final" text,
"Score" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Outcome of the jounieh tournament?
| SELECT "Outcome" FROM table_35269 WHERE "Tournament" = 'jounieh' | wikisql |
CREATE TABLE table_name_6 (
result VARCHAR,
award VARCHAR,
year VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the result for the Outer Critics Circle award earlier than 2004?
| SELECT result FROM table_name_6 WHERE award = "outer critics circle award" AND year < 2004 | 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 jyjgzbb.JCZBMC, jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM jybgb JOIN jyjgzbb ON jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE jybgb.JZLSH = '06900614343' AND jyjgzbb.JCRXM LIKE '邹%' | css |
CREATE TABLE table_66632 (
"Position" real,
"Name" text,
"Played" real,
"Drawn" real,
"Lost" real,
"Points" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How much Drawn has a Name of erc lechbruck, and Points smaller than 17?
| SELECT COUNT("Drawn") FROM table_66632 WHERE "Name" = 'erc lechbruck' AND "Points" < '17' | wikisql |
CREATE TABLE table_18710512_3 (
single VARCHAR,
date VARCHAR,
other_details VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What single(s) released in 2008 and had 4000 copies?
| SELECT single FROM table_18710512_3 WHERE date = 2008 AND other_details = "4000 copies" | sql_create_context |
CREATE TABLE table_41058 (
"Date" text,
"Title" text,
"Director" text,
"Production Cost" text,
"Singapore Gross" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which film was released in August 2004?
| SELECT "Title" FROM table_41058 WHERE "Date" = 'august 2004' | wikisql |
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location t... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.marital_status = "SINGLE" AND demographic.diagnosis = "COPD EXACERBATION" | mimicsql_data |
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,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 locations (
LOCATION_ID decimal(4,0... | SELECT EMAIL, DEPARTMENT_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) | nvbench |
CREATE TABLE Course_Authors_and_Tutors (
author_id INTEGER,
author_tutor_ATB VARCHAR(3),
login_name VARCHAR(40),
password VARCHAR(40),
personal_name VARCHAR(80),
middle_name VARCHAR(80),
family_name VARCHAR(80),
gender_mf VARCHAR(1),
address_line_1 VARCHAR(80)
)
CREATE TABLE Courses... | SELECT date_of_enrolment, COUNT(date_of_enrolment) FROM Student_Course_Enrolment AS T1 JOIN Student_Tests_Taken AS T2 ON T1.registration_id = T2.registration_id WHERE T2.test_result = "Pass" ORDER BY COUNT(date_of_enrolment) DESC | nvbench |
CREATE TABLE table_61646 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the place when the score was 70-69-74=213?
| SELECT "Place" FROM table_61646 WHERE "Score" = '70-69-74=213' | wikisql |
CREATE TABLE table_204_791 (
id number,
"event" text,
"winner" text,
"second" text,
"third" text,
"fourth" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- who was next to finish after josh constable in the 2008 telstra men 's pro ?
| SELECT "second" FROM table_204_791 WHERE "event" = "2008 telstra men's pro" | squall |
CREATE TABLE table_75397 (
"Years tallest" text,
"Name" text,
"Height ft / m" text,
"Floors" real,
"Year completed" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How tall is the florida life building, completed before 1990?
| SELECT "Height ft / m" FROM table_75397 WHERE "Year completed" < '1990' AND "Name" = 'florida life building' | wikisql |
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE d_items (
row_id number,
itemid ... | SELECT COUNT(*) FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'bicarbonate') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 28253) AND STRFTIME('%y', labevents.charttime) = '2102' | mimic_iii |
CREATE TABLE table_180802_2 (
zodiac_sign VARCHAR,
abbr VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the zodiac sing for the month abbreviated as . .?
| SELECT zodiac_sign FROM table_180802_2 WHERE abbr = "มี.ค." | sql_create_context |
CREATE TABLE table_60829 (
"Position" real,
"Team" text,
"Played" real,
"Drawn" real,
"Lost" real,
"Goals For" real,
"Goals Against" real,
"Goal Difference" text,
"Points 1" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How much Dra... | SELECT COUNT("Drawn") FROM table_60829 WHERE "Points 1" = '51' AND "Lost" > '5' | wikisql |
CREATE TABLE table_7961 (
"Tie no" text,
"Home team" text,
"Score" text,
"Away team" text,
"Date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Away Team when the Home Team is Fulham?
| SELECT "Away team" FROM table_7961 WHERE "Home team" = 'fulham' | wikisql |
CREATE TABLE table_name_32 (
shooter VARCHAR,
score_points VARCHAR,
rank_points VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who's the shooter with 13 score points and 10 rank points?
| SELECT shooter FROM table_name_32 WHERE score_points = "13" AND rank_points = "10" | sql_create_context |
CREATE TABLE table_80213 (
"Year" real,
"Competition" text,
"Venue" text,
"Position" text,
"Notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What position is 1999?
| SELECT "Position" FROM table_80213 WHERE "Year" = '1999' | wikisql |
CREATE TABLE table_204_638 (
id number,
"year" number,
"tournament" text,
"surface" text,
"round" text,
"winner" text,
"score" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- who was the first player to win at wimbledon ?
| SELECT "winner" FROM table_204_638 WHERE "tournament" = 'wimbledon' ORDER BY "year" LIMIT 1 | squall |
CREATE TABLE table_8374 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Home is on january 11?
| SELECT "Home" FROM table_8374 WHERE "Date" = 'january 11' | wikisql |
CREATE TABLE table_name_31 (
event VARCHAR,
total VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What event did the shooter, who had 29 total points, compete in?
| SELECT event FROM table_name_31 WHERE total = "29" | sql_create_context |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.