instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE table_32433 ( "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. -- Which team has a home field at Glenferrie Oval?
SELECT "Home team" FROM table_32433 WHERE "Venue" = 'glenferrie oval'
wikisql
CREATE TABLE table_8365 ( "Game" real, "Date" text, "Opponent" text, "Score" text, "Location/Attendance" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Record, when Date is 'March 1'?
SELECT "Record" FROM table_8365 WHERE "Date" = 'march 1'
wikisql
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetake...
SELECT AVG(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 = '027-82318')) AND lab.labname = 'cpk-mb index'
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 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_20317 ( "Series #" real, "Season #" real, "Title" text, "Directed by:" text, "Written by:" text, "Original air date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the title of the first episode of the season that begi...
SELECT "Title" FROM table_20317 WHERE "Original air date" = 'February 27, 1954'
wikisql
CREATE TABLE hz_info_zyjzjlb ( JZLSH number, YLJGDM number, zyjzjlb_id number ) 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 tim...
SELECT zyjzjlb.JZKSDM, zyjzjlb.JZKSMC FROM zyjzjlb WHERE zyjzjlb.JZLSH = '77388683029'
css
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 zyb WHERE zyb.PERSON_SEX = '华芷若' AND MOD(zyb.MED_CLINIC_ID, 1) = 0
css
CREATE TABLE table_30849 ( "Series" real, "Premiere" text, "Finale" text, "Runners-up" text, "Winner" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the date when Miranda Gore Browne was runner-up?
SELECT "Finale" FROM table_30849 WHERE "Runners-up" = 'Miranda Gore Browne'
wikisql
CREATE TABLE t_kc22 ( AMOUNT number, CHA_ITEM_LEV number, DATA_ID text, DIRE_TYPE number, DOSE_FORM text, DOSE_UNIT text, EACH_DOSAGE text, EXP_OCC_DATE time, FLX_MED_ORG_ID text, FXBZ number, HOSP_DOC_CD text, HOSP_DOC_NM text, MED_CLINIC_ID text, MED_DIRE_CD tex...
SELECT t_kc21.OUT_DIAG_DIS_CD, t_kc21.OUT_DIAG_DIS_NM FROM t_kc21 WHERE t_kc21.PERSON_ID = '63645719' AND t_kc21.MED_SER_ORG_NO = '7473839' AND t_kc21.OUT_DIAG_DOC_NM LIKE '柏%'
css
CREATE TABLE table_40914 ( "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 director for the film produced by River Films?
SELECT "Director" FROM table_40914 WHERE "Producer" = 'river films'
wikisql
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 prescriptions ( subject_id text, hadm_id...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.age < "50" AND diagnoses.long_title = "Acute vascular insufficiency of intestine"
mimicsql_data
CREATE TABLE table_8401 ( "Brigade" text, "Staffing" text, "Type" text, "Location" text, "Pumpers" real, "Tankers" real, "Telebooms" text, "Platforms" text, "Cars" text, "Hazmat" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How...
SELECT COUNT("Pumpers") FROM table_8401 WHERE "Cars" = '1' AND "Staffing" = 'volunteer' AND "Brigade" = 'grovedale' AND "Tankers" < '1'
wikisql
CREATE TABLE table_37040 ( "Call sign" text, "Frequency MHz" real, "City of license" text, "ERP W" real, "Class" text, "FCC info" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the least frequency Mhz with call sign of k202ag
SELECT MIN("Frequency MHz") FROM table_37040 WHERE "Call sign" = 'k202ag'
wikisql
CREATE TABLE table_14299 ( "Name A[\u203a ]" text, "Dam or A[\u203a ] Reservoir" text, "GNIS Feature ID # Link A[\u203a ] B[\u203a ]" real, "Elevation A[\u203a ]" text, "Borough or A[\u203a ] Census area" text ) -- Using valid SQLite, answer the following questions for the tables provided above. ...
SELECT MAX("GNIS Feature ID # Link A[\u203a ] B[\u203a ]") FROM table_14299 WHERE "Name A[\u203a ]" = 'upper dewey lake dam'
wikisql
CREATE TABLE fare ( fare_id int, from_airport varchar, to_airport varchar, fare_basis_code text, fare_airline text, restriction_code text, one_direction_cost int, round_trip_cost int, round_trip_required varchar ) CREATE TABLE food_service ( meal_code text, meal_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, fare, flight, flight_fare WHERE (CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'DENVER' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1....
atis
CREATE TABLE table_72802 ( "Poll Source" text, "Dates administered" text, "Democrat: John Kerry" text, "Republican: Jeff Beatty" text, "Lead Margin" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the maximum lead margin on august 5, 2008?
SELECT MAX("Lead Margin") FROM table_72802 WHERE "Dates administered" = 'August 5, 2008'
wikisql
CREATE TABLE table_name_62 ( score VARCHAR, opponents VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Tell me the score of misa eguchi eri hozumi
SELECT score FROM table_name_62 WHERE opponents = "misa eguchi eri hozumi"
sql_create_context
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE procedures ( ...
SELECT MAX(demographic.days_stay) FROM demographic WHERE demographic.diagnosis = "S/P HANGING"
mimicsql_data
CREATE TABLE person_info ( CSD text, CSRQ time, GJDM text, GJMC text, JGDM text, JGMC text, MZDM text, MZMC text, RYBH text, XBDM number, XBMC text, XLDM text, XLMC text, XM text, ZYLBDM text, ZYMC text ) CREATE TABLE jyjgzbb ( BGDH text, BGRQ tim...
SELECT * FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN person_info_hz_info ON person_info.RYBH = person_info_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_MZJZ...
css
CREATE TABLE table_1416612_1 ( mean_elevation VARCHAR, lowest_point VARCHAR, state VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many mean elevation with lowest point being gulf of mexico and state being texas
SELECT COUNT(mean_elevation) FROM table_1416612_1 WHERE lowest_point = "Gulf of Mexico" AND state = "Texas"
sql_create_context
CREATE TABLE table_4940 ( "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 fo...
SELECT "Tries for" FROM table_4940 WHERE "Losing bonus" = '5' AND "Club" = 'maesteg celtic rfc'
wikisql
CREATE TABLE table_train_258 ( "id" int, "gender" string, "autoimmune_disease" bool, "renal_disease" bool, "hepatic_disease" bool, "immune_deficiency_disorder" bool, "active_hepatitis" bool, "body_mass_index_bmi" float, "NOUSE" float ) -- Using valid SQLite, answer the following qu...
SELECT * FROM table_train_258 WHERE gender = 'male' OR gender = 'female'
criteria2sql
CREATE TABLE table_12787 ( "Tournament" text, "2009" text, "2010" text, "2011" text, "2012" text, "Win %" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the 2011 Australian Open and a 2010 QF?
SELECT "2011" FROM table_12787 WHERE "Tournament" = 'australian open' AND "2010" = 'qf'
wikisql
CREATE TABLE table_36220 ( "Surname" text, "First" text, "D.O.B." text, "Bats" text, "Throws" text, "Position" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When was Lachlan Dale born?
SELECT "D.O.B." FROM table_36220 WHERE "Surname" = 'dale' AND "First" = 'lachlan'
wikisql
CREATE TABLE table_32310 ( "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. -- How large was the crowd when the away team was m...
SELECT "Crowd" FROM table_32310 WHERE "Away team" = 'melbourne'
wikisql
CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE...
SELECT COUNT(*) > 0 FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 9964 AND admissions.dischtime IS NULL)
mimic_iii
CREATE TABLE table_59850 ( "Name" text, "Pennant" text, "Builder" text, "Homeport" text, "Commissioned" text, "Status" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the status of the ship INS Ranvir?
SELECT "Status" FROM table_59850 WHERE "Name" = 'ins ranvir'
wikisql
CREATE TABLE table_28523_3 ( school VARCHAR, religious_affiliation VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the website of the school affiliated with the Church of England?
SELECT school AS website FROM table_28523_3 WHERE religious_affiliation = "Church of England"
sql_create_context
CREATE TABLE table_19089 ( "Code" real, "County" text, "Former Province" text, "Area (km 2 )" text, "Population Census 2009" real, "Capital" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what's the county with code being 2
SELECT "County" FROM table_19089 WHERE "Code" = '2'
wikisql
CREATE TABLE t_kc24 ( MED_SAFE_PAY_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, MED_CLINIC_ID text, REF_SLT_FLG number, CLINIC_SLT_DATE time, COMP_ID text, PERSON_ID text, FLX_MED_ORG_ID text, INSU_TYPE text, MED_AMOUT number, PER_ACC_PAY number, OVE_PAY numb...
SELECT MED_ORG_DEPT_CD, MED_ORG_DEPT_NM FROM t_kc22 WHERE STA_DATE BETWEEN '2004-11-10' AND '2021-07-19' AND MED_INV_ITEM_TYPE = '手术费' GROUP BY MED_ORG_DEPT_CD ORDER BY COUNT(*) LIMIT 20
css
CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_ID decimal(4,0) ) CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0),...
SELECT JOB_ID, SUM(SALARY) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 GROUP BY JOB_ID ORDER BY SUM(SALARY)
nvbench
CREATE TABLE table_66202 ( "Outcome" text, "Date" text, "Tournament" text, "Surface" text, "Opponent in the final" text, "Score" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- In the final against Ashley Harkleroad what was the score?
SELECT "Score" FROM table_66202 WHERE "Opponent in the final" = 'ashley harkleroad'
wikisql
CREATE TABLE table_21220 ( "Province" text, "Skip" text, "W" real, "L" real, "PF" real, "PA" real, "Ends Won" real, "Ends Lost" real, "Blank Ends" real, "Stolen Ends" real, "Shot Pct." real ) -- Using valid SQLite, answer the following questions for the tables provided abov...
SELECT MAX("Ends Lost") FROM table_21220
wikisql
CREATE TABLE job_history ( EMPLOYEE_ID decimal(6,0), START_DATE date, END_DATE date, JOB_ID varchar(10), DEPARTMENT_ID decimal(4,0) ) CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) ) CREATE TABLE locations ( LOCAT...
SELECT HIRE_DATE, COUNT(HIRE_DATE) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) ORDER BY COUNT(HIRE_DATE) DESC
nvbench
CREATE TABLE t_kc22 ( AMOUNT number, CHA_ITEM_LEV number, DATA_ID text, DIRE_TYPE number, DOSE_FORM text, DOSE_UNIT text, EACH_DOSAGE text, EXP_OCC_DATE time, FLX_MED_ORG_ID text, FXBZ number, HOSP_DOC_CD text, HOSP_DOC_NM text, MED_CLINIC_ID text, MED_DIRE_CD tex...
SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.t_kc21_PERSON_ID = '86641609' AND NOT t_kc22.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT < 1587.71)
css
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 MAX(vitalperiodic.sao2) FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '012-4131')) AND NOT vitalperiodic.sao2 IS NULL AND DATETI...
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 zyjzjlb.JZLSH FROM hz_info JOIN zyjzjlb ON hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX WHERE hz_info.person_info_XM = '花正阳' AND NOT zyjzjlb.JZLSH IN (SELECT jybgb.JZLSH FROM jybgb WHERE jybgb.BGRQ >= '2018-09-29')
css
CREATE TABLE teaches ( id text, course_id text, sec_id text, semester text, year number ) CREATE TABLE time_slot ( time_slot_id text, day text, start_hr number, start_min number, end_hr number, end_min number ) CREATE TABLE classroom ( building text, room_number tex...
SELECT course_id FROM section WHERE semester = 'Fall' AND year = 2009 INTERSECT SELECT course_id FROM section WHERE semester = 'Spring' AND year = 2010
spider
CREATE TABLE table_28761 ( "Dist." real, "Democratic Coalition" text, "Alliance" text, "Together We Can Do More" text, "Independent Regional Force" text, "Independents" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the democratic coalat...
SELECT "Democratic Coalition" FROM table_28761 WHERE "Together We Can Do More" = 'Sergio Castro ( PC )'
wikisql
CREATE TABLE table_name_29 ( location VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Date of sun. oct. 1 has what location?
SELECT location FROM table_name_29 WHERE date = "sun. oct. 1"
sql_create_context
CREATE TABLE table_204_874 ( id number, "year" number, "winner" text, "runner-up" text, "final score" text, "third" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- who was the winner in the first year of 1992 ?
SELECT "winner" FROM table_204_874 WHERE "year" = 1992
squall
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE medication ( me...
SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'hypothyroidism' AND STRFTIME('%y', diagnosis.diagnosistime) >= '2105') AS t1 JOIN (SELECT patient.uniquepid,...
eicu
CREATE TABLE finrev_fed_key_17 ( state_code number, state text, #_records text ) CREATE TABLE ndecoreexcel_math_grade8 ( year number, state text, all_students text, average_scale_score number ) CREATE TABLE finrev_fed_17 ( state_code number, idcensus number, school_district tex...
SELECT T2.state, T3.average_scale_score FROM finrev_fed_key_17 AS T2 JOIN finrev_fed_17 AS T1 ON T1.state_code = T2.state_code JOIN ndecoreexcel_math_grade8 AS T3 ON T2.state = T3.state GROUP BY T2.state ORDER BY SUM(T1.t_fed_rev) LIMIT 1
studentmathscore
CREATE TABLE papers ( Id VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many papers are published in total?
SELECT COUNT(*) FROM papers
sql_create_context
CREATE TABLE table_name_18 ( keynote_version INTEGER, numbers_version VARCHAR, pages_version VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the latest keynote version of version 2.3 of numbers with pages greater than 4.3?
SELECT MAX(keynote_version) FROM table_name_18 WHERE numbers_version = "2.3" AND pages_version > 4.3
sql_create_context
CREATE TABLE table_name_58 ( attendance INTEGER, home_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the Attendance when Oxford United was the Home team?
SELECT SUM(attendance) FROM table_name_58 WHERE home_team = "oxford united"
sql_create_context
CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE transfers ( r...
SELECT STRFTIME('%j', icustays.outtime) - STRFTIME('%j', icustays.intime) FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 72107) AND NOT icustays.outtime IS NULL ORDER BY icustays.intime LIMIT 1
mimic_iii
CREATE TABLE table_12023 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the home team score when the home team i...
SELECT "Home team score" FROM table_12023 WHERE "Home team" = 'collingwood'
wikisql
CREATE TABLE table_38159 ( "City" text, "Country" text, "IATA" text, "ICAO" text, "Airport" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Country when the IATA shows cju?
SELECT "Country" FROM table_38159 WHERE "IATA" = 'cju'
wikisql
CREATE TABLE table_name_62 ( chassis VARCHAR, rounds VARCHAR, driver VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the name of the Chassis of Diver Maria Teresa de Filippis in round 1?
SELECT chassis FROM table_name_62 WHERE rounds = "1" AND driver = "maria teresa de filippis"
sql_create_context
CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE FlagTypes ( Id number, Name text, Description text ) CREATE TABLE ReviewRejectionReasons ( Id...
SELECT Tags.TagName, COUNT(PostTags.TagId) AS no FROM PostTags, Tags WHERE Tags.Id = PostTags.TagId AND TagName = 'france' GROUP BY TagName ORDER BY no DESC
sede
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid number, wa...
SELECT AVG(intakeoutput.cellvaluenumeric) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '021-111547')) AND intakeoutput.celllabel = 'vasc...
eicu
CREATE TABLE table_name_73 ( branding VARCHAR, callsign VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Branding, when Callsign is 'DXED-TV'?
SELECT branding FROM table_name_73 WHERE callsign = "dxed-tv"
sql_create_context
CREATE TABLE table_name_75 ( first_elected INTEGER, district VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average first elected for the district South Carolina 2?
SELECT AVG(first_elected) FROM table_name_75 WHERE district = "south carolina 2"
sql_create_context
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE intakeoutput ( intakeoutputid numb...
SELECT t1.drugname FROM (SELECT medication.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM medication WHERE STRFTIME('%y', medication.drugstarttime) = '2104' GROUP BY medication.drugname) AS t1 WHERE t1.c1 <= 3
eicu
CREATE TABLE record ( ID int, Result text, Swimmer_ID int, Event_ID int ) CREATE TABLE event ( ID int, Name text, Stadium_ID int, Year text ) CREATE TABLE stadium ( ID int, name text, Capacity int, City text, Country text, Opening_year int ) CREATE TABLE swimme...
SELECT meter_300, ID FROM swimmer ORDER BY ID DESC
nvbench
CREATE TABLE table_1415 ( "Country" text, "Freedom in the World 2013" text, "2013 Index of Economic Freedom" text, "2013 Press Freedom Index" text, "2012 Democracy Index" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How much freedom can did the pe...
SELECT "Freedom in the World 2013" FROM table_1415 WHERE "Country" = 'Guinea'
wikisql
CREATE TABLE program ( program_id int, name varchar, college varchar, introduction varchar ) 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...
SELECT DISTINCT advisory_requirement FROM course WHERE department = 'PIBS' AND number = 507
advising
CREATE TABLE table_19810459_1 ( result VARCHAR, background VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the result for the contestant whose background was as a business major?
SELECT result FROM table_19810459_1 WHERE background = "Business major"
sql_create_context
CREATE TABLE table_60545 ( "Name" text, "Pos." text, "Height" text, "Weight" text, "Date of Birth" text, "Club" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Eftychia Karagianni Pos.?
SELECT "Pos." FROM table_60545 WHERE "Name" = 'eftychia karagianni'
wikisql
CREATE TABLE table_15053 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" real, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the loss for the record of 42-36?
SELECT "Loss" FROM table_15053 WHERE "Record" = '42-36'
wikisql
CREATE TABLE table_name_79 ( grid INTEGER, team VARCHAR, points VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the smallest grid value that had 16 points and a team of Mi-Jack Conquest Racing?
SELECT MIN(grid) FROM table_name_79 WHERE team = "mi-jack conquest racing" AND points = "16"
sql_create_context
CREATE TABLE table_40561 ( "Tournament" text, "Wins" real, "Top-5" real, "Top-10" real, "Top-25" real, "Events" real, "Cuts made" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the sum of Events when the top-25 is more than 5, and th...
SELECT SUM("Events") FROM table_40561 WHERE "Top-25" > '5' AND "Top-10" < '4' AND "Wins" > '2'
wikisql
CREATE TABLE table_11786 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the lowest crowd when essendon is the aw...
SELECT MIN("Crowd") FROM table_11786 WHERE "Away team" = 'essendon'
wikisql
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 TABLE state ( state_code text, state_name text, country_name text ) CREATE T...
SELECT DISTINCT ground_service.transport_type FROM city, ground_service WHERE city.city_name = 'LOS ANGELES' AND ground_service.city_code = city.city_code AND ground_service.transport_type = 'LIMOUSINE'
atis
CREATE TABLE table_name_17 ( country VARCHAR, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What country does Tiger Woods play for?
SELECT country FROM table_name_17 WHERE player = "tiger woods"
sql_create_context
CREATE TABLE table_42245 ( "Event" text, "Record" text, "Nation" text, "Date" text, "Venue" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Event has a Record of 4:02.54?
SELECT "Event" FROM table_42245 WHERE "Record" = '4:02.54'
wikisql
CREATE TABLE table_19791 ( "Year" real, "Mens singles" text, "Womens singles" text, "Mens doubles" text, "Womens doubles" text, "Mixed doubles" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- who is the the womens doubles with mens doubles being ...
SELECT "Womens doubles" FROM table_19791 WHERE "Mens doubles" = 'Reinhold Pum Karl Buchart' AND "Mixed doubles" = 'Hermann Fröhlich Lore Voit'
wikisql
CREATE TABLE table_24188 ( "No in Series" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production code" real, "U.S. viewers (millions)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many original...
SELECT COUNT("Original air date") FROM table_24188 WHERE "Production code" = '4398016'
wikisql
CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text ) CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number...
SELECT TagName FROM Tags ORDER BY Count
sede
CREATE TABLE invoices ( invoice_number number, invoice_date time, invoice_details text ) CREATE TABLE shipment_items ( shipment_id number, order_item_id number ) CREATE TABLE order_items ( order_item_id number, product_id number, order_id number, order_item_status text, order_i...
SELECT T1.customer_name FROM customers AS T1 JOIN orders AS T2 ON T1.customer_id = T2.customer_id WHERE T2.order_status = "On Road" INTERSECT SELECT T1.customer_name FROM customers AS T1 JOIN orders AS T2 ON T1.customer_id = T2.customer_id WHERE T2.order_status = "Shipped"
spider
CREATE TABLE university ( School_ID int, School text, Location text, Founded real, Affiliation text, Enrollment real, Nickname text, Primary_conference text ) CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Per...
SELECT ACC_Road, Team_ID FROM basketball_match GROUP BY All_Home, ACC_Road
nvbench
CREATE TABLE table_16046689_29 ( bowl_game VARCHAR, city VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the name of the bowl game that was played in Tempe, Arizona?
SELECT bowl_game FROM table_16046689_29 WHERE city = "Tempe, Arizona"
sql_create_context
CREATE TABLE race ( Race_ID int, Name text, Class text, Date text, Track_ID text ) CREATE TABLE track ( Track_ID int, Name text, Location text, Seating real, Year_Opened real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Return a hi...
SELECT Name, Seating FROM track WHERE Year_Opened > 2000 ORDER BY Seating
nvbench
CREATE TABLE party_host ( Party_ID int, Host_ID int, Is_Main_in_Charge bool ) CREATE TABLE host ( Host_ID int, Name text, Nationality text, Age text ) CREATE TABLE party ( Party_ID int, Party_Theme text, Location text, First_year text, Last_year text, Number_of_host...
SELECT First_year, COUNT(First_year) FROM party WHERE Party_Theme = "Spring" OR Party_Theme = "Teqnology" ORDER BY COUNT(First_year)
nvbench
CREATE TABLE jyjgzbb ( BGDH text, BGRQ time, CKZFWDX text, CKZFWSX number, CKZFWXX number, JCFF text, JCRGH text, JCRXM text, JCXMMC text, JCZBDM text, JCZBJGDL number, JCZBJGDW text, JCZBJGDX text, JCZBMC text, JLDW text, JYRQ time, JYZBLSH text, ...
SELECT COUNT(*) FROM mzjzjlb JOIN hz_info_mzjzjlb JOIN hz_info ON hz_info_mzjzjlb.JZLSH = mzjzjlb.JZLSH AND hz_info_mzjzjlb.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info_mzjzjlb.JZLSH = mzjzjlb.JZLSH AND hz_info_mzjzjlb.mzjzjlb_id = mzjzjlb.mzjzjlb_id AND hz_info_mzjzjlb.YLJGDM = hz_info.YLJGDM WHERE hz_info.YLJGDM = '15...
css
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 jybgb.BGDH FROM jybgb WHERE jybgb.JZLSH = '13021515758' AND NOT jybgb.KSMC LIKE '%手术%'
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 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.ethnicity = "WHITE" AND demographic.dob_year < "2058"
mimicsql_data
CREATE TABLE course_offering ( offering_id int, course_id int, semester int, section_number int, start_time time, end_time time, monday varchar, tuesday varchar, wednesday varchar, thursday varchar, friday varchar, saturday varchar, sunday varchar, has_final_proje...
SELECT DISTINCT course.department, course.name, course.number FROM course, program_course WHERE course.department LIKE '%MODGREEK%' AND program_course.category LIKE 'PreMajor' AND program_course.course_id = course.course_id
advising
CREATE TABLE requirement ( requirement_id int, requirement varchar, college varchar ) CREATE TABLE offering_instructor ( offering_instructor_id int, offering_id int, instructor_id int ) CREATE TABLE student ( student_id int, lastname varchar, firstname varchar, program_id int, ...
SELECT DISTINCT course.number FROM course, program_course WHERE (course.number = 452 OR course.number = 473) AND course.department = 'EECS' AND program_course.course_id = course.course_id ORDER BY program_course.workload DESC LIMIT 1
advising
CREATE TABLE table_name_87 ( author VARCHAR, first_issue VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Author of the Title with a First Issue of September 2010?
SELECT author FROM table_name_87 WHERE first_issue = "september 2010"
sql_create_context
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, h...
SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE patient.patientunitstayid IN (SELECT lab.patientunitstayid FROM lab WHERE lab.labname = '-eos' AND STRFTIME('%y', lab.labresulttime) <= '2102')
eicu
CREATE TABLE table_name_1 ( city_of_license VARCHAR, frequency VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Tell me the city of license for 0 106.9 fm
SELECT city_of_license FROM table_name_1 WHERE frequency = "0 106.9 fm"
sql_create_context
CREATE TABLE table_name_36 ( rank INTEGER, notes VARCHAR, time VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the rank of the athletes that have Notes of fb, and a Time of 6:47.30?
SELECT SUM(rank) FROM table_name_36 WHERE notes = "fb" AND time = "6:47.30"
sql_create_context
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, ...
SELECT AVG(demographic.age) FROM demographic WHERE demographic.gender = "F" AND demographic.expire_flag = "1"
mimicsql_data
CREATE TABLE table_17467447_1 ( original_airdate VARCHAR, us_viewers__million_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the air date when the U.S. viewers was 5.50 million?
SELECT original_airdate FROM table_17467447_1 WHERE us_viewers__million_ = "5.50"
sql_create_context
CREATE TABLE course_offering ( offering_id int, course_id int, semester int, section_number int, start_time time, end_time time, monday varchar, tuesday varchar, wednesday varchar, thursday varchar, friday varchar, saturday varchar, sunday varchar, has_final_proje...
SELECT DISTINCT course.department, course.name, course.number FROM course, program_course WHERE course.department LIKE '%EECS%' AND program_course.category LIKE '%ULCS%' AND program_course.course_id = course.course_id
advising
CREATE TABLE table_46004 ( "Position" real, "Played" real, "Points" real, "Wins" real, "Draws" real, "Losses" real, "Goals for" real, "Goals against" real, "Goal Difference" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the ...
SELECT AVG("Played") FROM table_46004 WHERE "Wins" < '11' AND "Goals for" > '42' AND "Points" > '22' AND "Losses" = '11'
wikisql
CREATE TABLE table_58899 ( "Glenelg FL" text, "Wins" real, "Byes" real, "Losses" real, "Draws" real, "Against" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many byes were then when there were less than 737 against?
SELECT SUM("Byes") FROM table_58899 WHERE "Against" < '737'
wikisql
CREATE TABLE table_27290 ( "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 district for mike rogers
SELECT "District" FROM table_27290 WHERE "Incumbent" = 'Mike Rogers'
wikisql
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.dod_year <= "2126.0" AND procedures.short_title = "Umbilical vein cath"
mimicsql_data
CREATE TABLE table_58546 ( "Awards" text, "Year" real, "Category" text, "Result" text, "Production" text, "Roll" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What category was nominated in 2010 fo the British Soap Awards?
SELECT "Category" FROM table_58546 WHERE "Year" = '2010' AND "Result" = 'nominated' AND "Awards" = 'british soap awards'
wikisql
CREATE TABLE gwyjzb ( 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_ORG_DEPT_NM, gwyjzb.IN_DIAG_DIS_CD, AVG(gwyjzb.PERSON_AGE) FROM gwyjzb WHERE gwyjzb.MED_SER_ORG_NO = '2686792' GROUP BY gwyjzb.MED_ORG_DEPT_NM, gwyjzb.IN_DIAG_DIS_CD UNION SELECT fgwyjzb.MED_ORG_DEPT_NM, fgwyjzb.IN_DIAG_DIS_CD, AVG(fgwyjzb.PERSON_AGE) FROM fgwyjzb WHERE fgwyjzb.MED_SER_ORG_NO = '26867...
css
CREATE TABLE table_name_51 ( staffel_d VARCHAR, staffel_e VARCHAR, season VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Staffel D in the season 1983-84 with a Staffel E of Motor Suhl?
SELECT staffel_d FROM table_name_51 WHERE staffel_e = "motor suhl" AND season = "1983-84"
sql_create_context
CREATE TABLE table_46667 ( "Position" real, "Team" text, "Played" real, "Drawn" real, "Lost" real, "Goals For" real, "Goals Against" real, "Goal Average 1" real, "Points 2" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- For a team ha...
SELECT MIN("Position") FROM table_46667 WHERE "Goals For" > '95'
wikisql
CREATE TABLE table_name_62 ( constituency_number VARCHAR, name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Constituency number for Pandhana?
SELECT constituency_number FROM table_name_62 WHERE name = "pandhana"
sql_create_context
CREATE TABLE table_7483 ( "Year" real, "Events played" real, "Cuts made" real, "Wins" real, "2nds" real, "Top 10s" real, "Best finish" text, "Earnings ($)" real, "Rank" text, "Scoring average" real, "Scoring rank" text ) -- Using valid SQLite, answer the following questions...
SELECT COUNT("Wins") FROM table_7483 WHERE "Rank" = '98' AND "Scoring average" > '73.52'
wikisql
CREATE TABLE txmzjzjlb ( 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 jyjgzbb.JCRGH, jyjgzbb.JCRXM 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_MZ...
css
CREATE TABLE swimmer ( nationality VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- List countries that have more than one swimmer.
SELECT nationality, COUNT(*) FROM swimmer GROUP BY nationality HAVING COUNT(*) > 1
sql_create_context
CREATE TABLE table_71781 ( "Date" text, "Region" text, "Label" text, "Catalogue" text, "Format" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which label is from the Germany region?
SELECT "Label" FROM table_71781 WHERE "Region" = 'germany'
wikisql