instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE fare_basis ( fare_basis_code text, booking_class text, class_type text, premium text, economy text, discounted text, night text, season text, basis_days text ) CREATE TABLE dual_carrier ( main_airline varchar, low_flight_number int, high_flight_number int, ...
SELECT DISTINCT airline.airline_code FROM airline, airport, flight WHERE airport.airport_code = 'MKE' AND flight.airline_code = airline.airline_code AND flight.to_airport = airport.airport_code
atis
CREATE TABLE photos ( id int, camera_lens_id int, mountain_id int, color text, name text ) CREATE TABLE mountain ( id int, name text, Height real, Prominence real, Range text, Country text ) CREATE TABLE camera_lens ( id int, brand text, name text, focal_len...
SELECT T1.name, COUNT(*) FROM camera_lens AS T1 JOIN photos AS T2 ON T1.id = T2.camera_lens_id GROUP BY T1.id ORDER BY COUNT(*)
nvbench
CREATE TABLE race ( race_id number, name text, class text, date text, track_id text ) CREATE TABLE track ( track_id number, name text, location text, seating number, year_opened number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- S...
SELECT T2.name FROM race AS T1 JOIN track AS T2 ON T1.track_id = T2.track_id GROUP BY T1.track_id ORDER BY COUNT(*) DESC LIMIT 1
spider
CREATE TABLE table_67351 ( "Date" text, "City" text, "Event" text, "Winner" text, "Prize" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the City, when the Prize is 880,000?
SELECT "City" FROM table_67351 WHERE "Prize" = '€880,000'
wikisql
CREATE TABLE table_1500146_1 ( rhel_release_date VARCHAR, scientific_linux_release VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When is the rhel release date when scientific linux release is 3.0.4
SELECT rhel_release_date FROM table_1500146_1 WHERE scientific_linux_release = "3.0.4"
sql_create_context
CREATE TABLE broadcast ( channel_id number, program_id number, time_of_day text ) CREATE TABLE broadcast_share ( channel_id number, program_id number, date text, share_in_percent number ) CREATE TABLE program ( program_id number, name text, origin text, launch number, o...
SELECT name FROM channel ORDER BY rating_in_percent DESC
spider
CREATE TABLE table_35572 ( "Position" real, "Pilot" text, "Glider" text, "Speed" text, "Distance" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the lowest position for bruce taylor?
SELECT MIN("Position") FROM table_35572 WHERE "Pilot" = 'bruce taylor'
wikisql
CREATE TABLE film ( Film_ID int, Rank_in_series int, Number_in_season int, Title text, Directed_by text, Original_air_date text, Production_code text ) CREATE TABLE schedule ( Cinema_ID int, Film_ID int, Date text, Show_times_per_day int, Price float ) CREATE TABLE cine...
SELECT Openning_year, AVG(Capacity) FROM cinema ORDER BY Openning_year
nvbench
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 WHERE demographic.age < "72" AND demographic.dod_year <= "2168.0"
mimicsql_data
CREATE TABLE record ( ID int, Result text, Swimmer_ID int, Event_ID int ) CREATE TABLE stadium ( ID int, name text, Capacity int, City text, Country text, Opening_year int ) CREATE TABLE event ( ID int, Name text, Stadium_ID int, Year text ) CREATE TABLE swimme...
SELECT Nationality, SUM(ID) FROM swimmer GROUP BY Nationality ORDER BY SUM(ID) DESC
nvbench
CREATE TABLE table_204_562 ( id number, "no." number, "date" text, "location" text, "surface" text, "opponent in final" text, "score" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the top ranked location ?
SELECT "location" FROM table_204_562 WHERE "no." = 1
squall
CREATE TABLE ref_service_types ( service_type_code text, parent_service_type_code text, service_type_description text ) CREATE TABLE marketing_regions ( marketing_region_code text, marketing_region_name text, marketing_region_descriptrion text, other_details text ) CREATE TABLE bookings ( ...
SELECT T2.store_name FROM bookings AS T1 JOIN drama_workshop_groups AS T2 ON T1.workshop_group_id = T2.workshop_group_id WHERE T1.status_code = "stop"
spider
CREATE TABLE table_180802_3 ( color VARCHAR, planet VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the color of the planet venus?
SELECT color FROM table_180802_3 WHERE planet = "Venus"
sql_create_context
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE intakeoutput ( intakeou...
SELECT patient.admissionweight FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '002-59265') AND NOT patient.admissionweight IS NULL AND DATETIME(patient.unitadmittime) <= DATETIME(CURRENT_TIME(), '-36 month') ORDER BY patient.unita...
eicu
CREATE TABLE table_448 ( "Character(s)" text, "First Appearance" text, "Cover Date" text, "Publisher" text, "Estimated Value" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the total number of publisher where first appearance is daredevil #1...
SELECT COUNT("Publisher") FROM table_448 WHERE "First Appearance" = 'Daredevil #1'
wikisql
CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE icustays ( row_id number, subject_id number, hadm_id number, icustay_id number, first_careunit text, last_careunit text...
SELECT COUNT(*) FROM prescriptions WHERE prescriptions.drug = 'potassium chl 40 meq / 1000 ml ns' AND DATETIME(prescriptions.startdate) <= DATETIME(CURRENT_TIME(), '-3 year')
mimic_iii
CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_ID decimal(4,0) ) CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(40), POSTAL_CODE varchar(12), CITY varchar(30), STATE_PROVINCE varchar(25...
SELECT HIRE_DATE, AVG(MANAGER_ID) FROM employees WHERE HIRE_DATE < '2002-06-21' ORDER BY AVG(MANAGER_ID) DESC
nvbench
CREATE TABLE table_33593 ( "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 did the away team score when the home team ...
SELECT "Away team score" FROM table_33593 WHERE "Home team score" = '9.18 (72)'
wikisql
CREATE TABLE table_41791 ( "Rank" real, "Name" text, "Years" text, "Matches" real, "Goals" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Goals have a Name of lee dong-gook?
SELECT MAX("Goals") FROM table_41791 WHERE "Name" = 'lee dong-gook'
wikisql
CREATE TABLE table_47613 ( "Date" text, "Competition" text, "Winners" text, "Score" text, "Runners-up" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who were the runners-up in the game that was won by Cork City F.C. on 10/05/1998?
SELECT "Runners-up" FROM table_47613 WHERE "Winners" = 'cork city f.c.' AND "Date" = '10/05/1998'
wikisql
CREATE TABLE buildings ( id int, name text, City text, Height int, Stories int, Status text ) CREATE TABLE Office_locations ( building_id int, company_id int, move_in_year int ) CREATE TABLE Companies ( id int, name text, Headquarters text, Industry text, Sales_...
SELECT T2.name, COUNT(T2.name) FROM Office_locations AS T1 JOIN buildings AS T2 ON T1.building_id = T2.id JOIN Companies AS T3 ON T1.company_id = T3.id GROUP BY T2.name ORDER BY COUNT(T2.name) DESC
nvbench
CREATE TABLE table_18797 ( "Player" text, "Played" real, "Sets Won" real, "Sets Lost" real, "Legs Won" real, "Legs Lost" real, "100+" real, "140+" real, "180s" real, "High Checkout" real, "3-dart Average" text ) -- Using valid SQLite, answer the following questions for the ...
SELECT MIN("180s") FROM table_18797
wikisql
CREATE TABLE table_name_49 ( date VARCHAR, record VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Date has a Record of 7 7 1?
SELECT date FROM table_name_49 WHERE record = "7–7–1"
sql_create_context
CREATE TABLE table_40695 ( "Region" text, "Host" text, "Venue" text, "City" text, "State" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Mideast region host University of Tennessee is in what state?
SELECT "State" FROM table_40695 WHERE "Region" = 'mideast' AND "Host" = 'university of tennessee'
wikisql
CREATE TABLE table_25966 ( "Year" real, "Host City" text, "Host School" text, "Champion" text, "Second Place" text, "Third Place" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who were the champions in years where michigan technological univers...
SELECT "Champion" FROM table_25966 WHERE "Third Place" = 'Michigan Technological University'
wikisql
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 microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-17834')) AND microlab.culturesite = 'sputum, tracheal specimen' AND DATETI...
eicu
CREATE TABLE table_41635 ( "Driver" text, "NOR 1" text, "NOR 2" text, "ZAN 1" text, "ZAN 2" text, "N\u00dcR 1" text, "N\u00dcR 2" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the zan 1 that has 11 as the nor 1?
SELECT "ZAN 1" FROM table_41635 WHERE "NOR 1" = '11'
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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.marital_status = "DIVORCED" AND diagnoses.short_title = "Heart valve transplant"
mimicsql_data
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 COUNT(*) FROM (SELECT t_kc24.t_kc21_MED_ORG_DEPT_CD FROM t_kc24 WHERE t_kc24.t_kc21_MED_SER_ORG_NO = '7737144' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2002-04-10' AND '2007-07-20' GROUP BY t_kc24.t_kc21_MED_ORG_DEPT_CD HAVING SUM(t_kc24.MED_AMOUT) > 8492.85) AS T
css
CREATE TABLE table_name_47 ( markatal INTEGER, inhabitants_per_km² VARCHAR, area__in_km²_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the sum of Markatal, when Inhabitants Per Km is less than 13, and when Area (in Km ) is 27?
SELECT SUM(markatal) FROM table_name_47 WHERE inhabitants_per_km² < 13 AND area__in_km²_ = 27
sql_create_context
CREATE TABLE table_name_97 ( score VARCHAR, opponent VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Can you tell me the Score that has the Opponent of at edmonton oilers?
SELECT score FROM table_name_97 WHERE opponent = "at edmonton oilers"
sql_create_context
CREATE TABLE table_name_24 ( player VARCHAR, previous_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which player was previously on the New York Knicks?
SELECT player FROM table_name_24 WHERE previous_team = "new york knicks"
sql_create_context
CREATE TABLE endowment ( endowment_id number, school_id number, donator_name text, amount number ) CREATE TABLE budget ( school_id number, year number, budgeted number, total_budget_percent_budgeted number, invested number, total_budget_percent_invested number, budget_invest...
SELECT T2.school_name FROM endowment AS T1 JOIN school AS T2 ON T1.school_id = T2.school_id GROUP BY T1.school_id HAVING SUM(T1.amount) <= 10
spider
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 zyjzjlb ( CYBQDM text, CYBQMC...
SELECT jybgb.SHRGH, jybgb.SHRXM FROM jybgb WHERE jybgb.JZLSH = '93390516653' GROUP BY jybgb.SHRGH HAVING COUNT(*) > 21
css
CREATE TABLE table_68025 ( "Year" real, "Result" text, "Award" text, "Category" text, "Nominated work" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the award for the 2009 songwriter of the year?
SELECT "Award" FROM table_68025 WHERE "Year" = '2009' AND "Category" = 'songwriter of the year'
wikisql
CREATE TABLE table_name_67 ( date VARCHAR, home VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the date of the home game for Colorado?
SELECT date FROM table_name_67 WHERE home = "colorado"
sql_create_context
CREATE TABLE table_name_70 ( tournament VARCHAR, location VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What tournament is in Arizona?
SELECT tournament FROM table_name_70 WHERE location = "arizona"
sql_create_context
CREATE TABLE table_name_29 ( years_for_jazz VARCHAR, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What years did Troy Hudson play for the Jazz?
SELECT years_for_jazz FROM table_name_29 WHERE player = "troy hudson"
sql_create_context
CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), ...
SELECT HIRE_DATE, SUM(MANAGER_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40
nvbench
CREATE TABLE table_name_98 ( loss VARCHAR, record VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the loss of the Mariners game when they had a record of 21-34?
SELECT loss FROM table_name_98 WHERE record = "21-34"
sql_create_context
CREATE TABLE table_name_67 ( circuit VARCHAR, winning_team VARCHAR, fastest_lap VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What circuit did marlboro team penske win with an unknown fastest lap?
SELECT circuit FROM table_name_67 WHERE winning_team = "marlboro team penske" AND fastest_lap = "unknown"
sql_create_context
CREATE TABLE Products ( Product_Type_Code VARCHAR, Product_Price INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Show the product type codes that have both products with price higher than 4500 and products with price lower than 3000.
SELECT Product_Type_Code FROM Products WHERE Product_Price > 4500 INTERSECT SELECT Product_Type_Code FROM Products WHERE Product_Price < 3000
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 gwyjzb.MED_CLINIC_ID FROM gwyjzb WHERE gwyjzb.PERSON_NM = '云甜恬' AND gwyjzb.MED_SER_ORG_NO = '1264230' AND gwyjzb.OUT_DIAG_DIS_NM LIKE '%沙眼%' UNION SELECT fgwyjzb.MED_CLINIC_ID FROM fgwyjzb WHERE fgwyjzb.PERSON_NM = '云甜恬' AND fgwyjzb.MED_SER_ORG_NO = '1264230' AND fgwyjzb.OUT_DIAG_DIS_NM LIKE '%沙眼%'
css
CREATE TABLE table_23384 ( "Ballpark" text, "Location" text, "Team" text, "Opened" real, "Closed" real, "Demod" real, "Current Status" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many locations have been used for ballparks named Memor...
SELECT COUNT("Location") FROM table_23384 WHERE "Ballpark" = 'Memorial Stadium'
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 COUNT(*) FROM zyjybgb WHERE zyjybgb.JZLSH = '40747707754' UNION SELECT COUNT(*) FROM mzjybgb WHERE mzjybgb.JZLSH = '40747707754'
css
CREATE TABLE jybgb ( YLJGDM text, YLJGDM_MZJZJLB text, YLJGDM_ZYJZJLB text, BGDH text, BGRQ time, JYLX number, JZLSH text, JZLSH_MZJZJLB text, JZLSH_ZYJZJLB text, JZLX number, KSBM text, KSMC text, SQRGH text, SQRXM text, BGRGH text, BGRXM text, SHRGH ...
SELECT JCZBDM, JCZBMC, JCZBJGDX, JCZBJGDL, JCZBJGDW, CKZFWXX, CKZFWSX FROM jyjgzbb WHERE BGDH = '31259533225'
css
CREATE TABLE table_name_22 ( finish VARCHAR, franchise VARCHAR, year VARCHAR, league VARCHAR, percentage VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the Finish when NL was the League, the Percentage was under 0.726, the Year was large...
SELECT finish FROM table_name_22 WHERE league = "nl" AND percentage < 0.726 AND year > 1897 AND franchise = "pittsburgh pirates"
sql_create_context
CREATE TABLE table_train_253 ( "id" int, "pregnancy_or_lactation" bool, "pre_eclampsia" bool, "acute_ischemia" bool, "pre_gestational_hypertension" bool, "diabetic" string, "smoking" bool, "coronary_artery_disease_cad" bool, "NOUSE" float ) -- Using valid SQLite, answer the followi...
SELECT * FROM table_train_253 WHERE pregnancy_or_lactation = 1 AND pre_gestational_hypertension = 1
criteria2sql
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 COUNT(*) FROM hz_info JOIN mzjzjlb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX WHERE hz_info.person_info_XM = '窦碧玉' AND mzjzjlb.JZKSRQ BETWEEN '2001-08-28' AND '2006-01-01' AND mzjzjlb.YLJGDM = '9175260'
css
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 medication ( medi...
SELECT COUNT(*) > 0 FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '021-246447')) AND vitalperiodic.respiration BETWEEN respiration_lowe...
eicu
CREATE TABLE swimmer ( id number, name text, nationality text, meter_100 number, meter_200 text, meter_300 text, meter_400 text, meter_500 text, meter_600 text, meter_700 text, time text ) CREATE TABLE stadium ( id number, name text, capacity number, city tex...
SELECT name FROM swimmer ORDER BY meter_100
spider
CREATE TABLE table_41933 ( "Position" real, "Team" text, "Points" real, "Played" real, "Drawn" real, "Lost" real, "Against" real, "Difference" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the highest Points in Position 2 with m...
SELECT MAX("Points") FROM table_41933 WHERE "Position" = '2' AND "Drawn" > '3'
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 COUNT(*) FROM qtb JOIN t_kc22 ON qtb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE qtb.PERSON_ID = '86561769' AND t_kc22.STA_DATE BETWEEN '2002-01-19' AND '2019-07-05' AND t_kc22.SOC_SRT_DIRE_NM = '盐酸文拉法辛缓释片' UNION SELECT COUNT(*) FROM gyb JOIN t_kc22 ON gyb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gyb.PERSON_ID ...
css
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 demographic.gender, prescriptions.formulary_drug_cd FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.subject_id = "2560"
mimicsql_data
CREATE TABLE department ( dept_code text, dept_name text, school_code text, emp_num number, dept_address text, dept_extension text ) CREATE TABLE class ( class_code text, crs_code text, class_section text, class_time text, class_room text, prof_num number ) CREATE TABLE...
SELECT crs_credit, crs_description FROM course WHERE crs_code = 'CIS-220'
spider
CREATE TABLE table_name_87 ( pick INTEGER, nfl_club VARCHAR, round VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the highest pick of the houston oilers NFL club, which has a round greater than 10?
SELECT MAX(pick) FROM table_name_87 WHERE nfl_club = "houston oilers" AND round > 10
sql_create_context
CREATE TABLE table_47962 ( "Round" real, "Pick" real, "Overall" real, "Name" text, "Position" text, "College" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which round has more than 79 overall and a position of QB?
SELECT "Round" FROM table_47962 WHERE "Position" = 'qb' AND "Overall" > '79'
wikisql
CREATE TABLE city ( city_code varchar, city_name varchar, state_code varchar, country_name varchar, time_zone_code varchar ) CREATE TABLE time_interval ( period text, begin_time int, end_time int ) CREATE TABLE dual_carrier ( main_airline varchar, low_flight_number int, hig...
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 = 'SAN FRANCISCO' AND date_day.day_number = 21 AND date_day.month_number = ...
atis
CREATE TABLE time_zone ( time_zone_code text, time_zone_name text, hours_from_gmt int ) CREATE TABLE food_service ( meal_code text, meal_number int, compartment text, meal_description varchar ) CREATE TABLE date_day ( month_number int, day_number int, year int, day_name var...
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'HOUSTON' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'ST. PA...
atis
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 t.range AS "score_range", COUNT(*) AS "number_of_occurences" FROM (SELECT CASE WHEN LENGTH(Body) BETWEEN 0 AND 100 THEN ' 0-100' WHEN LENGTH(Body) BETWEEN 101 AND 200 THEN '101-200' WHEN LENGTH(Body) BETWEEN 201 AND 300 THEN '201-300' WHEN LENGTH(Body) BETWEEN 301 AND 400 THEN '301-400' WHEN LENGTH(Body) BETWEEN...
sede
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.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM, t_kc22.UNIVALENT FROM t_kc22 WHERE t_kc22.MED_CLINIC_ID IN (SELECT qtb.MED_CLINIC_ID FROM qtb WHERE qtb.PERSON_NM = '陈梦凡' AND qtb.MED_SER_ORG_NO = '5107523' UNION SELECT gyb.MED_CLINIC_ID FROM gyb WHERE gyb.PERSON_NM = '陈梦凡' AND gyb.MED_SER_ORG_NO = '5107523' UNION...
css
CREATE TABLE table_78987 ( "Position" real, "Team" text, "Played" real, "Drawn" real, "Lost" real, "Goals For" real, "Goals Against" real, "Goal Difference" text, "Points 1" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the ...
SELECT COUNT("Goals For") FROM table_78987 WHERE "Drawn" < '7' AND "Lost" < '21' AND "Points 1" = '33'
wikisql
CREATE TABLE table_2562572_26 ( dominant_religion__2002_ VARCHAR, settlement VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the dominant religion in Gornji Tavankut?
SELECT dominant_religion__2002_ FROM table_2562572_26 WHERE settlement = "Gornji Tavankut"
sql_create_context
CREATE TABLE table_name_79 ( outcome VARCHAR, partnering VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the outcome for jordan kerr july 19, 2004
SELECT outcome FROM table_name_79 WHERE partnering = "jordan kerr" AND date = "july 19, 2004"
sql_create_context
CREATE TABLE bdmzjzjlb ( CYBQDM text, CYBQMC text, CYCWH text, CYKSDM text, CYKSMC text, CYSJ time, CYZTDM number, HZXM text, JZKSDM text, JZKSMC text, JZLSH number, KH text, KLX number, MZBMLX number, MZJZLSH text, MZZDBM text, MZZDMC text, MZZYZD...
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 movie ( movie_id number, title text, year number, director text, budget_million number, gross_worldwide number ) CREATE TABLE culture_company ( company_name text, type text, incorporated_in text, group_equity_shareholding number, book_club_id text, movie_id ...
SELECT category, COUNT(*) FROM book_club GROUP BY category
spider
CREATE TABLE table_name_22 ( apps INTEGER, season VARCHAR, goals VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the most apps that a has a total season and 3 goals?
SELECT MAX(apps) FROM table_name_22 WHERE season = "total" AND goals > 3
sql_create_context
CREATE TABLE table_204_302 ( id number, "rank" number, "nation" text, "gold" number, "silver" number, "bronze" number, "total" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- which is the only nation to win a gold medal and nothing else ?
SELECT "nation" FROM table_204_302 WHERE "gold" = 1 AND "silver" = 0 AND "bronze" = 0
squall
CREATE TABLE member ( Member_ID int, Name text, Country text, College_ID int ) CREATE TABLE college ( College_ID int, Name text, Leader_Name text, College_Location text ) CREATE TABLE round ( Round_ID int, Member_ID int, Decoration_Theme text, Rank_in_Round int ) -- U...
SELECT Country, COUNT(*) FROM member GROUP BY Country
nvbench
CREATE TABLE table_51045 ( "Season" real, "Team 1" text, "Score" text, "Team 2" text, "Venue" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Venue has a Score of 0:0, a Season larger than 2010, and a Team 1 of t&t hanoi?
SELECT "Venue" FROM table_51045 WHERE "Score" = '0:0' AND "Season" > '2010' AND "Team 1" = 't&t hanoi'
wikisql
CREATE TABLE table_name_74 ( section VARCHAR, season VARCHAR, level VARCHAR, position VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which section has a level of Tier 3, is in the 6th position, and is in the 1937-38 season?
SELECT section FROM table_name_74 WHERE level = "tier 3" AND position = "6th" AND season = "1937-38"
sql_create_context
CREATE TABLE table_60516 ( "Season" real, "Series" text, "Team" text, "Races" text, "Wins" text, "Poles" text, "Podiums" text, "Points" text, "Position" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Team has Podiums of 0, and ...
SELECT "Team" FROM table_60516 WHERE "Podiums" = '0' AND "Position" = 'nc†'
wikisql
CREATE TABLE lives_in ( stuid number, dormid number, room_number number ) CREATE TABLE dorm ( dormid number, dorm_name text, student_capacity number, gender text ) CREATE TABLE has_amenity ( dormid number, amenid number ) CREATE TABLE student ( stuid number, lname text, ...
SELECT fname FROM student WHERE age > 20
spider
CREATE TABLE table_27539535_7 ( february VARCHAR, opponent VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What day in February did the team play the boston bruins?
SELECT february FROM table_27539535_7 WHERE opponent = "Boston Bruins"
sql_create_context
CREATE TABLE table_name_80 ( average INTEGER, team VARCHAR, goals VARCHAR, matches VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the largest Average with Goals smaller than 34, Matches larger than 30, and a Team of cultural leonesa?
SELECT MAX(average) FROM table_name_80 WHERE goals < 34 AND matches > 30 AND team = "cultural leonesa"
sql_create_context
CREATE TABLE table_14752049_6 ( country VARCHAR, change__2011_to_2012_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When the change (2011 to 2012) is +13.4% what is the country?
SELECT country FROM table_14752049_6 WHERE change__2011_to_2012_ = "+13.4%"
sql_create_context
CREATE TABLE table_46375 ( "Tournament" text, "Surface" text, "Week" text, "Winner" text, "Finalist" text, "Semifinalists" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Semifinalists that has a Tournament of Cincinnati?
SELECT "Semifinalists" FROM table_46375 WHERE "Tournament" = 'cincinnati'
wikisql
CREATE TABLE ground_service ( city_code text, airport_code text, transport_type text, ground_fare int ) CREATE TABLE time_interval ( period text, begin_time int, end_time int ) CREATE TABLE class_of_service ( booking_class varchar, rank int, class_description text ) CREATE TAB...
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE (CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'ATLANTA' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'DENVE...
atis
CREATE TABLE table_16175217_1 ( donor_payment VARCHAR, country VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the donor payment in Belgium?
SELECT donor_payment FROM table_16175217_1 WHERE country = "Belgium"
sql_create_context
CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text ) CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number,...
SELECT Id AS "post_link", * FROM Posts JOIN PostTags ON Posts.Id = PostTags.PostId WHERE PostTags.TagId = 4 AND (Body LIKE '%dpkg%' OR Body LIKE '% apt%' OR Body LIKE '%apt-get%') ORDER BY CreationDate DESC
sede
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) 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, ...
SELECT jyjgzbb.CKZFWXX, jyjgzbb.CKZFWSX FROM mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN mzjzjlb_jybgb ON mzjzjlb.YLJGDM = mzjzjlb_jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH AND mzjzjlb_jybgb.YLJGDM = jybgb.YLJGDM AND mzjzjlb_jybgb.BGDH = jybgb....
css
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 ParentId AS "Post Link", OwnerUserId AS "User Link", COUNT(*) AS "Number of Answers" FROM Posts WHERE ParentId > 0 AND OwnerUserId > 0 AND Score > 5 GROUP BY ParentId, OwnerUserId HAVING COUNT(*) >= 2 ORDER BY COUNT(*) DESC
sede
CREATE TABLE table_203_104 ( id number, "athlete" text, "nation" text, "olympics" text, "gold" number, "silver" number, "bronze" number, "total" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what was the greatest number of gold medals...
SELECT MAX("gold") FROM table_203_104
squall
CREATE TABLE table_name_55 ( h_a_n VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is H/A/N when Date is February 24?
SELECT h_a_n FROM table_name_55 WHERE date = "february 24"
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 demographic.dob, diagnoses.icd9_code FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.name = "Jerry Deberry"
mimicsql_data
CREATE TABLE table_65039 ( "Rank" real, "Rider" text, "Team" text, "Speed" text, "Time" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the team when the time is 1:11.19.89?
SELECT "Team" FROM table_65039 WHERE "Time" = '1:11.19.89'
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 WHERE demographic.admityear < "2148" AND diagnoses.short_title = "Obesity NOS"
mimicsql_data
CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid number, wardid number, admissionheight number, admissionweight number, dischargeweight number, hospitaladmittime time, ...
SELECT t1.celllabel FROM (SELECT intakeoutput.celllabel, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM intakeoutput WHERE intakeoutput.cellpath LIKE '%output%' AND STRFTIME('%y', intakeoutput.intakeoutputtime) >= '2103' GROUP BY intakeoutput.celllabel) AS t1 WHERE t1.c1 <= 5
eicu
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemics...
SELECT MAX(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 diagnosis.patientunitstayid FROM diagnosis WHERE diagnosis.diagnosisname = 'diabetes mellitus - type ii')) AND STRFTIME(...
eicu
CREATE TABLE table_name_79 ( base_pairs VARCHAR, genes VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What base pair has 832 genes?
SELECT base_pairs FROM table_name_79 WHERE genes = 832
sql_create_context
CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE icustays ( row_id number, subject_id number, hadm_id number, icustay_id number, first_careunit text, last_careunit ...
SELECT COUNT(*) > 0 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 = 9566)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'arterial bp [systo...
mimic_iii
CREATE TABLE table_name_14 ( tracking_method VARCHAR, latest_stable_release VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which tracking method has a latest stable release of 2.23-05?
SELECT tracking_method FROM table_name_14 WHERE latest_stable_release = "2.23-05"
sql_create_context
CREATE TABLE table_68719 ( "Name" text, "Years" text, "League" text, "FA Cup" text, "League Cup" text, "Europe" text, "Other [C ]" text, "Total" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- The Europe listing of 117 0 (8) belongs to wh...
SELECT "League" FROM table_68719 WHERE "Europe" = '117 0 (8)'
wikisql
CREATE TABLE table_name_94 ( chassis VARCHAR, year INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the chassis of Emilio de Villota in 1981?
SELECT chassis FROM table_name_94 WHERE year > 1981
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 zyjzjlb.MZBMLX, zyjzjlb.MZZDBM, zyjzjlb.MZZDMC FROM zyjzjlb WHERE zyjzjlb.JZLSH = '07789075441'
css
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 jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN 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.JZLSH_MZJZJLB ...
css
CREATE TABLE table_28113 ( "Series #" real, "Season #" real, "Title" text, "Director" text, "Writer(s)" text, "Airdate" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the season # for the episode with air date february 2, 1970?
SELECT MAX("Season #") FROM table_28113 WHERE "Airdate" = 'February 2, 1970'
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 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.icd9_code = "41031" AND lab.fluid = "Ascites"
mimicsql_data
CREATE TABLE table_203_530 ( id number, "country" text, "gdp (usd bln, 2012)" number, "gdp (usd bln, 2017)" number, "gdp (usd ppp bln, 2012)" number, "gdp (usd ppp bln, 2017)" number, "per capita (usd, 2012)" number, "per capita (usd, 2017)" number, "per capita (usd ppp, 2012)" numbe...
SELECT SUM("gdp (usd ppp bln, 2012)") FROM table_203_530 WHERE "country" IN ('niger', 'sierra leone')
squall
CREATE TABLE employee ( eid number, name text, salary number ) CREATE TABLE aircraft ( aid number, name text, distance number ) CREATE TABLE flight ( flno number, origin text, destination text, distance number, departure_date time, arrival_date time, price number, ...
SELECT T2.name FROM flight AS T1 JOIN aircraft AS T2 ON T1.aid = T2.aid WHERE T1.flno = 99
spider