instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE table_name_89 ( country VARCHAR, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What country is player mike sullivan from?
SELECT country FROM table_name_89 WHERE player = "mike sullivan"
sql_create_context
CREATE TABLE paperkeyphrase ( paperid int, keyphraseid int ) CREATE TABLE cite ( citingpaperid int, citedpaperid int ) CREATE TABLE author ( authorid int, authorname varchar ) CREATE TABLE field ( fieldid int ) CREATE TABLE dataset ( datasetid int, datasetname varchar ) CREATE T...
SELECT DISTINCT COUNT(paper.paperid), writes.authorid FROM paper, venue, writes WHERE venue.venueid = paper.venueid AND venue.venuename = 'ACL' AND writes.paperid = paper.paperid GROUP BY writes.authorid
scholar
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id...
SELECT MAX(demographic.days_stay) FROM demographic WHERE demographic.dob_year > "2060"
mimicsql_data
CREATE TABLE table_23250 ( "Rank" real, "Couple" text, "Judges" real, "Public" real, "Total" real, "Vote percentage" text, "Result" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When 8 is the public and the result is safe what is the highes...
SELECT MAX("Rank") FROM table_23250 WHERE "Result" = 'Safe' AND "Public" = '8'
wikisql
CREATE TABLE table_36991 ( "Distance" text, "Event" text, "Record" text, "Nationality" text, "Year" real, "Location" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the distance in 1997?
SELECT "Distance" FROM table_36991 WHERE "Year" = '1997'
wikisql
CREATE TABLE table_29521180_35 ( round_of_16 VARCHAR, athlete VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the round of 16 result for felipe saucedo?
SELECT round_of_16 FROM table_29521180_35 WHERE athlete = "Felipe Saucedo"
sql_create_context
CREATE TABLE table_69428 ( "7:00" text, "7:30" text, "8:00" text, "8:30" text, "9:00" text, "9:30" text, "10:00" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the 10:00 feature with 1 vs. 100 at 8:30?
SELECT "10:00" FROM table_69428 WHERE "8:30" = '1 vs. 100'
wikisql
CREATE TABLE table_1061075_1 ( competition VARCHAR, aggregate VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what's the competition where aggregate is 4 7
SELECT competition FROM table_1061075_1 WHERE aggregate = "4–7"
sql_create_context
CREATE TABLE table_name_24 ( lane INTEGER, overall_rank VARCHAR, time VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the greatest lane with an overall rank of 79 and a time larger than 26.1?
SELECT MAX(lane) FROM table_name_24 WHERE overall_rank = "79" AND time > 26.1
sql_create_context
CREATE TABLE t_kc21 ( MED_CLINIC_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, COMP_ID text, PERSON_ID text, PERSON_NM text, IDENTITY_CARD text, SOC_SRT_CARD text, PERSON_SEX number, PERSON_AGE number, IN_HOSP_DATE time, OUT_HOSP_DATE time, DIFF_PLACE_FLG numb...
SELECT OUT_HOSP_DATE FROM t_kc21 WHERE MED_CLINIC_ID = '37631577362'
css
CREATE TABLE table_44881 ( "Hanyu" text, "Tongyong" text, "Pe\u030dh-\u014de-j\u012b" text, "Chinese" text, "Area (km\u00b2)" real, "No. of villages" real, "Population (2010)" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Where in Tongyong ...
SELECT "Tongyong" FROM table_44881 WHERE "Hanyu" = 'sanmin'
wikisql
CREATE TABLE table_2624098_1 ( english_day_name_meaning VARCHAR, old_english_day_name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the English meaning of the old English name 's turnesd g'?
SELECT english_day_name_meaning FROM table_2624098_1 WHERE old_english_day_name = "Sæturnesdæg"
sql_create_context
CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text ) CREATE TABLE PostsWithDeleted ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate ti...
SELECT a.ParentId AS "post_link", q.Tags, a.Score FROM Posts AS q LEFT OUTER JOIN Posts AS a ON q.Id = a.ParentId WHERE a.OwnerUserId = '##UserID##' AND q.Tags LIKE '%excel%' AND NOT q.Tags LIKE '%<excel>%' ORDER BY a.Score DESC
sede
CREATE TABLE table_53479 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Week has an Opponent of san francisco 49ers?
SELECT MAX("Week") FROM table_53479 WHERE "Opponent" = 'san francisco 49ers'
wikisql
CREATE TABLE table_3653 ( "Pick #" real, "Player" text, "Position" text, "Nationality" text, "NHL team" text, "College/junior/club team" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the college/junior/club team for player don barber?
SELECT "College/junior/club team" FROM table_3653 WHERE "Player" = 'Don Barber'
wikisql
CREATE TABLE table_33256 ( "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 was the size of the crowd that saw the Home...
SELECT COUNT("Crowd") FROM table_33256 WHERE "Home team score" = '11.10 (76)'
wikisql
CREATE TABLE paperdataset ( paperid int, datasetid int ) CREATE TABLE journal ( journalid int, journalname varchar ) CREATE TABLE paper ( paperid int, title varchar, venueid int, year int, numciting int, numcitedby int, journalid int ) CREATE TABLE paperfield ( fieldid...
SELECT DISTINCT WRITES_0.paperid FROM author AS AUTHOR_0, author AS AUTHOR_1, writes AS WRITES_0, writes AS WRITES_1 WHERE AUTHOR_0.authorname = 'Frank Keller' AND AUTHOR_1.authorname = 'Mirella Lapata' AND WRITES_0.authorid = AUTHOR_0.authorid AND WRITES_1.authorid = AUTHOR_1.authorid AND WRITES_1.paperid = WRITES_0.p...
scholar
CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time, drug text, dose_val...
SELECT AVG(chartevents.valuenum) FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 3242)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'sao2'...
mimic_iii
CREATE TABLE table_20584 ( "No." real, "Date" text, "Tournament" text, "Winning score" text, "To par" text, "Margin of victory" text, "Runner(s)-up" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the runner up at the Volvo Masters An...
SELECT "Runner(s)-up" FROM table_20584 WHERE "Tournament" = 'Volvo Masters Andalucia'
wikisql
CREATE TABLE table_name_20 ( airport VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which 2008 has an Airport of hurghada international airport?
SELECT AVG(2008) FROM table_name_20 WHERE airport = "hurghada international airport"
sql_create_context
CREATE TABLE table_56380 ( "Bowling figures Wickets-Runs (Overs)" text, "Bowler" text, "Versus" text, "Venue" text, "Date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What were the bowling figures for the competition at Pietermaritzburg?
SELECT "Bowling figures Wickets-Runs (Overs)" FROM table_56380 WHERE "Venue" = 'pietermaritzburg'
wikisql
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 SUM(t_kc22.AMOUNT) FROM t_kc22 JOIN mzb ON mzb.MED_ORG_DEPT_CD = t_kc22.MED_CLINIC_ID WHERE mzb.PERSON_NM = '19494267' AND t_kc22.STA_DATE BETWEEN '2006-02-17' AND '2006-06-28' AND t_kc22.MED_INV_ITEM_TYPE = '检查费'
css
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_SER_ORG_NO FROM t_kc21 WHERE PERSON_ID = '05485933' AND MED_CLINIC_ID IN (SELECT MED_CLINIC_ID FROM t_kc22 WHERE SOC_SRT_DIRE_NM = '替米沙坦片')
css
CREATE TABLE table_46962 ( "Name" text, "Premier League" real, "League Cup" real, "FA Cup" real, "Total" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average total of kenwyne jones, who has more than 10 premier leagues?
SELECT AVG("Total") FROM table_46962 WHERE "Name" = 'kenwyne jones' AND "Premier League" > '10'
wikisql
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE treatment ( ...
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 = 'albuterol-ipratropium (duoneb) inhalation solu...
eicu
CREATE TABLE entrepreneur ( Entrepreneur_ID int, People_ID int, Company text, Money_Requested real, Investor text ) CREATE TABLE people ( People_ID int, Name text, Height real, Weight real, Date_of_Birth text ) -- Using valid SQLite, answer the following questions for the tabl...
SELECT Investor, COUNT(*) FROM entrepreneur GROUP BY Investor ORDER BY COUNT(*) 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 demographic ...
SELECT demographic.diagnosis, diagnoses.short_title FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.subject_id = "8440"
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 COUNT(*) FROM (SELECT t_kc21.MED_ORG_DEPT_CD FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '8879930' GROUP BY t_kc21.MED_ORG_DEPT_CD HAVING MIN(t_kc21.IN_HOSP_DAYS) > 10) AS T
css
CREATE TABLE flight_leg ( flight_id int, leg_number int, leg_flight int ) CREATE TABLE restriction ( restriction_code text, advance_purchase int, stopovers text, saturday_stay_required text, minimum_stay int, maximum_stay int, application text, no_discounts text ) CREATE TA...
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'PITTSBURGH' AND date_day.day_number = 22 AND date_day.month_number = 3 AN...
atis
CREATE TABLE table_21892 ( "Outcome" text, "Year" real, "Championship" text, "Surface" text, "Partner" text, "Opponents" text, "Score" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- On what surface was the game played with a score of 6 4, 6 ...
SELECT "Surface" FROM table_21892 WHERE "Score" = '6–4, 6–4'
wikisql
CREATE TABLE paperkeyphrase ( paperid int, keyphraseid int ) CREATE TABLE cite ( citingpaperid int, citedpaperid int ) CREATE TABLE author ( authorid int, authorname varchar ) CREATE TABLE field ( fieldid int ) CREATE TABLE dataset ( datasetid int, datasetname varchar ) CREATE T...
SELECT DISTINCT paper.paperid FROM keyphrase, paper, paperkeyphrase WHERE keyphrase.keyphrasename = 'character recognition' AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paper.paperid = paperkeyphrase.paperid AND paper.year < 2010
scholar
CREATE TABLE table_51118 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which country has a score of 70-71-72=213?
SELECT "Country" FROM table_51118 WHERE "Score" = '70-71-72=213'
wikisql
CREATE TABLE table_name_30 ( sales_total VARCHAR, chart VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Sales Total has a Chart of oricon monthly albums chart?
SELECT sales_total FROM table_name_30 WHERE chart = "oricon monthly albums chart"
sql_create_context
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 COUNT(*) FROM t_kc21 WHERE PERSON_NM = '王芳茵' AND CLINIC_TYPE = '住院' AND MOD(MED_AMOUT, 1) = 0
css
CREATE TABLE table_name_69 ( nationality VARCHAR, school_club_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What Nationality is the Iowa State team?
SELECT nationality FROM table_name_69 WHERE school_club_team = "iowa state"
sql_create_context
CREATE TABLE table_name_31 ( year VARCHAR, result VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- In which year did he finish 11th?
SELECT COUNT(year) FROM table_name_31 WHERE result = "11th"
sql_create_context
CREATE TABLE table_2592 ( "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. -- What' the series number of ...
SELECT MIN("No. in series") FROM table_2592 WHERE "No. in season" = '13'
wikisql
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE 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.short_title = "History of tobacco use" AND lab."CATEGORY" = "Blood Gas"
mimicsql_data
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text, person_info_CSD text, person_info_CSRQ time, person_info_GJDM text, person_info_GJMC text, person_info_JGDM text, person_info_JGMC text, person_info_MZDM text, person_info_MZMC text, person_info_XBDM ...
SELECT jybgb.BGDH 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.person_info_XM = '凤英发' AND NOT jybgb.BGDH IN (SELECT jyjgzbb.BGDH FROM jyjgz...
css
CREATE TABLE table_12357 ( "Model" text, "Chassis code" text, "Production time" text, "Number built" real, "Engine" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the production time with more than 2.737 built and a 280s model?
SELECT "Production time" FROM table_12357 WHERE "Number built" > '2.737' AND "Model" = '280s'
wikisql
CREATE TABLE table_name_80 ( total INTEGER, county VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is galway county's total?
SELECT SUM(total) FROM table_name_80 WHERE county = "galway"
sql_create_context
CREATE TABLE Manufacturers ( name VARCHAR, code VARCHAR ) CREATE TABLE products ( Price INTEGER, manufacturer VARCHAR, price INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Select the names of manufacturer whose products have an average price hig...
SELECT AVG(T1.price), T2.name FROM products AS T1 JOIN Manufacturers AS T2 ON T1.manufacturer = T2.code GROUP BY T2.name HAVING AVG(T1.price) >= 150
sql_create_context
CREATE TABLE table_203_853 ( id number, "date" text, "opponent" text, "home/away" text, "field" text, "result" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what was the difference in score between the barrage and the lizards on june 2 .
SELECT ABS("result" - "result") FROM table_203_853 WHERE "date" = 'june 2'
squall
CREATE TABLE room ( roomnumber number, roomtype text, blockfloor number, blockcode number, unavailable boolean ) CREATE TABLE trained_in ( physician number, treatment number, certificationdate time, certificationexpires time ) CREATE TABLE block ( blockfloor number, blockco...
SELECT nurse FROM on_call WHERE blockfloor = 1 AND blockcode = 1
spider
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE intakeoutput ( intakeoutpu...
SELECT medication.drugstarttime FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '002-30780' AND NOT patient.hospitaldischargetime IS NULL ORDER...
eicu
CREATE TABLE time_interval ( period text, begin_time int, end_time int ) CREATE TABLE compartment_class ( compartment varchar, class_type varchar ) CREATE TABLE state ( state_code text, state_name text, country_name text ) CREATE TABLE flight ( aircraft_code_sequence text, air...
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'WASHINGTON' AND date_day.day_number = 23 AND date_day.month_number = 4 A...
atis
CREATE TABLE table_658 ( "Department" text, "Acronym" text, "Office" text, "Incumbent" text, "in Office since" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what's the acronym with department being department of finance kagawaran ng pananalapi
SELECT "Acronym" FROM table_658 WHERE "Department" = 'Department of Finance Kagawaran ng Pananalapi'
wikisql
CREATE TABLE event ( Event_ID int, Date text, Venue text, Name text, Event_Attendance int ) CREATE TABLE journalist ( journalist_ID int, Name text, Nationality text, Age text, Years_working int ) CREATE TABLE news_report ( journalist_ID int, Event_ID int, Work_Type ...
SELECT Work_Type, AVG(Years_working) FROM journalist AS t1 JOIN news_report AS t2 ON t1.journalist_ID = t2.journalist_ID GROUP BY t2.Work_Type
nvbench
CREATE TABLE table_name_23 ( semifinalists VARCHAR, finalist VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Semifinalists has a Finalist of andre agassi?
SELECT semifinalists FROM table_name_23 WHERE finalist = "andre agassi"
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 demographic.dob, demographic.language FROM demographic WHERE demographic.name = "Kurt Buczek"
mimicsql_data
CREATE TABLE table_name_16 ( name VARCHAR, rank VARCHAR, last VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who had a rank more than 48, and a last in 2005?
SELECT name FROM table_name_16 WHERE rank > 48 AND last = 2005
sql_create_context
CREATE TABLE table_22669044_9 ( high_points VARCHAR, record VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the high points 31-27
SELECT high_points FROM table_22669044_9 WHERE record = "31-27"
sql_create_context
CREATE TABLE table_76691 ( "Date" text, "Time" text, "Opponent" text, "Score" text, "Site" text, "City" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Score has a Time of 5:00pm?
SELECT "Score" FROM table_76691 WHERE "Time" = '5:00pm'
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 * FROM person_info JOIN hz_info JOIN zyjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX WHERE person_info.XM = '章雅柔' AND hz_info.YLJGDM = '0809864' AND zyjzjlb.CYKSMC LIKE '%肝胆科%'
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 zzmzjzjlb ( HXPLC number, HZX...
SELECT COUNT(*) FROM zzmzjzjlb WHERE zzmzjzjlb.JZKSBM = '07063' AND zzmzjzjlb.JZKSRQ BETWEEN '2008-11-04' AND '2016-02-25' UNION SELECT COUNT(*) FROM fzzmzjzjlb WHERE fzzmzjzjlb.JZKSBM = '07063' AND fzzmzjzjlb.JZKSRQ BETWEEN '2008-11-04' AND '2016-02-25'
css
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 zyjybgb.JYKSBM, zyjybgb.JYKSMC FROM zyjybgb WHERE zyjybgb.BGDH = '49398353012' UNION SELECT mzjybgb.JYKSBM, mzjybgb.JYKSMC FROM mzjybgb WHERE mzjybgb.BGDH = '49398353012'
css
CREATE TABLE characteristics ( characteristic_id number, characteristic_type_code text, characteristic_data_type text, characteristic_name text, other_characteristic_details text ) CREATE TABLE product_characteristics ( product_id number, characteristic_id number, product_characteristic...
SELECT COUNT(DISTINCT t3.characteristic_name) FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN characteristics AS t3 ON t2.characteristic_id = t3.characteristic_id WHERE t1.product_name = "sesame"
spider
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 COUNT(DISTINCT PERSON_ID) FROM t_kc21 WHERE IN_DIAG_DIS_NM = '酒精依赖综合征'
css
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 procedures ( ...
SELECT procedures.icd9_code, procedures.long_title FROM procedures WHERE procedures.subject_id = "813"
mimicsql_data
CREATE TABLE table_40751 ( "Rank" text, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Bronze has a Rank of 9?
SELECT COUNT("Bronze") FROM table_40751 WHERE "Rank" = '9'
wikisql
CREATE TABLE table_name_95 ( year VARCHAR, result VARCHAR, extra VARCHAR, tournament VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- In which year was the Tournament of european indoor championships played where the Extra was 800 m and the Result was ...
SELECT year FROM table_name_95 WHERE extra = "800 m" AND tournament = "european indoor championships" AND result = "2nd"
sql_create_context
CREATE TABLE table_name_63 ( driver VARCHAR, grid VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which driver had a grid of 2?
SELECT driver FROM table_name_63 WHERE grid = 2
sql_create_context
CREATE TABLE Users ( Id number, Reputation number, CreationDate time, DisplayName text, LastAccessDate time, WebsiteUrl text, Location text, AboutMe text, Views number, UpVotes number, DownVotes number, ProfileImageUrl text, EmailHash text, AccountId number ) CRE...
SELECT pt.Name, p.Id AS "post_link", 'site://suggested-edits/' + CAST(se.Id AS TEXT) AS "Suggested edit", ROUND(CAST((JULIANDAY(COALESCE(ApprovalDate, RejectionDate)) - JULIANDAY(se.CreationDate)) * 86400.0 AS INT) / 86400., 2) AS "Review time (days)" FROM SuggestedEdits AS se INNER JOIN Posts AS p ON se.PostId = p.Id ...
sede
CREATE TABLE table_40917 ( "Title" text, "Director" text, "Producer" text, "Production Cost" text, "Singapore Gross" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the producer for the film directed by 1997?
SELECT "Producer" FROM table_40917 WHERE "Director" = '1997'
wikisql
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob te...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "ANGIOEDEMA"
mimicsql_data
CREATE TABLE table_63490 ( "Rank" real, "Peak" text, "Country" text, "Island" text, "Elevation (m)" real, "Col (m)" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the rank when the elevation is 1,628, and Col (m) is larger than 0?
SELECT COUNT("Rank") FROM table_63490 WHERE "Elevation (m)" = '1,628' AND "Col (m)" > '0'
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 COUNT(*) FROM Posts WHERE OwnerUserId IN (SELECT Id FROM Users WHERE NOT Location IS NULL)
sede
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 demographic ( subject_id text, hadm_id t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.dob_year < "2060" AND procedures.long_title = "Other closed [endoscopic] biopsy of biliary duct or sphincter of Oddi"
mimicsql_data
CREATE TABLE table_22409 ( "Episode" text, "Garfield Episode 1" text, "U.S. Acres Episode" text, "Garfield Episode 2" text, "Original Airdate" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the name of episode 2 for garfield when episode 1 i...
SELECT "Garfield Episode 2" FROM table_22409 WHERE "Garfield Episode 1" = 'Suburban Jungle'
wikisql
CREATE TABLE table_name_40 ( cargo VARCHAR, ship_size VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What cargo was contained in a ship size of aframax?
SELECT cargo FROM table_name_40 WHERE ship_size = "aframax"
sql_create_context
CREATE TABLE Patient ( SSN INTEGER, Name VARCHAR(30), Address VARCHAR(30), Phone VARCHAR(30), InsuranceID INTEGER, PCP INTEGER ) CREATE TABLE Block ( BlockFloor INTEGER, BlockCode INTEGER ) CREATE TABLE Medication ( Code INTEGER, Name VARCHAR(30), Brand VARCHAR(30), Des...
SELECT T1.Name, COUNT(*) FROM Physician AS T1 JOIN Patient AS T2 ON T1.EmployeeID = T2.PCP GROUP BY T1.EmployeeID
nvbench
CREATE TABLE table_54784 ( "Round" real, "Pick" real, "Player" text, "Position" text, "Nationality" text, "Team" text, "College" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the team for pick more than 30 and position of c with round ...
SELECT "Team" FROM table_54784 WHERE "Pick" > '30' AND "Position" = 'c' AND "Round" > '4'
wikisql
CREATE TABLE table_name_18 ( frequency VARCHAR, on_air_id VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the frequency with on-air ID of 1way fm
SELECT frequency FROM table_name_18 WHERE on_air_id = "1way fm"
sql_create_context
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admityear < "2167" AND lab.label = "Reticulocyte Count, Automated"
mimicsql_data
CREATE TABLE table_30064 ( "No. in series" real, "No. in season" 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 ab...
SELECT "Title" FROM table_30064 WHERE "U.S. viewers (million)" = '2.02'
wikisql
CREATE TABLE table_1065 ( "Pos" real, "Member Association" text, "Points (total 500)" real, "Clubs" real, "Group stage" real, "Play-off" real, "AFC Cup" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many times has the points total for t...
SELECT COUNT("AFC Cup") FROM table_1065 WHERE "Points (total 500)" = '289'
wikisql
CREATE TABLE order_items ( order_id VARCHAR, product_id VARCHAR ) CREATE TABLE customers ( customer_name VARCHAR, customer_id VARCHAR ) CREATE TABLE customer_orders ( customer_id VARCHAR, order_id VARCHAR ) CREATE TABLE products ( product_id VARCHAR, product_name VARCHAR ) -- Using ...
SELECT DISTINCT T1.customer_name FROM customers AS T1 JOIN customer_orders AS T2 ON T1.customer_id = T2.customer_id JOIN order_items AS T3 ON T2.order_id = T3.order_id JOIN products AS T4 ON T3.product_id = T4.product_id WHERE T4.product_name = "keyboard"
sql_create_context
CREATE TABLE table_29090 ( "Round #" text, "Home Team" text, "Win/Loss" text, "Score" text, "Opposition" text, "Location" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the score when the opposition was West Coast in Wanganui?
SELECT "Score" FROM table_29090 WHERE "Opposition" = 'West Coast' AND "Location" = 'Wanganui'
wikisql
CREATE TABLE table_name_26 ( date VARCHAR, attendance VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When was the game that had 58,025 people in attendance?
SELECT date FROM table_name_26 WHERE attendance = "58,025"
sql_create_context
CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE VoteTypes ( Id number, Name text ) CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE TagSynonyms ( Id number, SourceTagName text, TargetTagName text, ...
SELECT Id AS "post_link", CreationDate, Score, Tags FROM Posts WHERE Tags IN ('<' + '##tag1:string##' + '><' + '##tag2:string##' + '>', '<' + '##tag2:string##' + '><' + '##tag1:string##' + '>') AND AcceptedAnswerId IS NULL ORDER BY CreationDate DESC
sede
CREATE TABLE table_5328 ( "Season" text, "Level" real, "Position" text, "Nationality" text, "Apps" real, "Goals" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Position of the Level 3 winner from Saint Kitts and Nevis?
SELECT "Position" FROM table_5328 WHERE "Level" = '3' AND "Nationality" = 'saint kitts and nevis'
wikisql
CREATE TABLE table_66240 ( "Peak" text, "Country" text, "Elevation (m)" real, "Prominence (m)" real, "Col (m)" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which country has a Col (m) of 1374?
SELECT "Country" FROM table_66240 WHERE "Col (m)" = '1374'
wikisql
CREATE TABLE table_name_38 ( total VARCHAR, silver INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How much Total has a Silver smaller than 0?
SELECT COUNT(total) FROM table_name_38 WHERE silver < 0
sql_create_context
CREATE TABLE ftxmzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH number, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, KH text, KLX number, MJZH text, ML number, MZZYZDZZBM text, MZZYZD...
SELECT * FROM person_info JOIN hz_info JOIN txmzjzjlb JOIN jybgb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = txmzjzjlb.YLJGDM AND hz_info.KH = txmzjzjlb.KH AND hz_info.KLX = txmzjzjlb.KLX AND txmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND txmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jy...
css
CREATE TABLE table_name_48 ( date VARCHAR, tie_no VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What date has 11 as the tie no.?
SELECT date FROM table_name_48 WHERE tie_no = "11"
sql_create_context
CREATE TABLE table_name_12 ( attendance VARCHAR, result VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- I want the attendance which has a result of l 49 21
SELECT attendance FROM table_name_12 WHERE result = "l 49–21"
sql_create_context
CREATE TABLE table_1226250_1 ( prothrombin_time VARCHAR, condition VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How in prothrombin affected by glanzmann's thrombasthenia.
SELECT prothrombin_time FROM table_1226250_1 WHERE condition = "Glanzmann's thrombasthenia"
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.BGDH FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN mzjzjlb_jybgb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = mzjzjlb_jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND mzjzjlb_jybgb.YLJGDM = jybgb.YLJGDM AND mzjzjlb_jybgb.BGDH ...
css
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 procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) ...
SELECT MIN(demographic.age) FROM demographic WHERE demographic.gender = "M" AND demographic.ethnicity = "BLACK/AFRICAN AMERICAN"
mimicsql_data
CREATE TABLE laptimes ( raceid number, driverid number, lap number, position number, time text, milliseconds number ) CREATE TABLE constructorstandings ( constructorstandingsid number, raceid number, constructorid number, points number, position number, positiontext text...
SELECT DISTINCT T1.forename FROM drivers AS T1 JOIN driverstandings AS T2 ON T1.driverid = T2.driverid WHERE T2.position = 1 AND T2.wins = 1
spider
CREATE TABLE employee ( emp_num number, emp_lname text, emp_fname text, emp_initial text, emp_jobcode text, emp_hiredate time, emp_dob time ) CREATE TABLE class ( class_code text, crs_code text, class_section text, class_time text, class_room text, prof_num number ) ...
SELECT COUNT(DISTINCT dept_address), school_code FROM department GROUP BY school_code
spider
CREATE TABLE table_53616 ( "Subframe #" real, "Page #" text, "Name" text, "Word #" real, "Bits" text, "Scale" text, "Signed" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is URA Index scale?
SELECT "Scale" FROM table_53616 WHERE "Name" = 'ura index'
wikisql
CREATE TABLE table_24219 ( "Department" text, "Micro (10ha)" real, "Small (100ha)" real, "Medium (500ha)" real, "Big (>500ha)" real, "Total" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which department has a small of 11370?
SELECT "Department" FROM table_24219 WHERE "Small (100ha)" = '11370'
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 INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.long_title = "Chronic obstructive asthma, unspecified" AND lab."CATEGORY" = "Hematology"
mimicsql_data
CREATE TABLE film_market_estimation ( Estimation_ID int, Low_Estimate real, High_Estimate real, Film_ID int, Type text, Market_ID int, Year int ) CREATE TABLE film ( Film_ID int, Title text, Studio text, Director text, Gross_in_dollar int ) CREATE TABLE market ( Mar...
SELECT Year, COUNT(Year) FROM film_market_estimation AS T1 JOIN market AS T2 ON T1.Market_ID = T2.Market_ID WHERE T2.Country = "Japan" ORDER BY T1.Year DESC
nvbench
CREATE TABLE table_6491 ( "Source" text, "Date" text, "GERB" text, "Attack" text, "Blue Coalition" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What GERB has an 11% Attack?
SELECT "GERB" FROM table_6491 WHERE "Attack" = '11%'
wikisql
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob te...
SELECT AVG(demographic.days_stay) FROM demographic WHERE demographic.diagnosis = "COPD EXACERBATION"
mimicsql_data
CREATE TABLE table_18491 ( "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. -- Name the minumim first elected for alvin bush
SELECT MIN("First elected") FROM table_18491 WHERE "Incumbent" = 'Alvin Bush'
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 'https://stackoverflow.com/questions/' + CAST(questions.Id AS TEXT), questions.Score, questions.ViewCount FROM Posts AS questions JOIN Posts AS answers ON answers.ParentId = questions.Id JOIN Users AS u ON u.Id = answers.OwnerUserId WHERE u.Id = 575376 AND questions.PostTypeId = 1 AND (questions.ViewCount > 3000...
sede
CREATE TABLE table_name_61 ( frequency__khz_ INTEGER, licensed_location VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the smallest frequency (kHz) that is in the location of Longview?
SELECT MIN(frequency__khz_) FROM table_name_61 WHERE licensed_location = "longview"
sql_create_context