instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE table_name_12 ( rank INTEGER, total VARCHAR, nation VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the sum of rank when total is 3 and the nation is Australia?
SELECT SUM(rank) FROM table_name_12 WHERE total = 3 AND nation = "australia"
sql_create_context
CREATE TABLE food_service ( meal_code text, meal_number int, compartment text, meal_description varchar ) CREATE TABLE time_interval ( period text, begin_time int, end_time int ) CREATE TABLE city ( city_code varchar, city_name varchar, state_code varchar, country_name varc...
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 = 'PHILADELPHIA' AND date_day.day_number = 27 AND date_day.month_number = 8 ...
atis
CREATE TABLE table_14225 ( "T-35" text, "T-100" text, "KV-1 M1940" text, "KV-1 M1941" text, "KV-1 M1942" text, "KV-1S M1942" text, "KV-85 M1943" text, "IS-2 M1945" text, "IS-3 M1945" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Wha...
SELECT "KV-85 M1943" FROM table_14225 WHERE "KV-1S M1942" = '45'
wikisql
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) C...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.icd9_code = "35981" AND prescriptions.drug_type = "BASE"
mimicsql_data
CREATE TABLE table_14801 ( "Station No." real, "Station Name" text, "Chinese Name" text, "Travel Time (hrs)" text, "Distance (km)" real, "Transfers" text, "Location ( District )" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the Chin...
SELECT "Chinese Name" FROM table_14801 WHERE "Station Name" = 'wudaokou'
wikisql
CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Percent text, ACC_Home text, ACC_Road text, All_Games text, All_Games_Percent int, All_Home text, All_Road text, All_Neutral text ) CREATE TABLE university ( Scho...
SELECT All_Games, Team_ID FROM basketball_match ORDER BY Team_ID
nvbench
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 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-3355' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospi...
eicu
CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Percent text, ACC_Home text, ACC_Road text, All_Games text, All_Games_Percent int, All_Home text, All_Road text, All_Neutral text ) CREATE TABLE university ( Scho...
SELECT All_Neutral, School_ID FROM basketball_match
nvbench
CREATE TABLE table_41693 ( "Team #1" text, "Agg." text, "Team #2" text, "1st leg" text, "2nd leg" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the team #1 that has unics kazan for team #2?
SELECT "Team #1" FROM table_41693 WHERE "Team #2" = 'unics kazan'
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 MAIN_COND_DES FROM t_kc21 WHERE MED_CLINIC_ID = '76565041487'
css
CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE labevents ( row_id number, ...
SELECT transfers.wardid FROM transfers WHERE transfers.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 56348) AND NOT transfers.wardid IS NULL AND STRFTIME('%y', transfers.intime) = '2103' ORDER BY transfers.intime DESC LIMIT 1
mimic_iii
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE diagnosis ( diag...
SELECT MIN(vitalperiodic.respiration) FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '022-47232')) AND NOT vitalperiodic.respiration IS ...
eicu
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, T1.id FROM mountain AS T1 JOIN photos AS T2 ON T1.id = T2.mountain_id
nvbench
CREATE TABLE table_name_94 ( viewers__millions_ VARCHAR, airdate VARCHAR, channel_4_weekly_rank_a VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the number of viewers in millions for the episode on October 10, 2008, and a Channel 4 weekly rank a ...
SELECT COUNT(viewers__millions_) FROM table_name_94 WHERE airdate = "october 10, 2008" AND channel_4_weekly_rank_a < 30
sql_create_context
CREATE TABLE table_16799784_11 ( name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the name origin of Nike Fossae?
SELECT name AS origin FROM table_16799784_11 WHERE name = "Nike Fossae"
sql_create_context
CREATE TABLE table_68915 ( "Year" real, "Theme" text, "Artist" text, "Mintage" text, "Issue price" real, "Special notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average issue price with from Toronto maple leafs gift set, and a...
SELECT AVG("Issue price") FROM table_68915 WHERE "Special notes" = 'from toronto maple leafs gift set' AND "Mintage" = '3527'
wikisql
CREATE TABLE table_16356 ( "Rank" real, "English title" text, "Chinese title" text, "Average" real, "Peak" real, "Premiere" real, "Finale" real, "HK viewers" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many viewers were there for ...
SELECT "HK viewers" FROM table_16356 WHERE "Premiere" = '34'
wikisql
CREATE TABLE table_20018 ( "Census Year" real, "Number of Muslims 000" real, "Population of England and Wales 000" real, "Muslim (% of Total population)" text, "Registered Mosques" real, "Muslims per mosque" real ) -- Using valid SQLite, answer the following questions for the tables provided a...
SELECT MAX("Census Year") FROM table_20018
wikisql
CREATE TABLE table_60112 ( "Country" text, "Date" text, "Label" text, "Format" text, "Catalogue #" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which label is in a limited edition cd/dvd format?
SELECT "Label" FROM table_60112 WHERE "Format" = 'limited edition cd/dvd'
wikisql
CREATE TABLE table_name_23 ( release_date VARCHAR, release_price___usd__ VARCHAR, turbo VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the release date when the release price (usd) is $346 and the turbo is 9/11?
SELECT release_date FROM table_name_23 WHERE release_price___usd__ = "$346" AND turbo = "9/11"
sql_create_context
CREATE TABLE table_27592654_2 ( province VARCHAR, electorate VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the province if the electorate was Collingwood?
SELECT province FROM table_27592654_2 WHERE electorate = "Collingwood"
sql_create_context
CREATE TABLE table_name_11 ( score VARCHAR, competition_round VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the score of the copa libertadores group 3 competition round on 2 February 1994?
SELECT score FROM table_name_11 WHERE competition_round = "copa libertadores group 3" AND date = "2 february 1994"
sql_create_context
CREATE TABLE people ( People_ID int, Sex text, Name text, Date_of_Birth text, Height real, Weight real ) CREATE TABLE candidate ( Candidate_ID int, People_ID int, Poll_Source text, Date text, Support_rate real, Consider_rate real, Oppose_rate real, Unsure_rate re...
SELECT Date_of_Birth, Height FROM people ORDER BY Date_of_Birth
nvbench
CREATE TABLE table_31678 ( "Cellist" text, "Orchestra" text, "Conductor" text, "Record Company" text, "Year of Recording" real, "Format" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What record company released a CD in 1964?
SELECT "Record Company" FROM table_31678 WHERE "Year of Recording" = '1964' AND "Format" = 'cd'
wikisql
CREATE TABLE table_203_79 ( id number, "year" number, "film" text, "publisher" text, "director" text, "distributor" text, "worldwide gross" text, "notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- which live action american superhero...
SELECT "film" FROM table_203_79 ORDER BY "worldwide gross" DESC LIMIT 1
squall
CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time, drug text, ...
SELECT microbiologyevents.spec_type_desc FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 55624) AND DATETIME(microbiologyevents.charttime) <= DATETIME(CURRENT_TIME(), '-37 month') ORDER BY microbiologyevents.charttime LIMIT 1
mimic_iii
CREATE TABLE table_204_575 ( id number, "place" number, "position" text, "number" number, "name" text, "league one" number, "fa cup" number, "league cup" number, "football league trophy" number, "total" number ) -- Using valid SQLite, answer the following questions for the tabl...
SELECT "name" FROM table_204_575 WHERE "total" < (SELECT "total" FROM table_204_575 WHERE "name" = 'paul parry') ORDER BY "total" DESC LIMIT 1
squall
CREATE TABLE table_27378582_1 ( city VARCHAR, enrollment VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the city for enrollment being 19900
SELECT city FROM table_27378582_1 WHERE enrollment = 19900
sql_create_context
CREATE TABLE table_206359_1 ( _percentage_of_votes VARCHAR, _percentage_of_capital VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What percentage of votes does the shareholder with 78.19% of capital have?
SELECT _percentage_of_votes FROM table_206359_1 WHERE _percentage_of_capital = "78.19"
sql_create_context
CREATE TABLE table_24330803_1 ( poles INTEGER, season VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many pole positions were there for the 2011 season?
SELECT MAX(poles) FROM table_24330803_1 WHERE season = 2011
sql_create_context
CREATE TABLE zyjzjlb ( YLJGDM text, JZLSH text, MZJZLSH text, KH text, KLX number, HZXM text, WDBZ number, RYDJSJ time, RYTJDM number, RYTJMC text, JZKSDM text, JZKSMC text, RZBQDM text, RZBQMC text, RYCWH text, CYKSDM text, CYKSMC text, CYBQDM tex...
SELECT SG, TZ, TW, SSY, SZY, XL, HXPLC, ML FROM mzjzjlb WHERE JZLSH = '97259664233'
css
CREATE TABLE offering_instructor ( offering_instructor_id int, offering_id int, instructor_id int ) CREATE TABLE comment_instructor ( instructor_id int, student_id int, score int, comment_text varchar ) CREATE TABLE gsi ( course_offering_id int, student_id int ) CREATE TABLE cours...
SELECT DISTINCT name, number FROM course WHERE department = 'EECS' AND has_lab = 'N'
advising
CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time, drug text, dose_val_rx text, dose_unit_rx text, route text ) CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, ...
SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', transfers.intime)) FROM transfers WHERE transfers.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 65582 AND admissions.dischtime IS NULL)) AND transfers....
mimic_iii
CREATE TABLE t_kc21 ( CLINIC_ID text, CLINIC_TYPE text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, ...
SELECT SUM(t_kc24.MED_AMOUT) FROM t_kc21 JOIN t_kc24 ON t_kc21.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE t_kc21.MED_SER_ORG_NO = '0148623' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2007-03-23' AND '2016-01-01'
css
CREATE TABLE table_66721 ( "Rank" real, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total rank with a total larger than 2, and less than 0 gold
SELECT SUM("Rank") FROM table_66721 WHERE "Total" > '2' AND "Gold" < '0'
wikisql
CREATE TABLE table_35043 ( "Length (feet)" text, "Year" text, "Make and model" text, "Floor type" text, "Number of seats" real, "Bicycle capacity\u2020" real, "Fuel propulsion" text, "Quantity" real ) -- Using valid SQLite, answer the following questions for the tables provided above. ...
SELECT COUNT("Number of seats") FROM table_35043 WHERE "Year" = '2001' AND "Quantity" > '4'
wikisql
CREATE TABLE table_34594 ( "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 mean drawn when the difference is 0...
SELECT AVG("Drawn") FROM table_34594 WHERE "Difference" = '0' AND "Against" > '31'
wikisql
CREATE TABLE table_11195 ( "Year" real, "Entrant" text, "Chassis" text, "Engine" text, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- which year has the toyota tf102 chassis?
SELECT COUNT("Year") FROM table_11195 WHERE "Chassis" = 'toyota tf102'
wikisql
CREATE TABLE table_22128871_1 ( director VARCHAR, vietnamese_title VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many directors have vietnamese titles of Gate, Gate, Paragate?
SELECT COUNT(director) FROM table_22128871_1 WHERE vietnamese_title = "Gate, gate, paragate"
sql_create_context
CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, valuenum number, valueuom t...
SELECT COUNT(DISTINCT t1.subject_id) 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 d_icd_diagnoses.short_title = 'twin-mate lb-in ho...
mimic_iii
CREATE TABLE event ( Event_ID int, Date text, Venue text, Name text, Event_Attendance int ) CREATE TABLE journalist ( journalist_ID int, Name text, Nationality text, Age text, Years_working int ) CREATE TABLE news_report ( journalist_ID int, Event_ID int, Work_Type ...
SELECT Nationality, COUNT(*) FROM journalist GROUP BY Nationality ORDER BY Nationality DESC
nvbench
CREATE TABLE table_name_78 ( first_game INTEGER, lost VARCHAR, drawn VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the earliest first game for a rugby team that has 7 lost games and 0 draws?
SELECT MIN(first_game) FROM table_name_78 WHERE lost = 7 AND drawn < 0
sql_create_context
CREATE TABLE table_name_31 ( planet VARCHAR, sanskrit_word VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Planet has a Sanskrit word of budha?
SELECT planet FROM table_name_31 WHERE sanskrit_word = "budha"
sql_create_context
CREATE TABLE table_48499 ( "Tie no" text, "Home team" text, "Score" text, "Away team" text, "Date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many times did Arsenal tie when they were away?
SELECT "Tie no" FROM table_48499 WHERE "Away team" = 'arsenal'
wikisql
CREATE TABLE qtb ( 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_NM = '袁英武' AND t_kc22.STA_DATE BETWEEN '2003-07-04' AND '2010-02-19' AND t_kc22.SELF_PAY_PRO < 0.03 UNION SELECT COUNT(*) FROM gyb JOIN t_kc22 ON gyb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gyb.PERSON_NM = '袁英武' AND t_k...
css
CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE outputevents ( ...
SELECT prescriptions.drug FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 66411 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1) AND prescriptions.route = 'os' ORDER BY prescriptions.startdate LIMIT 1
mimic_iii
CREATE TABLE table_2692 ( "Rnd" real, "Date" text, "Race Name" text, "Length" text, "Track" text, "Location" text, "Pole Position" text, "Winning Driver" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- If the location is Brooklyn, Michiga...
SELECT COUNT("Rnd") FROM table_2692 WHERE "Location" = 'Brooklyn, Michigan' AND "Pole Position" = 'Bobby Unser'
wikisql
CREATE TABLE statements ( statement_id number, statement_details text ) CREATE TABLE documents_with_expenses ( document_id number, budget_type_code text, document_details text ) CREATE TABLE accounts ( account_id number, statement_id number, account_details text ) CREATE TABLE project...
SELECT budget_type_code, budget_type_description FROM ref_budget_codes
spider
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 lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.marital_status = "WIDOWED" AND lab.label = "Bicarbonate"
mimicsql_data
CREATE TABLE table_9240 ( "Player" text, "No.(s)" text, "Height in Ft." text, "Position" text, "Years with Spurs" text, "School/Previous Club Team/Country" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Position, when Height in Ft. is 6-...
SELECT "Position" FROM table_9240 WHERE "Height in Ft." = '6-10'
wikisql
CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAddress text ) CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversa...
SELECT Id AS "user_link", (SELECT COUNT(*) FROM Posts WHERE PostTypeId = 1 AND LastEditorUserId = Users.Id AND OwnerUserId != Users.Id) AS QuestionEdits, (SELECT COUNT(*) FROM Posts WHERE PostTypeId = 2 AND LastEditorUserId = Users.Id AND OwnerUserId != Users.Id) AS AnswerEdits, (SELECT COUNT(*) FROM Posts WHERE LastEd...
sede
CREATE TABLE table_name_1 ( type VARCHAR, issued VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What type was issued in 1964?
SELECT type FROM table_name_1 WHERE issued = 1964
sql_create_context
CREATE TABLE table_38932 ( "Player" text, "Touchdowns" real, "Extra points" real, "Field goals" real, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Touchdowns is the lowest one that has Extra points smaller than 14, and a Player of w...
SELECT MIN("Touchdowns") FROM table_38932 WHERE "Extra points" < '14' AND "Player" = 'white' AND "Points" < '5'
wikisql
CREATE TABLE table_204_313 ( id number, "date" text, "operation" text, "location" text, "type" text, "information" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what are the total number of nato naval blockades ?
SELECT COUNT(*) FROM table_204_313 WHERE "type" = 'naval blockade'
squall
CREATE TABLE table_49205 ( "Year" real, "Starts" real, "Wins" real, "Top 5" real, "Top 10" real, "Poles" real, "Avg. Start" real, "Avg. Finish" real, "Winnings" text, "Position" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What...
SELECT MAX("Year") FROM table_49205 WHERE "Position" = '77th' AND "Poles" < '0'
wikisql
CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE admissions ( row_id number, subject_id number, ...
SELECT admissions.admission_type FROM admissions WHERE admissions.subject_id = 51977 AND STRFTIME('%y', admissions.admittime) >= '2103' ORDER BY admissions.admittime DESC LIMIT 1
mimic_iii
CREATE TABLE t_kc21 ( MED_CLINIC_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, COMP_ID text, PERSON_ID text, PERSON_NM text, IDENTITY_CARD text, SOC_SRT_CARD text, PERSON_SEX number, PERSON_AGE number, IN_HOSP_DATE time, OUT_HOSP_DATE time, DIFF_PLACE_FLG numb...
SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.PERSON_NM = '花心宜' GROUP BY t_kc22.SOC_SRT_DIRE_CD ORDER BY COUNT(*) DESC
css
CREATE TABLE certificate ( eid number(9,0), aid number(9,0) ) CREATE TABLE flight ( flno number(4,0), origin varchar2(20), destination varchar2(20), distance number(6,0), departure_date date, arrival_date date, price number(7,2), aid number(9,0) ) CREATE TABLE aircraft ( ai...
SELECT destination, COUNT(*) FROM flight GROUP BY destination
nvbench
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE 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 WHERE demographic.dob_year < "2056"
mimicsql_data
CREATE TABLE wdmzjzjlb ( 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.JYZBLSH 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.BGDH WHERE hz...
css
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.IN_DIAG_DIS_NM, AVG(gwyjzb.PERSON_AGE) FROM gwyjzb WHERE gwyjzb.MED_SER_ORG_NO = '7148894' GROUP BY gwyjzb.IN_DIAG_DIS_NM UNION SELECT fgwyjzb.IN_DIAG_DIS_NM, AVG(fgwyjzb.PERSON_AGE) FROM fgwyjzb WHERE fgwyjzb.MED_SER_ORG_NO = '7148894' GROUP BY fgwyjzb.IN_DIAG_DIS_NM
css
CREATE TABLE table_name_52 ( val_de_marne VARCHAR, seine_saint_denis VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- WHAT IS Val-de-Marne WITH Seine-Saint-Denis of 4.0%?
SELECT val_de_marne FROM table_name_52 WHERE seine_saint_denis = "4.0%"
sql_create_context
CREATE TABLE class_of_service ( booking_class varchar, rank int, class_description text ) CREATE TABLE airport ( airport_code varchar, airport_name text, airport_location text, state_code varchar, country_name varchar, time_zone_code varchar, minimum_connect_time int ) CREATE T...
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 = 'LAS VEGAS' AND date_day.day_number = 27 AND date_day.month_number = 8 AND...
atis
CREATE TABLE t_kc21 ( MED_CLINIC_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, COMP_ID text, PERSON_ID text, PERSON_NM text, IDENTITY_CARD text, SOC_SRT_CARD text, PERSON_SEX number, PERSON_AGE number, IN_HOSP_DATE time, OUT_HOSP_DATE time, DIFF_PLACE_FLG numb...
SELECT MED_INV_ITEM_TYPE FROM t_kc22 WHERE MED_CLINIC_ID = '02885209981' AND SOC_SRT_DIRE_NM = '稳心颗粒'
css
CREATE TABLE table_14689 ( "Year" text, "Start" text, "Qual" text, "Rank" text, "Finish" text, "Laps" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What year had the Finish of 12?
SELECT "Year" FROM table_14689 WHERE "Finish" = '12'
wikisql
CREATE TABLE table_name_8 ( opponent VARCHAR, tournament VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Opponent, when Tournament is 'Phuket , Thailand'?
SELECT opponent FROM table_name_8 WHERE tournament = "phuket , thailand"
sql_create_context
CREATE TABLE table_name_56 ( draft INTEGER, player VARCHAR, pick VARCHAR, round VARCHAR, nationality VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Draft has a Round of 1, a Nationality of canada, a Pick of 1, and a Player of vincent lecava...
SELECT AVG(draft) FROM table_name_56 WHERE round = "1" AND nationality = "canada" AND pick = "1" AND player = "vincent lecavalier"
sql_create_context
CREATE TABLE table_35530 ( "Unit" text, "Russian" text, "Translation" text, "Ratio" text, "Cubic inches (exact)" text, "Metric value" text, "Imperial value" text, "US Customary" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What are the...
SELECT "Cubic inches (exact)" FROM table_35530 WHERE "Metric value" = '104.955 l'
wikisql
CREATE TABLE table_name_14 ( season INTEGER, f_laps VARCHAR, poles VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average Season, when F/Laps is 1, and when Poles is less than 0?
SELECT AVG(season) FROM table_name_14 WHERE f_laps = 1 AND poles < 0
sql_create_context
CREATE TABLE table_name_85 ( directed_by VARCHAR, written_by VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who directed the episode written cyrus nowrasteh?
SELECT directed_by FROM table_name_85 WHERE written_by = "cyrus nowrasteh"
sql_create_context
CREATE TABLE table_name_1 ( player VARCHAR, place VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Place 2 Player?
SELECT player FROM table_name_1 WHERE place = "2"
sql_create_context
CREATE TABLE table_name_36 ( record VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the record for Dec 16?
SELECT record FROM table_name_36 WHERE date = "dec 16"
sql_create_context
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) C...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admission_type = "URGENT" AND prescriptions.drug = "Oxacillin"
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 diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.ethnicity = "WHITE - RUSSIAN" AND lab.itemid = "51375"
mimicsql_data
CREATE TABLE table_18864 ( "Result" text, "Date" text, "Race" text, "Venue" text, "Group" text, "Distance" text, "Weight (kg)" text, "Time" text, "Jockey" text, "Winner/2nd" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many...
SELECT COUNT("Weight (kg)") FROM table_18864 WHERE "Winner/2nd" = '1st - Defier' AND "Venue" = 'Randwick'
wikisql
CREATE TABLE table_26166836_1 ( country VARCHAR, road_race VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- In which country was the xiamen international marathon?
SELECT country FROM table_26166836_1 WHERE road_race = "Xiamen International Marathon"
sql_create_context
CREATE TABLE table_11677760_1 ( nba_draft VARCHAR, hometown VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the nba draft for the player from the hometown of virginia beach, va?
SELECT nba_draft FROM table_11677760_1 WHERE hometown = "Virginia Beach, VA"
sql_create_context
CREATE TABLE table_name_73 ( entered_service INTEGER, builder VARCHAR, number VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When did the tom smith built train enter service with a number under 7007?
SELECT AVG(entered_service) FROM table_name_73 WHERE builder = "tom smith" AND number < 7007
sql_create_context
CREATE TABLE climber ( climber_id number, name text, country text, time text, points number, mountain_id number ) CREATE TABLE mountain ( mountain_id number, name text, height number, prominence number, range text, country text ) -- Using valid SQLite, answer the follo...
SELECT name FROM mountain WHERE height > 5000 OR prominence > 1000
spider
CREATE TABLE table_name_56 ( home_team VARCHAR, away_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which home team competed against the away team of Melbourne?
SELECT home_team FROM table_name_56 WHERE away_team = "melbourne"
sql_create_context
CREATE TABLE table_204_881 ( id number, "round" number, "date" text, "score" text, "opponent" text, "opponent's score" text, "result" text, "venue" text, "attendance" number, "best on ground" text, "team" text ) -- Using valid SQLite, answer the following questions for the ...
SELECT "opponent" FROM table_204_881 WHERE "opponent's score" - "score" = 2
squall
CREATE TABLE PostsWithDeleted ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId number, OwnerDisplayName text, LastEditorUserId number, LastEditorDispl...
WITH texts_cte AS (SELECT DISTINCT c.Text AS Text FROM Comments AS c JOIN Posts AS p ON (c.PostId = p.Id) AND (p.OwnerUserId = '##UserId##') WHERE (c.Text LIKE '%@%')), substrings_cte AS (SELECT SUBSTRING(Text, STR_POSITION(Text, '@'), LENGTH(Text)) AS TextFrom FROM texts_cte), names AS (SELECT SUBSTRING(TextFrom, 1, P...
sede
CREATE TABLE table_2215159_2 ( outcome VARCHAR, year VARCHAR, surface VARCHAR, partner VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many outcomes were there for matches played with Chuck McKinley on grass in 1962?
SELECT COUNT(outcome) FROM table_2215159_2 WHERE surface = "Grass" AND partner = "Chuck McKinley" AND year = 1962
sql_create_context
CREATE TABLE table_name_58 ( position VARCHAR, years VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the position in 1999?
SELECT position FROM table_name_58 WHERE years = "1999"
sql_create_context
CREATE TABLE table_36180 ( "Week" real, "Date" text, "Opponent" text, "Location" text, "Time ( ET )" text, "Result" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Date of sun. oct. 29 has what time (et)?
SELECT "Time ( ET )" FROM table_36180 WHERE "Date" = 'sun. oct. 29'
wikisql
CREATE TABLE table_1152 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Record" text, "Game Site" text, "Attendance" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the game site for december 12, 1965
SELECT "Game Site" FROM table_1152 WHERE "Date" = 'December 12, 1965'
wikisql
CREATE TABLE candidate ( Candidate_ID int, People_ID int, Poll_Source text, Date text, Support_rate real, Consider_rate real, Oppose_rate real, Unsure_rate real ) CREATE TABLE people ( People_ID int, Sex text, Name text, Date_of_Birth text, Height real, Weight re...
SELECT Sex, COUNT(Sex) FROM people GROUP BY Sex
nvbench
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 Founder, SUM(Revenue) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder ORDER BY Founder
nvbench
CREATE TABLE table_name_21 ( time VARCHAR, elimination VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What time is listed against Elimination number 2?
SELECT time FROM table_name_21 WHERE elimination = "2"
sql_create_context
CREATE TABLE table_21271 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what i...
SELECT COUNT("Location Attendance") FROM table_21271 WHERE "Date" = 'December 29'
wikisql
CREATE TABLE month ( month_number int, month_name text ) CREATE TABLE class_of_service ( booking_class varchar, rank int, class_description text ) CREATE TABLE aircraft ( aircraft_code varchar, aircraft_description varchar, manufacturer varchar, basic_type varchar, engines int,...
SELECT DISTINCT fare.fare_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 (((flight.airline_code = 'CO') AND flight.flight_number = 271) AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN FRAN...
atis
CREATE TABLE qtb ( 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 WHERE qtb.MED_SER_ORG_NO = '3132833' AND qtb.IN_HOSP_DATE BETWEEN '2007-09-13' AND '2018-12-25' UNION SELECT COUNT(*) FROM gyb WHERE gyb.MED_SER_ORG_NO = '3132833' AND gyb.IN_HOSP_DATE BETWEEN '2007-09-13' AND '2018-12-25' UNION SELECT COUNT(*) FROM zyb WHERE zyb.MED_SER_ORG_NO = '3132833' AND ...
css
CREATE TABLE table_name_94 ( races_ridden VARCHAR, nationality VARCHAR, races_won VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many races did the German racer that won less than 10 races ride?
SELECT COUNT(races_ridden) FROM table_name_94 WHERE nationality = "german" AND races_won < 10
sql_create_context
CREATE TABLE table_204_798 ( id number, "year" number, "competition" text, "venue" text, "position" text, "notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- in which years did fumio finish 3rd and 2nd ?
SELECT "year" FROM table_204_798 WHERE "position" IN (3, 2)
squall
CREATE TABLE table_204_363 ( id number, "res." text, "record" text, "opponent" text, "method" text, "event" text, "date" text, "round" number, "time" text, "location" text, "notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. ...
SELECT COUNT(*) FROM table_204_363
squall
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 SUM(CASE WHEN patient.hospitaldischargestatus = 'alive' THEN 1 WHEN STRFTIME('%j', patient.hospitaldischargetime) - STRFTIME('%j', t4.diagnosistime) > 3 * 365 THEN 1 ELSE 0 END) * 100 / COUNT(*) FROM (SELECT t2.uniquepid, t2.diagnosistime FROM (SELECT t1.uniquepid, t1.diagnosistime FROM (SELECT patient.uniquepid...
eicu
CREATE TABLE table_32686 ( "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 highest attendance at Junction Oval...
SELECT MAX("Crowd") FROM table_32686 WHERE "Venue" = 'junction oval'
wikisql
CREATE TABLE table_23806 ( "BSE Code" text, "Company" text, "City" text, "GICS Sector" text, "Free float" text, "Index weighting (%" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is every company with an index weighting % of 1 and the city...
SELECT "Company" FROM table_23806 WHERE "Index weighting (%" = '1' AND "City" = 'Dimitrovgrad'
wikisql
CREATE TABLE table_2941 ( "Rank" real, "Building [A ]" text, "City" text, "Country" text, "Height (m)" text, "Height (ft)" text, "Floors" real, "Built" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How tall is the building with 36 floor...
SELECT "Height (m)" FROM table_2941 WHERE "Floors" = '36'
wikisql
CREATE TABLE table_name_26 ( round INTEGER, opponent VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the highest round a fight lasted against masutatsu yano?
SELECT MAX(round) FROM table_name_26 WHERE opponent = "masutatsu yano"
sql_create_context