instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE table_39037 ( "Result" text, "Date" text, "Race" text, "Venue" text, "Group" text, "Distance" text, "Weight (kg)" real, "Time" text, "Jockey" text, "Winner/2nd" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What gro...
SELECT "Group" FROM table_39037 WHERE "Distance" = '1200 m'
wikisql
CREATE TABLE table_31425 ( "Prefix class" text, "Type and usage" text, "Example" text, "Equivalent" text, "Reference" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is every prefix class for the equivalent of NTE160?
SELECT "Prefix class" FROM table_31425 WHERE "Equivalent" = 'NTE160'
wikisql
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.long_title = "Presence of cerebrospinal fluid drainage device" AND lab.flag = "abnormal"
mimicsql_data
CREATE TABLE table_60115 ( "Country" text, "Date" text, "Label" text, "Format" text, "Catalogue #" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the format of catalog number 886973273913 (gowow012) in the United Kingdom?
SELECT "Format" FROM table_60115 WHERE "Country" = 'united kingdom' AND "Catalogue #" = '886973273913 (gowow012)'
wikisql
CREATE TABLE table_50390 ( "Outcome" text, "Date" text, "Championship" text, "Surface" text, "Opponent in the final" text, "Score in the final" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the date of the match with arnaud di pasquale ...
SELECT "Date" FROM table_50390 WHERE "Opponent in the final" = 'arnaud di pasquale'
wikisql
CREATE TABLE table_19494 ( "Pick #" real, "NFL Team" text, "Player" text, "Position" text, "College" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what's the player with college being penn state
SELECT "Player" FROM table_19494 WHERE "College" = 'Penn State'
wikisql
CREATE TABLE table_67887 ( "City" text, "Province/Region" text, "Country" text, "IATA" text, "ICAO" text, "Airport" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the ICAO of Nakashibetsu?
SELECT "ICAO" FROM table_67887 WHERE "City" = 'nakashibetsu'
wikisql
CREATE TABLE table_22875 ( "Outcome" text, "Year" real, "Championship" text, "Surface" text, "Partner" text, "Opponents in the final" text, "Score in the final" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- state the number of surface where...
SELECT COUNT("Surface") FROM table_22875 WHERE "Championship" = 'Australian Open' AND "Score in the final" = '6–3, 4–6, 11–9'
wikisql
CREATE TABLE table_1463383_1 ( left_bloc VARCHAR, social_democratic VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many percentages of Left Bloc correspond to a 32.1% Social Democratic?
SELECT COUNT(left_bloc) FROM table_1463383_1 WHERE social_democratic = "32.1%"
sql_create_context
CREATE TABLE ship ( ship_id number, name text, type text, built_year number, class text, flag text ) CREATE TABLE captain ( captain_id number, name text, ship_id number, age text, class text, rank text ) -- Using valid SQLite, answer the following questions for the tab...
SELECT name, type, flag FROM ship ORDER BY built_year DESC LIMIT 1
spider
CREATE TABLE table_56050 ( "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. -- On what date was there a competition in which the home team ...
SELECT "Date" FROM table_56050 WHERE "Home" = 'suns'
wikisql
CREATE TABLE mzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH text, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, KH text, KLX number, MJZH text, ML number, MZZYZDZZBM text, MZZYZDZZMC ...
SELECT AVG(jyjgzbb.JCZBJGDL), MIN(jyjgzbb.JCZBJGDL), MAX(jyjgzbb.JCZBJGDL) FROM mzjzjlb JOIN jyjgzbb ON mzjzjlb.YLJGDM = jyjgzbb.jybgb_YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jyjgzbb.jybgb_JZLSH_MZJZJLB WHERE mzjzjlb.JZZDBM = 'H19.777' AND jyjgzbb.JCZBMC = '促甲状腺激素'
css
CREATE TABLE table_10696 ( "Party" text, "1999 Election" real, "2003 Election" real, "2007 Election" real, "May 2010" real, "2011 Election" real, "May 2012" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total of the 2003 electio...
SELECT SUM("2003 Election") FROM table_10696 WHERE "May 2010" = '5' AND "1999 Election" < '6'
wikisql
CREATE TABLE table_204_538 ( id number, "pos." number, "driver" text, "co-driver" text, "car" text, "time" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- who finished sooner , freitas or camacho ?
SELECT "driver" FROM table_204_538 WHERE "driver" IN ('filipe freitas', 'jose camacho') ORDER BY "pos." LIMIT 1
squall
CREATE TABLE jyjgzbb ( JYZBLSH text, YLJGDM text, BGDH text, BGRQ time, JYRQ time, JCRGH text, JCRXM text, SHRGH text, SHRXM text, JCXMMC text, JCZBDM text, JCFF text, JCZBMC text, JCZBJGDX text, JCZBJGDL number, JCZBJGDW text, SBBM text, YQBH text...
(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_38746 ( "Round" real, "Player" text, "Position" text, "Nationality" text, "College/Junior/Club Team (League)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What College team has 8 rounds?
SELECT "College/Junior/Club Team (League)" FROM table_38746 WHERE "Round" = '8'
wikisql
CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text ) CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE ReviewTaskResultTypes ( Id number, Name text, Description...
WITH cte AS (SELECT Id, NTILE(100) OVER (ORDER BY LENGTH(Body)) AS percentile FROM Posts WHERE PostTypeId = 1) SELECT cte.percentile, MIN(LENGTH(p.Body)) AS LengthStart, MAX(LENGTH(p.Body)) AS LengthStop, AVG(p.Score) AS avgScore, AVG(p.AnswerCount) AS AvgAnswerCount, AVG(p.ViewCount) AS AvgViewCount, AVG(p.CommentCoun...
sede
CREATE TABLE customer ( cust_ID varchar(3), cust_name varchar(20), acc_type char(1), acc_bal int, no_of_loans int, credit_score int, branch_ID int, state varchar(20) ) CREATE TABLE loan ( loan_ID varchar(3), loan_type varchar(15), cust_ID varchar(3), branch_ID varchar(3)...
SELECT bname, SUM(amount) FROM bank AS T1 JOIN loan AS T2 ON T1.branch_ID = T2.branch_ID GROUP BY T1.bname ORDER BY bname
nvbench
CREATE TABLE table_60712 ( "Rank" real, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total number of bronzes that is less than 1 in total?
SELECT COUNT("Bronze") FROM table_60712 WHERE "Total" < '1'
wikisql
CREATE TABLE Student_Addresses ( student_id INTEGER, address_id INTEGER, date_address_from DATETIME, date_address_to DATETIME, monthly_rental DECIMAL(19,4), other_details VARCHAR(255) ) CREATE TABLE Addresses ( address_id INTEGER, line_1 VARCHAR(120), line_2 VARCHAR(120), line_3...
SELECT other_details, SUM(monthly_rental) FROM Student_Addresses GROUP BY other_details ORDER BY monthly_rental DESC
nvbench
CREATE TABLE table_name_31 ( pinnacle_height VARCHAR, name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Pinnacle height of chimney of orot rabin?
SELECT pinnacle_height FROM table_name_31 WHERE name = "chimney of orot rabin"
sql_create_context
CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, valuenum number, valueuom te...
SELECT t1.drug FROM (SELECT prescriptions.drug, COUNT(prescriptions.startdate) AS c1 FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 30171 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1) GROUP BY prescriptions.drug) A...
mimic_iii
CREATE TABLE table_68389 ( "Player" text, "Country" text, "Year(s) won" text, "Total" real, "To par" text, "Finish" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- The To par of +14 was won in what year(s)?
SELECT "Year(s) won" FROM table_68389 WHERE "To par" = '+14'
wikisql
CREATE TABLE table_71636 ( "Club" text, "Played" 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 following questions f...
SELECT "Lost" FROM table_71636 WHERE "Points" = '47'
wikisql
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE vitalperiodi...
SELECT lab.labresult FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '002-41152')) AND lab.labname = 'creatinine' AND DATETIME(lab.labresulttime, 'start of m...
eicu
CREATE TABLE table_1666 ( "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 is...
SELECT MIN("Game") FROM table_1666 WHERE "Team" = 'Houston'
wikisql
CREATE TABLE table_13867 ( "Date" text, "Season" text, "Playing for" text, "Opponent" text, "Final score" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the final score when the opponent is platense?
SELECT "Final score" FROM table_13867 WHERE "Opponent" = 'platense'
wikisql
CREATE TABLE mzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH text, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, KH text, KLX number, MJZH text, ML number, MZZYZDZZBM text, MZZYZDZZMC ...
SELECT mzjzjlb.JZZTDM, mzjzjlb.JZZTMC FROM mzjzjlb WHERE mzjzjlb.JZLSH = '34349699182'
css
CREATE TABLE table_204_573 ( id number, "#" number, "title" text, "performer(s)" text, "film" text, "length" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many songs are more than four minutes long ?
SELECT COUNT("title") FROM table_204_573 WHERE "length" >= 4
squall
CREATE TABLE table_79841 ( "Title" text, "Album" text, "Country" text, "Peak position" real, "Weeks on chart" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the title of the single with the peak position of 10 and weeks on chart is less than...
SELECT "Title" FROM table_79841 WHERE "Peak position" = '10' AND "Weeks on chart" < '19'
wikisql
CREATE TABLE table_30717 ( "First air date" text, "Reward" text, "Immunity" text, "Eliminated" text, "Vote" text, "Finish" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the vote number when immunity listed as David and reward is listed ...
SELECT "Vote" FROM table_30717 WHERE "Immunity" = 'David' AND "Reward" = 'None'
wikisql
CREATE TABLE table_278229_1 ( no_of_counties INTEGER, commandery VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When yidu is the commandery what is the lowest number of countries?
SELECT MIN(no_of_counties) FROM table_278229_1 WHERE commandery = "Yidu 宜都"
sql_create_context
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 INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.insurance = "Medicare" AND procedures.short_title = "Opn/oth rep aort vlv-tis"
mimicsql_data
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime t...
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 = '006-133605')) AND NOT vitalperiodic.systemicdiastol...
eicu
CREATE TABLE table_27033 ( "\u2116" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production code" text, "U.S. viewers (million)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who wrote the episode wi...
SELECT "Written by" FROM table_27033 WHERE "U.S. viewers (million)" = '8.61'
wikisql
CREATE TABLE t_kc21 ( CLINIC_ID text, CLINIC_TYPE text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, ...
SELECT COUNT(*) FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '6176731' AND t_kc21.IN_HOSP_DATE BETWEEN '2009-12-18' AND '2011-08-05' AND t_kc21.CLINIC_TYPE = '住院'
css
CREATE TABLE table_name_69 ( time VARCHAR, round VARCHAR, opponent VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the time of round 2 against Taylor Mccorriston?
SELECT time FROM table_name_69 WHERE round = "2" AND opponent = "taylor mccorriston"
sql_create_context
CREATE TABLE table_203_570 ( id number, "#" number, "title" text, "tpb isbn" text, "tpb release date" text, "tpb page number" number, "collected material" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- which collection made the top of the li...
SELECT "title" FROM table_203_570 WHERE id = 1
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(*) FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '025-44495')) AND microlab.culturesite = 'sputum, tracheal specimen' AND DATETIME(m...
eicu
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.gender = "F" AND demographic.diagnosis = "CHEST PAIN"
mimicsql_data
CREATE TABLE table_61343 ( "Name" text, "Number" real, "Position" text, "Height" text, "Year" text, "Hometown" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Guard Kerri Shields Hometown?
SELECT "Hometown" FROM table_61343 WHERE "Position" = 'guard' AND "Name" = 'kerri shields'
wikisql
CREATE TABLE table_name_41 ( score VARCHAR, game VARCHAR, record VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Score of the game earlier than 69 with a record of 4 56?
SELECT score FROM table_name_41 WHERE game < 69 AND record = "4–56"
sql_create_context
CREATE TABLE table_62320 ( "Country" text, "Builder" text, "Location" text, "Ship" text, "Class / type" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Builder, when Country is 'United Kingdom', and when Location is 'Chatham, Kent'?
SELECT "Builder" FROM table_62320 WHERE "Country" = 'united kingdom' AND "Location" = 'chatham, kent'
wikisql
CREATE TABLE icustays ( row_id number, subject_id number, hadm_id number, icustay_id number, first_careunit text, last_careunit text, first_wardid number, last_wardid number, intime time, outtime time ) CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, s...
SELECT patients.gender FROM patients WHERE patients.subject_id = 29806
mimic_iii
CREATE TABLE table_46384 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Decision" text, "Series" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Visitor has a Series of 2 1?
SELECT "Visitor" FROM table_46384 WHERE "Series" = '2 – 1'
wikisql
CREATE TABLE table_47910 ( "Reservation" text, "Location" text, "1969" real, "1979" real, "1989" real, "2000" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the 1979 number for Standing Rock Indian Reservation when the 1989 is less than ...
SELECT SUM("1979") FROM table_47910 WHERE "Reservation" = 'standing rock indian reservation' AND "1989" < '54.9'
wikisql
CREATE TABLE table_22423 ( "No. in series" text, "Title" text, "Directed By" text, "Written By" text, "air date" text, "Production code" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When 1008/1009 is the production code how many directors are ...
SELECT COUNT("Directed By") FROM table_22423 WHERE "Production code" = '1008/1009'
wikisql
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE demographic ...
SELECT demographic.gender, demographic.diagnosis FROM demographic WHERE demographic.subject_id = "1121"
mimicsql_data
CREATE TABLE table_name_21 ( lineup VARCHAR, location VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the lineup for washington dc
SELECT lineup FROM table_name_21 WHERE location = "washington dc"
sql_create_context
CREATE TABLE mzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH text, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, KH text, KLX number, MJZH text, ML number, MZZYZDZZBM text, MZZYZDZZMC ...
SELECT jyjgzbb.JYZBLSH FROM hz_info JOIN mzjzjlb JOIN zyjybgb JOIN jyjgzbb 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 AND zyjybgb.YLJGDM = jyjgzbb.YLJGDM AND zyjybgb.BGDH = jyjgzbb.BGD...
css
CREATE TABLE table_name_34 ( rank INTEGER, country VARCHAR, total VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What rank was Peru with a total greater than 3?
SELECT MAX(rank) FROM table_name_34 WHERE country = "peru" AND total > 3
sql_create_context
CREATE TABLE table_name_12 ( games INTEGER, lost INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the lowest number of games with less than 1 loss?
SELECT MIN(games) FROM table_name_12 WHERE lost < 1
sql_create_context
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 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 = '64014857'
css
CREATE TABLE table_31760 ( "Year" real, "Team" text, "Chassis" text, "Engine" text, "Rank" text, "Points" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many points did the 2005 1st place team receive?
SELECT "Points" FROM table_31760 WHERE "Year" = '2005'
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 gwyjzb.MED_CLINIC_ID FROM gwyjzb JOIN t_kc24 ON gwyjzb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE gwyjzb.PERSON_NM = '赵凯乐' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2008-08-29' AND '2016-10-19' UNION SELECT fgwyjzb.MED_CLINIC_ID FROM fgwyjzb JOIN t_kc24 ON fgwyjzb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE fgwyjzb.PER...
css
CREATE TABLE table_68693 ( "Episode #" real, "Title" text, "Part 1" text, "Part 2" text, "Part 3" text, "Part 4" text, "Part 5" text, "Part 6" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When is Part 2, when Part 4 is on December 9, 2...
SELECT "Part 2" FROM table_68693 WHERE "Part 4" = 'december 9, 2007'
wikisql
CREATE TABLE table_45690 ( "Game" real, "December" real, "Opponent" text, "Score" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the sum of December, when Game is greater than 31, and when Score is '5 - 2'?
SELECT SUM("December") FROM table_45690 WHERE "Game" > '31' AND "Score" = '5 - 2'
wikisql
CREATE TABLE pilot ( Pilot_name VARCHAR, Pilot_ID VARCHAR ) CREATE TABLE aircraft ( Model VARCHAR, Aircraft_ID VARCHAR ) CREATE TABLE pilot_record ( Aircraft_ID VARCHAR, Pilot_ID VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Show the names...
SELECT T3.Pilot_name, T2.Model FROM pilot_record AS T1 JOIN aircraft AS T2 ON T1.Aircraft_ID = T2.Aircraft_ID JOIN pilot AS T3 ON T1.Pilot_ID = T3.Pilot_ID
sql_create_context
CREATE TABLE EMPLOYEE ( city VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many distinct cities does the employees live in?
SELECT COUNT(DISTINCT city) FROM EMPLOYEE
sql_create_context
CREATE TABLE status ( station_id INTEGER, bikes_available INTEGER, docks_available INTEGER, time TEXT ) CREATE TABLE trip ( id INTEGER, duration INTEGER, start_date TEXT, start_station_name TEXT, start_station_id INTEGER, end_date TEXT, end_station_name TEXT, end_station...
SELECT date, AVG(mean_humidity) FROM weather ORDER BY max_gust_speed_mph DESC LIMIT 3
nvbench
CREATE TABLE table_30108346_1 ( country VARCHAR, troops_per_one_million_population VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the country for troops per one million being 54.9
SELECT country FROM table_30108346_1 WHERE troops_per_one_million_population = "54.9"
sql_create_context
CREATE TABLE submission ( Submission_ID int, Scores real, Author text, College text ) CREATE TABLE Acceptance ( Submission_ID int, Workshop_ID int, Result text ) CREATE TABLE workshop ( Workshop_ID int, Date text, Venue text, Name text ) -- Using valid SQLite, answer the ...
SELECT Venue, COUNT(Venue) FROM workshop GROUP BY Venue ORDER BY Venue
nvbench
CREATE TABLE table_29356 ( "Episode No. Episode No. refers to the episodes number in the overall series, whereas Series No. refers to the episodes number in this particular series." real, "Series No." real, "Episode" text, "Director" text, "Writer" text, "Original airdate" text ) -- Using vali...
SELECT "Episode No. Episode No. refers to the episodes number in the overall series, whereas Series No. refers to the episodes number in this particular series." FROM table_29356 WHERE "Series No." = '3'
wikisql
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 jybgb.KSBM, jybgb.KSMC FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE person_info.XM = '...
css
CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE FlagTypes ( Id number, Name text, Description text ) CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate t...
SELECT COUNT(Id) FROM Users WHERE Reputation >= 10000
sede
CREATE TABLE table_53492 ( "Pick" real, "Round" text, "Player" text, "Position" text, "School" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was Rudy Harris' pick number in round 4?
SELECT MAX("Pick") FROM table_53492 WHERE "Round" = 'round 4' AND "Player" = 'rudy harris'
wikisql
CREATE TABLE table_39089 ( "Election" real, "Labour" real, "Conservative" real, "Liberal" real, "Social Democratic Party" real, "Social and Liberal Democrats/ Liberal Democrats" real, "Independent" real, "Green" real, "Other" text, "Control" text ) -- Using valid SQLite, answer...
SELECT "Other" FROM table_39089 WHERE "Green" = '0' AND "Independent" = '1' AND "Labour" < '45' AND "Control" = 'labour lose to no overall control'
wikisql
CREATE TABLE table_7473 ( "Region" text, "Date" text, "Label" text, "Format" text, "Catalog" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the label for the catalog of none, and is in the United Kingdom?
SELECT "Label" FROM table_7473 WHERE "Catalog" = 'none' AND "Region" = 'united kingdom'
wikisql
CREATE TABLE table_name_9 ( visitor VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the visitor on March 27?
SELECT visitor FROM table_name_9 WHERE date = "march 27"
sql_create_context
CREATE TABLE table_43963 ( "Bank type" text, "Number of branches" real, "On-site ATMs" real, "Off-site ATMs" real, "Total ATMs" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the minimum total ATMs with new private sector banks as the bank t...
SELECT MIN("Total ATMs") FROM table_43963 WHERE "Bank type" = 'new private sector banks' AND "On-site ATMs" > '1883'
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 = "DIVORCED" AND demographic.admityear < "2121"
mimicsql_data
CREATE TABLE jybgb_jyjgzbb ( JYZBLSH number, YLJGDM text, jyjgzbb_id number ) CREATE TABLE mzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH text, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, ...
SELECT jybgb.SHSJ FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE person_info.XM = '奚白云' AND jybg...
css
CREATE TABLE fare_basis ( fare_basis_code text, booking_class text, class_type text, premium text, economy text, discounted text, night text, season text, basis_days text ) CREATE TABLE flight_leg ( flight_id int, leg_number int, leg_flight int ) CREATE TABLE equipment_...
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 ((((flight.arrival_time <= 1715 AND flight.arrival_time >= 1645) AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'OAKLAND' AND flight.t...
atis
CREATE TABLE table_19926 ( "Series Ep." text, "Episode" real, "Netflix" text, "Segment A" text, "Segment B" text, "Segment C" text, "Segment D" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the first episode with a netflix episode c...
SELECT MIN("Episode") FROM table_19926 WHERE "Netflix" = 'S02E20'
wikisql
CREATE TABLE table_49785 ( "Rank" real, "Name" text, "Team" text, "Games" real, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many points are there for rank 5 with more than 34 games?
SELECT COUNT("Points") FROM table_49785 WHERE "Rank" = '5' AND "Games" > '34'
wikisql
CREATE TABLE employee ( employeeid number, lastname text, firstname text, title text, reportsto number, birthdate time, hiredate time, address text, city text, state text, country text, postalcode text, phone text, fax text, email text ) CREATE TABLE playlist...
SELECT COUNT(*) FROM mediatype AS T1 JOIN track AS T2 ON T1.mediatypeid = T2.mediatypeid WHERE T1.name = "AAC audio file"
spider
CREATE TABLE table_29093 ( "Series #" real, "Season #" real, "Title" text, "Director" text, "Writer" text, "Original Airdate" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is the director where title is 'the comeback'?
SELECT "Director" FROM table_29093 WHERE "Title" = 'The Comeback'
wikisql
CREATE TABLE table_25318033_1 ( races VARCHAR, points VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which races have 137 points?
SELECT races FROM table_25318033_1 WHERE points = "137"
sql_create_context
CREATE TABLE jybgb ( YLJGDM text, YLJGDM_MZJZJLB text, YLJGDM_ZYJZJLB text, BGDH text, BGRQ time, JYLX number, JZLSH text, JZLSH_MZJZJLB text, JZLSH_ZYJZJLB text, JZLX number, KSBM text, KSMC text, SQRGH text, SQRXM text, BGRGH text, BGRXM text, SHRGH ...
(SELECT jyjgzbb.JCRGH, jyjgzbb.JCRXM FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb ON 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 = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb...
css
CREATE TABLE table_49494 ( "Issued" real, "Type" text, "Design" text, "Serial format" text, "Serials issued" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the issued serial for yellow on blue design issued in 1955?
SELECT "Serials issued" FROM table_49494 WHERE "Design" = 'yellow on blue' AND "Issued" = '1955'
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 MED_CLINIC_ID FROM t_kc21 WHERE PERSON_NM = '褚莹华' AND MED_SER_ORG_NO = '9536805' AND NOT OUT_DIAG_DIS_NM LIKE '%胃肠炎%'
css
CREATE TABLE table_36181 ( "Games" real, "Drawn" real, "Lost" real, "Points difference" text, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many games have more than 10 points and more than 2 draws?
SELECT COUNT("Games") FROM table_36181 WHERE "Points" = '10' AND "Drawn" > '2'
wikisql
CREATE TABLE table_name_27 ( away_team VARCHAR, home_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the score of the away team that played richmond?
SELECT away_team AS score FROM table_name_27 WHERE home_team = "richmond"
sql_create_context
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 T2.Founder, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Founder
nvbench
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 t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM, t_kc22.QTY, t_kc22.UNIVALENT, t_kc22.AMOUNT FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.PERSON_NM = '陈恬美' AND t_kc21.IN_HOSP_DATE BETWEEN '2003-11-22' AND '2014-07-17'
css
CREATE TABLE student ( student_id int, lastname varchar, firstname varchar, program_id int, declare_major varchar, total_credit int, total_gpa float, entered_as varchar, admit_term int, predicted_graduation_semester int, degree varchar, minor varchar, internship varch...
SELECT DISTINCT course.department, course.name, course.number FROM course, program_course WHERE course.department LIKE '%CHEM%' AND program_course.category LIKE 'PreMajor' AND program_course.course_id = course.course_id
advising
CREATE TABLE table_57909 ( "Year" real, "Title" text, "Original channel" text, "Role" text, "Note" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the original channel when the year is after 2012?
SELECT "Original channel" FROM table_57909 WHERE "Year" > '2012'
wikisql
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.diagnosis = "ST ELEVATED MYOCARDIAL INFARCTION\CARDIAC CATH" AND lab.fluid = "Joint Fluid"
mimicsql_data
CREATE TABLE table_27042 ( "\u2116" real, "#" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production code" text, "U.S. viewers (million)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is th...
SELECT MAX("#") FROM table_27042 WHERE "Written by" = 'Matthew Pitts'
wikisql
CREATE TABLE table_name_49 ( place VARCHAR, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What Place has a Player of bernhard langer?
SELECT place FROM table_name_49 WHERE player = "bernhard langer"
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 INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.marital_status = "MARRIED" AND diagnoses.short_title = "DMII hprosmlr uncontrold"
mimicsql_data
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number...
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 = '004-32407')) AND NOT vitalperiodic.heartrate IS NUL...
eicu
CREATE TABLE table_name_66 ( bronze INTEGER, gold VARCHAR, rank VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many bronzes for nations with over 22 golds and ranked under 2?
SELECT MAX(bronze) FROM table_name_66 WHERE gold > 22 AND rank < 2
sql_create_context
CREATE TABLE table_name_38 ( third_vice_president VARCHAR, inaugurated VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Third Vice President, when Inaugurated is '15 March 1934'?
SELECT third_vice_president FROM table_name_38 WHERE inaugurated = "15 march 1934"
sql_create_context
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 inputevents_cv ( row_id number, subject_id number, hadm_id numbe...
SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', inputevents_cv.charttime)) FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 10855) AND icustays.outtime IS NULL) ...
mimic_iii
CREATE TABLE table_35709 ( "Source" text, "Date" text, "Fidesz" text, "MSZP" text, "SZDSZ" text, "Jobbik" text, "others" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Jobbik percentage with a Fidesz of 61% and others of 2%?
SELECT "Jobbik" FROM table_35709 WHERE "Fidesz" = '61%' AND "others" = '2%'
wikisql
CREATE TABLE table_name_1 ( finish VARCHAR, qual VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the finish which has qual of 144.817
SELECT finish FROM table_name_1 WHERE qual = "144.817"
sql_create_context
CREATE TABLE table_204_15 ( id number, "year" number, "date" text, "venue" text, "city" text, "country" text, "notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many times was a conference held in san francisco ?
SELECT COUNT(*) FROM table_204_15 WHERE "city" = 'san francisco'
squall
CREATE TABLE table_16388478_2 ( home_team VARCHAR, ground VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What were the home team scores at york park?
SELECT home_team AS score FROM table_16388478_2 WHERE ground = "York Park"
sql_create_context
CREATE TABLE authors ( authid number, lname text, fname text ) CREATE TABLE authorship ( authid number, instid number, paperid number, authorder number ) CREATE TABLE papers ( paperid number, title text ) CREATE TABLE inst ( instid number, name text, country text ) -...
SELECT DISTINCT t1.fname, t1.lname FROM authors AS t1 JOIN authorship AS t2 ON t1.authid = t2.authid JOIN inst AS t3 ON t2.instid = t3.instid WHERE t3.name = "Google"
spider