instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE table_12783 (
"Satellite" text,
"Launch date" text,
"Carrier rocket" text,
"Launch site" text,
"COSPAR ID" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the COSPAR ID of Ariel 4, which was launched with a Scout carrier rocket?
| SELECT "COSPAR ID" FROM table_12783 WHERE "Carrier rocket" = 'scout' AND "Satellite" = 'ariel 4' | wikisql |
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime t... | SELECT vitalperiodic.sao2 FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '022-187132')) AND NOT vitalperiodic.sao2 IS NULL AND DATETIME(... | eicu |
CREATE TABLE bdmzjzjlb (
CYBQDM text,
CYBQMC text,
CYCWH text,
CYKSDM text,
CYKSMC text,
CYSJ time,
CYZTDM number,
HZXM text,
JZKSDM text,
JZKSMC text,
JZLSH number,
KH text,
KLX number,
MZBMLX number,
MZJZLSH text,
MZZDBM text,
MZZDMC text,
MZZYZD... | SELECT wdmzjzjlb.CYBQDM, wdmzjzjlb.CYBQMC, wdmzjzjlb.CYCWH FROM wdmzjzjlb WHERE wdmzjzjlb.JZLSH = '78308838010' UNION SELECT bdmzjzjlb.CYBQDM, bdmzjzjlb.CYBQMC, bdmzjzjlb.CYCWH FROM bdmzjzjlb WHERE bdmzjzjlb.JZLSH = '78308838010' | css |
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 (SELECT vitalperiodic.respiration FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '027-62948')) AND NOT vitalperiodic.respiration ... | eicu |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_type = "URGENT" AND procedures.icd9_code = "12" | mimicsql_data |
CREATE TABLE table_name_58 (
termination_of_mission VARCHAR,
presentation_of_credentials VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the termination of mission date of the representative with a presentation of credentials date on July 4, 1898?
| SELECT termination_of_mission FROM table_name_58 WHERE presentation_of_credentials = "july 4, 1898" | sql_create_context |
CREATE TABLE STUDENT (
STU_NUM int,
STU_LNAME varchar(15),
STU_FNAME varchar(15),
STU_INIT varchar(1),
STU_DOB datetime,
STU_HRS int,
STU_CLASS varchar(2),
STU_GPA float(8),
STU_TRANSFER numeric,
DEPT_CODE varchar(18),
STU_PHONE varchar(4),
PROF_NUM int
)
CREATE TABLE EM... | SELECT CLASS_ROOM, COUNT(*) FROM CLASS GROUP BY CLASS_ROOM ORDER BY CLASS_ROOM | nvbench |
CREATE TABLE products (
product_details VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Find the detail of products whose detail contains the word 'Latte' or the word 'Americano
| SELECT product_details FROM products WHERE product_details LIKE "%Latte%" OR product_details LIKE "%Americano%" | sql_create_context |
CREATE TABLE Invoices (
invoice_number INTEGER,
order_id INTEGER,
invoice_date DATETIME
)
CREATE TABLE Invoice_Line_Items (
order_item_id INTEGER,
invoice_number INTEGER,
product_id INTEGER,
product_title VARCHAR(80),
product_quantity VARCHAR(50),
product_price DECIMAL(19,4),
de... | SELECT product_name, COUNT(*) FROM Order_Items AS T1 JOIN Products AS T2 ON T1.product_id = T2.product_id JOIN Orders AS T3 ON T3.order_id = T1.order_id GROUP BY T2.product_name | nvbench |
CREATE TABLE job_history (
EMPLOYEE_ID decimal(6,0),
START_DATE date,
END_DATE date,
JOB_ID varchar(10),
DEPARTMENT_ID decimal(4,0)
)
CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
LOCATION_ID decimal(4,0)
)
CREATE TABLE... | SELECT JOB_ID, AVG(SALARY) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) GROUP BY JOB_ID ORDER BY AVG(SALARY) DESC | nvbench |
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 lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_type = "URGENT" AND lab.label = "Potassium, Whole Blood" | mimicsql_data |
CREATE TABLE table_name_79 (
year INTEGER,
entrant VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the largest year with an Entrant of ron harris / team lotus?
| SELECT MAX(year) FROM table_name_79 WHERE entrant = "ron harris / team lotus" | sql_create_context |
CREATE TABLE table_name_41 (
season VARCHAR,
wicket_partnership VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which season is the wicket 2nd partnership in?
| SELECT season FROM table_name_41 WHERE wicket_partnership = "2nd" | sql_create_context |
CREATE TABLE table_name_77 (
tournament VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the tournament with A in 2011?
| SELECT tournament FROM table_name_77 WHERE 2011 = "a" | sql_create_context |
CREATE TABLE table_name_66 (
wins VARCHAR,
draws VARCHAR,
goals_against VARCHAR,
goals_for VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many Wins have Goals against smaller than 30, and Goals for larger than 25, and Draws larger than 5?
| SELECT COUNT(wins) FROM table_name_66 WHERE goals_against < 30 AND goals_for > 25 AND draws > 5 | sql_create_context |
CREATE TABLE table_5935 (
"Date" text,
"Tournament" text,
"Location" text,
"Winner" text,
"Score" text,
"1st prize ( $ )" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the name of the Tournament on oct 23?
| SELECT "Tournament" FROM table_5935 WHERE "Date" = 'oct 23' | wikisql |
CREATE TABLE table_name_43 (
losses INTEGER,
draws VARCHAR,
against VARCHAR,
wins VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the losses average when the against is greater than 1255 and wins is 0 and the draws less than 0?
| SELECT AVG(losses) FROM table_name_43 WHERE against > 1255 AND wins = 0 AND draws < 0 | sql_create_context |
CREATE TABLE photos (
mountain_id VARCHAR,
camera_lens_id VARCHAR
)
CREATE TABLE mountain (
name VARCHAR,
prominence VARCHAR,
id VARCHAR
)
CREATE TABLE camera_lens (
id VARCHAR,
brand VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Show ... | SELECT name, prominence FROM mountain EXCEPT SELECT T1.name, T1.prominence FROM mountain AS T1 JOIN photos AS T2 ON T1.id = T2.mountain_id JOIN camera_lens AS T3 ON T2.camera_lens_id = T3.id WHERE T3.brand = 'Sigma' | sql_create_context |
CREATE TABLE table_name_33 (
drawn INTEGER,
lost VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the whole of Drawn that has a Lost of 4?
| SELECT SUM(drawn) FROM table_name_33 WHERE lost = 4 | sql_create_context |
CREATE TABLE table_name_66 (
win__percentage INTEGER,
season VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the lowest win% in the 1999-2013 season?
| SELECT MIN(win__percentage) FROM table_name_66 WHERE season = "1999-2013" | sql_create_context |
CREATE TABLE table_204_599 (
id number,
"party" text,
"first duma" text,
"second duma" text,
"third duma" text,
"fourth duma" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many total seats were taken in the fourth duma ?
| SELECT SUM("fourth duma") FROM table_204_599 | squall |
CREATE TABLE table_12186237_1 (
motogp_winner VARCHAR,
circuit VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who is the Motogp winnder for the Catalunya Circuit?
| SELECT motogp_winner FROM table_12186237_1 WHERE circuit = "Catalunya" | sql_create_context |
CREATE TABLE table_name_98 (
country VARCHAR,
finish VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which country has a finish of t4?
| SELECT country FROM table_name_98 WHERE finish = "t4" | 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 diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE procedures (
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.long_title = "Migraine, unspecified, without mention of intractable migraine without mention of status migrainosus" AND lab.f... | mimicsql_data |
CREATE TABLE table_34955 (
"Year" real,
"Men's singles" text,
"Women's singles" text,
"Men's doubles" text,
"Women's doubles" text,
"Mixed doubles" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When did mika heinonen susanna dahlberg win mixed ... | SELECT AVG("Year") FROM table_34955 WHERE "Mixed doubles" = 'mika heinonen susanna dahlberg' | wikisql |
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospit... | SELECT vitalperiodic.observationtime FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '016-29754') AND NOT patient.unitdischargetime IS NU... | eicu |
CREATE TABLE table_203_142 (
id number,
"pos" text,
"no" number,
"rider" text,
"bike" text,
"laps" number,
"time" text,
"grid" number,
"points" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- in the 2007 phillip island superbike wor... | SELECT COUNT("rider") FROM table_203_142 WHERE "points" <> "" AND "points" >= 10 | squall |
CREATE TABLE table_767 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" text,
"Result" text,
"Candidates" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the first elected for lost renomination democratic loss
| SELECT "First elected" FROM table_767 WHERE "Result" = 'Lost renomination Democratic loss' | wikisql |
CREATE TABLE table_name_29 (
silver INTEGER,
rank VARCHAR,
bronze VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How much Silver has a Rank of 1, and a Bronze smaller than 3?
| SELECT SUM(silver) FROM table_name_29 WHERE rank = "1" AND bronze < 3 | 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 = "ABDOMINAL PAIN" AND demographic.age < "67" | mimicsql_data |
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_ORG_DEPT_NM, IN_DIAG_DIS_CD, AVG(PERSON_AGE) FROM t_kc21 WHERE MED_SER_ORG_NO = '8754336' GROUP BY MED_ORG_DEPT_NM, IN_DIAG_DIS_CD | css |
CREATE TABLE table_name_8 (
year INTEGER,
engine VARCHAR,
entrant VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the average year that the Belanger Motors had an Offenhauser l4 engine?
| SELECT AVG(year) FROM table_name_8 WHERE engine = "offenhauser l4" AND entrant = "belanger motors" | sql_create_context |
CREATE TABLE table_16574 (
"Character" text,
"Portrayed by" text,
"First appearance" text,
"Last appearance" text,
"Duration" text,
"Episodes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which episode did actor A. J. Buckley last appear in?
| SELECT "Last appearance" FROM table_16574 WHERE "Portrayed by" = 'A. J. Buckley' | wikisql |
CREATE TABLE table_name_39 (
attendance INTEGER,
time VARCHAR,
location VARCHAR,
game VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the attendance when the location is veterans stadium, the game is more than 3 and the time is 2:21?
| SELECT AVG(attendance) FROM table_name_39 WHERE location = "veterans stadium" AND game > 3 AND time = "2:21" | sql_create_context |
CREATE TABLE table_203_362 (
id number,
"school" text,
"location" text,
"outright titles" number,
"shared titles" number,
"runners-up" number,
"total finals" number,
"last title" number,
"last final" number
)
-- Using valid SQLite, answer the following questions for the tables prov... | SELECT COUNT("school") FROM table_203_362 WHERE "outright titles" > 5 | squall |
CREATE TABLE table_33919 (
"Name" text,
"Faith" text,
"Type" text,
"DCSF number" real,
"Ofsted number" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What name that has a DCSF number bigger than 2448 and an Ofsted number of 131319?
| SELECT "Name" FROM table_33919 WHERE "DCSF number" > '2448' AND "Ofsted number" = '131319' | wikisql |
CREATE TABLE table_255602_1 (
pop_density__per_km²_ VARCHAR,
area__km²_ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the population density where area is 48.67?
| SELECT COUNT(pop_density__per_km²_) FROM table_255602_1 WHERE area__km²_ = "48.67" | sql_create_context |
CREATE TABLE table_23950 (
"City (Utility)" text,
"Residential Monthly usage: 1000 kWh" text,
"Small power Power demand: 40 kW; Consumption 10,000 kWh, load factor: 35%." text,
"Medium power Power demand: 1,000 kW; Consumption: 400,000 kWh, load factor: 56 %." text,
"Large power Power demand: 50,000... | SELECT "City (Utility)" FROM table_23950 WHERE "Residential Monthly usage: 1000 kWh" = '11.80' | wikisql |
CREATE TABLE cite (
cited int,
citing int
)
CREATE TABLE domain_conference (
cid int,
did int
)
CREATE TABLE domain_journal (
did int,
jid int
)
CREATE TABLE journal (
homepage varchar,
jid int,
name varchar
)
CREATE TABLE publication_keyword (
kid int,
pid int
)
CREATE ... | SELECT COUNT(DISTINCT (publication.title)) FROM author, journal, organization, publication, writes WHERE journal.name = 'VLDB' AND organization.name = 'University of Michigan' AND organization.oid = author.oid AND publication.jid = journal.jid AND publication.year > 2000 AND writes.aid = author.aid AND writes.pid = pub... | academic |
CREATE TABLE table_name_38 (
score VARCHAR,
visitor VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the score when philadelphia visited?
| SELECT score FROM table_name_38 WHERE visitor = "philadelphia" | sql_create_context |
CREATE TABLE table_name_92 (
year INTEGER,
returned_on VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Year has a Returned On of march 10, 2013?
| SELECT AVG(year) FROM table_name_92 WHERE returned_on = "march 10, 2013" | 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 All_Road, All_Games_Percent FROM basketball_match ORDER BY All_Road | nvbench |
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 qtb.MED_CLINIC_ID FROM qtb WHERE qtb.PERSON_NM = '许天蓝' AND qtb.MED_SER_ORG_NO = '0791593' AND qtb.IN_DIAG_DIS_NM LIKE '%阻塞性%' UNION SELECT gyb.MED_CLINIC_ID FROM gyb WHERE gyb.PERSON_NM = '许天蓝' AND gyb.MED_SER_ORG_NO = '0791593' AND gyb.IN_DIAG_DIS_NM LIKE '%阻塞性%' UNION SELECT zyb.MED_CLINIC_ID FROM zyb WHERE zy... | css |
CREATE TABLE table_name_38 (
played VARCHAR,
points_for VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many rounds were played in the matching resulting in a Points For score of 343?
| SELECT played FROM table_name_38 WHERE points_for = "343" | sql_create_context |
CREATE TABLE table_8368 (
"Date" text,
"Home" text,
"Score" text,
"Away" text,
"Attendance" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Home team when Motagua is the Away team?
| SELECT "Home" FROM table_8368 WHERE "Away" = 'motagua' | wikisql |
CREATE TABLE gsi (
course_offering_id int,
student_id int
)
CREATE TABLE student_record (
student_id int,
course_id int,
semester int,
grade varchar,
how varchar,
transfer_source varchar,
earn_credit varchar,
repeat_term varchar,
test_id varchar
)
CREATE TABLE requirement (... | SELECT DISTINCT semester.year FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND course.department = 'THEORY' AND course.number = 543 AND semester.semester_id = course_offering.semester ORDER BY semester.year LIMIT 1 | advising |
CREATE TABLE table_name_58 (
format VARCHAR,
year INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the format of the album with a year less than 1992?
| SELECT format FROM table_name_58 WHERE year < 1992 | sql_create_context |
CREATE TABLE table_203_494 (
id number,
"party" text,
"votes" number,
"%" number,
"swing" number,
"seats" number,
"change" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- which party won the top place in the election ?
| SELECT "party" FROM table_203_494 ORDER BY "votes" DESC LIMIT 1 | squall |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
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,
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.expire_flag = "1" AND procedures.short_title = "Aortocor bypas-3 cor art" | mimicsql_data |
CREATE TABLE table_39397 (
"Call sign" text,
"Frequency MHz" real,
"City of license" text,
"ERP W" real,
"Class" text,
"FCC info" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the average value of ERP W in Beardstown, Illinois for a fre... | SELECT AVG("ERP W") FROM table_39397 WHERE "City of license" = 'beardstown, illinois' AND "Frequency MHz" > '93.5' | 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 jybgb.JYKSBM, jybgb.JYKSMC FROM jybgb WHERE jybgb.JZLSH = '46219280257' | css |
CREATE TABLE fare (
fare_id int,
from_airport varchar,
to_airport varchar,
fare_basis_code text,
fare_airline text,
restriction_code text,
one_direction_cost int,
round_trip_cost int,
round_trip_required varchar
)
CREATE TABLE equipment_sequence (
aircraft_code_sequence varchar,... | 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, flight, flight_stop WHERE ((((flight.arrival_time <= 2000 AND flight.arrival_time >= 1700) AND CITY_2.city_code = AIRPOR... | atis |
CREATE TABLE zyjzjlb (
YLJGDM text,
JZLSH text,
MZJZLSH text,
KH text,
KLX number,
HZXM text,
WDBZ number,
RYDJSJ time,
RYTJDM number,
RYTJMC text,
JZKSDM text,
JZKSMC text,
RZBQDM text,
RZBQMC text,
RYCWH text,
CYKSDM text,
CYKSMC text,
CYBQDM tex... | (SELECT mzjzjlb.YLJGDM FROM person_info JOIN hz_info JOIN mzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX WHERE person_info.XM = '张天蓝') UNION (SELECT zyjzjlb.YLJGDM FROM person_info JOIN hz_info JOIN zyjzjlb ON person_info.RYBH = h... | css |
CREATE TABLE table_name_74 (
year INTEGER,
country VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the average year of the film from France/Hong Kong?
| SELECT AVG(year) FROM table_name_74 WHERE country = "france/hong kong" | sql_create_context |
CREATE TABLE table_45209 (
"English" text,
"Pali" text,
"Sanskrit" text,
"Chinese" text,
"Tibetan" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Pali has an English of mindfulness of breathing?
| SELECT "Pali" FROM table_45209 WHERE "English" = 'mindfulness of breathing' | wikisql |
CREATE TABLE table_name_43 (
region VARCHAR,
name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the region that the Blaine County Museum is located in?
| SELECT region FROM table_name_43 WHERE name = "blaine county museum" | sql_create_context |
CREATE TABLE table_name_64 (
replaced_by VARCHAR,
team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the replaced by for racing santander
| SELECT replaced_by FROM table_name_64 WHERE team = "racing santander" | sql_create_context |
CREATE TABLE table_41371 (
"Party" text,
"Marplan" text,
"Gallup" text,
"National Opinion Polls (NOP)" text,
"Opinion Research Centre (OPC)" text,
"Harris" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Harris, when Marplan is 1.3%
| SELECT "Harris" FROM table_41371 WHERE "Marplan" = '1.3%' | wikisql |
CREATE TABLE table_48589 (
"Date" text,
"Opponent" text,
"Score" text,
"Record" text,
"Streak" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- who is the opponent on february 8, 1990?
| SELECT "Opponent" FROM table_48589 WHERE "Date" = 'february 8, 1990' | wikisql |
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 qtb.MED_CLINIC_ID FROM qtb WHERE qtb.PERSON_ID = '11103457' AND NOT qtb.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT > 9690.79) UNION SELECT gyb.MED_CLINIC_ID FROM gyb WHERE gyb.PERSON_ID = '11103457' AND NOT gyb.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_k... | css |
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
CREATE TABLE zzmzjzjlb (
HXPLC number,
HZXM text,
JLSJ time,
JZJSSJ time,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
JZLSH number,
JZZDBM text,
JZZDSM text,
JZZTDM number,
JZZTMC text,
K... | SELECT jybgb.SHSJ FROM hz_info JOIN zzmzjzjlb JOIN jybgb 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 WHERE hz_info.RYBH = '70984037' AND jybgb.BGRQ BETWEEN '2009-08-30' AND '2012-... | css |
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.SHRGH, jyjgzbb.SHRXM FROM jyjgzbb WHERE jyjgzbb.JYZBLSH = '05952751468' | css |
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 jyjgzbb (
BGDH text,
BGRQ tim... | SELECT mzjzjlb.SG, mzjzjlb.TZ 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 = '38161352' | css |
CREATE TABLE table_14590 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the To par for t10 place and score of 72-71=143
| SELECT "To par" FROM table_14590 WHERE "Place" = 't10' AND "Score" = '72-71=143' | wikisql |
CREATE TABLE table_9612 (
"Missouri vs." text,
"Overall Record" text,
"at Columbia" text,
"at Opponent's Venue" text,
"at Neutral Site" text,
"Last 5 Meetings" text,
"Last 10 Meetings" text,
"Current Streak" text,
"During Time in Big 12" text
)
-- Using valid SQLite, answer the fol... | SELECT "at Columbia" FROM table_9612 WHERE "Last 5 Meetings" = 'ku, 4-1' | wikisql |
CREATE TABLE course_prerequisite (
pre_course_id int,
course_id int
)
CREATE TABLE jobs (
job_id int,
job_title varchar,
description varchar,
requirement varchar,
city varchar,
state varchar,
country varchar,
zip int
)
CREATE TABLE area (
course_id int,
area varchar
)
... | SELECT DISTINCT course.department, course.name, course.number, program_course.workload FROM course INNER JOIN student_record ON student_record.course_id = course.course_id INNER JOIN program_course ON program_course.course_id = course.course_id WHERE program_course.workload = (SELECT MAX(PROGRAM_COURSEalias1.workload) ... | advising |
CREATE TABLE ENROLL (
CLASS_CODE varchar(5),
STU_NUM int,
ENROLL_GRADE varchar(50)
)
CREATE TABLE PROFESSOR (
EMP_NUM int,
DEPT_CODE varchar(10),
PROF_OFFICE varchar(50),
PROF_EXTENSION varchar(4),
PROF_HIGH_DEGREE varchar(5)
)
CREATE TABLE CLASS (
CLASS_CODE varchar(5),
CRS_CO... | SELECT DEPT_CODE, SUM(CRS_CREDIT) FROM COURSE GROUP BY DEPT_CODE ORDER BY SUM(CRS_CREDIT) DESC | nvbench |
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_NM = '蒋惜玉' AND MED_SER_ORG_NO = '6783949' AND OUT_DIAG_DIS_NM LIKE '%人格障碍%' | css |
CREATE TABLE table_name_43 (
crowd INTEGER,
venue VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the average crowd size of games held at Glenferrie Oval?
| SELECT AVG(crowd) FROM table_name_43 WHERE venue = "glenferrie oval" | 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 inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
... | SELECT COUNT(*) > 0 FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 81432) AND DATETIME(microbiologyevents.charttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') | mimic_iii |
CREATE TABLE table_17276 (
"Series #" real,
"Season #" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Musical guest and song" text,
"Original air date" text,
"Production code" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- W... | SELECT "Title" FROM table_17276 WHERE "Original air date" = 'February 6, 1997' | wikisql |
CREATE TABLE table_58187 (
"Name" text,
"Years" text,
"Area" text,
"Authority" text,
"Decile" text,
"Roll" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which school has a state authority and a roll of 318?
| SELECT "Name" FROM table_58187 WHERE "Authority" = 'state' AND "Roll" = '318' | 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.gender = "F" AND demographic.days_stay > "8" | mimicsql_data |
CREATE TABLE table_65414 (
"Region" text,
"Date" text,
"Format" text,
"Label" text,
"Edition" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What kind of edition was released September 23, 2008 from the United States?
| SELECT "Edition" FROM table_65414 WHERE "Date" = 'september 23, 2008' AND "Region" = 'united states' | wikisql |
CREATE TABLE table_18325 (
"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.
-- How many times was the candidates dick gephardt (d) 81.9% lee buchschach... | SELECT COUNT("Incumbent") FROM table_18325 WHERE "Candidates" = 'Dick Gephardt (D) 81.9% Lee Buchschacher (R) 18.1%' | wikisql |
CREATE TABLE instructor (
instructor_id int,
name varchar,
uniqname varchar
)
CREATE TABLE program (
program_id int,
name varchar,
college varchar,
introduction varchar
)
CREATE TABLE jobs (
job_id int,
job_title varchar,
description varchar,
requirement varchar,
city v... | SELECT DISTINCT course.department, course.name, course.number, program_course.workload, program_course.workload FROM course, program_course WHERE program_course.category LIKE '%ULCS%' AND program_course.course_id = course.course_id AND program_course.workload = (SELECT MIN(PROGRAM_COURSEalias1.workload) FROM program_co... | advising |
CREATE TABLE table_136 (
"1921" text,
"party" text,
"Manhattan" text,
"The Bronx" text,
"Brooklyn" text,
"Queens" text,
"Richmond [Staten Is.]" text,
"Total" real,
"%" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which candidate wo... | SELECT "1921" FROM table_136 WHERE "Queens" = '88' | wikisql |
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 DOSE_FORM, SPEC FROM t_kc22 WHERE MED_CLINIC_ID = '15071328538' AND SOC_SRT_DIRE_NM = '盐酸金霉素眼膏' | css |
CREATE TABLE table_52530 (
"Round" real,
"Overall" real,
"Player" text,
"Nationality" text,
"Club team" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the name of the player picked before round 2?
| SELECT "Player" FROM table_52530 WHERE "Round" < '2' | wikisql |
CREATE TABLE table_3317 (
"No. in series" real,
"No. in season" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production code" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many episodes in the se... | SELECT COUNT("No. in season") FROM table_3317 WHERE "No. in series" = '142' | wikisql |
CREATE TABLE table_name_2 (
year INTEGER,
points INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the total years with more than 1 points?
| SELECT SUM(year) FROM table_name_2 WHERE points > 1 | sql_create_context |
CREATE TABLE table_18332845_2 (
calling_at VARCHAR,
arrival VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the calling for the 18.42 arrival time?
| SELECT calling_at FROM table_18332845_2 WHERE arrival = "18.42" | sql_create_context |
CREATE TABLE table_68762 (
"Outcome" text,
"Date" text,
"Tournament" text,
"Surface" text,
"Opponent" text,
"Score" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Tournament has a Score of 6 4, 6 4?
| SELECT "Tournament" FROM table_68762 WHERE "Score" = '6–4, 6–4' | wikisql |
CREATE TABLE table_50449 (
"Name" text,
"Country" text,
"Type" text,
"Moving from" text,
"Transfer window" text,
"Transfer fee" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the country of the player moving from belgrano with a summer t... | SELECT "Country" FROM table_50449 WHERE "Transfer window" = 'summer' AND "Moving from" = 'belgrano' | wikisql |
CREATE TABLE requirement (
requirement_id int,
requirement varchar,
college varchar
)
CREATE TABLE comment_instructor (
instructor_id int,
student_id int,
score int,
comment_text varchar
)
CREATE TABLE student_record (
student_id int,
course_id int,
semester int,
grade varc... | SELECT DISTINCT course_offering.section_number FROM course, course_offering, semester WHERE course_offering.monday = 'N' AND course.course_id = course_offering.course_id AND course.department = 'REES' AND course.number = 289 AND semester.semester = 'FA' AND semester.semester_id = course_offering.semester AND semester.y... | advising |
CREATE TABLE table_204_332 (
id number,
"administrative\narea" text,
"area\nkm2" number,
"area\nsq mi" number,
"population" number,
"administrative\ncentre" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many administrative areas have a popu... | SELECT COUNT("administrative\narea") FROM table_204_332 WHERE "population" < 500 | squall |
CREATE TABLE table_name_90 (
hometown VARCHAR,
height VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Hometown has a Height of 6-10?
| SELECT hometown FROM table_name_90 WHERE height = "6-10" | sql_create_context |
CREATE TABLE table_64249 (
"Position" text,
"Gymnast" text,
"A Score" real,
"B Score" real,
"Total" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the A score when the B score is more than 9.15 and the gymnast was in the 2nd position?
| SELECT SUM("A Score") FROM table_64249 WHERE "B Score" > '9.15' AND "Position" = '2nd' | wikisql |
CREATE TABLE Posts (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body text,
OwnerUserId number,
OwnerDisplayName text,
LastEditorUserId number,
LastEditorDisplayName text... | SELECT TagTotals.TagName, SUM(TagTotals.Count) AS Total FROM (SELECT TagSynonyms.TargetTagName AS TagName, Tags.Count FROM Tags INNER JOIN TagSynonyms ON (Tags.TagName = TagSynonyms.SourceTagName) UNION ALL SELECT Tags.TagName, Tags.Count FROM Tags LEFT JOIN TagSynonyms ON (Tags.TagName = TagSynonyms.SourceTagName) WHE... | sede |
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time... | SELECT AVG(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 = 'ceftriaxone')) AND STRFTIME('%y', cost.charget... | eicu |
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 (SELECT labevents.valuenum FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 71558 AND admissions.dischtime IS NULL) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'potassium') ORDER BY labevents.charttim... | mimic_iii |
CREATE TABLE wdmzjzjlb (
CYBQDM text,
CYBQMC text,
CYCWH text,
CYKSDM text,
CYKSMC text,
CYSJ time,
CYZTDM number,
HZXM text,
JZKSDM text,
JZKSMC text,
JZLSH number,
KH text,
KLX number,
MZBMLX number,
MZJZLSH text,
MZZDBM text,
MZZDMC text,
MZZYZD... | SELECT wdmzjzjlb.RZBQDM, wdmzjzjlb.RZBQMC, wdmzjzjlb.RYCWH FROM wdmzjzjlb WHERE wdmzjzjlb.JZLSH = '25043466122' UNION SELECT bdmzjzjlb.RZBQDM, bdmzjzjlb.RZBQMC, bdmzjzjlb.RYCWH FROM bdmzjzjlb WHERE bdmzjzjlb.JZLSH = '25043466122' | css |
CREATE TABLE table_54600 (
"Year" real,
"Date" text,
"Type" text,
"President" text,
"Location" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the President with a Location of justus lipsius building, brussels, and a Type with scheduled, and ... | SELECT "President" FROM table_54600 WHERE "Location" = 'justus lipsius building, brussels' AND "Type" = 'scheduled' AND "Year" > '2011' AND "Date" = '18–19 october' | wikisql |
CREATE TABLE table_name_37 (
team VARCHAR,
drawn VARCHAR,
lost VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which team has 1 as the drawn, with 2 as the lost?
| SELECT team FROM table_name_37 WHERE drawn = 1 AND lost = 2 | sql_create_context |
CREATE TABLE table_23995075_2 (
teams_that_can_still_qualify VARCHAR,
teams_that_have_secured_qualification VARCHAR,
teams_started VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many teams can still qualify when there are 0 teams that have secured qu... | SELECT teams_that_can_still_qualify FROM table_23995075_2 WHERE teams_that_have_secured_qualification = "0" AND teams_started = "52" | sql_create_context |
CREATE TABLE table_204_225 (
id number,
"rank" number,
"country/territory" text,
"miss supranational" number,
"1st runner-up" number,
"2nd runner-up" number,
"3rd runner-up" number,
"4th runner-up" number,
"semifinalists" number,
"total" number
)
-- Using valid SQLite, answer t... | SELECT (SELECT "semifinalists" FROM table_204_225 WHERE "country/territory" = 'panama') - (SELECT "semifinalists" FROM table_204_225 WHERE "country/territory" = 'vietnam') | squall |
CREATE TABLE student_record (
student_id int,
course_id int,
semester int,
grade varchar,
how varchar,
transfer_source varchar,
earn_credit varchar,
repeat_term varchar,
test_id varchar
)
CREATE TABLE instructor (
instructor_id int,
name varchar,
uniqname varchar
)
CREA... | SELECT DISTINCT course.department, course.name, course.number, program_course.workload FROM course INNER JOIN student_record ON student_record.course_id = course.course_id INNER JOIN program_course ON program_course.course_id = course.course_id WHERE course.department = 'RCHUMS' AND program_course.workload = (SELECT MA... | advising |
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
)
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
)
-- Using valid SQLite, answer the following questions for the... | SELECT Headquarter, COUNT(Headquarter) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter | nvbench |
CREATE TABLE table_name_32 (
title VARCHAR,
translation VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which title has a translation in it of 1000 lies?
| SELECT title FROM table_name_32 WHERE translation = "1000 lies" | 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 jybgb.BBCJBW FROM jybgb WHERE jybgb.BGDH = '99700035543' | css |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.