instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) 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, insuranc...
SELECT t2.drug FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE admissions.subject_id = 14035 AND diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'late e...
mimic_iii
CREATE TABLE table_42788 ( "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 rank is the team with 1 silver, 3 bronze and a total of less than 8 medals?
SELECT COUNT("Rank") FROM table_42788 WHERE "Silver" = '1' AND "Bronze" = '3' AND "Total" < '8'
wikisql
CREATE TABLE txmzjzjlb ( 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 (SELECT COUNT(*) FROM hz_info JOIN txmzjzjlb ON hz_info.YLJGDM = txmzjzjlb.YLJGDM AND hz_info.KH = txmzjzjlb.KH AND hz_info.KLX = txmzjzjlb.KLX WHERE hz_info.RYBH = '12121203' AND txmzjzjlb.JZKSRQ BETWEEN '2001-05-07' AND '2020-07-12' UNION SELECT COUNT(*) FROM hz_info JOIN ftxmzjzjlb ON hz_info.YLJGDM = ftxmzjz...
css
CREATE TABLE table_1341973_6 ( result VARCHAR, district VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the result of the election in california 2?
SELECT result FROM table_1341973_6 WHERE district = "California 2"
sql_create_context
CREATE TABLE t_kc21_t_kc24 ( MED_CLINIC_ID text, MED_SAFE_PAY_ID number ) 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, ...
SELECT COUNT(t_kc21.PERSON_ID) FROM t_kc21 WHERE t_kc21.IN_DIAG_DIS_NM = '器质性心境[情感]障碍'
css
CREATE TABLE table_41794 ( "Year" real, "Competition" text, "Venue" text, "Position" text, "Event" text, "Notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What Position was achieved in the World Championships Competition in Tokyo, Japan?
SELECT "Position" FROM table_41794 WHERE "Competition" = 'world championships' AND "Venue" = 'tokyo, japan'
wikisql
CREATE TABLE mzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH text, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, KH text, KLX number, MJZH text, ML number, MZZYZDZZBM text, MZZYZDZZMC ...
SELECT hz_info.person_info_XM FROM hz_info JOIN zyjzjlb JOIN jybgb ON hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX AND zyjzjlb.YLJGDM = jybgb.YLJGDM_ZYJZJLB AND zyjzjlb.JZLSH = jybgb.JZLSH_ZYJZJLB WHERE jybgb.BGDH = '66920522667'
css
CREATE TABLE table_13341 ( "Name" text, "Platform" text, "Indication" text, "Status" text, "Collaboration" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What company collaborated with non-hodgkin lymphoma?
SELECT "Collaboration" FROM table_13341 WHERE "Indication" = 'non-hodgkin lymphoma'
wikisql
CREATE TABLE table_name_8 ( not_outs INTEGER, runs VARCHAR, average VARCHAR, matches VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the lowest Not Outs with an average lower than 31.25, fewer than 13 matches, and fewer than 327 runs?
SELECT MIN(not_outs) FROM table_name_8 WHERE average < 31.25 AND matches < 13 AND runs < 327
sql_create_context
CREATE TABLE table_203_345 ( id number, "name" text, "party" text, "took office" number, "left office" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what party was the last provincial representative of gilbert plains ?
SELECT "party" FROM table_203_345 ORDER BY "took office" DESC LIMIT 1
squall
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_kc24.PER_ACC_PAY) FROM t_kc21 JOIN t_kc24 ON t_kc21.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE t_kc21.PERSON_NM = '邹学博' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2010-04-09' AND '2014-05-05'
css
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE diagnoses ( ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.age < "20" AND demographic.days_stay > "20"
mimicsql_data
CREATE TABLE flight_stop ( flight_id int, stop_number int, stop_days text, stop_airport text, arrival_time int, arrival_airline text, arrival_flight_number int, departure_time int, departure_airline text, departure_flight_number int, stop_time int ) CREATE TABLE date_day ( ...
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 CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'BALTIMORE' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.ci...
atis
CREATE TABLE table_204_511 ( id number, "number" number, "driver" text, "entrant" text, "chassis" text, "engine" text, "tyre" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- tony bettenhausen and paul russo drove cars with what kind of engine...
SELECT "engine" FROM table_204_511 WHERE "driver" = 'tony bettenhausen'
squall
CREATE TABLE table_60217 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text, "Money ( \u00a3 )" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How much money does the player with a 69-70-72-64=275 score have?
SELECT "Money ( \u00a3 )" FROM table_60217 WHERE "Score" = '69-70-72-64=275'
wikisql
CREATE TABLE table_21681 ( "Date" text, "Opponent" text, "Home / Away" 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....
SELECT "Score" FROM table_21681 WHERE "Record" = '2-5'
wikisql
CREATE TABLE table_14882588_3 ( yacht VARCHAR, sail_number VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What were all Yachts with a sail number of 6952?
SELECT yacht FROM table_14882588_3 WHERE sail_number = "6952"
sql_create_context
CREATE TABLE table_71754 ( "Rider" text, "Matches" real, "Rides" real, "Bonus Pts" real, "Total Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the average number of points with bonus pts less than 31 with the rider dennis gavros?
SELECT AVG("Total Points") FROM table_71754 WHERE "Rider" = 'dennis gavros' AND "Bonus Pts" < '31'
wikisql
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE demographic ...
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.charttime = "2108-09-28 03:52:00"
mimicsql_data
CREATE TABLE airlines ( alid number, name text, iata text, icao text, callsign text, country text, active text ) CREATE TABLE routes ( rid number, dst_apid number, dst_ap text, src_apid number, src_ap text, alid number, airline text, codeshare text ) CREATE ...
SELECT city FROM airports GROUP BY city HAVING COUNT(*) > 2 ORDER BY COUNT(*)
spider
CREATE TABLE table_name_91 ( writer VARCHAR, original_airdate VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who's the Writer with an Original Airdate of september 4, 2005 (hbo)?
SELECT writer FROM table_name_91 WHERE original_airdate = "september 4, 2005 (hbo)"
sql_create_context
CREATE TABLE table_name_96 ( club VARCHAR, losing_bp VARCHAR, lost VARCHAR, played VARCHAR, drawn VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the club that has played 22 rounds, has a drawn score of 0, has lost 14, and whose losing BP ...
SELECT club FROM table_name_96 WHERE played = "22" AND drawn = "0" AND lost = "14" AND losing_bp = "5"
sql_create_context
CREATE TABLE table_18976 ( "Institution" text, "Location" text, "Founded" real, "Affiliation" text, "Enrollment" real, "Nickname" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Where is Interlake located?
SELECT "Location" FROM table_18976 WHERE "Institution" = 'Interlake'
wikisql
CREATE TABLE journalist ( journalist_ID int, Name text, Nationality text, Age text, Years_working int ) CREATE TABLE event ( Event_ID int, Date text, Venue text, Name text, Event_Attendance int ) CREATE TABLE news_report ( journalist_ID int, Event_ID int, Work_Type ...
SELECT Nationality, COUNT(*) FROM journalist GROUP BY Nationality
nvbench
CREATE TABLE table_18034 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Game site" text, "Record" text, "Attendance" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Where did the teams play on October 16, 1977?
SELECT "Game site" FROM table_18034 WHERE "Date" = 'October 16, 1977'
wikisql
CREATE TABLE table_13578 ( "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. -- What is the To par of the United States, when the Total was 145, in 2004?
SELECT "To par" FROM table_13578 WHERE "Country" = 'united states' AND "Total" = '145' AND "Year(s) won" = '2004'
wikisql
CREATE TABLE mzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH text, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, KH text, KLX number, MJZH text, ML number, MZZYZDZZBM text, MZZYZDZZMC ...
SELECT jyjgzbb.CKZFWXX, jyjgzbb.CKZFWSX FROM mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN hz_info_mzjzjlb ON hz_info_mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH AND hz_info_mzjzjlb.JZLSH = mzjzjlb.JZLSH AND hz_info_mzjzjlb.YLJGDM ...
css
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) CREATE TABLE zyjzjlb ( CYBQDM text, CYBQMC text, CYCWH text, CYKSDM text, CYKSMC text, CYSJ time, CYZTDM number, HZXM text, JZKSDM text, JZKSMC text, JZLSH text, KH text, KLX number,...
SELECT zyjzjlb.CYZTDM FROM zyjzjlb WHERE zyjzjlb.JZLSH = '51689517780'
css
CREATE TABLE table_4056 ( "Executed person" text, "Date of execution" text, "Place of execution" text, "Crime" text, "Method" text, "Under President" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- for what crime was gunther volz executed at metz...
SELECT "Crime" FROM table_4056 WHERE "Place of execution" = 'Metz' AND "Executed person" = 'Gunther Volz'
wikisql
CREATE TABLE table_name_71 ( career VARCHAR, player VARCHAR, wickets VARCHAR, rank VARCHAR, average VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the career of the rank higher than 1, with an average less than 36.13 and 15 wickets, and ...
SELECT career FROM table_name_71 WHERE rank > 1 AND average < 36.13 AND wickets = 15 AND player = "george o'brien"
sql_create_context
CREATE TABLE table_39086 ( "Team" text, "Recopa 1994" text, "Supercopa 1994" text, "CONMEBOL 1994" text, "Copa Libertadores 1995" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Team has a Recopa 1994 of n/a and a CONMEBOL 1994 of 1st round?
SELECT "Team" FROM table_39086 WHERE "Recopa 1994" = 'n/a' AND "CONMEBOL 1994" = '1st round'
wikisql
CREATE TABLE competition_record ( competition_id number, farm_id number, rank number ) CREATE TABLE farm ( farm_id number, year number, total_horses number, working_horses number, total_cattle number, oxen number, bulls number, cows number, pigs number, sheep_and_goa...
SELECT T2.theme FROM city AS T1 JOIN farm_competition AS T2 ON T1.city_id = T2.host_city_id WHERE T1.population > 1000
spider
CREATE TABLE table_61722 ( "Name" text, "Country" text, "Type" text, "Moving from" text, "Transfer window" text, "Ends" text, "Transfer fee" text, "Source" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the type of sco country?
SELECT "Type" FROM table_61722 WHERE "Country" = 'sco'
wikisql
CREATE TABLE table_name_28 ( home VARCHAR, attendance VARCHAR, away VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the home team in the game with more than 1675, and Olimpia was the away side?
SELECT home FROM table_name_28 WHERE attendance > 1675 AND away = "olimpia"
sql_create_context
CREATE TABLE table_1341549_33 ( candidates VARCHAR, party VARCHAR, district VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many candidates with party being democratic and dbeingtrict being new york5
SELECT COUNT(candidates) FROM table_1341549_33 WHERE party = "Democratic" AND district = "New York5"
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 lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admityear < "2197" AND lab.fluid = "Urine"
mimicsql_data
CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), ...
SELECT FIRST_NAME, SUM(SALARY) FROM employees WHERE FIRST_NAME LIKE '%m' GROUP BY FIRST_NAME ORDER BY FIRST_NAME DESC
nvbench
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text,...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.insurance = "Self Pay"
mimicsql_data
CREATE TABLE instructor ( instructor_id int, name varchar, uniqname varchar ) CREATE TABLE gsi ( course_offering_id int, student_id int ) CREATE TABLE requirement ( requirement_id int, requirement varchar, college varchar ) CREATE TABLE program ( program_id int, name varchar, ...
SELECT DISTINCT course_offering.end_time, course_offering.friday, course_offering.monday, course_offering.saturday, course_offering.start_time, course_offering.sunday, course_offering.thursday, course_offering.tuesday, course_offering.wednesday FROM course, course_offering, semester WHERE course.course_id = course_offe...
advising
CREATE TABLE table_name_94 ( nominated_work VARCHAR, award VARCHAR, year VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What nominated work received a tony award in 2009?
SELECT nominated_work FROM table_name_94 WHERE award = "tony award" AND year = 2009
sql_create_context
CREATE TABLE table_8487 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Ground" text, "Date" text, "Crowd" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What ground had a 17.10 (112) home team score?
SELECT "Ground" FROM table_8487 WHERE "Home team score" = '17.10 (112)'
wikisql
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE medication ( medicationid n...
SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE DATETIME(patient.hospitaladmittime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year')
eicu
CREATE TABLE table_name_90 ( country VARCHAR, name VARCHAR, wins VARCHAR, rank VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Country has Wins larger than 2, and a Rank of 2, and a Name of federico bahamontes?
SELECT country FROM table_name_90 WHERE wins > 2 AND rank = 2 AND name = "federico bahamontes"
sql_create_context
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE cost ( costid number, ...
SELECT t3.diagnosisname FROM (SELECT t2.diagnosisname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, treatment.treatmenttime, patient.patienthealthsystemstayid FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'stres...
eicu
CREATE TABLE mzjzjlb_jybgb ( YLJGDM_MZJZJLB text, BGDH number, YLJGDM number ) 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, X...
SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN mzjzjlb_jybgb ON 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 jybgb.YLJGDM = jyjgzbb...
css
CREATE TABLE table_14536 ( "Country" text, "Total population (1000)" real, "Total Foreign-born (1000)" real, "Born in other EU state (1000)" real, "Born in a non EU state (1000)" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the greatest Bo...
SELECT MAX("Born in other EU state (1000)") FROM table_14536 WHERE "Total Foreign-born (1000)" > '1,380' AND "Country" = 'italy' AND "Born in a non EU state (1000)" < '3,205'
wikisql
CREATE TABLE betfront ( year number, datetime time, country text, competion text, match text, home_opening number, draw_opening number, away_opening number, home_closing number, draw_closing number, away_closing number ) CREATE TABLE football_data ( season text, date...
SELECT COUNT(*) FROM football_data WHERE fthg = 0 AND ftag = 0
worldsoccerdatabase
CREATE TABLE table_name_18 ( chassis VARCHAR, rank VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What Chassis ranked 18th?
SELECT chassis FROM table_name_18 WHERE rank = "18th"
sql_create_context
CREATE TABLE table_22923 ( "Standard" text, "Color system" text, "Informational CVBS Lines" text, "Bit rate [ Mbit/s ]" text, "Waveform" text, "Bits per line (including run-in)" real, "Max. Characters (per page row)" real ) -- Using valid SQLite, answer the following questions for the tabl...
SELECT "Waveform" FROM table_22923 WHERE "Bit rate [ Mbit/s ]" = '6.203'
wikisql
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) ...
SELECT lab.itemid, lab.label FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.name = "Chandra Schulman"
mimicsql_data
CREATE TABLE table_13619027_9 ( high_rebounds VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many different values if the number is high rebounds can be found for the game on March 13?
SELECT COUNT(high_rebounds) FROM table_13619027_9 WHERE date = "March 13"
sql_create_context
CREATE TABLE table_2655016_9 ( series__number VARCHAR, original_air_date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the series # on airdate September 21, 2002?
SELECT series__number FROM table_2655016_9 WHERE original_air_date = "September 21, 2002"
sql_create_context
CREATE TABLE table_name_41 ( nationality VARCHAR, years_for_jazz VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the nationality of all Utah Jazz Players, that played 1987-88?
SELECT nationality FROM table_name_41 WHERE years_for_jazz = "1987-88"
sql_create_context
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE patient ( uniquepid text, ...
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 = '002-70965')) AND NOT vitalperiodic.systemicmean IS ...
eicu
CREATE TABLE gsi ( course_offering_id int, student_id int ) CREATE TABLE requirement ( requirement_id int, requirement varchar, college varchar ) CREATE TABLE offering_instructor ( offering_instructor_id int, offering_id int, instructor_id int ) CREATE TABLE instructor ( instructo...
SELECT DISTINCT advisory_requirement, enforced_requirement, name FROM course WHERE department = 'EECS' AND number = 599
advising
CREATE TABLE table_47409 ( "Circuit" text, "Location" text, "Date" text, "Pole Position" text, "Fastest Lap" text, "Winner" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Location, when Fastest Lap is Ben Spies, when Pole Position is Ben...
SELECT "Location" FROM table_47409 WHERE "Fastest Lap" = 'ben spies' AND "Pole Position" = 'ben spies' AND "Winner" = 'ben spies' AND "Date" = 'tooele, utah'
wikisql
CREATE TABLE table_56151 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the name of the home team that has a venue called EMCG?
SELECT "Home team" FROM table_56151 WHERE "Venue" = 'emcg'
wikisql
CREATE TABLE PostFeedback ( Id number, PostId number, IsAnonymous boolean, VoteTypeId number, CreationDate time ) CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) CREATE TABLE SuggestedEdits ( Id n...
SELECT * FROM Posts WHERE STR_POSITION(Title, 'error') > 0 OR STR_POSITION(Title, 'syntax error') > 0 OR STR_POSITION(Title, 'syntaxerror') > 0 OR STR_POSITION(Title, 'exception') > 0
sede
CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemicsystolic number, systemicdiastolic number, systemicmean number, observationtime time ) CREATE TABLE microlab ( microl...
SELECT SUM(intakeoutput.cellvaluenumeric) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-21388') AND NOT patient.unitdischargetime IS...
eicu
CREATE TABLE table_1341930_33 ( first_elected VARCHAR, district VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many first elected with district being north carolina 2
SELECT COUNT(first_elected) FROM table_1341930_33 WHERE district = "North Carolina 2"
sql_create_context
CREATE TABLE member ( Member_ID int, Name text, Membership_card text, Age int, Time_of_purchase int, Level_of_membership int, Address text ) CREATE TABLE shop ( Shop_ID int, Address text, Num_of_staff text, Score real, Open_Year text ) CREATE TABLE happy_hour_member ( ...
SELECT Address, COUNT(*) FROM member GROUP BY Address
nvbench
CREATE TABLE table_15275 ( "Championship" text, "Current champion(s)" text, "Reign" text, "Date won" text, "Days held" real, "Location" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the location of reign 3
SELECT "Location" FROM table_15275 WHERE "Reign" = '3'
wikisql
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.dod_year <= "2168.0" AND prescriptions.formulary_drug_cd = "TOPI25"
mimicsql_data
CREATE TABLE table_name_68 ( opponent VARCHAR, november VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- who is the opponent on november 24?
SELECT opponent FROM table_name_68 WHERE november = 24
sql_create_context
CREATE TABLE table_24792 ( "Pilot" text, "Organization" text, "Total Flights" real, "USAF space flights" real, "FAI space flights" real, "Max Mach" text, "Max speed (mph)" real, "Max altitude (miles)" text ) -- Using valid SQLite, answer the following questions for the tables provided ...
SELECT MAX("FAI space flights") FROM table_24792 WHERE "Max Mach" = '5.65'
wikisql
CREATE TABLE table_name_75 ( shooter VARCHAR, event VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the shooter for the WC Beijing event?
SELECT shooter FROM table_name_75 WHERE event = "wc beijing"
sql_create_context
CREATE TABLE table_name_96 ( loss VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the loss for june 30
SELECT loss FROM table_name_96 WHERE date = "june 30"
sql_create_context
CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartr...
SELECT COUNT(*) > 0 FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '022-199074')) AND medication.drugname IN ('enoxaparin 40 mg/0.4 ml syr', '...
eicu
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 COUNT(*) FROM t_kc22 WHERE t_kc22.MED_ORG_DEPT_CD = '022' AND t_kc22.STA_DATE BETWEEN '2015-06-20' AND '2018-11-08' AND t_kc22.SOC_SRT_DIRE_NM = '盐酸文拉法辛胶囊'
css
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 = '9853107' AND NOT zyjzjlb.CYKSMC LIKE '%老年病%'
css
CREATE TABLE table_46361 ( "Round" real, "Pick" real, "Overall" real, "Name" text, "Position" text, "College" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total round of the rb player from Purdue with a pick less than 3?
SELECT COUNT("Round") FROM table_46361 WHERE "Position" = 'rb' AND "College" = 'purdue' AND "Pick" < '3'
wikisql
CREATE TABLE job_history ( EMPLOYEE_ID decimal(6,0), START_DATE date, END_DATE date, JOB_ID varchar(10), DEPARTMENT_ID decimal(4,0) ) CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(40), POSTAL_CODE varchar(12), CITY varchar(30), STATE_PROVINCE varchar(...
SELECT HIRE_DATE, DEPARTMENT_ID FROM employees WHERE HIRE_DATE < '2002-06-21' ORDER BY HIRE_DATE DESC
nvbench
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 SUM(inputevents_cv.amount) FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 12885)) AND inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.lab...
mimic_iii
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 MED_CLINIC_ID FROM t_kc21 WHERE PERSON_NM = '喻茂学' AND MED_SER_ORG_NO = '8314168' AND NOT OUT_DIAG_DIS_NM LIKE '%包括%'
css
CREATE TABLE table_17355408_7 ( date VARCHAR, high_assists VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Chauncey Billups (6) had a high assist on what date?
SELECT date FROM table_17355408_7 WHERE high_assists = "Chauncey Billups (6)"
sql_create_context
CREATE TABLE table_name_30 ( elevator VARCHAR, order_and_title VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- The Cardinal-Priest of S. Prassede order and title has who as the elevator?
SELECT elevator FROM table_name_30 WHERE order_and_title = "cardinal-priest of s. prassede"
sql_create_context
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE intakeoutput ( ...
SELECT MIN(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.patientunitstayid IN (SELECT lab.patientunitstayid FROM lab WHERE lab.labname = 'acetaminophen')) AND DATETIME(cost.chargetime, 'start of year') = DA...
eicu
CREATE TABLE table_name_71 ( crowd INTEGER, away_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the highest crowd number of the game where the away team was south melbourne?
SELECT MAX(crowd) FROM table_name_71 WHERE away_team = "south melbourne"
sql_create_context
CREATE TABLE zyjzjlb ( CYBQDM text, CYBQMC text, CYCWH text, CYKSDM text, CYKSMC text, CYSJ time, CYZTDM number, HZXM text, JZKSDM text, JZKSMC text, JZLSH text, KH text, KLX number, MZBMLX number, MZJZLSH text, MZZDBM text, MZZDMC text, MZZYZDZZBM...
SELECT jyjgzbb.JYZBLSH FROM hz_info JOIN mzjzjlb JOIN jyjgzbb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jyjgzbb.jybgb_YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jyjgzbb.jybgb_JZLSH_MZJZJLB WHERE hz_info.RYBH = '94261760' AND jyjgzbb.JYRQ BETWEEN '2013-01-1...
css
CREATE TABLE table_name_15 ( result VARCHAR, extra VARCHAR, year VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the result when extra is 4 x 100 m relay and the year is later than 1971?
SELECT result FROM table_name_15 WHERE extra = "4 x 100 m relay" AND year > 1971
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 lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text,...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.religion = "PROTESTANT QUAKER" AND demographic.admityear < "2180"
mimicsql_data
CREATE TABLE fgwyjzb ( 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 COUNT(*) FROM gwyjzb JOIN t_kc22 ON gwyjzb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gwyjzb.PERSON_ID = '83192146' AND t_kc22.STA_DATE BETWEEN '2001-08-28' AND '2002-12-20' AND t_kc22.SELF_PAY_PRO < 0.32 UNION SELECT COUNT(*) FROM fgwyjzb JOIN t_kc22 ON fgwyjzb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE fgwyjzb...
css
CREATE TABLE table_name_10 ( team VARCHAR, rank VARCHAR, time VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the name of the team with a rank smaller than 5 and a time of 1:37.58.38?
SELECT team FROM table_name_10 WHERE rank < 5 AND time = "1:37.58.38"
sql_create_context
CREATE TABLE table_204_228 ( id number, "year" number, "title" text, "credit" text, "role" text, "notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many films are there in total ?
SELECT COUNT("title") FROM table_204_228
squall
CREATE TABLE table_35391 ( "Round" real, "Pick #" real, "Overall" real, "Name" text, "Position" text, "College" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the overall number for a pick of #10, from Louisiana Tech, and a round bigger ...
SELECT SUM("Overall") FROM table_35391 WHERE "Pick #" = '10' AND "College" = 'louisiana tech' AND "Round" > '3'
wikisql
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) CREATE TABLE jybgb ( BBCJBW text, BBDM text, BBMC text, BBZT number, BGDH text, BGJGDM text, BGJGMC text, BGRGH text, BGRQ time, BGRXM text, BGSJ time, CJRQ time, JSBBRQSJ time, ...
SELECT txmzjzjlb.JZLSH FROM person_info JOIN hz_info JOIN txmzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = txmzjzjlb.YLJGDM AND hz_info.KH = txmzjzjlb.KH AND hz_info.KLX = txmzjzjlb.KLX WHERE person_info.XM = '苏正诚' AND NOT txmzjzjlb.JZLSH IN (SELECT jybgb.JZLSH FROM jybgb WHERE jybgb.BGRQ >= '2021-04-1...
css
CREATE TABLE table_61325 ( "Episode" text, "18-49" text, "Viewers (m)" real, "Rating" text, "Share" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What Rating has Viewers (m) of 2.73?
SELECT "Rating" FROM table_61325 WHERE "Viewers (m)" = '2.73'
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 SOC_SRT_DIRE_CD, SOC_SRT_DIRE_NM FROM t_kc22 WHERE MED_CLINIC_ID = '93533608212' AND OVE_SELF_AMO > 7130.31
css
CREATE TABLE table_2760 ( "Pos" text, "##" real, "Name" text, "Team" text, "Lap One" text, "Lap Two" text, "Lap Three" text, "Lap Four" text, "Total Time" text, "Avg. Speed" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was...
SELECT "Avg. Speed" FROM table_2760 WHERE "Total Time" = '1:30.4842'
wikisql
CREATE TABLE table_name_87 ( season VARCHAR, series VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What season was the Formula BMW USA in?
SELECT season FROM table_name_87 WHERE series = "formula bmw usa"
sql_create_context
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 COUNT(*) FROM wrestler
spider
CREATE TABLE zyjzjlb ( CYBQDM text, CYBQMC text, CYCWH text, CYKSDM text, CYKSMC text, CYSJ time, CYZTDM number, HZXM text, JZKSDM text, JZKSMC text, JZLSH text, KH text, KLX number, MZBMLX number, MZJZLSH text, MZZDBM text, MZZDMC text, MZZYZDZZBM...
SELECT * FROM person_info JOIN hz_info JOIN zyjzjlb JOIN person_info_hz_info ON person_info.RYBH = person_info_hz_info.RYBH AND hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX AND person_info_hz_info.KH = hz_info.KH AND person_info_hz_info.KLX = hz_info.KLX AND person_info_hz_i...
css
CREATE TABLE table_20142629_2 ( _3_cylinder VARCHAR, stanier VARCHAR, fowler VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When the Fowler is 16, what is the number of cylinders?
SELECT COUNT(stanier), _3_cylinder FROM table_20142629_2 WHERE fowler = 16
sql_create_context
CREATE TABLE table_7481 ( "Year" real, "Events played" real, "Cuts made" real, "Wins" real, "2nds" real, "Top 10s" real, "Best finish" text, "Earnings ($)" real, "Rank" text, "Scoring average" real, "Scoring rank" text ) -- Using valid SQLite, answer the following questions...
SELECT SUM("Events played") FROM table_7481 WHERE "Cuts made" < '0'
wikisql
CREATE TABLE table_48109 ( "Province" text, "Largest city" text, "2nd Largest" text, "3rd Largest" text, "4th largest" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the 3rd largest where the largest city is Ardabil?
SELECT "3rd Largest" FROM table_48109 WHERE "Largest city" = 'ardabil'
wikisql
CREATE TABLE table_34870 ( "Team" text, "Average" real, "Points" real, "Played" real, "1989-90" text, "1990-91" text, "1991-1992" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which played number has an average of 1.026 and a 1989-90 that i...
SELECT "Played" FROM table_34870 WHERE "Average" > '1.026' AND "1989-90" = '36'
wikisql
CREATE TABLE table_29461 ( "#" real, "Episode" text, "Air Date" text, "Rating" text, "Share" text, "18-49 (Rating/Share)" text, "Viewers (m)" text, "Weekly Rank (#)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many maximum # when ...
SELECT MAX("#") FROM table_29461 WHERE "Viewers (m)" = '8.01'
wikisql
CREATE TABLE table_1333612_1 ( population VARCHAR, country VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what's the population with country being chile
SELECT population FROM table_1333612_1 WHERE country = "Chile"
sql_create_context
CREATE TABLE table_51205 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the away team when the home team was south melbourne?
SELECT "Away team" FROM table_51205 WHERE "Home team" = 'south melbourne'
wikisql
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 T1.Name, T2.Revenue FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name ORDER BY T2.Revenue
nvbench