instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE table_49927 ( "Round" real, "Player" text, "Position" text, "Nationality" text, "College/Junior/Club Team (League)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- WHAT IS THE POSITION FOR CANADA, ROUND SMALLER THAN 7, PLAYER ZACH BOYCHU...
SELECT "Position" FROM table_49927 WHERE "Nationality" = 'canada' AND "Round" < '7' AND "Player" = 'zach boychuk'
wikisql
CREATE TABLE table_28473 ( "Character" text, "Played by" text, "Season 1" real, "Season 2" real, "Season 3" real, "Season 4" real, "First Appearance" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many season 3 appearances by Morgan the ...
SELECT MAX("Season 3") FROM table_28473 WHERE "Played by" = 'Morgan the Dog'
wikisql
CREATE TABLE table_test_16 ( "id" int, "left_ventricular_ejection_fraction_lvef" int, "systolic_blood_pressure_sbp" int, "severe_hypertension" bool, "adrenaline" bool, "stroke" bool, "renal_disease" bool, "severe_uncontrolled_arterial_hypertension" bool, "hepatic_disease" bool, "...
SELECT * FROM table_test_16 WHERE stroke = 1
criteria2sql
CREATE TABLE table_62407 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What player scored 68-66=134?
SELECT "Player" FROM table_62407 WHERE "Score" = '68-66=134'
wikisql
CREATE TABLE table_1341865_44 ( incumbent VARCHAR, district VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what's incumbent with district being tennessee 5
SELECT incumbent FROM table_1341865_44 WHERE district = "Tennessee 5"
sql_create_context
CREATE TABLE table_27411 ( "Country" text, "Skip" text, "W" real, "L" real, "PF" real, "PA" real, "Ends Won" real, "Ends Lost" real, "Blank Ends" real, "Stolen Ends" real, "Shot %" real ) -- Using valid SQLite, answer the following questions for the tables provided above. ...
SELECT "Ends Won" FROM table_27411 WHERE "Blank Ends" = '0'
wikisql
CREATE TABLE table_35256 ( "Rank" real, "Airport" text, "Location" text, "Code (IATA)" text, "Total Cargo (Metric Tonnes)" text, "2003 Rank" text, "% Change" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the IATA code of the airport...
SELECT "Code (IATA)" FROM table_35256 WHERE "Total Cargo (Metric Tonnes)" = '1,838,894'
wikisql
CREATE TABLE table_name_13 ( date_of_birth VARCHAR, position_s_ VARCHAR, seasons VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the date of birth of the goalkeeper from the 1st season?
SELECT date_of_birth FROM table_name_13 WHERE position_s_ = "goalkeeper" AND seasons = "1st"
sql_create_context
CREATE TABLE table_27696 ( "Round" real, "Circuit" text, "Location" text, "Date" text, "Pole position" text, "Fastest lap" text, "Winning driver" text, "Winning team" text, "Supporting" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- ...
SELECT "Pole position" FROM table_27696 WHERE "Supporting" = 'USAC National Midget Series'
wikisql
CREATE TABLE table_77710 ( "Name" text, "Bodyweight" real, "Snatch" real, "Clean & jerk" real, "Total (kg)" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the average clean and jerk for snatch of 140 and total kg less than 315
SELECT AVG("Clean & jerk") FROM table_77710 WHERE "Snatch" = '140' AND "Total (kg)" < '315'
wikisql
CREATE TABLE table_41741 ( "Date" text, "Opponent" text, "Location" text, "Score" text, "Loss" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the name of the Opponent when there is a Record of 39-19?
SELECT "Opponent" FROM table_41741 WHERE "Record" = '39-19'
wikisql
CREATE TABLE table_21582 ( "County" text, "Kerry%" text, "Kerry#" real, "Bush%" text, "Bush#" real, "Others%" text, "Others#" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the percentage of others when the number of others is 2286?
SELECT "Others%" FROM table_21582 WHERE "Others#" = '2286'
wikisql
CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE TagSynonyms ( Id number, SourceTagName text, TargetTagName text, CreationDate time, OwnerUserId number, AutoRenameCount number, LastAutoRename time, Score number, ApprovedByUserId number, ApprovalDate time ) C...
SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation FROM Users WHERE LOWER(Users.AboutMe) LIKE LOWER('% Uber %') ORDER BY Reputation DESC
sede
CREATE TABLE table_670 ( "Year" real, "Finish position" text, "1st day" text, "2nd day" text, "3rd day" text, "4th Day" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what's the 4th day with 3rd day being bumped by downing
SELECT "4th Day" FROM table_670 WHERE "3rd day" = 'bumped by Downing'
wikisql
CREATE TABLE technician ( Name VARCHAR, technician_ID VARCHAR ) CREATE TABLE machine ( Machine_series VARCHAR, machine_id VARCHAR ) CREATE TABLE repair_assignment ( machine_id VARCHAR, technician_ID VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above...
SELECT T3.Name, T2.Machine_series FROM repair_assignment AS T1 JOIN machine AS T2 ON T1.machine_id = T2.machine_id JOIN technician AS T3 ON T1.technician_ID = T3.technician_ID
sql_create_context
CREATE TABLE table_10007452_3 ( fuel_propulsion VARCHAR, fleet_series__quantity_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the fuel propulsion where the fleet series (quantity) is 310-329 (20)?
SELECT fuel_propulsion FROM table_10007452_3 WHERE fleet_series__quantity_ = "310-329 (20)"
sql_create_context
CREATE TABLE table_54250 ( "Player" text, "No.(s)" text, "Height in Ft." text, "Position" text, "Years for Rockets" text, "School/Club Team/Country" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Height for Years for Rockets of 2005-...
SELECT "Height in Ft." FROM table_54250 WHERE "Years for Rockets" = '2005-06'
wikisql
CREATE TABLE table_204_888 ( id number, "location" text, "mile" number, "destinations" text, "notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many miles is the us 522 south - berkeley springs , wv location ?
SELECT "mile" FROM table_204_888 WHERE "destinations" = 'us 522 south - berkeley springs, wv'
squall
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREAT...
SELECT SUM(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 = '033-3992')) AND intakeoutput.cellpath LIKE '%out...
eicu
CREATE TABLE table_204_980 ( id number, "name" text, "type" text, "elevation\n(ground station)" number, "elevation\n(mountain station)" number, "slope length" number, "capacity\n(persons/hour)" number, "construction year" number ) -- Using valid SQLite, answer the following questions f...
SELECT "name" FROM table_204_980 ORDER BY "construction year" DESC LIMIT 1
squall
CREATE TABLE table_11820 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Leading scorer" text, "Attendance" real, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the record when the visitor is mavericks
SELECT "Record" FROM table_11820 WHERE "Visitor" = 'mavericks'
wikisql
CREATE TABLE icustays ( row_id number, subject_id number, hadm_id number, icustay_id number, first_careunit text, last_careunit text, first_wardid number, last_wardid number, intime time, outtime time ) CREATE TABLE prescriptions ( row_id number, subject_id number, h...
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 = 'venous cath nec') AND procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 26849) AND DATETIME(procedures_icd....
mimic_iii
CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeri...
SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', intakeoutput.intakeoutputtime)) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid ...
eicu
CREATE TABLE table_10268 ( "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 away team scored 17.17 (119)?
SELECT "Away team" FROM table_10268 WHERE "Away team score" = '17.17 (119)'
wikisql
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) 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, ...
SELECT person_info.XM FROM person_info JOIN hz_info JOIN zyjzjlb JOIN jybgb JOIN zyjzjlb_jybgb 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 AND zyjzjlb.YLJGDM = zyjzjlb_jybgb.YLJGDM_ZYJZJLB AND zyjzjlb.JZLSH = jybgb.JZLSH_ZYJZJLB AND zy...
css
CREATE TABLE jybgb ( BBCJBW text, BBDM text, BBMC text, BBZT number, BGDH text, BGJGDM text, BGJGMC text, BGRGH text, BGRQ time, BGRXM text, BGSJ time, CJRQ time, JSBBRQSJ time, JSBBSJ time, JYBBH text, JYJGMC text, JYJSGH text, JYJSQM text, JY...
SELECT jyjgzbb.JCRGH, jyjgzbb.JCRXM FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN jybgb_jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.J...
css
CREATE TABLE table_55622 ( "Year" real, "Rank" real, "Games" real, "Win%" real, "Postseason" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What postseason has a win% between 0.40700000000000003 and 108 with a rank of 1?
SELECT "Postseason" FROM table_55622 WHERE "Win%" > '0.40700000000000003' AND "Games" < '108' AND "Rank" = '1'
wikisql
CREATE TABLE table_name_38 ( winter_olympics VARCHAR, country VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the Winter Olympics was Japan as the country?
SELECT winter_olympics FROM table_name_38 WHERE country = "japan"
sql_create_context
CREATE TABLE table_44379 ( "Number" text, "Builder" text, "Type" text, "Date" text, "Works number" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Type, when Works Number is 75823?
SELECT "Type" FROM table_44379 WHERE "Works number" = '75823'
wikisql
CREATE TABLE table_30845 ( "taluka Name" text, "Population (2001 census)" real, "% of District Population" text, "Male" real, "Male(%)" text, "Female" real, "Female(%)" text, "Sex Ratio" real, "Literacy" real, "Literacy(%)" text, "Literate Male" real, "Literate Male(%)" t...
SELECT COUNT("Literate Male(%)") FROM table_30845 WHERE "% of District Population" = '3.28'
wikisql
CREATE TABLE table_15346009_1 ( date VARCHAR, location VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- On what day was the tournament in Alabama?
SELECT date FROM table_15346009_1 WHERE location = "Alabama"
sql_create_context
CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text ) CREATE...
SELECT Id AS "comment_link", PostId AS "post_link", CreationDate AS "comment_date", Score FROM Comments WHERE '##UserId:int##' = UserId AND Score > 0 ORDER BY Score DESC, CreationDate DESC LIMIT 1000
sede
CREATE TABLE table_name_91 ( score VARCHAR, attendance VARCHAR, away_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the score when the attendance is less than 83 and Raunds Town is the away team?
SELECT score FROM table_name_91 WHERE attendance < 83 AND away_team = "raunds town"
sql_create_context
CREATE TABLE table_10935548_1 ( title VARCHAR, directed_by VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which episode was directed by Jean de Segonzac?
SELECT title FROM table_10935548_1 WHERE directed_by = "Jean de Segonzac"
sql_create_context
CREATE TABLE list ( classroom VARCHAR, grade VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Report the total number of students for each fourth-grade classroom.
SELECT classroom, COUNT(*) FROM list WHERE grade = "4" GROUP BY classroom
sql_create_context
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE diagnoses ( ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_type = "ELECTIVE" AND demographic.diagnosis = "CORONARY ARTERY DISEASE"
mimicsql_data
CREATE TABLE table_name_80 ( laps INTEGER, year VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many laps were in 1958?
SELECT SUM(laps) FROM table_name_80 WHERE year = "1958"
sql_create_context
CREATE TABLE table_name_48 ( body_width_mm INTEGER, lead_pitch_mm VARCHAR, body_length_mm VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Body Width/mm has a Lead Pitch/mm smaller than 0.55, and a Body Length/mm larger than 18.4?
SELECT MIN(body_width_mm) FROM table_name_48 WHERE lead_pitch_mm < 0.55 AND body_length_mm > 18.4
sql_create_context
CREATE TABLE t_kc24 ( ACCOUNT_DASH_DATE time, ACCOUNT_DASH_FLG number, CASH_PAY number, CIVIL_SUBSIDY number, CKC102 number, CLINIC_ID text, CLINIC_SLT_DATE time, COMP_ID text, COM_ACC_PAY number, COM_PAY number, DATA_ID text, ENT_ACC_PAY number, ENT_PAY number, F...
SELECT t_kc22.DIRE_TYPE FROM t_kc22 JOIN t_kc21_t_kc22 JOIN t_kc21 ON t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID AND t_kc21_t_kc22.MED_CLINIC_ID = t_kc21.MED_CLINIC_ID WHERE t_kc21.MED_CLINIC_ID = '82940377602' AND t_kc22.SOC_SRT_DIRE_NM = '格列美脲片'
css
CREATE TABLE table_name_11 ( week INTEGER, game_site VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What average week has shea stadium as the game site, and 1979-12-09 as the date?
SELECT AVG(week) FROM table_name_11 WHERE game_site = "shea stadium" AND date = "1979-12-09"
sql_create_context
CREATE TABLE jybgb_jyjgzbb ( JYZBLSH number, YLJGDM text, jyjgzbb_id number ) 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 tex...
SELECT * FROM jyjgzbb WHERE jyjgzbb.JCZBMC = (SELECT jyjgzbb.JCZBMC FROM jyjgzbb WHERE jyjgzbb.JYZBLSH = '37036653223') AND jyjgzbb.JCZBJGDW = (SELECT jyjgzbb.JCZBJGDW FROM jyjgzbb WHERE jyjgzbb.JYZBLSH = '37036653223') AND jyjgzbb.JCZBJGDL = (SELECT jyjgzbb.JCZBJGDL FROM jyjgzbb WHERE jyjgzbb.JYZBLSH = '37036653223')
css
CREATE TABLE table_76405 ( "Year" text, "2009" text, "2008" text, "2007" text, "2006" text, "2005" text, "2004" text, "2003" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the 2007 for the 2003 desert prince?
SELECT "2007" FROM table_76405 WHERE "2003" = 'desert prince'
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.admission_location = "TRSF WITHIN THIS FACILITY" AND demographic.days_stay > "30"
mimicsql_data
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 INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.short_title = "Abn react-procedure NOS" AND lab."CATEGORY" = "Chemistry"
mimicsql_data
CREATE TABLE table_204_781 ( id number, "name(s)" text, "yard no." number, "type (as built)" text, "owner" text, "imo number" number, "laid down" text, "launched" text, "delivered/\ncommissioned" text, "fate/\ndecommissioned" text, "notes" text ) -- Using valid SQLite, answ...
SELECT "owner" FROM table_204_781 WHERE id = 1
squall
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid numb...
SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', treatment.treatmenttime)) FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '016-27397...
eicu
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 text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admityear < "2129" AND lab.itemid = "50993"
mimicsql_data
CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) 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...
SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT transfers.hadm_id FROM transfers WHERE transfers.careunit = 'ccu' AND STRFTIME('%y', transfers.intime) = '2105')
mimic_iii
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREA...
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 = '022-89058')) AND STRFTIME('%y-%m', medication.drugstarttime) >...
eicu
CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemicsystolic number, systemicdiastolic number, systemicmean number, observationtime time ) CREATE TABLE microlab ( microl...
SELECT t3.diagnosisname FROM (SELECT t2.diagnosisname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime, patient.patienthealthsystemstayid FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'drug ...
eicu
CREATE TABLE Room ( RoomNumber INTEGER, RoomType VARCHAR(30), BlockFloor INTEGER, BlockCode INTEGER, Unavailable BOOLEAN ) CREATE TABLE Physician ( EmployeeID INTEGER, Name VARCHAR(30), Position VARCHAR(30), SSN INTEGER ) CREATE TABLE Stay ( StayID INTEGER, Patient INTEGER,...
SELECT Name, COUNT(Name) FROM Appointment AS T1 JOIN Patient AS T2 ON T1.Patient = T2.SSN GROUP BY Name ORDER BY COUNT(Name)
nvbench
CREATE TABLE table_1140082_2 ( location VARCHAR, race VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Where is the German Grand Prix?
SELECT location FROM table_1140082_2 WHERE race = "German Grand Prix"
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 demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admityear < "2198" AND procedures.long_title = "Circumcision"
mimicsql_data
CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varchar(20), LAST_NAME varchar(25), EMAIL varchar(25), PHONE_NUMBER varchar(20), HIRE_DATE date, JOB_ID varchar(10), SALARY decimal(8,2), COMMISSION_PCT decimal(2,2), MANAGER_ID decimal(6,0), DEPARTMENT_ID decimal(...
SELECT EMPLOYEE_ID, COMMISSION_PCT FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200)
nvbench
CREATE TABLE table_78172 ( "Season" real, "Belonging league" text, "Matches" real, "league point" real, "Draw" real, "Lose" real, "Goal difference" real, "Point" real, "Lost point" real, "Final rank" real ) -- Using valid SQLite, answer the following questions for the tables pr...
SELECT AVG("Lose") FROM table_78172 WHERE "Lost point" > '16' AND "Goal difference" < '37' AND "Point" < '43'
wikisql
CREATE TABLE invoice_line_items ( order_item_id number, invoice_number number, product_id number, product_title text, product_quantity text, product_price number, derived_product_cost number, derived_vat_payable number, derived_total_cost number ) CREATE TABLE orders ( order_id ...
SELECT gender, COUNT(*) FROM customers GROUP BY gender
spider
CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE labevents ( row...
SELECT admissions.dischtime FROM admissions WHERE admissions.subject_id = 51977 AND DATETIME(admissions.dischtime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') ORDER BY admissions.dischtime LIMIT 1
mimic_iii
CREATE TABLE table_name_21 ( nationality VARCHAR, pick VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which nationality's pick was 415?
SELECT nationality FROM table_name_21 WHERE pick = "415"
sql_create_context
CREATE TABLE table_name_17 ( opposition VARCHAR, city VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Opposition has a City of taunton?
SELECT opposition FROM table_name_17 WHERE city = "taunton"
sql_create_context
CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE cost ( row_id number, subject_id...
SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE ...
mimic_iii
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 mzjzjlb.JZLSH FROM hz_info JOIN mzjzjlb JOIN hz_info_mzjzjlb ON hz_info.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND 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_mzj...
css
CREATE TABLE table_2794180_11 ( radio_commentator VARCHAR, television_commentator VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who made the comments for radio broadcast when Jan Gabrielsson made them for television broadcast?
SELECT radio_commentator FROM table_2794180_11 WHERE television_commentator = "Jan Gabrielsson"
sql_create_context
CREATE TABLE TagSynonyms ( Id number, SourceTagName text, TargetTagName text, CreationDate time, OwnerUserId number, AutoRenameCount number, LastAutoRename time, Score number, ApprovedByUserId number, ApprovalDate time ) CREATE TABLE PostHistoryTypes ( Id number, Name te...
SELECT Id AS "comment_link" FROM Comments WHERE LOWER(Text) LIKE 'what have you tried%' AND LENGTH(Text) < 75 ORDER BY LENGTH(Text), Id
sede
CREATE TABLE table_31288 ( "Season" text, "Level" text, "Division" text, "Section" text, "Position" text, "Movements" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the name of the movement in the 7th position
SELECT "Movements" FROM table_31288 WHERE "Position" = '7th'
wikisql
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admityear < "2146" AND lab.label = "PTT"
mimicsql_data
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 demographic.admittime, demographic.dischtime FROM demographic WHERE demographic.name = "Tracy Farmer"
mimicsql_data
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 cost ( costid number, uniquepi...
SELECT COUNT(*) > 0 FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '017-59454')) AND intakeoutput.cellpath LIKE '%output%' AND intakeoutpu...
eicu
CREATE TABLE t_kc24 ( ACCOUNT_DASH_DATE time, ACCOUNT_DASH_FLG number, CASH_PAY number, CIVIL_SUBSIDY number, CKC102 number, CLINIC_ID text, CLINIC_SLT_DATE time, COMP_ID text, COM_ACC_PAY number, COM_PAY number, DATA_ID text, ENT_ACC_PAY number, ENT_PAY number, F...
SELECT t_kc22.SOC_SRT_DIRE_CD FROM t_kc22 JOIN t_kc21_t_kc22 JOIN t_kc21 ON t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID AND t_kc21_t_kc22.MED_CLINIC_ID = t_kc21.MED_CLINIC_ID WHERE t_kc21.MED_CLINIC_ID = '57735254801' AND t_kc22.SOC_SRT_DIRE_NM = '益心舒胶囊'
css
CREATE TABLE table_74945 ( "Club" text, "Played" text, "Drawn" text, "Lost" text, "Points for" text, "Points against" text, "Tries for" text, "Tries against" text, "Try bonus" text, "Losing bonus" text, "Points" text ) -- Using valid SQLite, answer the following questions f...
SELECT "Points for" FROM table_74945 WHERE "Played" = '22' AND "Tries against" = '43'
wikisql
CREATE TABLE table_25604014_9 ( production_code VARCHAR, written_by VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the production code for theresa rebeck
SELECT production_code FROM table_25604014_9 WHERE written_by = "Theresa Rebeck"
sql_create_context
CREATE TABLE table_name_68 ( fleet_numbers VARCHAR, diagram VARCHAR, built VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What fleet numbers have a diagram less than 99 and built in 1960?
SELECT fleet_numbers FROM table_name_68 WHERE diagram < 99 AND built = "1960"
sql_create_context
CREATE TABLE table_48183 ( "Year" real, "Entrant" text, "Chassis" text, "Engine" text, "Points" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What engine has the Mercedes AMG Petronas f1 team, and 93 points?
SELECT "Engine" FROM table_48183 WHERE "Entrant" = 'mercedes amg petronas f1 team' AND "Points" = '93'
wikisql
CREATE TABLE table_44347 ( "Rank" text, "Time" text, "Athlete" text, "Nation" text, "Date" text, "Race" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the name of the athlete with a time of 30:48?
SELECT "Athlete" FROM table_44347 WHERE "Time" = '30:48'
wikisql
CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE patients ( row_...
SELECT labevents.charttime FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 65582) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'calculated total co2') AND STRFTIME('%y-%m', labevents.charttime) >= '2104-08' ...
mimic_iii
CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER ) CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL ) -- Using valid SQLite, answer the following questions for the...
SELECT Headquarter, AVG(Manufacturer) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter ORDER BY Headquarter DESC
nvbench
CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE job_history ( EMPLOYEE_ID decimal(6,0), START_DATE date, END_DATE date, JOB_ID varchar(10), ...
SELECT HIRE_DATE, SALARY FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' ORDER BY HIRE_DATE DESC
nvbench
CREATE TABLE table_71569 ( "Rank" real, "Name" text, "Nationality" text, "Score" text, "Perfection" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the rank of Svetlana Fedorenko?
SELECT "Rank" FROM table_71569 WHERE "Name" = 'svetlana fedorenko'
wikisql
CREATE TABLE t_kc22 ( MED_EXP_DET_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, MED_CLINIC_ID text, MED_EXP_BILL_ID text, SOC_SRT_DIRE_CD text, SOC_SRT_DIRE_NM text, DIRE_TYPE number, CHA_ITEM_LEV number, MED_INV_ITEM_TYPE text, MED_DIRE_CD text, MED_DIRE_NM text,...
SELECT SUM(MED_AMOUT) FROM t_kc24 WHERE PERSON_ID = '32179054' AND CLINIC_SLT_DATE BETWEEN '2004-02-21' AND '2013-08-10'
css
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 T1.Code, T1.Price FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter
nvbench
CREATE TABLE table_78872 ( "Team" text, "City" text, "Venue" text, "Capacity" real, "Head Coach" text, "Team Captain" text, "Past Season" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Capacity of the Venue of Head Coach Farhad K...
SELECT SUM("Capacity") FROM table_78872 WHERE "Head Coach" = 'farhad kazemi'
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 = "Pyelonephritis NOS" AND lab.flag = "delta"
mimicsql_data
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 ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.age < "31" AND diagnoses.icd9_code = "2809"
mimicsql_data
CREATE TABLE table_name_29 ( Vice VARCHAR, president VARCHAR, treasurer VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Vice President has a President of daniel masny, and a Treasurer of rebecca t. altmann?
SELECT Vice AS president FROM table_name_29 WHERE president = "daniel masny" AND treasurer = "rebecca t. altmann"
sql_create_context
CREATE TABLE table_name_78 ( score VARCHAR, home VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What score has detroit as the home, and December 9 as the date?
SELECT score FROM table_name_78 WHERE home = "detroit" AND date = "december 9"
sql_create_context
CREATE TABLE table_name_22 ( place VARCHAR, score VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the place when the score was 71-69-71=211?
SELECT place FROM table_name_22 WHERE score = 71 - 69 - 71 = 211
sql_create_context
CREATE TABLE person_info ( RYBH text, XBDM number, XBMC text, XM text, CSRQ time, CSD text, MZDM text, MZMC text, GJDM text, GJMC text, JGDM text, JGMC text, XLDM text, XLMC text, ZYLBDM text, ZYMC text ) CREATE TABLE jybgb ( YLJGDM text, YLJGDM_M...
SELECT KH, KLX FROM mzjzjlb WHERE JZLSH = '18195078262'
css
CREATE TABLE table_55963 ( "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 Home team score when the crowd was ...
SELECT "Home team score" FROM table_55963 WHERE "Crowd" > '12,240' AND "Away team" = 'carlton'
wikisql
CREATE TABLE table_69120 ( "Name" text, "Years" text, "Gender" text, "Area" text, "Authority" text, "Decile" real, "Roll" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the highest roll number of the school with a state authority and...
SELECT MAX("Roll") FROM table_69120 WHERE "Authority" = 'state' AND "Decile" < '8'
wikisql
CREATE TABLE table_name_40 ( score VARCHAR, high_assists VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Score has a High assists of whalen (5)?
SELECT score FROM table_name_40 WHERE high_assists = "whalen (5)"
sql_create_context
CREATE TABLE table_74400 ( "Date" text, "Time" text, "ACC Team" text, "Big Ten Team" text, "Location" text, "Television" text, "Attendance" real, "Winner" text, "Challenge Leader" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who we...
SELECT "Challenge Leader" FROM table_74400 WHERE "Winner" = 'Boston College (88-76)'
wikisql
CREATE TABLE program_requirement ( program_id int, category varchar, min_credit int, additional_req varchar ) CREATE TABLE course ( course_id int, name varchar, department varchar, number varchar, credits varchar, advisory_requirement varchar, enforced_requirement varchar, ...
SELECT DISTINCT num_enrolled FROM course WHERE department = 'EECS' AND number = 542
advising
CREATE TABLE table_26178 ( "Neighbourhood" text, "% 0-19" text, "% 20-39" text, "% 40-59" text, "% 60-74" text, "% 75 +" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is every value for % 75 + if % 0-19 is 19,75%?
SELECT "% 75 +" FROM table_26178 WHERE "% 0-19" = '19,75%'
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.days_stay > "6" AND procedures.long_title = "Biopsy of bone marrow"
mimicsql_data
CREATE TABLE table_50916 ( "Governor" text, "State" text, "Past" text, "Party" text, "Elected/assumed office" real, "Seat up" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What state had an elected/assumed office in 2013?
SELECT "State" FROM table_50916 WHERE "Elected/assumed office" = '2013'
wikisql
CREATE TABLE table_name_27 ( goals_for INTEGER, team VARCHAR, lost VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Goals For has a Team of congleton town, and a Lost larger than 11?
SELECT MAX(goals_for) FROM table_name_27 WHERE team = "congleton town" AND lost > 11
sql_create_context
CREATE TABLE table_5565 ( "Series Ep." text, "Episode" real, "Netflix" text, "Segment A" text, "Segment B" text, "Segment C" text, "Segment D" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the series ep for darts
SELECT "Series Ep." FROM table_5565 WHERE "Segment D" = 'darts'
wikisql
CREATE TABLE table_name_19 ( hometown VARCHAR, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which hometown has a player of Ray Drew?
SELECT hometown FROM table_name_19 WHERE player = "ray drew"
sql_create_context
CREATE TABLE table_name_42 ( year INTEGER, venue VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the lowest Year, when Venue is Rio De Janeiro, Brazil?
SELECT MIN(year) FROM table_name_42 WHERE venue = "rio de janeiro, brazil"
sql_create_context
CREATE TABLE transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, eventtype text, careunit text, wardid number, intime time, outtime time ) CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, ...
SELECT COUNT(*) > 0 FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 56490) AND microbiologyevents.spec_type_desc = 'blood culture' AND DATETIME(microbiologyevents.charttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', ...
mimic_iii
CREATE TABLE table_47775 ( "Game" real, "Date" text, "Opponent" text, "Score" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the Maple Leafs' record on game 52?
SELECT "Record" FROM table_47775 WHERE "Game" = '52'
wikisql