instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE table_name_67 ( player VARCHAR, position VARCHAR, club_province VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which player Munster from Munster is a fly-half?
SELECT player FROM table_name_67 WHERE position = "fly-half" AND club_province = "munster"
sql_create_context
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 demographic ( subject_id text, hadm_id t...
SELECT demographic.age, demographic.language FROM demographic WHERE demographic.name = "Francis Baseler"
mimicsql_data
CREATE TABLE station ( id number, name text, lat number, long number, dock_count number, city text, installation_date text ) CREATE TABLE status ( station_id number, bikes_available number, docks_available number, time text ) CREATE TABLE weather ( date text, max_te...
SELECT date, zip_code FROM weather WHERE max_temperature_f >= 80
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 jyjgzbb ( BGDH text, BGRQ tim...
SELECT zzmzjzjlb.JZLSH FROM hz_info JOIN zzmzjzjlb ON hz_info.YLJGDM = zzmzjzjlb.YLJGDM AND hz_info.KH = zzmzjzjlb.KH AND hz_info.KLX = zzmzjzjlb.KLX WHERE hz_info.RYBH = '50636004' AND hz_info.YLJGDM = '9316112' AND NOT zzmzjzjlb.JZKSMC LIKE '%老年病%' UNION SELECT fzzmzjzjlb.JZLSH FROM hz_info JOIN fzzmzjzjlb ON hz_info...
css
CREATE TABLE table_26998135_2 ( outgoing_manager VARCHAR, team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the outgoing manager for the team kas mpa a?
SELECT outgoing_manager FROM table_26998135_2 WHERE team = "Kasımpaşa"
sql_create_context
CREATE TABLE captain ( Captain_ID int, Name text, Ship_ID int, age text, Class text, Rank text ) CREATE TABLE Ship ( Ship_ID int, Name text, Type text, Built_Year real, Class text, Flag text ) -- Using valid SQLite, answer the following questions for the tables provide...
SELECT Rank, COUNT(*) FROM captain GROUP BY Rank ORDER BY COUNT(*) DESC
nvbench
CREATE TABLE geographic ( city_name varchar, county varchar, region varchar ) CREATE TABLE restaurant ( id int, name varchar, food_type varchar, city_name varchar, rating "decimal ) CREATE TABLE location ( restaurant_id int, house_number int, street_name varchar, city_n...
SELECT location.house_number, restaurant.name FROM geographic, location, restaurant WHERE geographic.region = 'bay area' AND restaurant.city_name = geographic.city_name AND restaurant.food_type = 'american' AND restaurant.id = location.restaurant_id AND restaurant.rating = (SELECT MAX(RESTAURANTalias1.rating) FROM geog...
restaurants
CREATE TABLE technician ( technician_id real, Name text, Team text, Starting_Year real, Age int ) CREATE TABLE repair ( repair_ID int, name text, Launch_Date text, Notes text ) CREATE TABLE repair_assignment ( technician_id int, repair_ID int, Machine_ID int ) CREATE T...
SELECT Team, COUNT(*) FROM technician GROUP BY Team ORDER BY Team
nvbench
CREATE TABLE table_9662 ( "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. -- Which Home team has a Tie no of replay, a Date of 19 november 1985, and an Away team of tranmere rovers?...
SELECT "Home team" FROM table_9662 WHERE "Tie no" = 'replay' AND "Date" = '19 november 1985' AND "Away team" = 'tranmere rovers'
wikisql
CREATE TABLE table_name_3 ( points VARCHAR, year VARCHAR, chassis VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many points were there before 1979 with a ferrari 312b2 chassis?
SELECT points FROM table_name_3 WHERE year < 1979 AND chassis = "ferrari 312b2"
sql_create_context
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 SUM(outputevents.value) FROM outputevents WHERE outputevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 94122)) AND outputevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'cer...
mimic_iii
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(lab.labresult) FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-7325')) AND lab.labname = 'mch' AND DATETIME(lab.labresulttime, 'start of year...
eicu
CREATE TABLE table_29336 ( "No. in series" real, "No. in season" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production code" text, "U.S. viewers (million)" text ) -- Using valid SQLite, answer the following questions for the tables provided ab...
SELECT "U.S. viewers (million)" FROM table_29336 WHERE "Directed by" = 'Allison Liddi-Brown'
wikisql
CREATE TABLE table_52275 ( "Race Title" text, "Circuit" text, "City / State" text, "Date" text, "Winner" text, "Team" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the winner for the Winton Motor Raceway circuit?
SELECT "Winner" FROM table_52275 WHERE "Circuit" = 'winton motor raceway'
wikisql
CREATE TABLE table_34076 ( "Track number" real, "Song title" text, "Songwriter(s)" text, "Orchestra" text, "Time" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the songwriter for track number 12
SELECT "Songwriter(s)" FROM table_34076 WHERE "Track number" = '12'
wikisql
CREATE TABLE table_77689 ( "Player" text, "Shoots" text, "Acquired" real, "Place of Birth" text, "Joined from" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who acquired tom norton?
SELECT "Acquired" FROM table_77689 WHERE "Player" = 'tom norton'
wikisql
CREATE TABLE table_8184 ( "Club" text, "Sport" text, "Founded" real, "League" text, "Venue" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Venue has a Club of west bromwich albion?
SELECT "Venue" FROM table_8184 WHERE "Club" = 'west bromwich albion'
wikisql
CREATE TABLE table_18349 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Result" text, "Candidates" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the candidates for texas 20
SELECT "Candidates" FROM table_18349 WHERE "District" = 'Texas 20'
wikisql
CREATE TABLE table_204_911 ( id number, "album / name" text, "artist(s)" text, "label" text, "role/credit" text, "date" text, "chart#" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the top album name ?
SELECT "album / name" FROM table_204_911 WHERE id = 1
squall
CREATE TABLE table_51992 ( "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 lowest amount of bronze Liechtenstein, who has more than 11 gold, has?
SELECT MIN("Bronze") FROM table_51992 WHERE "Nation" = 'liechtenstein' AND "Gold" > '11'
wikisql
CREATE TABLE table_31438 ( "model" text, "Sonnet" text, "Apple" text, "NUpowr 117" text, "NUpowr 167" text, "NUpowr 183" text, "NUpowr G3" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When 0,4, or 8 mb is the nupowr 117 what is the sonnet?...
SELECT "Sonnet" FROM table_31438 WHERE "NUpowr 117" = '0,4, or 8 MB'
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 jyjgzbb.JCRGH, jyjgzbb.JCRXM 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 AND jy...
css
CREATE TABLE table_203_126 ( id number, "date" text, "opponent#" text, "rank#" text, "site" text, "result" text, "attendance" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- who did ohio state play before indiana on october 23 ?
SELECT "opponent#" FROM table_203_126 WHERE id = (SELECT id FROM table_203_126 WHERE "date" = 'october 23' AND "opponent#" = 'indiana') - 1
squall
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 procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.gender = "F" AND demographic.diagnosis = "CONGESTIVE HEART FAILURE"
mimicsql_data
CREATE TABLE table_name_10 ( area_km_2 INTEGER, population VARCHAR, status VARCHAR, census_ranking VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the area (in km2) for the community that has a status of village, a census ranking of 2,471 of 5...
SELECT SUM(area_km_2) FROM table_name_10 WHERE status = "village" AND census_ranking = "2,471 of 5,008" AND population < 748
sql_create_context
CREATE TABLE table_55235 ( "Match" real, "Date" text, "Competition or tour" text, "Ground" text, "Opponent" text, "Score1" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the score of the competition of friendly, at match 7?
SELECT "Score1" FROM table_55235 WHERE "Competition or tour" = 'friendly' AND "Match" = '7'
wikisql
CREATE TABLE table_12808 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What Player's Score is 69-71-69=208?
SELECT "Player" FROM table_12808 WHERE "Score" = '69-71-69=208'
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 prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_type = "EMERGENCY" AND lab.fluid = "Ascites"
mimicsql_data
CREATE TABLE table_name_92 ( tv_network_s_ VARCHAR, country VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the name of Bulgaria's TV network?
SELECT tv_network_s_ FROM table_name_92 WHERE country = "bulgaria"
sql_create_context
CREATE TABLE table_23285849_10 ( score VARCHAR, high_points VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When j.r. smith (26) has the highest amount of points what is the score?
SELECT score FROM table_23285849_10 WHERE high_points = "J.R. Smith (26)"
sql_create_context
CREATE TABLE table_name_19 ( date VARCHAR, loss VARCHAR, opponent VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the date of A. Benes loss to the Rockies?
SELECT date FROM table_name_19 WHERE loss = "a. benes" AND opponent = "rockies"
sql_create_context
CREATE TABLE t_kc22 ( MED_EXP_DET_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, MED_CLINIC_ID text, MED_EXP_BILL_ID text, SOC_SRT_DIRE_CD text, SOC_SRT_DIRE_NM text, DIRE_TYPE number, CHA_ITEM_LEV number, MED_INV_ITEM_TYPE text, MED_DIRE_CD text, MED_DIRE_NM text,...
SELECT COUNT(*) FROM (SELECT t_kc21.MED_ORG_DEPT_CD FROM t_kc21 JOIN t_kc24 ON t_kc21.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE t_kc21.MED_SER_ORG_NO = '3173533' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2001-05-20' AND '2016-10-13' GROUP BY t_kc21.MED_ORG_DEPT_CD HAVING SUM(t_kc24.MED_AMOUT) <= 8682.9) AS T
css
CREATE TABLE table_43684 ( "Class" text, "Team" text, "Driver" text, "Chassis \u2013 Engine" text, "Laps" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which class had Stanley Dickens as a driver?
SELECT "Class" FROM table_43684 WHERE "Driver" = 'stanley dickens'
wikisql
CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, eventtype text, careunit text, wardi...
SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE ...
mimic_iii
CREATE TABLE table_30269 ( "Pick #" real, "CFL Team" text, "Player" text, "Position" text, "College" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What college did the player who was drafted by Calgary go to?
SELECT "College" FROM table_30269 WHERE "CFL Team" = 'Calgary'
wikisql
CREATE TABLE table_72392 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Result" text, "Candidates" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the district for tim lee hall
SELECT "District" FROM table_72392 WHERE "Incumbent" = 'Tim Lee Hall'
wikisql
CREATE TABLE table_71059 ( "Place" text, "Player" text, "Country" text, "Score" real, "To par" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- In which place is Emmet French?
SELECT "Place" FROM table_71059 WHERE "Player" = 'emmet french'
wikisql
CREATE TABLE table_21088 ( "Name" text, "Latitude" text, "Longitude" text, "Diameter (km)" text, "Year named" real, "Name origin" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the name of 36.0n
SELECT "Name" FROM table_21088 WHERE "Latitude" = '36.0N'
wikisql
CREATE TABLE table_53042 ( "Round" real, "Pick" real, "Player" text, "Nationality" text, "School" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which pick's player was Marc Lewis (lhp)?
SELECT "Pick" FROM table_53042 WHERE "Player" = 'marc lewis (lhp)'
wikisql
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 patient ( uniquep...
SELECT COUNT(*) FROM treatment WHERE treatment.treatmentname = 'narcotic antagonist - naloxone (narcan)' AND STRFTIME('%y', treatment.treatmenttime) >= '2104'
eicu
CREATE TABLE exhibition_record ( Exhibition_ID int, Date text, Attendance int ) CREATE TABLE artist ( Artist_ID int, Name text, Country text, Year_Join int, Age int ) CREATE TABLE exhibition ( Exhibition_ID int, Year int, Theme text, Artist_ID int, Ticket_Price real...
SELECT Year_Join, COUNT(Year_Join) FROM artist WHERE Country <> 'United States' GROUP BY Year_Join ORDER BY COUNT(Year_Join)
nvbench
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_location = "TRANSFER FROM HOSP/EXTRAM" AND procedures.icd9_code = "4573"
mimicsql_data
CREATE TABLE table_name_87 ( name_v_t_e VARCHAR, club VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the name of the player from club pro recco?
SELECT name_v_t_e FROM table_name_87 WHERE club = "pro recco"
sql_create_context
CREATE TABLE table_name_30 ( silver VARCHAR, nation VARCHAR, rank VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many silvers have a Nation of hungary, and a Rank larger than 10?
SELECT COUNT(silver) FROM table_name_30 WHERE nation = "hungary" AND rank > 10
sql_create_context
CREATE TABLE table_name_36 ( zaaps___ziips VARCHAR, model VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- For Model e64 what is the zAAPs/zIIPs?
SELECT zaaps___ziips FROM table_name_36 WHERE model = "e64"
sql_create_context
CREATE TABLE table_21501564_1 ( theme VARCHAR, original_artist VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many weeks featured duffy as the original artist?
SELECT COUNT(theme) FROM table_21501564_1 WHERE original_artist = "Duffy"
sql_create_context
CREATE TABLE table_name_31 ( release_date VARCHAR, catalogue VARCHAR, recorded VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When was the cataglogue EPA 4054 released with a 1/12/57 recorded?
SELECT release_date FROM table_name_31 WHERE catalogue = "epa 4054" AND recorded = "1/12/57"
sql_create_context
CREATE TABLE table_name_92 ( country VARCHAR, score VARCHAR, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Country has a Score of 69, and a Player of mick soli?
SELECT country FROM table_name_92 WHERE score = 69 AND player = "mick soli"
sql_create_context
CREATE TABLE table_67360 ( "Image" real, "Smith" text, "Ashmolean" real, "Foster" real, "Hahland" real, "Dinsmoor" text, "Hofkes-Brukker" text, "Harrison" text, "Cooper" text, "BM/Corbett" text ) -- Using valid SQLite, answer the following questions for the tables provided abov...
SELECT "Smith" FROM table_67360 WHERE "Ashmolean" = '16'
wikisql
CREATE TABLE table_name_73 ( bronze INTEGER, nation VARCHAR, total VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the highest Bronze, when Nation is 'South Africa', and when Total is less than 20?
SELECT MAX(bronze) FROM table_name_73 WHERE nation = "south africa" AND total < 20
sql_create_context
CREATE TABLE table_8794 ( "Rank" real, "City" text, "Population" real, "Country" text, "Area (km\u00b2)" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which rank had a population of 7,069,000?
SELECT COUNT("Rank") FROM table_8794 WHERE "Population" = '7,069,000'
wikisql
CREATE TABLE table_203_216 ( id number, "rank" number, "hospital" text, "city" text, "county" text, "# beds" number, "type of hospital" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what hospital in los angeles county providing hospital bed...
SELECT "hospital" FROM table_203_216 WHERE "county" = 'los angeles' AND "type of hospital" = 'rehabilitaion' AND "rank" <= 10
squall
CREATE TABLE dual_carrier ( main_airline varchar, low_flight_number int, high_flight_number int, dual_airline varchar, service_name text ) CREATE TABLE flight_fare ( flight_id int, fare_id int ) CREATE TABLE flight ( aircraft_code_sequence text, airline_code varchar, airline_fl...
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 ((((((flight.arrival_time < 41 OR flight.time_elapsed >= 60) AND flight.departure_time > flight.arrival_time) AND date_day.day_number = 25 AND da...
atis
CREATE TABLE airlines ( alid integer, name text, iata varchar(2), icao varchar(3), callsign text, country text, active varchar(2) ) CREATE TABLE airports ( apid integer, name text, city text, country text, x real, y real, elevation bigint, iata character varc...
SELECT name, elevation FROM airports WHERE city = 'New York' ORDER BY name
nvbench
CREATE TABLE table_78113 ( "Res." text, "Record" text, "Opponent" text, "Method" text, "Event" text, "Round" text, "Time" text, "Location" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Res has a Method of decision (unanimous) and ...
SELECT "Res." FROM table_78113 WHERE "Method" = 'decision (unanimous)' AND "Opponent" = 'wataru sakata'
wikisql
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 text ) CREATE TABLE event ( Event_ID int, Date text, Venue text, Name text, Event_Attendance...
SELECT Nationality, AVG(Age) FROM journalist GROUP BY Nationality ORDER BY Nationality
nvbench
CREATE TABLE member ( member_id number, card_number text, name text, hometown text, level number ) CREATE TABLE membership_register_branch ( member_id number, branch_id text, register_year text ) CREATE TABLE purchase ( member_id number, branch_id text, year text, total...
SELECT level FROM member GROUP BY level ORDER BY COUNT(*) DESC LIMIT 1
spider
CREATE TABLE accounts ( account_id number, customer_id number, account_name text, other_account_details text ) CREATE TABLE customers ( customer_id number, customer_first_name text, customer_last_name text, customer_address text, customer_phone text, customer_email text, oth...
SELECT COUNT(*) FROM customers_cards AS T1 JOIN customers AS T2 ON T1.customer_id = T2.customer_id WHERE T2.customer_first_name = "Blanche" AND T2.customer_last_name = "Huels" AND T1.card_type_code = "Credit"
spider
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 d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text )...
SELECT COUNT(*) > 0 FROM admissions WHERE admissions.subject_id = 51497 AND DATETIME(admissions.admittime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year')
mimic_iii
CREATE TABLE jobs ( job_id int, job_title varchar, description varchar, requirement varchar, city varchar, state varchar, country varchar, zip int ) CREATE TABLE ta ( campus_job_id int, student_id int, location varchar ) CREATE TABLE course_prerequisite ( pre_course_id ...
SELECT DISTINCT COURSEalias0.department, COURSEalias0.name, COURSEalias0.number, SEMESTERalias0.semester FROM (SELECT course_id FROM student_record WHERE earn_credit = 'Y' AND student_id = 1) AS DERIVED_TABLEalias0, course AS COURSEalias0, course_offering AS COURSE_OFFERINGalias0, program_course AS PROGRAM_COURSEalias0...
advising
CREATE TABLE table_52191 ( "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. -- Who was the home team at Princes Park when the a...
SELECT "Home team" FROM table_52191 WHERE "Crowd" > '30,848' AND "Venue" = 'princes park'
wikisql
CREATE TABLE table_name_67 ( tournament VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which tournament had the result of a W in 2009?
SELECT tournament FROM table_name_67 WHERE 2009 = "w"
sql_create_context
CREATE TABLE table_1342198_18 ( candidates VARCHAR, district VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is the candidate wehre district is louisiana 1?
SELECT candidates FROM table_1342198_18 WHERE district = "Louisiana 1"
sql_create_context
CREATE TABLE table_76658 ( "Season" text, "Series" text, "Team Name" text, "Races" text, "Wins" text, "Poles" text, "F.L." text, "Podiums" text, "Points" text, "Position" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the...
SELECT "Poles" FROM table_76658 WHERE "Points" = '104'
wikisql
CREATE TABLE table_2517159_1 ( last_appearance VARCHAR, name_of_bowl VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the last appearance for music city bowl
SELECT last_appearance FROM table_2517159_1 WHERE name_of_bowl = "Music City Bowl"
sql_create_context
CREATE TABLE table_6029 ( "National team" text, "Club" text, "Season" text, "Apps" real, "Goals" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- In what Season does the Internazionale Club have more than 2 Apps?
SELECT "Season" FROM table_6029 WHERE "Apps" > '2' AND "Club" = 'internazionale'
wikisql
CREATE TABLE table_47299 ( "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. -- What is the away team for the home team wigan athletic?
SELECT "Away team" FROM table_47299 WHERE "Home team" = 'wigan athletic'
wikisql
CREATE TABLE table_36659 ( "Season" real, "Driver" text, "Team" text, "Tyre" text, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What team won after 2008?
SELECT "Team" FROM table_36659 WHERE "Season" > '2008'
wikisql
CREATE TABLE table_9092 ( "Res." text, "Record" text, "Opponent" text, "Method" text, "Event" text, "Round" real, "Time" text, "Location" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the record with the opponent as Carlton Jone...
SELECT "Record" FROM table_9092 WHERE "Opponent" = 'carlton jones'
wikisql
CREATE TABLE table_71015 ( "Competing entities" text, "First held" real, "Current holder" text, "Next" text, "Held every" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Can you tell me the Competing entities that has the First held smaller than 1970...
SELECT "Competing entities" FROM table_71015 WHERE "First held" < '1970'
wikisql
CREATE TABLE table_14999 ( "No.1" text, "No.2" text, "No.3" text, "No.4" text, "No.5" text, "No.6" text, "No.7" text, "No.8" text, "No.9" text, "No.10" text, "FINAL" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was numb...
SELECT "No.9" FROM table_14999 WHERE "No.7" = 'joana' AND "FINAL" = 'pedro'
wikisql
CREATE TABLE table_57846 ( "Driver" text, "Constructor" text, "Laps" real, "Time/Retired" text, "Grid" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who built the grid 2 car?
SELECT "Constructor" FROM table_57846 WHERE "Grid" = '2'
wikisql
CREATE TABLE t_kc24 ( MED_SAFE_PAY_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, MED_CLINIC_ID text, REF_SLT_FLG number, CLINIC_SLT_DATE time, COMP_ID text, PERSON_ID text, FLX_MED_ORG_ID text, INSU_TYPE text, MED_AMOUT number, PER_ACC_PAY number, OVE_PAY numb...
SELECT SUM(t_kc22.AMOUNT) FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.MED_SER_ORG_NO = '3306173' AND t_kc22.STA_DATE BETWEEN '2016-01-01' AND '2017-11-11' AND t_kc22.MED_INV_ITEM_TYPE = '检查费'
css
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_DIRE_CD text, MED_DIRE_NM text,...
SELECT t_kc21.IN_DIAG_DIS_CD, t_kc21.IN_DIAG_DIS_NM FROM t_kc21 WHERE t_kc21.PERSON_ID = '77266571'
css
CREATE TABLE table_8870 ( "Name" text, "Nationality" text, "Position" text, "Crewe Alexandra career" text, "Appearances" real, "Goals" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the position when the Crewe Alexandra career is 1988 19...
SELECT "Position" FROM table_8870 WHERE "Crewe Alexandra career" = '1988–1990' AND "Goals" = '31'
wikisql
CREATE TABLE shipments ( order_id VARCHAR, shipment_tracking_number VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Find the id of the order whose shipment tracking number is '3452'.
SELECT order_id FROM shipments WHERE shipment_tracking_number = "3452"
sql_create_context
CREATE TABLE table_name_84 ( form_factor VARCHAR, introduced VARCHAR, controller VARCHAR, capacities__gb_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which value for Form factor has Sandforce with Capacity 80/120/180/240/360/480 introduced in July...
SELECT form_factor FROM table_name_84 WHERE controller = "sandforce" AND capacities__gb_ = "80/120/180/240/360/480" AND introduced = "july 2013"
sql_create_context
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 jybgb.BGDH FROM hz_info JOIN mzjzjlb JOIN jybgb 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 WHERE hz_info.RYBH = '06227779' AND jybgb.BGRQ BETWEEN '2008-03-13' AND '2016-12-19' UNION...
css
CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPrivilegedUserGuidance text, MarkdownConcensusDescription text, CreationDate time, CreationModeratorId number, ApprovalDa...
SELECT OwnerUserId AS "user_link", AVG(Score) AS MedianScore FROM (SELECT OwnerUserId, Score, ROW_NUMBER() OVER (PARTITION BY OwnerUserId ORDER BY Score) AS RowAsc, ROW_NUMBER() OVER (PARTITION BY OwnerUserId ORDER BY Score DESC) AS RowDesc FROM Posts INNER JOIN Users ON Users.Id = OwnerUserId WHERE Users.Reputation >=...
sede
CREATE TABLE table_14665 ( "Year" real, "Tournament" text, "Venue" text, "Result" text, "Extra" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the extra result of the 4th game?
SELECT "Extra" FROM table_14665 WHERE "Result" = '4th'
wikisql
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, sy...
SELECT vitalperiodic.observationtime FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-78314')) AND vitalperiodic.respiration > 27.0 A...
eicu
CREATE TABLE t_kc24 ( ACCOUNT_DASH_DATE time, ACCOUNT_DASH_FLG number, CASH_PAY number, CIVIL_SUBSIDY number, CKC102 number, CLINIC_ID text, CLINIC_SLT_DATE time, COMP_ID text, COM_ACC_PAY number, COM_PAY number, DATA_ID text, ENT_ACC_PAY number, ENT_PAY number, F...
SELECT COUNT(*) FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '3692210' AND t_kc21.IN_HOSP_DATE BETWEEN '2010-10-25' AND '2020-02-24' AND t_kc21.SERVANT_FLG = '公务员'
css
CREATE TABLE table_76197 ( "Team" text, "Sets+" real, "Sets\u2013" real, "Points+" real, "Points\u2013" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the highest Points+ number that has a Sets+ number larger than 45, a Sets- number larger t...
SELECT MAX("Points+") FROM table_76197 WHERE "Sets+" > '45' AND "Points\u2013" < '1066' AND "Sets\u2013" > '9'
wikisql
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 jybgb ( BBCJBW text, BBDM tex...
SELECT jybgb.BGDH FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN mzjzjlb_jybgb 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 = mzjzjlb_jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND mzjzjl...
css
CREATE TABLE table_name_67 ( city_of_license VARCHAR, erp_w VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What City of license has a ERP W of 2,000?
SELECT city_of_license FROM table_name_67 WHERE erp_w = "2,000"
sql_create_context
CREATE TABLE store_product ( Store_ID int, Product_ID int ) CREATE TABLE product ( product_id int, product text, dimensions text, dpi real, pages_per_minute_color real, max_page_size text, interface text ) CREATE TABLE store_district ( Store_ID int, District_ID int ) CREAT...
SELECT District_name, City_Population FROM district WHERE City_Population BETWEEN 200000 AND 2000000 ORDER BY District_name
nvbench
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 lab ( labid numbe...
SELECT t1.diagnosisname FROM (SELECT diagnosis.diagnosisname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM diagnosis GROUP BY diagnosis.diagnosisname) AS t1 WHERE t1.c1 <= 4
eicu
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 demographic.admission_type FROM demographic WHERE demographic.subject_id = "3343"
mimicsql_data
CREATE TABLE table_204_323 ( id number, "year" number, "film" text, "function" text, "notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how long was the film schooled out before beginning blue ?
SELECT (SELECT "year" FROM table_204_323 WHERE "film" = 'beginning blue') - (SELECT "year" FROM table_204_323 WHERE "film" = 'schooled')
squall
CREATE TABLE table_8452 ( "Player" text, "Team" text, "Matches" real, "Wickets" real, "Average" real, "Best Bowling" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the highest wickets when the matches is less than 5, player is jim laker ...
SELECT MAX("Wickets") FROM table_8452 WHERE "Matches" < '5' AND "Player" = 'jim laker' AND "Average" > '52.44'
wikisql
CREATE TABLE table_45281 ( "Series Number" real, "Number of Episodes" real, "Original Air Date" real, "DVD Region 2 release date" text, "DVD Region 1 release date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the sum of the number of episod...
SELECT SUM("Number of Episodes") FROM table_45281 WHERE "Original Air Date" > '1991' AND "Series Number" < '21' AND "DVD Region 2 release date" = '26 march 2012'
wikisql
CREATE TABLE Research_Staff ( staff_id INTEGER, employer_organisation_id INTEGER, staff_details VARCHAR(255) ) CREATE TABLE Projects ( project_id INTEGER, organisation_id INTEGER, project_details VARCHAR(255) ) CREATE TABLE Staff_Roles ( role_code VARCHAR(10), role_description VARCHAR(...
SELECT T2.organisation_details, T1.organisation_id FROM Grants AS T1 JOIN Organisations AS T2 ON T1.organisation_id = T2.organisation_id GROUP BY T2.organisation_details ORDER BY T2.organisation_details
nvbench
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 aircraft ( aircraft_code varchar, aircraft_description varchar, manufacturer varchar,...
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 = 'MONTREAL' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'CHARL...
atis
CREATE TABLE table_36342 ( "Wind Farm" text, "Scheduled" text, "Capacity (MW)" real, "Turbines" real, "Type" text, "Location" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the type of turbine having fewer than 17 units and located in Co...
SELECT "Type" FROM table_36342 WHERE "Turbines" < '17' AND "Location" = 'county laois'
wikisql
CREATE TABLE table_name_94 ( place VARCHAR, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Where has Jimmy Demaret as a player?
SELECT place FROM table_name_94 WHERE player = "jimmy demaret"
sql_create_context
CREATE TABLE student ( student_id int, lastname varchar, firstname varchar, program_id int, declare_major varchar, total_credit int, total_gpa float, entered_as varchar, admit_term int, predicted_graduation_semester int, degree varchar, minor varchar, internship varch...
SELECT DISTINCT instructor.name FROM instructor INNER JOIN offering_instructor ON offering_instructor.instructor_id = instructor.instructor_id INNER JOIN course_offering ON offering_instructor.offering_id = course_offering.offering_id INNER JOIN course ON course.course_id = course_offering.course_id WHERE course.name L...
advising
CREATE TABLE table_65314 ( "Constituency number" text, "Name" text, "Reserved for ( SC / ST /None)" text, "District" text, "Number of electorates (2003)" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Constituency Number of Total:?
SELECT "Constituency number" FROM table_65314 WHERE "Name" = 'total:'
wikisql
CREATE TABLE table_204_394 ( id number, "year" number, "album" text, "label" text, "peak chart\npositions\nus" number, "peak chart\npositions\nus r&b" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- name an album released before celebration .
SELECT "album" FROM table_204_394 WHERE "year" < (SELECT "year" FROM table_204_394 WHERE "album" = 'celebration') ORDER BY "year" DESC LIMIT 1
squall
CREATE TABLE table_57210 ( "Pick" real, "Round" real, "Player" text, "Position" text, "School" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the lowest round that Melvin Johnson played?
SELECT MIN("Round") FROM table_57210 WHERE "Player" = 'melvin johnson'
wikisql
CREATE TABLE table_name_64 ( puchat_ligi INTEGER, uefa_cup VARCHAR, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Puchat Ligi has a UEFA Cup smaller than 2, and a Player of takesure chinyama?
SELECT MIN(puchat_ligi) FROM table_name_64 WHERE uefa_cup < 2 AND player = "takesure chinyama"
sql_create_context