instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE services ( service_id number, service_type_code text ) CREATE TABLE events ( event_id number, service_id number, event_details text ) CREATE TABLE participants ( participant_id number, participant_type_code text, participant_details text ) CREATE TABLE participants_in_eve...
SELECT T1.event_details FROM events AS T1 JOIN services AS T2 ON T1.service_id = T2.service_id WHERE T2.service_type_code = 'Marriage'
spider
CREATE TABLE table_10470082_5 ( no VARCHAR, _number VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many have the number 8
SELECT COUNT(no) FROM table_10470082_5 WHERE _number = 8
sql_create_context
CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid number, wardid number, admissionheight number, admissionweight number, dischargeweight number, hospitaladmittime time, ...
SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime, patient.patienthealthsystemstayid FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'delirium' AND DATETIME(diagnosis.diagnosistime) >= DATETIME(CURRENT_TIME(...
eicu
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.SG, mzjzjlb.TZ, mzjzjlb.TW, mzjzjlb.SSY, mzjzjlb.SZY, mzjzjlb.XL, mzjzjlb.HXPLC, mzjzjlb.ML FROM mzjzjlb WHERE mzjzjlb.JZLSH = '72157551077'
css
CREATE TABLE table_77437 ( "Season" text, "Points" real, "Rebounds" real, "Assists" real, "Blocks" real, "Steals" real, "Turnovers" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many blocks are there when the rebounds are fewer than 5.2...
SELECT COUNT("Blocks") FROM table_77437 WHERE "Rebounds" < '5.2'
wikisql
CREATE TABLE table_62342 ( "Rank" text, "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 average Silver, when Gold is less than 0?
SELECT AVG("Silver") FROM table_62342 WHERE "Gold" < '0'
wikisql
CREATE TABLE table_name_28 ( owner VARCHAR, name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who's the owner of Thai PBS?
SELECT owner FROM table_name_28 WHERE name = "thai pbs"
sql_create_context
CREATE TABLE table_13836704_6 ( transit_passengers VARCHAR, airport VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many transit passengers at london gatwick?
SELECT transit_passengers FROM table_13836704_6 WHERE airport = "London Gatwick"
sql_create_context
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob te...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.days_stay > "0" AND prescriptions.drug = "insulin"
mimicsql_data
CREATE TABLE table_21832 ( "Year" real, "Network" text, "Play-by-play" text, "Colour commentator(s)" text, "Sideline reporters" text, "Pregame host" text, "Pregame analysts" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who were the pregame...
SELECT "Pregame host" FROM table_21832 WHERE "Sideline reporters" = 'Steve Armitage and Brenda Irving'
wikisql
CREATE TABLE table_24638867_4 ( championship VARCHAR, partner VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What championships had a match where Natasha Zvereva played as partner?
SELECT championship FROM table_24638867_4 WHERE partner = "Natasha Zvereva"
sql_create_context
CREATE TABLE table_76874 ( "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 w...
SELECT MIN("Game") FROM table_76874 WHERE "Date" = 'november 15'
wikisql
CREATE TABLE table_1341568_34 ( party VARCHAR, incumbent VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What party did incumbent Stephen L. Neal belong to?
SELECT party FROM table_1341568_34 WHERE incumbent = "Stephen L. Neal"
sql_create_context
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob te...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.dod_year <= "2183.0" AND diagnoses.long_title = "Cerebral thrombosis with cerebral infarction"
mimicsql_data
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_kc21.IN_DIAG_DIS_CD, t_kc21.IN_DIAG_DIS_NM FROM t_kc21 WHERE t_kc21.PERSON_NM = '金清懿' AND t_kc21.IN_HOSP_DATE BETWEEN '2007-05-26' AND '2014-05-11' GROUP BY t_kc21.IN_DIAG_DIS_CD ORDER BY COUNT(*) DESC LIMIT 1
css
CREATE TABLE table_43674 ( "Position" real, "Team" text, "Played" real, "Drawn" real, "Lost" real, "Goals For" real, "Goals Against" real, "Goal Difference" text, "Points 1" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the ...
SELECT MAX("Lost") FROM table_43674 WHERE "Points 1" > '58' AND "Goals Against" = '66'
wikisql
CREATE TABLE table_1307842_7 ( gdp__billion_us$_ VARCHAR, gdp_per_capita__us$_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the gdp where gdp per capita 20200
SELECT gdp__billion_us$_ FROM table_1307842_7 WHERE gdp_per_capita__us$_ = 20200
sql_create_context
CREATE TABLE VoteTypes ( Id number, Name text ) CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE Users ( Id number, Reputation number, CreationDate time, DisplayName text, LastAc...
SELECT TagName, COUNT(Votes.Id) AS DownVotes FROM Tags INNER JOIN PostTags ON PostTags.TagId = Tags.Id INNER JOIN Posts ON Posts.ParentId = PostTags.PostId INNER JOIN Votes ON Votes.PostId = Posts.Id WHERE VoteTypeId = (SELECT Id FROM VoteTypes WHERE Name = 'DownMod') GROUP BY TagName ORDER BY DownVotes DESC
sede
CREATE TABLE mzb ( CLINIC_ID text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, INSU_TYPE text, IN...
SELECT COUNT(*) FROM (SELECT qtb.MED_ORG_DEPT_CD FROM qtb WHERE qtb.MED_SER_ORG_NO = '3731061' GROUP BY qtb.MED_ORG_DEPT_CD HAVING MAX(qtb.IN_HOSP_DAYS) < 8 UNION SELECT gyb.MED_ORG_DEPT_CD FROM gyb WHERE gyb.MED_SER_ORG_NO = '3731061' GROUP BY gyb.MED_ORG_DEPT_CD HAVING MAX(gyb.IN_HOSP_DAYS) < 8 UNION SELECT zyb.MED_O...
css
CREATE TABLE table_4897 ( "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 team is from Lake Oval?
SELECT "Home team" FROM table_4897 WHERE "Venue" = 'lake oval'
wikisql
CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE patients ( row_id n...
SELECT COUNT(*) FROM procedures_icd WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'procedure-one vessel') AND procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 62977 AND NOT admissions.disch...
mimic_iii
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 INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.short_title = "DMI keto nt st uncntrld" AND lab.flag = "delta"
mimicsql_data
CREATE TABLE table_3057 ( "Rank" real, "Player" text, "Points" real, "Points defending" real, "Points won" real, "New points" real, "Withdrew due to" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- List the rank of the player that left due to...
SELECT "Rank" FROM table_3057 WHERE "Withdrew due to" = 'right wrist surgery'
wikisql
CREATE TABLE class_of_service ( booking_class varchar, rank int, class_description text ) CREATE TABLE date_day ( month_number int, day_number int, year int, day_name varchar ) CREATE TABLE dual_carrier ( main_airline varchar, low_flight_number int, high_flight_number int, ...
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE ((CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'WASHINGTON' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'S...
atis
CREATE TABLE program ( program_id int, name varchar, college varchar, introduction varchar ) 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, admi...
SELECT DISTINCT instructor.name FROM course, course_offering, instructor, offering_instructor WHERE course.course_id = course_offering.course_id AND course.department = 'PAT' AND course.number = 331 AND offering_instructor.instructor_id = instructor.instructor_id AND offering_instructor.offering_id = course_offering.of...
advising
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 * FROM person_info JOIN hz_info JOIN wdmzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX WHERE person_info.XM = '水康成' AND hz_info.YLJGDM = '3230609' AND NOT wdmzjzjlb.JZZDSM LIKE '%张力%' UNION SELECT * FROM person_info JO...
css
CREATE TABLE table_77956 ( "Series" text, "Monday" text, "Tuesday" text, "Thursday" text, "Saturday" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Tuesday does big brother 12 air?
SELECT "Tuesday" FROM table_77956 WHERE "Series" = 'big brother 12'
wikisql
CREATE TABLE table_name_52 ( vote VARCHAR, district VARCHAR, seat VARCHAR, percentage VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many votes have a Seat of house A, and a Percentage of 75.44%, and a District smaller than 11?
SELECT COUNT(vote) FROM table_name_52 WHERE seat = "house a" AND percentage = "75.44%" AND district < 11
sql_create_context
CREATE TABLE table_13274 ( "School" text, "Location" text, "Mascot" text, "IHSAA Class" text, "County" text, "Year Joined" text, "Year Left" text, "Conference Joined" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What conference include...
SELECT "Conference Joined" FROM table_13274 WHERE "Mascot" = 'indians'
wikisql
CREATE TABLE table_50820 ( "Model number" text, "sSpec number" text, "Frequency" text, "L2 cache" text, "Mult." text, "Voltage" text, "Socket" text, "Release date" text, "Part number(s)" text, "Release price ( USD )" text ) -- Using valid SQLite, answer the following questions ...
SELECT "Release price ( USD )" FROM table_50820 WHERE "Model number" = 'atom z510pt'
wikisql
CREATE TABLE table_204_808 ( id number, "team" text, "no" number, "driver" text, "class" text, "chassis" text, "engine" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- the two drivers on t sport are clivio piccione and what other driver ?
SELECT "driver" FROM table_204_808 WHERE "driver" <> 'clivio piccione' AND "team" = 't-sport'
squall
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.YQBH, jyjgzbb.YQMC FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN hz_info_mzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND hz_info_mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb...
css
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 ta ( campus_job_id int, student_id int, location varchar ) CREATE TAB...
SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, instructor, offering_instructor WHERE course_offering.semester < (SELECT SEMESTERalias0.semester_id FROM semester AS SEMESTERalias0 WHERE SEMESTERalias0.semester = 'WN' AND SEMESTERalias0.year = 2016) AND course.course_id = cour...
advising
CREATE TABLE table_34480 ( "Game" real, "October" real, "Opponent" text, "Score" text, "Record" text, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Game has a Record of 5 3 1, and an October smaller than 29?
SELECT SUM("Game") FROM table_34480 WHERE "Record" = '5–3–1' AND "October" < '29'
wikisql
CREATE TABLE table_15582870_1 ( weight VARCHAR, college VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How heavy were the players who attended Arkansas?
SELECT weight FROM table_15582870_1 WHERE college = "Arkansas"
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 jybgb.SHSJ FROM hz_info JOIN mzjzjlb JOIN jybgb 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 WHERE hz_info.RYBH = '53577732' AND jybgb.BGRQ BETWEEN '2003-09-03' AND '2003-10-12') UNI...
css
CREATE TABLE table_name_89 ( Id VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the 2012 for 2009 of a and 2010 of a and 2011 of a
SELECT 2012 FROM table_name_89 WHERE 2009 = "a" AND 2010 = "a" AND 2011 = "a"
sql_create_context
CREATE TABLE airport_service ( city_code varchar, airport_code varchar, miles_distant int, direction varchar, minutes_distant int ) CREATE TABLE code_description ( code varchar, description text ) CREATE TABLE airport ( airport_code varchar, airport_name text, airport_location ...
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 = 'DENVER...
atis
CREATE TABLE table_74388 ( "No. in series" real, "No. in season" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production code" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the original air d...
SELECT "Original air date" FROM table_74388 WHERE "Production code" = '319'
wikisql
CREATE TABLE table_name_11 ( title VARCHAR, rank VARCHAR, worldwide_gross VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the title when the rank is less than 17 and the worldwide gross is $299,288,605?
SELECT title FROM table_name_11 WHERE rank < 17 AND worldwide_gross = "$299,288,605"
sql_create_context
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) ...
SELECT t4.diagnosisname FROM (SELECT t3.diagnosisname, DENSE_RANK() OVER (ORDER BY t3.c1 DESC) AS c2 FROM (SELECT t2.diagnosisname, 100 - SUM(CASE WHEN patient.hospitaldischargestatus = 'alive' THEN 1 WHEN STRFTIME('%j', patient.hospitaldischargetime) - STRFTIME('%j', t2.diagnosistime) > 4 * 365 THEN 1 ELSE 0 END) * 10...
eicu
CREATE TABLE table_name_11 ( venue VARCHAR, opposing_teams VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which venue was the opposing team New Zealand on 22/11/1997?
SELECT venue FROM table_name_11 WHERE opposing_teams = "new zealand" AND date = "22/11/1997"
sql_create_context
CREATE TABLE market ( Country VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- List all countries of markets in ascending alphabetical order.
SELECT Country FROM market ORDER BY Country
sql_create_context
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text,...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.ethnicity = "WHITE" AND diagnoses.short_title = "Hx of bladder malignancy"
mimicsql_data
CREATE TABLE has_allergy ( stuid number, allergy text ) CREATE TABLE allergy_type ( allergy text, allergytype text ) CREATE TABLE student ( stuid number, lname text, fname text, age number, sex text, major number, advisor number, city_code text ) -- Using valid SQLite...
SELECT allergytype, COUNT(*) FROM allergy_type GROUP BY allergytype
spider
CREATE TABLE table_name_26 ( city_of_license VARCHAR, frequency_mhz VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Tell me the city of license with frequency of Mhz of 90.3 fm
SELECT city_of_license FROM table_name_26 WHERE frequency_mhz = "90.3 fm"
sql_create_context
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) C...
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.icd9_code = "25060" AND lab.fluid = "Blood"
mimicsql_data
CREATE TABLE table_8901 ( "Consonant final stem" text, "Example: did-" text, "Vowel final stem" text, "Example: ch'aghara-" text, "Noun example: datv-" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What example for ch'aghara- is shown when the exam...
SELECT "Example: ch'aghara-" FROM table_8901 WHERE "Example: did-" = 'did-ma'
wikisql
CREATE TABLE table_27755784_10 ( team VARCHAR, high_assists VARCHAR, high_points VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the team when the high assists was stephen curry (7) and the high points was monta ellis (27)?
SELECT team FROM table_27755784_10 WHERE high_assists = "Stephen Curry (7)" AND high_points = "Monta Ellis (27)"
sql_create_context
CREATE TABLE t_kc21_t_kc24 ( MED_CLINIC_ID text, MED_SAFE_PAY_ID number ) 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...
SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_ID = '18088627' AND t_kc21.MED_SER_ORG_NO = '6281545' AND t_kc21.IN_DIAG_DIS_NM LIKE '%阿弗%'
css
CREATE TABLE table_18078 ( "Complete Series" text, "Region 1" text, "Region 2" text, "Region 4" text, "DVD Extras and Bonus Features" text, "Number Of Discs" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the region 2 for the complete fi...
SELECT "Region 2" FROM table_18078 WHERE "Complete Series" = 'The Complete Fifth Series'
wikisql
CREATE TABLE table_name_13 ( stadium VARCHAR, city VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What stadium has kutina as the city?
SELECT stadium FROM table_name_13 WHERE city = "kutina"
sql_create_context
CREATE TABLE table_46971 ( "Municipality" text, "Population" real, "Inhabitants per km\u00b2" real, "Area (in km\u00b2)" real, "Markatal" real, "Island" text, "Region" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the sum of Markata...
SELECT SUM("Markatal") FROM table_46971 WHERE "Inhabitants per km\u00b2" < '13' AND "Area (in km\u00b2)" = '27'
wikisql
CREATE TABLE wdmzjzjlb ( 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, MZZYZDZ...
SELECT COUNT(*) FROM wdmzjzjlb WHERE wdmzjzjlb.ZZYSGH = '21408957' AND wdmzjzjlb.JZKSRQ BETWEEN '2004-07-08' AND '2004-11-20' UNION SELECT COUNT(*) FROM bdmzjzjlb WHERE bdmzjzjlb.ZZYSGH = '21408957' AND bdmzjzjlb.JZKSRQ BETWEEN '2004-07-08' AND '2004-11-20'
css
CREATE TABLE fgwyjzb ( CLINIC_ID text, CLINIC_TYPE text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, ...
SELECT gwyjzb.MED_CLINIC_ID FROM gwyjzb WHERE gwyjzb.PERSON_ID = '39827509' AND gwyjzb.MED_SER_ORG_NO = '1609490' AND gwyjzb.IN_DIAG_DIS_NM LIKE '%合并%' UNION SELECT fgwyjzb.MED_CLINIC_ID FROM fgwyjzb WHERE fgwyjzb.PERSON_ID = '39827509' AND fgwyjzb.MED_SER_ORG_NO = '1609490' AND fgwyjzb.IN_DIAG_DIS_NM LIKE '%合并%'
css
CREATE TABLE table_20074 ( "Genus/Species" text, "Common Name" text, "Accession Number" text, "Length" text, "Similarity" text, "Identity" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the animals name when the genus/species is rattus no...
SELECT "Common Name" FROM table_20074 WHERE "Genus/Species" = 'Rattus norvegicus'
wikisql
CREATE TABLE table_54317 ( "PRR Class" text, "Builder\u2019s Model" text, "Build date" text, "Total produced" real, "Wheel arrangement" text, "Service" text, "Power output" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the build dat...
SELECT "Build date" FROM table_54317 WHERE "PRR Class" = 'brs24'
wikisql
CREATE TABLE table_name_88 ( score VARCHAR, losing_semifinalists VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the Score when the Losing Semifinalists were Toluca Unam?
SELECT score FROM table_name_88 WHERE losing_semifinalists = "toluca unam"
sql_create_context
CREATE TABLE table_29206 ( "City / Municipality" text, "No. of s Barangay" real, "Population (2010)" real, "Area (km\u00b2)" text, "Pop. density (per km\u00b2)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the number of barangay for 205.4 den...
SELECT "No. of s Barangay" FROM table_29206 WHERE "Pop. density (per km\u00b2)" = '205.4'
wikisql
CREATE TABLE airlines ( alid number, name text, iata text, icao text, callsign text, country text, active text ) CREATE TABLE routes ( rid number, dst_apid number, dst_ap text, src_apid number, src_ap text, alid number, airline text, codeshare text ) CREATE ...
SELECT COUNT(*) FROM routes WHERE dst_apid IN (SELECT apid FROM airports WHERE country = 'Canada') AND src_apid IN (SELECT apid FROM airports WHERE country = 'United States')
spider
CREATE TABLE table_name_60 ( college VARCHAR, team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What college has the Chicago Stags?
SELECT college FROM table_name_60 WHERE team = "chicago stags"
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 equipment_sequence ( aircraft_code_sequence varchar, aircraft_code varchar ) CREATE TABLE compartment_class ( compartment varchar, ...
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 = 'SAN FRANCISCO' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = ...
atis
CREATE TABLE table_15447 ( "Year" text, "Competition" text, "Opponent" text, "Score" text, "Venue" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the score at mcg venue and footscray opponent
SELECT "Score" FROM table_15447 WHERE "Venue" = 'mcg' AND "Opponent" = 'footscray'
wikisql
CREATE TABLE table_21092444_1 ( opponents VARCHAR, record VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the opponents for record of 2-1
SELECT opponents FROM table_21092444_1 WHERE record = "2-1"
sql_create_context
CREATE TABLE table_24207 ( "Order" real, "Couple" text, "Karen" text, "Nicky" text, "Jason" text, "Ruthie" text, "Robin" text, "Total" text, "Scoreboard" text, "Song" text, "Public Vote %" text, "Result" text ) -- Using valid SQLite, answer the following questions for t...
SELECT "Scoreboard" FROM table_24207 WHERE "Total" = '23.5'
wikisql
CREATE TABLE table_64765 ( "Rank" text, "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 least gold when the rank is 10 and silver is less than 0?
SELECT MIN("Gold") FROM table_64765 WHERE "Rank" = '10' AND "Silver" < '0'
wikisql
CREATE TABLE table_262476_3 ( founded INTEGER, institution VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When was alfred university founded?
SELECT MAX(founded) FROM table_262476_3 WHERE institution = "Alfred University"
sql_create_context
CREATE TABLE table_name_59 ( date VARCHAR, venue VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the date for the venue of brunswick street oval
SELECT date FROM table_name_59 WHERE venue = "brunswick street oval"
sql_create_context
CREATE TABLE table_36325 ( "Rank" real, "Time" real, "Athlete" text, "Nation" text, "Date" text, "Location" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Rank smaller than 5, and a Time larger than 10.7, and a Date of 10 july 2009 has what loca...
SELECT "Location" FROM table_36325 WHERE "Rank" < '5' AND "Time" > '10.7' AND "Date" = '10 july 2009'
wikisql
CREATE TABLE table_21979779_1 ( written_by VARCHAR, us_viewers__million_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- who are the writers of the episode that had 3.07 millions of North American spectators?
SELECT written_by FROM table_21979779_1 WHERE us_viewers__million_ = "3.07"
sql_create_context
CREATE TABLE table_71456 ( "Entrant" text, "Constructor" text, "Chassis" text, "Engine \u2020" text, "Tyre" text, "Driver" text, "Rounds" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which constructor makes the ej15 ej15b chassis?
SELECT "Constructor" FROM table_71456 WHERE "Chassis" = 'ej15 ej15b'
wikisql
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE diagnosis ( diagnosisid...
SELECT DISTINCT t1.c1 FROM (SELECT lab.labresult, PERCENT_RANK() OVER (ORDER BY lab.labresult) AS c1 FROM lab WHERE lab.labname = 'bun' AND lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.age = (SELECT patient.age FROM patient WHERE patient.uniquepid = '031-13920' AND patient.hospi...
eicu
CREATE TABLE table_name_34 ( earnings___ INTEGER, player VARCHAR, wins VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the lowest earnings of Vijay Singh who had more than 24 wins?
SELECT MIN(earnings___) AS $__ FROM table_name_34 WHERE player = "vijay singh" AND wins > 24
sql_create_context
CREATE TABLE table_name_8 ( place INTEGER, country VARCHAR, time VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When the United Kingdom had a time of 1:30.51.2, what was the lowest that they ranked?
SELECT MIN(place) FROM table_name_8 WHERE country = "united kingdom" AND time = "1:30.51.2"
sql_create_context
CREATE TABLE Customers ( customer_id INTEGER, customer_type_code VARCHAR(20), address_line_1 VARCHAR(80), address_line_2 VARCHAR(80), town_city VARCHAR(80), state VARCHAR(80), email_address VARCHAR(255), phone_number VARCHAR(80) ) CREATE TABLE Complaints ( complaint_id INTEGER, ...
SELECT product_category_code, AVG(product_price) FROM Products GROUP BY product_category_code ORDER BY product_category_code DESC
nvbench
CREATE TABLE table_10377 ( "Rank" text, "Name" text, "Height ft / m" text, "Floors" real, "Year" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the year for 8 rank
SELECT "Year" FROM table_10377 WHERE "Rank" = '8'
wikisql
CREATE TABLE table_name_50 ( record VARCHAR, visitor VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the record of the game where the visitor team is the Edmonton Oilers?
SELECT record FROM table_name_50 WHERE visitor = "edmonton oilers"
sql_create_context
CREATE TABLE table_63774 ( "Game" text, "Date" text, "Opponent" text, "Score" text, "Location Attendance" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When did the team have a 10-8 record?
SELECT "Date" FROM table_63774 WHERE "Record" = '10-8'
wikisql
CREATE TABLE table_name_42 ( build_date VARCHAR, total_produced VARCHAR, model VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the build date of the locomotives with a total produced less than 45 and a fb-2 model?
SELECT build_date FROM table_name_42 WHERE total_produced < 45 AND model = "fb-2"
sql_create_context
CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE prescriptions ( ...
SELECT COUNT(*) FROM prescriptions WHERE prescriptions.drug = 'nicardipine hcl iv' AND DATETIME(prescriptions.startdate) <= DATETIME(CURRENT_TIME(), '-4 year')
mimic_iii
CREATE TABLE table_name_11 ( venue VARCHAR, competition VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which venue hosted the 2004 AFC Asian Cup qualification on November 18, 2003?
SELECT venue FROM table_name_11 WHERE competition = "2004 afc asian cup qualification" AND date = "november 18, 2003"
sql_create_context
CREATE TABLE table_25235489_2 ( august_21_22 VARCHAR, march_27_29 VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many numbers are there for August when March is 139?
SELECT COUNT(august_21_22) FROM table_25235489_2 WHERE march_27_29 = "139"
sql_create_context
CREATE TABLE table_6063 ( "Year" text, "League" text, "Season" text, "Play-Off" text, "Baltic" text, "Events" text, "European" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which League that has no playoffs in the Year of 2008 09?
SELECT "League" FROM table_6063 WHERE "Play-Off" = '–' AND "Year" = '2008–09'
wikisql
CREATE TABLE table_5093 ( "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 was the score for the game against the New Jersey Nets?
SELECT "Score" FROM table_5093 WHERE "Opponent" = 'new jersey nets'
wikisql
CREATE TABLE table_66977 ( "Date" text, "Season" text, "Playing for" text, "Opponent" text, "Final score" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- In what Season is Necaxa an Opponent?
SELECT "Season" FROM table_66977 WHERE "Opponent" = 'necaxa'
wikisql
CREATE TABLE table_name_26 ( oil_pattern VARCHAR, runner_up VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the oil pattern for runner-up Pete Weber?
SELECT oil_pattern FROM table_name_26 WHERE runner_up = "pete weber"
sql_create_context
CREATE TABLE table_14345690_4 ( celebrity VARCHAR, famous_for VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the number of celebrity for athlete
SELECT COUNT(celebrity) FROM table_14345690_4 WHERE famous_for = "Athlete"
sql_create_context
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 MIN(demographic.age) FROM demographic WHERE demographic.marital_status = "WIDOWED" AND demographic.days_stay = "30"
mimicsql_data
CREATE TABLE table_21550897_1 ( original_air_date VARCHAR, _number VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many times did episode 6 originally air?
SELECT COUNT(original_air_date) FROM table_21550897_1 WHERE _number = 6
sql_create_context
CREATE TABLE table_27208311_1 ( episode VARCHAR, writer VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is every episode with Barry Purchese as the writer?
SELECT episode FROM table_27208311_1 WHERE writer = "Barry Purchese"
sql_create_context
CREATE TABLE table_62025 ( "Year" real, "Average" text, "High" real, "Sellouts" real, "Total for year" real, "WNBA game average" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total for year average that less than 7,742 is the WNBA g...
SELECT AVG("Total for year") FROM table_62025 WHERE "WNBA game average" < '7,742' AND "Average" = '7,625 (10th)' AND "Year" < '1999'
wikisql
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 Name, MIN(Price) FROM Products GROUP BY Name ORDER BY Name
nvbench
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, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE demographic (...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE prescriptions.formulary_drug_cd = "MICA100I" AND lab.fluid = "Pleural"
mimicsql_data
CREATE TABLE table_name_59 ( speed VARCHAR, rank VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- WHich Speed has a Rank of 2?
SELECT speed FROM table_name_59 WHERE rank = 2
sql_create_context
CREATE TABLE table_1749567_2 ( location VARCHAR, average_climb___percentage_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which race had an average climb of 40%?
SELECT location FROM table_1749567_2 WHERE average_climb___percentage_ = 40
sql_create_context
CREATE TABLE table_name_35 ( mar_3 VARCHAR, poll VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which March 3 has a Poll of baseball america (top 25)?
SELECT mar_3 FROM table_name_35 WHERE poll = "baseball america (top 25)"
sql_create_context
CREATE TABLE party_services ( booking_id number, customer_id number, service_id number, service_datetime time, booking_made_date time ) CREATE TABLE party_forms ( party_id number, form_id number, date_completion_started time, form_status_code text, date_fully_completed time ) C...
SELECT organization_name FROM organizations ORDER BY date_formed
spider
CREATE TABLE table_27026 ( "Eliminated" real, "Wrestler" text, "Entered" real, "Eliminated by" text, "Method of elimination" text, "Time" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the method of elimination in the chamber with a tim...
SELECT "Method of elimination" FROM table_27026 WHERE "Time" = '24:02'
wikisql
CREATE TABLE table_2127933_3 ( score VARCHAR, opponents VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What were the scores for matches with irving wright hazel hotchkiss wightman?
SELECT score FROM table_2127933_3 WHERE opponents = "Irving Wright Hazel Hotchkiss Wightman"
sql_create_context
CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Percent text, ACC_Home text, ACC_Road text, All_Games text, All_Games_Percent int, All_Home text, All_Road text, All_Neutral text ) CREATE TABLE university ( Scho...
SELECT All_Home, School_ID FROM basketball_match GROUP BY ACC_Home, All_Home
nvbench