instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.marital_status = "WIDOWED" AND prescriptions.route = "ID" | mimicsql_data |
CREATE TABLE zyjzjlb (
CYBQDM text,
CYBQMC text,
CYCWH text,
CYKSDM text,
CYKSMC text,
CYSJ time,
CYZTDM number,
HZXM text,
JZKSDM text,
JZKSMC text,
JZLSH text,
KH text,
KLX number,
MZBMLX number,
MZJZLSH text,
MZZDBM text,
MZZDMC text,
MZZYZDZZBM... | SELECT AVG(jyjgzbb.JCZBJGDL), MIN(jyjgzbb.JCZBJGDL), MAX(jyjgzbb.JCZBJGDL) FROM mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN jybgb_jyjgzbb ON mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jybgb_jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH AND jybgb_jyjgzbb.JYZBLSH = jyjgzbb.JY... | 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 COUNT(*) FROM (SELECT jybgb.KSBM FROM mzjzjlb JOIN jybgb ON mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE mzjzjlb.YLJGDM = '1741866' AND jybgb.BGRQ BETWEEN '2001-07-30' AND '2020-03-08' GROUP BY jybgb.KSBM HAVING COUNT(*) < 5) AS T | css |
CREATE TABLE table_name_78 (
venue VARCHAR,
result VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Venue when the result was 88 87?
| SELECT venue FROM table_name_78 WHERE result = "88–87" | sql_create_context |
CREATE TABLE table_name_9 (
country VARCHAR,
content VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What Country's Content is TV Locale?
| SELECT country FROM table_name_9 WHERE content = "tv locale" | sql_create_context |
CREATE TABLE table_28190363_1 (
network VARCHAR,
judges VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What are the networks whose version of the show includes the judges batuhan zeynio lu piatti murat bozok erol kaynar?
| SELECT network FROM table_28190363_1 WHERE judges = "Batuhan Zeynioğlu Piatti Murat Bozok Erol Kaynar" | sql_create_context |
CREATE TABLE table_15597975_2 (
pa INTEGER,
stolen_ends VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When the stolen ends equal 5 whats the amount of pa?
| SELECT MAX(pa) FROM table_15597975_2 WHERE stolen_ends = 5 | sql_create_context |
CREATE TABLE table_18234 (
"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.
-- What is the district for 1952?
| SELECT "District" FROM table_18234 WHERE "First elected" = '1952' | wikisql |
CREATE TABLE table_204_396 (
id number,
"country" text,
"masters" number,
"u.s. open" number,
"the open" number,
"pga" number,
"total" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- combined , how many winning golfers does england and wale... | SELECT SUM("masters") FROM table_204_396 WHERE "country" IN ('england', 'wales') | squall |
CREATE TABLE table_17058151_8 (
high_rebounds VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the total number of high rebounds for february 10
| SELECT COUNT(high_rebounds) FROM table_17058151_8 WHERE date = "February 10" | sql_create_context |
CREATE TABLE table_22354 (
"District" text,
"Vacator" text,
"Reason for change" text,
"Successor" text,
"Date successor seated" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which district did Ralph Harvey (r) vacated when he resigned?
| SELECT "District" FROM table_22354 WHERE "Vacator" = 'Ralph Harvey (R)' | wikisql |
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
InputTitle text,
MarkdownInputGuidance text,
MarkdownPostOwnerGuidance text,
MarkdownPrivilegedUserGuidance text,
MarkdownConcensusDescription text,
CreationDate time,
CreationModeratorId number,
ApprovalDa... | SELECT * FROM PostHistoryTypes | sede |
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 prescription... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.dod_year <= "2155.0" AND prescriptions.formulary_drug_cd = "OSEL75" | mimicsql_data |
CREATE TABLE table_17809 (
"Club" text,
"Played" text,
"Won" text,
"Drawn" text,
"Lost" text,
"Points for" text,
"Points against" text,
"Tries for" text,
"Tries against" text,
"Try bonus" text,
"Losing bonus" text,
"Points" text
)
-- Using valid SQLite, answer the follo... | SELECT "Tries against" FROM table_17809 WHERE "Drawn" = '2' | wikisql |
CREATE TABLE table_51615 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Leading scorer" text,
"Attendance" real,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the visitor when the lakers were at home with a Scor... | SELECT "Visitor" FROM table_51615 WHERE "Home" = 'lakers' AND "Score" = '85–106' | 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 COUNT(*) FROM gwyjzb WHERE gwyjzb.PERSON_NM = '马文心' AND gwyjzb.CLINIC_TYPE = '住院' AND MOD(gwyjzb.MED_AMOUT, 1) = 0 UNION SELECT COUNT(*) FROM fgwyjzb WHERE fgwyjzb.PERSON_NM = '马文心' AND fgwyjzb.CLINIC_TYPE = '住院' AND MOD(fgwyjzb.MED_AMOUT, 1) = 0 | css |
CREATE TABLE Rating (
stars INTEGER,
mID VARCHAR
)
CREATE TABLE Movie (
title VARCHAR,
director VARCHAR,
mID VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- For each director, return the director's name together with the title of the movie they d... | SELECT T2.title, T1.stars, T2.director, MAX(T1.stars) FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID WHERE director <> "null" GROUP BY director | sql_create_context |
CREATE TABLE table_59069 (
"Name" text,
"Owner" text,
"Programming" text,
"Type" text,
"Encryption" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the programming for mrt sobraniski kanal?
| SELECT "Programming" FROM table_59069 WHERE "Name" = 'mrt sobraniski kanal' | wikisql |
CREATE TABLE jybgb (
BBCJBW text,
BBDM text,
BBMC text,
BBZT number,
BGDH text,
BGJGDM text,
BGJGMC text,
BGRGH text,
BGRQ time,
BGRXM text,
BGSJ time,
CJRQ time,
JSBBRQSJ time,
JSBBSJ time,
JYBBH text,
JYJGMC text,
JYJSGH text,
JYJSQM text,
JY... | SELECT jyjgzbb.JYZBLSH 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 jybgb.YLJGDM = ... | css |
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 zyjybgb.BBCJBW FROM hz_info JOIN mzjzjlb JOIN zyjybgb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = zyjybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = zyjybgb.JZLSH_MZJZJLB WHERE hz_info.RYBH = '87435774' AND zyjybgb.BGRQ BETWEEN '2013-05-27' AND '2018-... | css |
CREATE TABLE table_2668329_25 (
result VARCHAR,
district VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What ended up happening in the district Virginia 22?
| SELECT result FROM table_2668329_25 WHERE district = "Virginia 22" | sql_create_context |
CREATE TABLE table_56613 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the home team score when the away team w... | SELECT "Home team score" FROM table_56613 WHERE "Away team" = 'hawthorn' | 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 DISTINCT cost.cost FROM cost WHERE cost.eventtype = 'treatment' AND cost.eventid IN (SELECT treatment.treatmentid FROM treatment WHERE treatment.treatmentname = 'valve replacement or repair - routine') | eicu |
CREATE TABLE staff_department_assignments (
staff_id number,
department_id number,
date_assigned_from time,
job_title_code text,
date_assigned_to time
)
CREATE TABLE department_stores (
dept_store_id number,
dept_store_chain_id number,
store_name text,
store_address text,
store_... | SELECT MAX(customer_code), MIN(customer_code) FROM customers | spider |
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CRE... | SELECT COUNT(*) > 0 FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '029-584')) AND DATETIME(medication.drugstarttime, 'start of year') = DATET... | eicu |
CREATE TABLE Rooms (
RoomId VARCHAR,
basePrice VARCHAR
)
CREATE TABLE Reservations (
firstname VARCHAR,
lastname VARCHAR,
Room VARCHAR,
Rate VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Find the first and last names of people who payed mor... | SELECT T1.firstname, T1.lastname FROM Reservations AS T1 JOIN Rooms AS T2 ON T1.Room = T2.RoomId WHERE T1.Rate - T2.basePrice > 0 | sql_create_context |
CREATE TABLE table_36729 (
"Province" text,
"School" text,
"City" text,
"Degree" text,
"Established" real,
"Closed" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what province was established in 1870
| SELECT "Province" FROM table_36729 WHERE "Established" = '1870' | wikisql |
CREATE TABLE class_of_service (
booking_class varchar,
rank int,
class_description text
)
CREATE TABLE airline (
airline_code varchar,
airline_name text,
note text
)
CREATE TABLE code_description (
code varchar,
description text
)
CREATE TABLE flight_stop (
flight_id int,
stop... | 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 = 'KANSAS CITY' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'DE... | atis |
CREATE TABLE table_197446_1 (
office VARCHAR,
term_ended VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What group was in office when the term ended in January 3, 1993?
| SELECT office FROM table_197446_1 WHERE term_ended = "January 3, 1993" | sql_create_context |
CREATE TABLE table_name_14 (
runner_up VARCHAR,
score VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When the Score was kapunda 7-7-49 angaston 6-8-44, who was the Runner-up?
| SELECT runner_up FROM table_name_14 WHERE score = "kapunda 7-7-49 angaston 6-8-44" | sql_create_context |
CREATE TABLE university (
School_ID int,
School text,
Location text,
Founded real,
Affiliation text,
Enrollment real,
Nickname text,
Primary_conference text
)
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Per... | SELECT ACC_Road, School_ID FROM basketball_match GROUP BY All_Home, ACC_Road | nvbench |
CREATE TABLE table_5633 (
"Frequency (MHz)" real,
"Call letters" text,
"Licensed location" text,
"Type" text,
"Format" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Frequency (MHz) that has a Call letters of krmd-fm has what sum?
| SELECT SUM("Frequency (MHz)") FROM table_5633 WHERE "Call letters" = 'krmd-fm' | wikisql |
CREATE TABLE table_1341453_40 (
candidates VARCHAR,
incumbent VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many candidates ran in the election where Mike Doyle was the incumbent?
| SELECT COUNT(candidates) FROM table_1341453_40 WHERE incumbent = "Mike Doyle" | sql_create_context |
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.person_info_XM = '苏正诚' AND NOT mzjzjlb.JZLSH IN (SELECT jybgb.JZLSH FROM jybgb WHERE jybgb.BGRQ >= '2021-04-10') | css |
CREATE TABLE table_79955 (
"Rank" real,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which silver has a Gold smaller than 12, a Rank smaller than 5, and a Bronze of 5?
| SELECT "Silver" FROM table_79955 WHERE "Gold" < '12' AND "Rank" < '5' AND "Bronze" = '5' | wikisql |
CREATE TABLE table_37426 (
"Medal" text,
"Name" text,
"Games" text,
"Sport" text,
"Event" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which participants won the silver medal for the Men's Doubles?
| SELECT "Name" FROM table_37426 WHERE "Medal" = 'silver' AND "Event" = 'men''s doubles' | wikisql |
CREATE TABLE table_18933 (
"Year (Ceremony)" text,
"Film title used in nomination" text,
"Original title" text,
"Director" text,
"Result" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who is the director of the fimm Biola Tak Berdawai?
| SELECT "Director" FROM table_18933 WHERE "Original title" = 'Biola tak berdawai' | wikisql |
CREATE TABLE subjects (
subject_id number,
subject_name text
)
CREATE TABLE courses (
course_id number,
author_id number,
subject_id number,
course_name text,
course_description text
)
CREATE TABLE students (
student_id number,
date_of_registration time,
date_of_latest_logon ti... | SELECT personal_name FROM course_authors_and_tutors INTERSECT SELECT personal_name FROM students | spider |
CREATE TABLE table_name_72 (
total VARCHAR,
rank_points VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- That's the total for rank points of olympic gold medalist?
| SELECT total FROM table_name_72 WHERE rank_points = "olympic gold medalist" | sql_create_context |
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttim... | SELECT MIN(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 = 24517)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'arte... | mimic_iii |
CREATE TABLE table_204_584 (
id number,
"pos" text,
"no" number,
"driver" text,
"constructor" text,
"laps" number,
"time/retired" text,
"grid" number,
"points" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- who had the best time dr... | SELECT "driver" FROM table_204_584 WHERE "constructor" = 'ferrari' ORDER BY "pos" LIMIT 1 | squall |
CREATE TABLE table_23927423_4 (
promoted_to_league VARCHAR,
relegated_to_league VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was promoted to the league when Coventry was relegated to the league?
| SELECT promoted_to_league FROM table_23927423_4 WHERE relegated_to_league = "Coventry" | sql_create_context |
CREATE TABLE table_name_13 (
attendance VARCHAR,
record VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many people were in attendance on the day there was a 30-22 victory?
| SELECT COUNT(attendance) FROM table_name_13 WHERE record = "30-22" | sql_create_context |
CREATE TABLE table_name_25 (
winning_driver VARCHAR,
second_driver VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Winning Driver has a Second Driver of jimmy bryan?
| SELECT winning_driver FROM table_name_25 WHERE second_driver = "jimmy bryan" | sql_create_context |
CREATE TABLE dual_carrier (
main_airline varchar,
low_flight_number int,
high_flight_number int,
dual_airline varchar,
service_name text
)
CREATE TABLE airline (
airline_code varchar,
airline_name text,
note text
)
CREATE TABLE airport (
airport_code varchar,
airport_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, 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 = 'SAN FR... | atis |
CREATE TABLE table_35006 (
"Urban Area" text,
"Country" text,
"Region" text,
"Population" real,
"Globalization Index" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the population of Valencia, Spain?
| SELECT AVG("Population") FROM table_35006 WHERE "Country" = 'spain' AND "Urban Area" = 'valencia' | wikisql |
CREATE TABLE t_kc24 (
ACCOUNT_DASH_DATE time,
ACCOUNT_DASH_FLG number,
CASH_PAY number,
CIVIL_SUBSIDY number,
CKC102 number,
CLINIC_ID text,
CLINIC_SLT_DATE time,
COMP_ID text,
COM_ACC_PAY number,
COM_PAY number,
DATA_ID text,
ENT_ACC_PAY number,
ENT_PAY number,
F... | SELECT COUNT(*) FROM t_kc21 JOIN t_kc22 JOIN t_kc21_t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc21_t_kc22.MED_CLINIC_ID AND t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID WHERE t_kc21.PERSON_NM = '俞虹影' AND t_kc22.STA_DATE BETWEEN '2014-05-05' AND '2019-01-16' AND t_kc22.MED_INV_ITEM_TYPE = '检查费' | css |
CREATE TABLE table_51834 (
"Year" real,
"Competition" text,
"Venue" text,
"Position" text,
"Event" text,
"Notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What were the notes of the All-Africa Games before 2007?
| SELECT "Notes" FROM table_51834 WHERE "Competition" = 'all-africa games' AND "Year" < '2007' | wikisql |
CREATE TABLE table_18920 (
"Country" text,
"Currency name" text,
"Month with highest inflation rate" text,
"Highest monthly inflation rate" text,
"Equivalent daily inflation rate" text,
"Time required for prices to double" text
)
-- Using valid SQLite, answer the following questions for the ta... | SELECT "Country" FROM table_18920 WHERE "Highest monthly inflation rate" = '3.13 × 10 8 %' | 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 prescription... | SELECT demographic.ethnicity FROM demographic WHERE demographic.subject_id = "16438" | mimicsql_data |
CREATE TABLE table_name_34 (
country VARCHAR,
icao VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which country is Lemd the ICAO of?
| SELECT country FROM table_name_34 WHERE icao = "lemd" | sql_create_context |
CREATE TABLE table_21435 (
"Episode Number" real,
"Air Date" text,
"Event 1" text,
"Event 2" text,
"Event 3" text,
"Event 4" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was event 2 when event 1 was Atlasphere?
| SELECT "Event 2" FROM table_21435 WHERE "Event 1" = 'Atlasphere' | wikisql |
CREATE TABLE table_name_31 (
nation VARCHAR,
gold VARCHAR,
bronze VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which nation has a gold less than 2 and a bronze less than 5?
| SELECT nation FROM table_name_31 WHERE gold < 2 AND bronze < 5 | sql_create_context |
CREATE TABLE food_service (
meal_code text,
meal_number int,
compartment text,
meal_description varchar
)
CREATE TABLE time_interval (
period text,
begin_time int,
end_time int
)
CREATE TABLE city (
city_code varchar,
city_name varchar,
state_code varchar,
country_name varc... | 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 = 'ATLANTA' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'WASHIN... | atis |
CREATE TABLE table_33471 (
"Year" real,
"Network" text,
"Play-by-play" text,
"Color commentator(s)" text,
"Sideline reporter(s)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the color commentator for Andrea Kremer and Tiki Barber?
| SELECT "Color commentator(s)" FROM table_33471 WHERE "Sideline reporter(s)" = 'andrea kremer and tiki barber' | wikisql |
CREATE TABLE table_name_38 (
recnet VARCHAR,
identifier VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the RECNet when the identifier is cbf-fm-20?
| SELECT recnet FROM table_name_38 WHERE identifier = "cbf-fm-20" | sql_create_context |
CREATE TABLE t_kc22 (
AMOUNT number,
CHA_ITEM_LEV number,
DATA_ID text,
DIRE_TYPE number,
DOSE_FORM text,
DOSE_UNIT text,
EACH_DOSAGE text,
EXP_OCC_DATE time,
FLX_MED_ORG_ID text,
FXBZ number,
HOSP_DOC_CD text,
HOSP_DOC_NM text,
MED_CLINIC_ID text,
MED_DIRE_CD tex... | SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.t_kc21_PERSON_NM = '吴德泽' AND NOT t_kc22.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT < 5837.52) | css |
CREATE TABLE table_59550 (
"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 Home team of tie no 2?
| SELECT "Home team" FROM table_59550 WHERE "Tie no" = '2' | wikisql |
CREATE TABLE table_28211213_2 (
team_nickname VARCHAR,
enrollment VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- 4512 is the enrollment what is the team nickname?
| SELECT team_nickname FROM table_28211213_2 WHERE enrollment = 4512 | sql_create_context |
CREATE TABLE team (
Team_id int,
Name text
)
CREATE TABLE player (
Player_ID int,
Player text,
Years_Played text,
Total_WL text,
Singles_WL text,
Doubles_WL text,
Team int
)
CREATE TABLE match_season (
Season real,
Player text,
Position text,
Country int,
Team i... | SELECT Years_Played, COUNT(Years_Played) FROM player GROUP BY Years_Played | nvbench |
CREATE TABLE table_46303 (
"Game" real,
"Date" text,
"Opponent" text,
"Score" text,
"Location" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What game ended with a final score of 126-108?
| SELECT MAX("Game") FROM table_46303 WHERE "Score" = '126-108' | wikisql |
CREATE TABLE table_name_47 (
volume VARCHAR,
weeks_on_top VARCHAR,
artist VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What volume 3 weeks on top for Third Eye Blind?
| SELECT volume AS :issue FROM table_name_47 WHERE weeks_on_top = "3" AND artist = "third eye blind" | sql_create_context |
CREATE TABLE table_name_64 (
position_in_table VARCHAR,
team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Position in Table, when Team is 'Morelia'?
| SELECT position_in_table FROM table_name_64 WHERE team = "morelia" | 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 transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
eventtype text,
careunit text,... | SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, diagnoses_icd.charttime, admissions.hadm_id FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title =... | mimic_iii |
CREATE TABLE 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 bdmzjzjlb (
HXPLC number,
HZX... | SELECT AVG(jyjgzbb.JCZBJGDL), MIN(jyjgzbb.JCZBJGDL), MAX(jyjgzbb.JCZBJGDL) FROM wdmzjzjlb JOIN jybgb JOIN jyjgzbb ON wdmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND wdmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE wdmzjzjlb.JZZDBM = 'N61.918' AND jyjgzbb.JCZBMC = '... | css |
CREATE TABLE table_10005 (
"Outcome" text,
"Year" real,
"Championship" text,
"Surface" text,
"Opponent" text,
"Rank" real,
"Round" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Championship, when Year is greater than 2002, and when ... | SELECT "Championship" FROM table_10005 WHERE "Year" > '2002' AND "Surface" = 'hard' | wikisql |
CREATE TABLE city (
city_code varchar,
city_name varchar,
state_code varchar,
country_name varchar,
time_zone_code varchar
)
CREATE TABLE date_day (
month_number int,
day_number int,
year int,
day_name varchar
)
CREATE TABLE restriction (
restriction_code text,
advance_purc... | 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 = 'DETROIT' AND date_day.day_number = 21 AND date_day.month_number = 2 AND ... | atis |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
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 t... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.age < "68" AND prescriptions.formulary_drug_cd = "VALC60L" | mimicsql_data |
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),
STREET_ADDRESS varchar(40),
POSTAL_CODE varchar(12),
CITY varchar(30),
STATE_PROVINCE varchar(... | SELECT JOB_ID, SUM(SALARY) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) GROUP BY JOB_ID ORDER BY JOB_ID DESC | nvbench |
CREATE TABLE table_11964263_13 (
high_points VARCHAR,
location_attendance VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the high points for toyota center 18,269?
| SELECT high_points FROM table_11964263_13 WHERE location_attendance = "Toyota Center 18,269" | sql_create_context |
CREATE TABLE table_25495 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What l... | SELECT "Location Attendance" FROM table_25495 WHERE "Record" = '20-12' | 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 jybgb.SHSJ FROM hz_info JOIN txmzjzjlb JOIN jybgb ON hz_info.YLJGDM = txmzjzjlb.YLJGDM AND hz_info.KH = txmzjzjlb.KH AND hz_info.KLX = txmzjzjlb.KLX AND txmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND txmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE hz_info.RYBH = '70984037' AND jybgb.BGRQ BETWEEN '2009-08-30' AND '2012-... | css |
CREATE TABLE table_38055 (
"Game" real,
"January" real,
"Opponent" text,
"Score" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the Record on Game 50?
| SELECT "Record" FROM table_38055 WHERE "Game" = '50' | wikisql |
CREATE TABLE table_74872 (
"Name" text,
"Hanzi" text,
"Origin" text,
"Launch" text,
"Owner" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Hanzi of Hong Kong in 1998?
| SELECT "Hanzi" FROM table_74872 WHERE "Origin" = 'hong kong' AND "Launch" = '1998' | wikisql |
CREATE TABLE student (
stuid number,
lname text,
fname text,
age number,
sex text,
major number,
advisor number,
city_code text
)
CREATE TABLE participates_in (
stuid number,
actid number
)
CREATE TABLE activity (
actid number,
activity_name text
)
CREATE TABLE faculty... | SELECT rank, COUNT(*) FROM faculty GROUP BY rank | spider |
CREATE TABLE mzjybgb (
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 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 = '40108491' AND NOT mzjzjlb.JZLSH IN (SELECT zyjybgb.JZLSH FROM zyjybgb WHERE zyjybgb.BGRQ <= '2011-09-11' UNION SELECT mzjybgb.JZLSH FROM mzjybgb WHERE mzjybgb... | css |
CREATE TABLE table_train_262 (
"id" int,
"gender" string,
"hemoglobin_a1c_hba1c" float,
"obesity" bool,
"diabetic" string,
"hba1c" float,
"body_mass_index_bmi" float,
"age" float,
"NOUSE" float
)
-- Using valid SQLite, answer the following questions for the tables provided above.
... | SELECT * FROM table_train_262 WHERE hba1c >= 6.5 AND hemoglobin_a1c_hba1c <= 8.5 | criteria2sql |
CREATE TABLE table_11677691_3 (
player VARCHAR,
hometown VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What player's hometown is Abilene, Texas?
| SELECT player FROM table_11677691_3 WHERE hometown = "Abilene, Texas" | sql_create_context |
CREATE TABLE venue (
venueid int,
venuename varchar
)
CREATE TABLE author (
authorid int,
authorname varchar
)
CREATE TABLE paperdataset (
paperid int,
datasetid int
)
CREATE TABLE cite (
citingpaperid int,
citedpaperid int
)
CREATE TABLE paperfield (
fieldid int,
paperid int... | SELECT DISTINCT paper.paperid FROM dataset, keyphrase, paper, paperdataset, paperkeyphrase, venue WHERE dataset.datasetname = 'Jeopardy! Questions' AND keyphrase.keyphrasename = 'Parsing' AND paperdataset.datasetid = dataset.datasetid AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paperkeyphrase.paperid = p... | scholar |
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost numb... | SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.dischtime IS NULL AND admissions.age BETWEEN 30 AND 39 | mimic_iii |
CREATE TABLE table_34810 (
"Year of Issue" real,
"Description" text,
"Weight" text,
"Diameter" text,
"Thickness" text,
"Edge" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Thickness has a Weight of 3.50grams?
| SELECT "Thickness" FROM table_34810 WHERE "Weight" = '3.50grams' | wikisql |
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.age < "74" | mimicsql_data |
CREATE TABLE table_13464416_6 (
high_points VARCHAR,
team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- tell who made the most scores on new jersey
| SELECT high_points FROM table_13464416_6 WHERE team = "New Jersey" | sql_create_context |
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
value... | SELECT (SELECT labevents.valuenum FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 71192 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label ... | mimic_iii |
CREATE TABLE table_name_78 (
week INTEGER,
attendance VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which week was the team's bye week?
| SELECT MAX(week) FROM table_name_78 WHERE attendance = "bye" | sql_create_context |
CREATE TABLE table_name_5 (
overall VARCHAR,
pick VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Overall number for pick 17?
| SELECT overall FROM table_name_5 WHERE pick = 17 | sql_create_context |
CREATE TABLE table_23224961_2 (
season VARCHAR,
oberfranken_west VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When sv neuses is the oberfranken west what is the season?
| SELECT season FROM table_23224961_2 WHERE oberfranken_west = "SV Neuses" | sql_create_context |
CREATE TABLE table_64170 (
"Medal" text,
"Name" text,
"Games" text,
"Sport" text,
"Event" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Event has a Medal of gold and a Name of barney henricus?
| SELECT "Event" FROM table_64170 WHERE "Medal" = 'gold' AND "Name" = 'barney henricus' | wikisql |
CREATE TABLE table_name_58 (
location VARCHAR,
game VARCHAR,
record VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Location has a Game greater than 27 and a Record of 18-10?
| SELECT location FROM table_name_58 WHERE game > 27 AND record = "18-10" | sql_create_context |
CREATE TABLE ftxmzjzjlb (
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 txmzjzjlb.JZKSBM, txmzjzjlb.JZKSMC FROM txmzjzjlb WHERE txmzjzjlb.JZLSH = '98899980007' UNION SELECT ftxmzjzjlb.JZKSBM, ftxmzjzjlb.JZKSMC FROM ftxmzjzjlb WHERE ftxmzjzjlb.JZLSH = '98899980007' | css |
CREATE TABLE table_name_43 (
record VARCHAR,
high_assists VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the record of the game when Lebron James (4) had the high assists?
| SELECT record FROM table_name_43 WHERE high_assists = "lebron james (4)" | sql_create_context |
CREATE TABLE table_name_60 (
long VARCHAR,
car VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the long for the player with 26 carries?
| SELECT long FROM table_name_60 WHERE car = 26 | sql_create_context |
CREATE TABLE table_name_3 (
country VARCHAR,
to_par VARCHAR,
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which country has a to par of +2 for Bernhard Langer?
| SELECT country FROM table_name_3 WHERE to_par = "+2" AND player = "bernhard langer" | sql_create_context |
CREATE TABLE table_name_80 (
draws VARCHAR,
wins VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Draws, when Wins is 'Did Not Qualify'?
| SELECT draws FROM table_name_80 WHERE wins = "did not qualify" | sql_create_context |
CREATE TABLE table_name_94 (
against VARCHAR,
team VARCHAR,
position VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Total againsts for the Sant'Anna team with a position number greater than 10?
| SELECT COUNT(against) FROM table_name_94 WHERE team = "sant'anna" AND position > 10 | sql_create_context |
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.diagnosis = "RASH" AND demographic.dod_year <= "2186.0" | mimicsql_data |
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
... | SELECT diagnoses_icd.charttime FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'cocaine abuse-continuous') AND diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 81840) AND DATETI... | mimic_iii |
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 allergy.drugname FROM allergy WHERE allergy.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '021-95970' AND patient.hospitaldischargetime IS NULL)) | eicu |
CREATE TABLE Institution (
Institution_id text,
Institution text,
Location text,
Founded real,
Type text,
Enrollment int,
Team text,
Primary_Conference text,
building_id text
)
CREATE TABLE building (
building_id text,
Name text,
Street_address text,
Years_as_tallest... | SELECT Type, SUM(Enrollment) FROM Institution GROUP BY Type | nvbench |
CREATE TABLE broadcast (
program_id VARCHAR
)
CREATE TABLE program (
name VARCHAR,
program_id VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Find the name of the program that is broadcast most frequently.
| SELECT t1.name FROM program AS t1 JOIN broadcast AS t2 ON t1.program_id = t2.program_id GROUP BY t2.program_id ORDER BY COUNT(*) DESC LIMIT 1 | sql_create_context |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.