instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE table_25923164_1 ( directed_by VARCHAR, us_viewers__million_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who directed the episode that had 12.88 million viewers?
SELECT directed_by FROM table_25923164_1 WHERE us_viewers__million_ = "12.88"
sql_create_context
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, ...
SELECT 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 = "3970" AND lab.fluid = "Pleural"
mimicsql_data
CREATE TABLE table_9975 ( "Game" text, "Date" text, "Home Team" text, "Result" text, "Road Team" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What game number was played on April 23, with Boston as the road team?
SELECT "Game" FROM table_9975 WHERE "Road Team" = 'boston' AND "Date" = 'april 23'
wikisql
CREATE TABLE table_name_50 ( date VARCHAR, city VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When was the event in Dublin?
SELECT date FROM table_name_50 WHERE city = "dublin"
sql_create_context
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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.dod_year <= "2133.0" AND prescriptions.formulary_drug_cd = "ALBU17H"
mimicsql_data
CREATE TABLE table_name_68 ( front_side_bus VARCHAR, model_number VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Front Side Bus for Model Number c7 1.5?
SELECT front_side_bus FROM table_name_68 WHERE model_number = "c7 1.5"
sql_create_context
CREATE TABLE table_name_55 ( wicket VARCHAR, runs__balls_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Wicket was it that had a 104 (69) Runs (balls) amount?
SELECT wicket FROM table_name_55 WHERE runs__balls_ = "104 (69)"
sql_create_context
CREATE TABLE table_67437 ( "Status" text, "Name" text, "First Performance" text, "Last Performance" text, "Style" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who had a ballet style with original cast?
SELECT "Name" FROM table_67437 WHERE "Style" = 'ballet' AND "Status" = 'original cast'
wikisql
CREATE TABLE table_79898 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was date of the game when the record was 31-15?
SELECT "Date" FROM table_79898 WHERE "Record" = '31-15'
wikisql
CREATE TABLE nuclear_power_plants ( id text, name text, latitude text, longitude text, country text, status text, reactortype text, reactormodel text, constructionstartat text, operationalfrom text, operationalto text, capacity text, lastupdatedat text, source tex...
SELECT country FROM nuclear_power_plants GROUP BY country HAVING COUNT(name) > 3
geonucleardata
CREATE TABLE table_38147 ( "Position" text, "Number" real, "Name" text, "Height" text, "Weight" real, "Class" text, "Hometown" text, "Games\u2191" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the class of the player with a weig...
SELECT "Class" FROM table_38147 WHERE "Weight" = '242'
wikisql
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 * FROM person_info JOIN hz_info JOIN zyjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX WHERE person_info.XM = '苗云岚' AND hz_info.YLJGDM = '9556803' AND NOT zyjzjlb.JZKSMC LIKE '%牙科%'
css
CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE d_icd_diagnoses ( row_id number...
SELECT d_labitems.label FROM d_labitems WHERE d_labitems.itemid IN (SELECT labevents.itemid FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 23721) AND STRFTIME('%y-%m', labevents.charttime) >= '2104-02' ORDER BY labevents.charttime LIMIT 1)
mimic_iii
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 INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_type = "NEWBORN" AND lab."CATEGORY" = "Blood Gas"
mimicsql_data
CREATE TABLE table_20401 ( "Player" text, "Matches" real, "Overs" text, "Maidens" real, "Runs" real, "Wickets" real, "Average" text, "Economy" text, "5w" real, "10w" real, "Best Bowling" text ) -- Using valid SQLite, answer the following questions for the tables provided ab...
SELECT "Overs" FROM table_20401 WHERE "Player" = 'Oliver Hannon-Dalby'
wikisql
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ...
SELECT demographic.dob, demographic.admission_location FROM demographic WHERE demographic.name = "Jerry Deberry"
mimicsql_data
CREATE TABLE table_name_58 ( date VARCHAR, pitcher VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- I want the date for an bal s nchez
SELECT date FROM table_name_58 WHERE pitcher = "aníbal sánchez"
sql_create_context
CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE i...
SELECT lab.labresulttime FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '030-56105')) AND lab.labname = 'mchc' AND STRFTIME('%y-%m', lab.labresulttime) = '2...
eicu
CREATE TABLE table_13897690_1 ( islands_name VARCHAR, population__2000_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the name is the island with a population of just 64?
SELECT islands_name FROM table_13897690_1 WHERE population__2000_ = "64"
sql_create_context
CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code tex...
SELECT patient.wardid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '012-39576') AND DATETIME(patient.unitadmittime) <= DATETIME(CURRENT_TIME(), '-1 year') ORDER BY patient.unitadmittime LIMIT 1
eicu
CREATE TABLE table_name_21 ( season VARCHAR, staffel_e VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which season has a Staffel E of Stahl Riesa?
SELECT season FROM table_name_21 WHERE staffel_e = "stahl riesa"
sql_create_context
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 Price, Manufacturer FROM Products WHERE Price BETWEEN 60 AND 120 GROUP BY Name
nvbench
CREATE TABLE table_25311 ( "Game" real, "Date" text, "Opponent" text, "Result" text, "Cowboys points" real, "Opponents" real, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What game was held against a team with a 6-3 record against...
SELECT "Game" FROM table_25311 WHERE "Record" = '6-3'
wikisql
CREATE TABLE table_7920 ( "Season in Tamil" text, "English Transliteration" text, "English Translation" text, "Season in Sanskrit" text, "Season in English" text, "Tamil Months" text, "Gregorian Months" text ) -- Using valid SQLite, answer the following questions for the tables provided ab...
SELECT "Season in Sanskrit" FROM table_7920 WHERE "Season in English" = 'summer'
wikisql
CREATE TABLE table_33567 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the smallest crowd at princes park?
SELECT MIN("Crowd") FROM table_33567 WHERE "Venue" = 'princes park'
wikisql
CREATE TABLE flight_fare ( flight_id int, fare_id int ) CREATE TABLE airport_service ( city_code varchar, airport_code varchar, miles_distant int, direction varchar, minutes_distant int ) CREATE TABLE flight ( aircraft_code_sequence text, airline_code varchar, airline_flight te...
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 = 'OAKLAND' AND date_day.day_number = 21 AND date_day.month_number = 2 AND d...
atis
CREATE TABLE wdmzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH number, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, KH text, KLX number, MJZH text, ML number, MZZYZDZZBM text, MZZYZDZ...
SELECT jybgb.SHSJ FROM person_info JOIN hz_info JOIN wdmzjzjlb JOIN jybgb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX AND wdmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND wdmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE person_info.XM = '周...
css
CREATE TABLE club ( club_id number, name text, region text, start_year text ) CREATE TABLE competition_result ( competition_id number, club_id_1 number, club_id_2 number, score text ) CREATE TABLE competition ( competition_id number, year number, competition_type text, ...
SELECT name FROM club WHERE NOT club_id IN (SELECT club_id FROM player)
spider
CREATE TABLE table_12477 ( "Name" text, "Pos." text, "Height" text, "Weight" text, "Date of Birth" text, "Club" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How tall is the person born on 1976-12-27?
SELECT "Height" FROM table_12477 WHERE "Date of Birth" = '1976-12-27'
wikisql
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id...
SELECT MAX(demographic.days_stay) FROM demographic WHERE demographic.dob_year > "2060"
mimicsql_data
CREATE TABLE table_name_59 ( score VARCHAR, opponent VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what was the score when scoville jenkins was the opponent?
SELECT score FROM table_name_59 WHERE opponent = "scoville jenkins"
sql_create_context
CREATE TABLE table_name_5 ( sample_size INTEGER, date VARCHAR, republican VARCHAR, margin_of_error VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the sample size of the poll taken on Dec 13-15, 2007 that had a margin of error of more than 4 a...
SELECT AVG(sample_size) FROM table_name_5 WHERE republican = "mike huckabee" AND margin_of_error > 4 AND date = "dec 13-15, 2007"
sql_create_context
CREATE TABLE table_15170 ( "Representative" text, "Title" text, "Presentation of Credentials" text, "Termination of Mission" text, "Appointed by" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Appointed by that has the Title of Ambassado...
SELECT "Appointed by" FROM table_15170 WHERE "Title" = 'ambassador extraordinary and plenipotentiary' AND "Representative" = 'spruille braden'
wikisql
CREATE TABLE table_name_44 ( population_1891 INTEGER, headquarters VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Population n1891 of the County with Sleaford Headquarters?
SELECT MAX(population_1891) FROM table_name_44 WHERE headquarters = "sleaford"
sql_create_context
CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE cost ( row_id number, subject_id number, hadm...
SELECT (SELECT labevents.valuenum FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 31088 AND admissions.dischtime IS NULL) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'rdw') ORDER BY labevents.charttime DESC...
mimic_iii
CREATE TABLE table_name_5 ( tie_no VARCHAR, away_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which tie number had an away team of Arsenal?
SELECT tie_no FROM table_name_5 WHERE away_team = "arsenal"
sql_create_context
CREATE TABLE table_41220 ( "Ballarat FL" text, "Wins" real, "Byes" real, "Losses" real, "Draws" real, "Against" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average draws with more than 1 win, 14 losses, and against less than 1836?...
SELECT AVG("Draws") FROM table_41220 WHERE "Wins" > '1' AND "Losses" = '14' AND "Against" < '1836'
wikisql
CREATE TABLE table_name_12 ( per_capita_income VARCHAR, county VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the per capital income for Washington county?
SELECT per_capita_income FROM table_name_12 WHERE county = "washington"
sql_create_context
CREATE TABLE hz_info ( KH text, KLX number, YLJGDM text, RYBH text ) CREATE TABLE mzjzjlb ( YLJGDM text, JZLSH text, KH text, KLX number, MJZH text, HZXM text, NLS number, NLY number, ZSEBZ number, JZZTDM number, JZZTMC text, JZJSSJ time, TXBZ number,...
SELECT SQRGH, SQRXM FROM jybgb WHERE BGDH = '77601421796'
css
CREATE TABLE table_57769 ( "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's the average number of people in the Crowd...
SELECT AVG("Crowd") FROM table_57769 WHERE "Home team" = 'essendon'
wikisql
CREATE TABLE table_10295819_2 ( ties_played INTEGER, years_played VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the minimum tiesplayed for 6 years
SELECT MIN(ties_played) FROM table_10295819_2 WHERE years_played = 6
sql_create_context
CREATE TABLE table_203_424 ( id number, "year" number, "starts" number, "wins" number, "top 5" number, "top 10" number, "poles" number, "avg. start" number, "avg. finish" number, "winnings" text, "position" text, "team(s)" text ) -- Using valid SQLite, answer the follow...
SELECT MAX("year") FROM table_203_424 WHERE "wins" >= 1
squall
CREATE TABLE table_name_51 ( score VARCHAR, country VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was japan's score?
SELECT score FROM table_name_51 WHERE country = "japan"
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_kc21.MED_SER_ORG_NO FROM t_kc21 WHERE t_kc21.PERSON_ID = '94479415' AND t_kc21.IN_HOSP_DATE BETWEEN '2016-04-10' AND '2018-12-25' GROUP BY t_kc21.MED_SER_ORG_NO ORDER BY COUNT(*) DESC LIMIT 1
css
CREATE TABLE table_18131 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Results" text, "Candidates" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the result of the election featuring incumbent norman sisisky?...
SELECT "Results" FROM table_18131 WHERE "Incumbent" = 'Norman Sisisky'
wikisql
CREATE TABLE wrestler ( wrestler_id number, name text, reign text, days_held text, location text, event text ) CREATE TABLE elimination ( elimination_id text, wrestler_id text, team text, eliminated_by text, elimination_move text, time text ) -- Using valid SQLite, ans...
SELECT location FROM wrestler GROUP BY location HAVING COUNT(*) > 2
spider
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 COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'acute renal failure' AND DATETIME(diagnosis.diagnosistime, 'start of year') = DATETIME(CURRENT_TIME(), 'star...
eicu
CREATE TABLE table_3008 ( "District" text, "Vacator" text, "Reason for change" text, "Successor" text, "Date successor seated" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When were the successor/s seated for Ohio 10th?
SELECT "Date successor seated" FROM table_3008 WHERE "District" = 'Ohio 10th'
wikisql
CREATE TABLE table_57914 ( "Race" text, "Circuit" text, "Date" text, "Pole position" text, "Fastest lap" text, "Winning driver" text, "Constructor" text, "Tyre" text, "Report" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Repo...
SELECT "Report" FROM table_57914 WHERE "Circuit" = 'reims'
wikisql
CREATE TABLE table_name_67 ( record VARCHAR, game VARCHAR, location VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the record when they played in the Miami Arena, before game 24?
SELECT record FROM table_name_67 WHERE game < 24 AND location = "miami arena"
sql_create_context
CREATE TABLE table_69776 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the record at the game that had a loss of Huffman (6 18)?
SELECT "Record" FROM table_69776 WHERE "Loss" = 'huffman (6–18)'
wikisql
CREATE TABLE table_34381 ( "Rank" real, "Name" text, "Nationality" text, "1st (m)" real, "Points" real, "Overall NT points" text, "Overall WC points (Rank)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Name has a Nationality of nor, ...
SELECT "Name" FROM table_34381 WHERE "Nationality" = 'nor' AND "Points" = '136'
wikisql
CREATE TABLE customer ( cust_ID varchar(3), cust_name varchar(20), acc_type char(1), acc_bal int, no_of_loans int, credit_score int, branch_ID int, state varchar(20) ) CREATE TABLE bank ( branch_ID int, bname varchar(20), no_of_customers int, city varchar(10), state ...
SELECT cust_name, credit_score FROM customer AS T1 JOIN loan AS T2 ON T1.cust_ID = T2.cust_ID ORDER BY credit_score DESC
nvbench
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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.days_stay > "4" AND prescriptions.formulary_drug_cd = "ENAL25I"
mimicsql_data
CREATE TABLE date_day ( month_number int, day_number int, year int, day_name varchar ) CREATE TABLE fare ( fare_id int, from_airport varchar, to_airport varchar, fare_basis_code text, fare_airline text, restriction_code text, one_direction_cost int, round_trip_cost int, ...
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 = 'SALT LAKE CITY' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name =...
atis
CREATE TABLE offering_instructor ( offering_instructor_id int, offering_id int, instructor_id int ) CREATE TABLE requirement ( requirement_id int, requirement varchar, college varchar ) CREATE TABLE course_offering ( offering_id int, course_id int, semester int, section_number ...
SELECT COUNT(*) > 0 FROM course, course_offering, instructor, offering_instructor, semester WHERE course.course_id = course_offering.course_id AND course.department = 'EECS' AND course.number = 509 AND instructor.name LIKE '%Zhaohui Xu%' AND offering_instructor.instructor_id = instructor.instructor_id AND offering_inst...
advising
CREATE TABLE table_38278 ( "Name" text, "Creator" text, "Platform / OS" text, "First public release" text, "Latest stable release" text, "Open source" text, "Programming language used" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Pro...
SELECT "Programming language used" FROM table_38278 WHERE "First public release" = '1997'
wikisql
CREATE TABLE table_66261 ( "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 average rank of west germany (frg), which has more than 1 silver, less than 11 g...
SELECT AVG("Rank") FROM table_66261 WHERE "Silver" > '1' AND "Gold" < '11' AND "Bronze" = '2' AND "Nation" = 'west germany (frg)'
wikisql
CREATE TABLE table_name_69 ( silver INTEGER, nation VARCHAR, gold VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the least silver that has mexico as a nation and a gold less than 0?
SELECT MIN(silver) FROM table_name_69 WHERE nation = "mexico" AND gold < 0
sql_create_context
CREATE TABLE table_name_45 ( goals_against INTEGER, losses VARCHAR, wins VARCHAR, goals_for VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Goals against has Wins of 13, and Goals for larger than 42, and more than 9 Losses?
SELECT AVG(goals_against) FROM table_name_45 WHERE wins = 13 AND goals_for > 42 AND losses > 9
sql_create_context
CREATE TABLE table_20906175_3 ( qb_rating VARCHAR, name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the QB rating for Neil lomax?
SELECT qb_rating FROM table_20906175_3 WHERE name = "Neil Lomax"
sql_create_context
CREATE TABLE table_12834315_5 ( barrel_profile VARCHAR, name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the barrell profile that goes with the gas piston carbine?
SELECT barrel_profile FROM table_12834315_5 WHERE name = "Gas Piston Carbine"
sql_create_context
CREATE TABLE table_80115 ( "Year" real, "Team" text, "Co-Drivers" text, "Class" text, "Laps" real, "Pos." text, "Class Pos." text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which position finished 3rd in class and completed less than 338 laps...
SELECT "Pos." FROM table_80115 WHERE "Class Pos." = '3rd' AND "Laps" < '338'
wikisql
CREATE TABLE photos ( id int, camera_lens_id int, mountain_id int, color text, name text ) CREATE TABLE camera_lens ( id int, brand text, name text, focal_length_mm real, max_aperture real ) CREATE TABLE mountain ( id int, name text, Height real, Prominence real...
SELECT brand, COUNT(brand) FROM camera_lens GROUP BY brand ORDER BY COUNT(brand)
nvbench
CREATE TABLE table_test_31 ( "id" int, "ejection_fraction_ef" int, "macular_disease" bool, "systemic" bool, "alt" float, "iud" bool, "condom_with_spermicide" bool, "gender" string, "meropenem" bool, "non_q_wave_myocardial_infarction" bool, "hbcab" bool, "unstable_angina" ...
SELECT * FROM table_test_31 WHERE adequate_contraception = 1 OR (gender = 'female' AND ((surgical_sterilization = 1 OR hormonal_contraceptives = 1 OR birth_control_pills = 1 OR depo_provera = 1 OR lupron_depot = 1) OR (barrier_methods = 1 AND spermicide = 1) OR intrauterine_device = 1 OR iud = 1)) OR (gender = 'male' A...
criteria2sql
CREATE TABLE table_66812 ( "Riding" text, "Candidate's Name" text, "Gender" text, "Residence" text, "Occupation" text, "Votes" real, "Rank" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the gender for the person that recieved over 1...
SELECT "Gender" FROM table_66812 WHERE "Votes" > '11,542' AND "Residence" = 'pasadena'
wikisql
CREATE TABLE table_65444 ( "Rank" real, "Player" text, "County" text, "Tally" text, "Total" real, "Matches" real, "Average" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average when the tally is 3 11, with more than 4 matches??...
SELECT COUNT("Average") FROM table_65444 WHERE "Tally" = '3–11' AND "Matches" > '4'
wikisql
CREATE TABLE table_name_79 ( gillingham_career VARCHAR, position VARCHAR, nationality VARCHAR, goals VARCHAR, apps VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When did the mf from England play for Gillingham that made 0 goals and less than 37 ...
SELECT gillingham_career FROM table_name_79 WHERE goals = 0 AND apps < 37 AND nationality = "england" AND position = "mf"
sql_create_context
CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) 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...
SELECT admissions.admittime FROM admissions WHERE admissions.subject_id = 12572 AND admissions.admission_location = 'transfer from hosp/extram' AND DATETIME(admissions.admittime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') ORDER BY admissions.admittime DESC LIMIT 1
mimic_iii
CREATE TABLE table_64807 ( "Date" text, "Venue" text, "Opponents" text, "Competition" text, "Match Report" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the match report for the game that was played on 23 august 2008 in stark's park during ...
SELECT "Match Report" FROM table_64807 WHERE "Venue" = 'stark''s park' AND "Competition" = 'second division' AND "Date" = '23 august 2008'
wikisql
CREATE TABLE table_66559 ( "Season" text, "Games" text, "Lost" text, "Tied" text, "Points" text, "Goals for" text, "Goals against" text, "Standing" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What are the games with an Involuntary sus...
SELECT "Games" FROM table_66559 WHERE "Standing" = 'involuntary suspension of season (hurricane rita)'
wikisql
CREATE TABLE time_zone ( time_zone_code text, time_zone_name text, hours_from_gmt int ) CREATE TABLE flight_fare ( flight_id int, fare_id int ) CREATE TABLE food_service ( meal_code text, meal_number int, compartment text, meal_description varchar ) CREATE TABLE ground_service ( ...
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 = 'MILWAUKEE' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'ORLA...
atis
CREATE TABLE table_204_540 ( id number, "name" text, "town" text, "deanery" text, "vicariate" text, "founded" number, "original ethnic community" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many parishes are named st. anthony ?
SELECT COUNT("name") FROM table_204_540 WHERE "name" = 'st. anthony'
squall
CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type text, admission_location text, discharge_location text, insurance text, language text, marital_status text, ethnicity text, age number ) CREATE ...
SELECT admissions.admittime FROM admissions WHERE admissions.subject_id = 15209 AND admissions.admission_location = 'transfer from hosp/extram' AND DATETIME(admissions.admittime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') ORDER BY admissions.admittime LIMIT 1
mimic_iii
CREATE TABLE table_name_18 ( round INTEGER, opponent VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the lowest Round with Opponent of rolando delgado?
SELECT MIN(round) FROM table_name_18 WHERE opponent = "rolando delgado"
sql_create_context
CREATE TABLE table_name_41 ( genre VARCHAR, developer_s_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the genre of developer(s) Lionhead Studios?
SELECT genre FROM table_name_41 WHERE developer_s_ = "lionhead studios"
sql_create_context
CREATE TABLE table_55081 ( "Season" text, "Club" text, "National League" text, "National Cup" text, "European Cup" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What national league has limoges csp, and french basketball cup?
SELECT "National League" FROM table_55081 WHERE "Club" = 'limoges csp' AND "National Cup" = 'french basketball cup'
wikisql
CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) CREATE TABLE Comments ( Id number, PostId number, Score number, Text text, CreationDate time, UserDisplayName text, UserId number, ContentLicense text ) CREATE TABLE PostHistory ( Id number, Po...
SELECT p.Id AS "post_link", p.Score, SUM(CASE WHEN f.VoteTypeId = 2 THEN 1 ELSE 0 END) AS AnonUpvotes, SUM(CASE WHEN f.VoteTypeId = 3 THEN 1 ELSE 0 END) AS AnonDownvotes, COUNT(f.Id) AS TotalAnonVotes FROM Posts AS p INNER JOIN PostFeedback AS f ON p.Id = f.PostId WHERE p.PostTypeId IN (1, 2) GROUP BY p.Id, p.Score ORD...
sede
CREATE TABLE movie ( movie_id int, Title text, Year int, Director text, Budget_million real, Gross_worldwide int ) CREATE TABLE book_club ( book_club_id int, Year int, Author_or_Editor text, Book_Title text, Publisher text, Category text, Result text ) CREATE TABLE ...
SELECT Director, COUNT(Director) FROM movie WHERE Year = 1999 OR Year = 2000 GROUP BY Director ORDER BY Director DESC
nvbench
CREATE TABLE table_7137 ( "Rank" text, "Belarusian (BGN/PCGN)" text, "Russian (BGN/PCGN)" text, "Status" text, "Obtaining" text, "Foundation" text, "Population (2010)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What Belarusian has a stat...
SELECT "Belarusian (BGN/PCGN)" FROM table_7137 WHERE "Status" = 'raion' AND "Foundation" = '1514' AND "Population (2010)" = '8100'
wikisql
CREATE TABLE table_name_7 ( premiere INTEGER, average VARCHAR, rank VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the premiere rating associated with an average of 35 ranked above 1?
SELECT MIN(premiere) FROM table_name_7 WHERE average = 35 AND rank > 1
sql_create_context
CREATE TABLE table_name_74 ( venue VARCHAR, home_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Where did Geelong play a home game?
SELECT venue FROM table_name_74 WHERE home_team = "geelong"
sql_create_context
CREATE TABLE table_17359181_1 ( points_2 INTEGER, goal_average_1 VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the highest value for Points 2 when the goal average 1 is 0.65?
SELECT MAX(points_2) FROM table_17359181_1 WHERE goal_average_1 = "0.65"
sql_create_context
CREATE TABLE table_49480 ( "Peak" text, "Location" text, "Height (m)" real, "Prominence (m)" real, "Col (m)" real, "Parent" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Where is the peak Pico Basil located?
SELECT "Location" FROM table_49480 WHERE "Peak" = 'pico basilé'
wikisql
CREATE TABLE table_train_258 ( "id" int, "gender" string, "autoimmune_disease" bool, "renal_disease" bool, "hepatic_disease" bool, "immune_deficiency_disorder" bool, "active_hepatitis" bool, "body_mass_index_bmi" float, "NOUSE" float ) -- Using valid SQLite, answer the following qu...
SELECT * FROM table_train_258 WHERE hepatic_disease = 1 OR active_hepatitis = 1
criteria2sql
CREATE TABLE table_2897457_1 ( pick__number VARCHAR, position VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What draft pick is a goaltender?
SELECT pick__number FROM table_2897457_1 WHERE position = "Goaltender"
sql_create_context
CREATE TABLE table_14373 ( "January" text, "February" text, "March" text, "April" text, "June" text, "July" text, "August" text, "September" text, "October" text, "November" text, "December" text ) -- Using valid SQLite, answer the following questions for the tables provide...
SELECT "June" FROM table_14373 WHERE "November" = 'lorraine olivia'
wikisql
CREATE TABLE table_10343 ( "No. in series" real, "No. in season" real, "Title" text, "Director" text, "Writer(s)" text, "Original air date" text, "Production code" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the title of Melsrose ...
SELECT "Title" FROM table_10343 WHERE "No. in series" = '168'
wikisql
CREATE TABLE table_14910 ( "Year" real, "Crime Index Total" real, "Violent crime" real, "Non-violent Crime" real, "Crime rate Per 1000" real, "Violent crime Rate per 1000" real, "Non-violent crime Rate per 1000" real, "Murder" real, "Rape" real, "Robbery" real, "Aggravated As...
SELECT MAX("Aggravated Assault") FROM table_14910 WHERE "Crime rate Per 1000" > '89.1' AND "Rape" = '23' AND "Crime Index Total" > '1590'
wikisql
CREATE TABLE table_45375 ( "Channel" text, "Play-by-play" text, "Color commentator(s)" text, "Studio host" text, "Studio analysts" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is the studio host for the game that has Paul Sunderland as play by...
SELECT "Studio host" FROM table_45375 WHERE "Play-by-play" = 'paul sunderland' AND "Studio analysts" = 'jack haley'
wikisql
CREATE TABLE table_15700367_4 ( runs_conceded INTEGER, name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the least runs conceded for brett lee
SELECT MIN(runs_conceded) FROM table_15700367_4 WHERE name = "Brett Lee"
sql_create_context
CREATE TABLE table_9021 ( "Level" real, "Shuttles" real, "Cumulative Shuttles" real, "Speed (km/h)" real, "Shuttle Time (seconds)" real, "Total level time (s)" real, "Distance (m)" real, "Cumulative Distance (m)" real, "Cumulative Time (min and seconds)" text ) -- Using valid SQLit...
SELECT SUM("Cumulative Distance (m)") FROM table_9021 WHERE "Level" < '8' AND "Cumulative Shuttles" > '61'
wikisql
CREATE TABLE table_23711 ( "Year" real, "District" real, "Blocks" real, "Panchayat" real, "Village" real, "Human (in Lakh )" text, "Animal (in Lakh )" text, "Total Area (in Lakh ha )" text, "Cropped area (in Lakh ha )" text, "Crop Damaged (in Lakh INR )" text, "House Affected...
SELECT "Crop Damaged (in Lakh INR )" FROM table_23711 WHERE "Public Property Damaged (in Lakh INR )" = '1,03,049.60'
wikisql
CREATE TABLE table_38873 ( "Year" text, "1801" text, "1811" text, "1821" text, "1841" text, "1851" text, "1861" text, "1871" text, "1881" text, "1891" text, "1901" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the 1861 ...
SELECT "1861" FROM table_38873 WHERE "1851" = '5291'
wikisql
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, flight WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'BOSTON' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BALTIMO...
atis
CREATE TABLE products ( name VARCHAR, Manufacturer VARCHAR ) CREATE TABLE manufacturers ( code VARCHAR, name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Find the name of product that is produced by both companies Creative Labs and Sony.
SELECT T1.name FROM products AS T1 JOIN manufacturers AS T2 ON T1.Manufacturer = T2.code WHERE T2.name = 'Creative Labs' INTERSECT SELECT T1.name FROM products AS T1 JOIN manufacturers AS T2 ON T1.Manufacturer = T2.code WHERE T2.name = 'Sony'
sql_create_context
CREATE TABLE table_15251 ( "Player" text, "Country" text, "Year(s) won" text, "Total" real, "To par" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which United States player has a To par of 14?
SELECT "Player" FROM table_15251 WHERE "Country" = 'united states' AND "To par" = '14'
wikisql
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid number, wa...
SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'metastatic lung ca' AND STRFTIME('%y', diagnosis.diagnosistime) <= '2104') AS t1 JOIN (SELECT patient.unique...
eicu
CREATE TABLE Student ( StuID INTEGER, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3) ) CREATE TABLE Allergy_Type ( Allergy VARCHAR(20), AllergyType VARCHAR(20) ) CREATE TABLE Has_Allergy ( StuID INTEGE...
SELECT Allergy, COUNT(*) FROM Has_Allergy GROUP BY Allergy ORDER BY COUNT(*) DESC
nvbench
CREATE TABLE table_38288 ( "Club" text, "Played" text, "Drawn" text, "Lost" text, "Points for" text, "Points against" text, "Tries for" text, "Tries against" text, "Try bonus" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is th...
SELECT "Points against" FROM table_38288 WHERE "Club" = 'ystradgynlais rfc'
wikisql