instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
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 vitalperiodic ( vitalperio...
SELECT MAX(t1.c1) FROM (SELECT COUNT(DISTINCT diagnosis.patientunitstayid) AS c1 FROM diagnosis WHERE diagnosis.diagnosisname = 's/p thoracotomy - decortication' AND STRFTIME('%y', diagnosis.diagnosistime) <= '2104' GROUP BY STRFTIME('%y', diagnosis.diagnosistime)) AS t1
eicu
CREATE TABLE table_47182 ( "Name" text, "Year Began" text, "s Registered user" text, "Updated in past 30 days" text, "Registration" text, "Ability to syndicate off-site feeds" text, "Userpics Free" text, "Userpics Paid" text, "Monthly Cost for Paid Account" text, "Yearly Cost for...
SELECT "Updated in past 30 days" FROM table_47182 WHERE "Registration" = 'open to people 13 and over'
wikisql
CREATE TABLE table_3378 ( "Episode #" real, "The W\u00f8rd" text, "Guest" text, "Introductory phrase" text, "Original airdate" text, "Production code" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the original airdate of episode #733?
SELECT "Original airdate" FROM table_3378 WHERE "Episode #" = '733'
wikisql
CREATE TABLE table_18904831_6 ( date VARCHAR, high_rebounds VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When dydek (11) has the highest rebounds what is the date?
SELECT date FROM table_18904831_6 WHERE high_rebounds = "Dydek (11)"
sql_create_context
CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, ...
SELECT Id AS "post_link", Score, ViewCount FROM Posts WHERE Title LIKE '%##Word##%' ORDER BY ViewCount DESC LIMIT 50
sede
CREATE TABLE table_name_83 ( venue VARCHAR, score VARCHAR, year VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What venue has 3 & 2 as the score, and 1965 as the year?
SELECT venue FROM table_name_83 WHERE score = "3 & 2" AND year = "1965"
sql_create_context
CREATE TABLE table_name_7 ( began_operation INTEGER, length__km_ VARCHAR, stations VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When is the earliest began operation with a length of sultan ismail and over 27 stations?
SELECT MIN(began_operation) FROM table_name_7 WHERE length__km_ = "sultan ismail" AND stations > 27
sql_create_context
CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_ID decimal(4,0) ) CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(40)...
SELECT SALARY, MANAGER_ID FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%'
nvbench
CREATE TABLE table_name_18 ( grid VARCHAR, time_retired VARCHAR, laps VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the grid when the time/retired is +9 laps and the laps is larger than 91?
SELECT COUNT(grid) FROM table_name_18 WHERE time_retired = "+9 laps" AND laps > 91
sql_create_context
CREATE TABLE aircraft ( aircraft_code varchar, aircraft_description varchar, manufacturer varchar, basic_type varchar, engines int, propulsion varchar, wide_body varchar, wing_span int, length int, weight int, capacity int, pay_load int, cruising_speed int, range_...
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, food_service WHERE ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BOSTON' AND flight.to_airport = AIRPORT_SERVICE_1.airport_code AND food_se...
atis
CREATE TABLE table_name_48 ( year VARCHAR, laps VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the year with 116 laps?
SELECT year FROM table_name_48 WHERE laps = 116
sql_create_context
CREATE TABLE employees ( first_name VARCHAR, department_id VARCHAR, last_name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Display the first name, and department number for all employees whose last name is 'McEwen'.
SELECT first_name, department_id FROM employees WHERE last_name = 'McEwen'
sql_create_context
CREATE TABLE VoteTypes ( Id number, Name text ) CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, ...
SELECT * FROM Users
sede
CREATE TABLE table_name_7 ( position VARCHAR, pick VARCHAR, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which position had a pick larger than 80 and Walt Mainer as a player?
SELECT position FROM table_name_7 WHERE pick > 80 AND player = "walt mainer"
sql_create_context
CREATE TABLE table_26301697_2 ( represents VARCHAR, hometown VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the represents for los alcarrizos
SELECT represents FROM table_26301697_2 WHERE hometown = "Los Alcarrizos"
sql_create_context
CREATE TABLE table_255 ( "Player" text, "No." text, "Nationality" text, "Position" text, "Years for Jazz" text, "School/Club Team" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- During which years did player number 35 play for Jazz?
SELECT "Years for Jazz" FROM table_255 WHERE "No." = '35'
wikisql
CREATE TABLE table_name_99 ( country VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the nationality of the winner on December 8, 1968?
SELECT country FROM table_name_99 WHERE date = "december 8, 1968"
sql_create_context
CREATE TABLE table_77240 ( "Outcome" text, "Year" real, "Championship" text, "Surface" text, "Opponent" text, "Score" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What championship after 1997 was the score 1 6, 4 6, 7 5, 5 7?
SELECT "Championship" FROM table_77240 WHERE "Year" > '1997' AND "Score" = '1–6, 4–6, 7–5, 5–7'
wikisql
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 gwyjzb.OUT_DIAG_DIS_CD, gwyjzb.OUT_DIAG_DIS_NM FROM gwyjzb WHERE gwyjzb.MED_CLINIC_ID = '88417567835' UNION SELECT fgwyjzb.OUT_DIAG_DIS_CD, fgwyjzb.OUT_DIAG_DIS_NM FROM fgwyjzb WHERE fgwyjzb.MED_CLINIC_ID = '88417567835'
css
CREATE TABLE Documents ( document_code VARCHAR(15), document_structure_code VARCHAR(15), document_type_code VARCHAR(15), access_count INTEGER, document_name VARCHAR(80) ) CREATE TABLE Images ( image_id INTEGER, image_alt_text VARCHAR(80), image_name VARCHAR(40), image_url VARCHAR(25...
SELECT role_code, COUNT(*) FROM Users GROUP BY role_code
nvbench
CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE d_icd_diagnoses ( ...
SELECT admissions.admission_type FROM admissions WHERE admissions.subject_id = 26849 AND DATETIME(admissions.admittime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') ORDER BY admissions.admittime LIMIT 1
mimic_iii
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, ...
SELECT MIN(demographic.age) FROM demographic WHERE demographic.diagnosis = "AORTIC INSUFFICIENCY\RE-DO STERNOTOMY; AORTIC VALVE REPLACEMENT " AND demographic.days_stay = "20"
mimicsql_data
CREATE TABLE table_39868 ( "Position" real, "Team" text, "Points" real, "Played" real, "Drawn" real, "Lost" real, "Against" real, "Difference" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the highest number of points for a posi...
SELECT MAX("Points") FROM table_39868 WHERE "Position" < '3' AND "Lost" < '1'
wikisql
CREATE TABLE table_name_83 ( hometown VARCHAR, college VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the hometown of the player who is headed to Duke?
SELECT hometown FROM table_name_83 WHERE college = "duke"
sql_create_context
CREATE TABLE table_2941848_10 ( s_color_commentator VARCHAR, pregame_hosts VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is the s color commentator when the pregame host is jon sciambi?
SELECT s_color_commentator FROM table_2941848_10 WHERE pregame_hosts = "Jon Sciambi"
sql_create_context
CREATE TABLE table_29423 ( "R" real, "Player" text, "Position" text, "The Championship" real, "FA Cup" real, "League Cup" real, "Total" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the position for the player becchio?
SELECT "Position" FROM table_29423 WHERE "Player" = 'Becchio'
wikisql
CREATE TABLE table_27877 ( "Settlement" text, "Cyrillic Name Other Names" text, "Type" text, "Population (2011)" real, "Largest ethnic group (2002)" text, "Dominant religion (2002)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many entries...
SELECT COUNT("Cyrillic Name Other Names") FROM table_27877 WHERE "Settlement" = 'Idvor'
wikisql
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 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.YLJGDM AND jybgb.BGDH = jyjgzbb....
css
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 lab.itemid FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.name = "Paul Edwards"
mimicsql_data
CREATE TABLE table_73399 ( "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. -- How many vacators have October 22, 1808 as date successor seated?
SELECT COUNT("Vacator") FROM table_73399 WHERE "Date successor seated" = 'October 22, 1808'
wikisql
CREATE TABLE mountain ( Mountain_ID int, Name text, Height real, Prominence real, Range text, Country text ) CREATE TABLE climber ( Climber_ID int, Name text, Country text, Time text, Points real, Mountain_ID int ) -- Using valid SQLite, answer the following questions ...
SELECT Country, COUNT(*) FROM climber GROUP BY Country ORDER BY Country DESC
nvbench
CREATE TABLE table_name_97 ( minister VARCHAR, portfolio VARCHAR, took_office VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Minister, when Portfolio is 'Minister of Pubblic Administration', and when Took Office is '14 November 2002'?
SELECT minister FROM table_name_97 WHERE portfolio = "minister of pubblic administration" AND took_office = "14 november 2002"
sql_create_context
CREATE TABLE table_name_97 ( capital VARCHAR, hangul_chosongul VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which capital has a Hangul of ?
SELECT capital FROM table_name_97 WHERE hangul_chosongul = "경상남도"
sql_create_context
CREATE TABLE t_kc22 ( AMOUNT number, CHA_ITEM_LEV number, DATA_ID text, DIRE_TYPE number, DOSE_FORM text, DOSE_UNIT text, EACH_DOSAGE text, EXP_OCC_DATE time, FLX_MED_ORG_ID text, FXBZ number, HOSP_DOC_CD text, HOSP_DOC_NM text, MED_CLINIC_ID text, MED_DIRE_CD tex...
SELECT t_kc21.OUT_DIAG_DIS_CD, AVG(t_kc21.PERSON_AGE) FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '8485099' GROUP BY t_kc21.OUT_DIAG_DIS_CD
css
CREATE TABLE Person ( name varchar(20), age INTEGER, city TEXT, gender TEXT, job TEXT ) CREATE TABLE PersonFriend ( name varchar(20), friend varchar(20), year INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Visualize a bar chart for w...
SELECT job, AVG(age) FROM Person GROUP BY job ORDER BY AVG(age) DESC
nvbench
CREATE TABLE Student_Course_Enrolment ( registration_id INTEGER, student_id INTEGER, course_id INTEGER, date_of_enrolment DATETIME, date_of_completion DATETIME ) CREATE TABLE Course_Authors_and_Tutors ( author_id INTEGER, author_tutor_ATB VARCHAR(3), login_name VARCHAR(40), password...
SELECT date_of_enrolment, COUNT(date_of_enrolment) FROM Student_Course_Enrolment ORDER BY COUNT(date_of_enrolment) DESC
nvbench
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 MAX(demographic.age) FROM demographic WHERE demographic.insurance = "Government" AND demographic.days_stay = "3"
mimicsql_data
CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE labevents ( r...
SELECT STRFTIME('%j', admissions.dischtime) - STRFTIME('%j', admissions.admittime) FROM admissions WHERE admissions.subject_id = 65883 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1
mimic_iii
CREATE TABLE table_24105 ( "Game" real, "Date" text, "Opponent" text, "Result" text, "Wildcats points" real, "Opponents" real, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many times did the Wildcats play a game 11 regardless ...
SELECT COUNT("Wildcats points") FROM table_24105 WHERE "Game" = '11'
wikisql
CREATE TABLE table_name_77 ( total INTEGER, gold VARCHAR, bronze VARCHAR, silver VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the lowest total medals when there were 0 gold medals, 0 silver medals, and more than 1 bronze medal?
SELECT MIN(total) FROM table_name_77 WHERE bronze > 1 AND silver = 0 AND gold < 0
sql_create_context
CREATE TABLE table_75663 ( "Rank" real, "Municipality" text, "Province" text, "Status" text, "Area (km 2 )" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the listed Status that has the Province of Ontario and Rank of 86?
SELECT "Status" FROM table_75663 WHERE "Province" = 'ontario' AND "Rank" = '86'
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 people ( People_ID int, Sex text, Name text, Date_of_Birth text, Height real, Weight real ) CREATE TABLE candidate ( Candidate_ID int, People_ID int, Poll_Source text, Date text, Support_rate real, Consider_rate real, Oppose_rate real, Unsure_rate re...
SELECT Date_of_Birth, Height FROM people
nvbench
CREATE TABLE table_79302 ( "Period" text, "Internet Explorer" text, "Firefox" text, "Chrome" text, "Safari" text, "Opera" text, "Other" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What opera has 19.87% as the firefox?
SELECT "Opera" FROM table_79302 WHERE "Firefox" = '19.87%'
wikisql
CREATE TABLE table_25675509_1 ( depth VARCHAR, longitude VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- If the longitude is 158.091 e, what is the depth?
SELECT depth FROM table_25675509_1 WHERE longitude = "158.091° E"
sql_create_context
CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Percent text, ACC_Home text, ACC_Road text, All_Games text, All_Games_Percent int, All_Home text, All_Road text, All_Neutral text ) CREATE TABLE university ( Scho...
SELECT Team_Name, School_ID FROM basketball_match ORDER BY Team_Name DESC
nvbench
CREATE TABLE table_78577 ( "Rider" text, "Bike" text, "Laps" real, "Time" text, "Grid" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the time of Max Biaggi with more than 2 grids, 20 laps?
SELECT "Time" FROM table_78577 WHERE "Grid" > '2' AND "Laps" = '20' AND "Rider" = 'max biaggi'
wikisql
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.language = "SPAN"
mimicsql_data
CREATE TABLE table_1360997_3 ( winner_2nd VARCHAR, time VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When the time is 1:36.30 what shows as winner?
SELECT winner_2nd FROM table_1360997_3 WHERE time = "1:36.30"
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 jyjgzbb.JYZBLSH FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE hz...
css
CREATE TABLE 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 diagnoses.short_title, diagnoses.long_title FROM diagnoses WHERE diagnoses.subject_id = "18077"
mimicsql_data
CREATE TABLE table_name_5 ( accreditation_type VARCHAR, accreditation_level VARCHAR, company_name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When the Nokia corporation had an accreditation level of joyn, what was the accreditation type?
SELECT accreditation_type FROM table_name_5 WHERE accreditation_level = "joyn" AND company_name = "nokia corporation"
sql_create_context
CREATE TABLE table_44981 ( "Year" real, "Starts" real, "Wins" real, "Top 5" real, "Top 10" real, "Poles" real, "Avg. Start" real, "Avg. Finish" real, "Winnings" text, "Position" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How ...
SELECT SUM("Avg. Finish") FROM table_44981 WHERE "Starts" = '9' AND "Top 10" < '0'
wikisql
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE medication (...
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 = '022-87224')) ORDER BY lab.labresulttime DESC LIMIT 1
eicu
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 AVG(jyjgzbb.JCZBJGDL), MIN(jyjgzbb.JCZBJGDL), MAX(jyjgzbb.JCZBJGDL) FROM mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN jybgb_jyjgzbb ON mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jybgb_jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH AND jybgb_jyjgzbb.JYZBLSH = jyjgzbb.JY...
css
CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title 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...
SELECT d_icd_diagnoses.short_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.icd9_code IN (SELECT t3.icd9_code FROM (SELECT t2.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, procedures_icd.charttime FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissi...
mimic_iii
CREATE TABLE table_name_21 ( laps VARCHAR, driver VARCHAR, grid VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was John Watson's total laps with a grid of less than 7?
SELECT COUNT(laps) FROM table_name_21 WHERE driver = "john watson" AND grid < 7
sql_create_context
CREATE TABLE table_name_88 ( pitcher VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the pitcher on June 8, 1961?
SELECT pitcher FROM table_name_88 WHERE date = "june 8, 1961"
sql_create_context
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) C...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.diagnosis = "ST ELEVATED MYOCARDIAL INFARCTION\CARDIAC CATH" AND procedures.short_title = "Cont inv mec ven <96 hrs"
mimicsql_data
CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) ) CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varchar(20), LAST_NAME varchar(25), EMAIL varchar(25), PHONE_NUMBER varchar(20), HIRE_DATE date, JO...
SELECT FIRST_NAME, MANAGER_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY FIRST_NAME
nvbench
CREATE TABLE invoice_lines ( id number, invoice_id number, track_id number, unit_price number, quantity number ) CREATE TABLE employees ( id number, last_name text, first_name text, title text, reports_to number, birth_date time, hire_date time, address text, cit...
SELECT name FROM playlists
spider
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(vitalperiodic.respiration) FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '005-12192')) AND NOT vitalperiodic.respiration IS ...
eicu
CREATE TABLE table_18247 ( "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. -- What was the results for the candidates listed as bart gordon (d) 76.5% ...
SELECT "Result" FROM table_18247 WHERE "Candidates" = 'Bart Gordon (D) 76.5% Wallace Embry (R) 23.5%'
wikisql
CREATE TABLE table_51749 ( "Year" real, "Athlete" text, "Nation" text, "Time" text, "Location" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What location had 1:59:12 in time?
SELECT "Location" FROM table_51749 WHERE "Time" = '1:59:12'
wikisql
CREATE TABLE table_28781 ( "Year (Ceremony)" text, "English title" text, "Arabic title" text, "Director" text, "Result" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When salt of this sea is the english title who is the director?
SELECT "Director" FROM table_28781 WHERE "English title" = 'Salt of this Sea'
wikisql
CREATE TABLE table_22857 ( "Model" text, "Year" text, "Code name" text, "Fab ( nm )" real, "Bus interface" text, "Transistor count (Millions)" real, "Memory max ( MiB )" text, "Core ( MHz )" real, "Memory ( MHz )" text, "Type" text, "Bus Width ( Bit )" real, "DirectX" tex...
SELECT COUNT("Bus Width ( Bit )") FROM table_22857 WHERE "Core ( MHz )" = '650'
wikisql
CREATE TABLE table_61961 ( "President" text, "Treasurer" text, "Secretary" text, "Social AO" text, "Academic AO" text, "Internal CO" text, "External CO" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What Social AO has a President of harm va...
SELECT "Social AO" FROM table_61961 WHERE "President" = 'harm van leeuwen'
wikisql
CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(40), POSTAL_CODE varchar(12), CITY varchar(30), STATE_PROVINCE varchar(25), COUNTRY_ID varchar(2) ) CREATE T...
SELECT HIRE_DATE, AVG(SALARY) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 ORDER BY AVG(SALARY) DESC
nvbench
CREATE TABLE table_21422977_1 ( coalition_parties VARCHAR, nº VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When n is 3, what are all the coaliton parties?
SELECT coalition_parties FROM table_21422977_1 WHERE nº = 3
sql_create_context
CREATE TABLE body_builder ( Body_Builder_ID int, People_ID int, Snatch real, Clean_Jerk real, Total real ) CREATE TABLE people ( People_ID int, Name text, Height real, Weight real, Birth_Date text, Birth_Place text ) -- Using valid SQLite, answer the following questions fo...
SELECT Clean_Jerk, Total FROM body_builder
nvbench
CREATE TABLE table_name_48 ( state VARCHAR, member VARCHAR, term_in_office VARCHAR, party VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which state has a Term in office of 1984 1996, a Party of labor, and a Member of robert tickner?
SELECT state FROM table_name_48 WHERE term_in_office = "1984–1996" AND party = "labor" AND member = "robert tickner"
sql_create_context
CREATE TABLE table_8260 ( "Name" text, "Company" text, "Tracking Method" text, "Latest stable release" text, "Price in USD" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Tracking Method has a Latest stable release of n/a, and a Price in USD o...
SELECT "Tracking Method" FROM table_8260 WHERE "Latest stable release" = 'n/a' AND "Price in USD" = 'from $202/month'
wikisql
CREATE TABLE employees ( id number, last_name text, first_name text, title text, reports_to number, birth_date time, hire_date time, address text, city text, state text, country text, postal_code text, phone text, fax text, email text ) CREATE TABLE albums ( ...
SELECT unit_price FROM tracks WHERE name = "Fast As a Shark"
spider
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 diagnoses ( ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_location = "EMERGENCY ROOM ADMIT" AND demographic.diagnosis = "TRANSIENT ISCHEMIC ATTACK"
mimicsql_data
CREATE TABLE table_32871 ( "Adherents" real, "Regular Attendees" real, "% of adherents" text, "Monasteries" real, "Parishes" real, "Average Parish Size" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the lowest average parish size with 4...
SELECT MIN("Average Parish Size") FROM table_32871 WHERE "% of adherents" = '47.2%' AND "Regular Attendees" > '4,936'
wikisql
CREATE TABLE table_11598 ( "Outcome" text, "Date" text, "Tournament" text, "Surface" text, "Partner" text, "Opponents in the final" text, "Score in the final" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- On what surface was the tournament ...
SELECT "Surface" FROM table_11598 WHERE "Opponents in the final" = 'kathleen horvath marcella mesker'
wikisql
CREATE TABLE table_21571 ( "Fin. Pos" real, "Car No." real, "Driver" text, "Team" text, "Laps" real, "Time/Retired" text, "Grid" real, "Laps Led" real, "Points" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- If grid is 2, what is the...
SELECT MIN("Fin. Pos") FROM table_21571 WHERE "Grid" = '2'
wikisql
CREATE TABLE table_8307 ( "Rank" real, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total number of gold medals of slovakia, which has less than 1 silver medal?
SELECT COUNT("Gold") FROM table_8307 WHERE "Silver" < '1' AND "Nation" = 'slovakia'
wikisql
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime...
SELECT COUNT(*) > 0 FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-1337')) AND DATETIME(microlab.culturetakentime, 'start of year') = DATETIM...
eicu
CREATE TABLE table_1109 ( "Rank" real, "Country" text, "International tourist arrivals (2011)" text, "International tourist arrivals (2010)" text, "Change (2010 to 2011)" text, "Change (2009 to 2010)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. ...
SELECT "International tourist arrivals (2010)" FROM table_1109 WHERE "International tourist arrivals (2011)" = '8.1 million'
wikisql
CREATE TABLE table_203_212 ( id number, "#" number, "district" text, "land area (km2)" number, "population\n(2010 census)" number, "density (persons/km2)" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- saint lucia has how many districts with a...
SELECT COUNT("district") FROM table_203_212 WHERE "density (persons/km2)" < 200
squall
CREATE TABLE table_38644 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Game site" text, "Attendance" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the average week for result of l 28 17
SELECT AVG("Week") FROM table_38644 WHERE "Result" = 'l 28–17'
wikisql
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) CREATE TABLE zyjzjlb_jybgb ( YLJGDM_ZYJZJLB text, BGDH number, YLJGDM number ) CREATE TABLE jyjgzbb ( BGDH text, BGRQ time, CKZFWDX text, CKZFWSX number, CKZFWXX number, JCFF text, JCRGH text, ...
SELECT zyjzjlb.CYZTDM FROM zyjzjlb WHERE zyjzjlb.JZLSH = '07717128027'
css
CREATE TABLE Institution ( Institution_id text, Institution text, Location text, Founded real, Type text, Enrollment int, Team text, Primary_Conference text, building_id text ) CREATE TABLE protein ( common_name text, protein_name text, divergence_from_human_lineage real...
SELECT Name, Height_feet FROM building AS T1 JOIN Institution AS T2 ON T1.building_id = T2.building_id WHERE T2.Founded > 1880 ORDER BY Height_feet DESC
nvbench
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 T2.Founder, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Founder ORDER BY T1.Code
nvbench
CREATE TABLE table_19248 ( "Year" real, "Boys singles" text, "Girls singles" text, "Boys doubles" text, "Girls doubles" text, "Mixed doubles" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When the girls doubles is ayu pratiwi anggi widia what i...
SELECT "Boys doubles" FROM table_19248 WHERE "Girls doubles" = 'Ayu Pratiwi Anggi Widia'
wikisql
CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Percent text, ACC_Home text, ACC_Road text, All_Games text, All_Games_Percent int, All_Home text, All_Road text, All_Neutral text ) CREATE TABLE university ( Scho...
SELECT ACC_Road, COUNT(ACC_Road) FROM basketball_match GROUP BY ACC_Road ORDER BY ACC_Road DESC
nvbench
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 (SELECT gwyjzb.MED_ORG_DEPT_CD FROM gwyjzb WHERE gwyjzb.MED_SER_ORG_NO = '4788064' GROUP BY gwyjzb.MED_ORG_DEPT_CD HAVING MAX(gwyjzb.IN_HOSP_DAYS) < 20 UNION SELECT fgwyjzb.MED_ORG_DEPT_CD FROM fgwyjzb WHERE fgwyjzb.MED_SER_ORG_NO = '4788064' GROUP BY fgwyjzb.MED_ORG_DEPT_CD HAVING MAX(fgwyjzb.IN_H...
css
CREATE TABLE table_name_51 ( equipment VARCHAR, position VARCHAR, points VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Equipment, when Position is greater than 28, and when Points is greater than 10?
SELECT equipment FROM table_name_51 WHERE position > 28 AND points > 10
sql_create_context
CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemicsystolic number, systemicdiastolic number, systemicmean number, observationtime time ) CREATE TABLE medication ( medi...
SELECT diagnosis.diagnosistime FROM diagnosis WHERE diagnosis.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '007-2498')) AND diagnosis.diagnosisname = 'encephalopathy' AND DA...
eicu
CREATE TABLE table_11381701_3 ( date VARCHAR, bada VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- On which dates was the value of Bada 0.05%?
SELECT date FROM table_11381701_3 WHERE bada = "0.05%"
sql_create_context
CREATE TABLE table_61900 ( "Year" real, "Edition" text, "Round" text, "Date" text, "Location" text, "Surface" text, "Against" text, "Opponent(s)" text, "Score" text, "Result" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Y...
SELECT AVG("Year") FROM table_61900 WHERE "Date" = '5–6 february'
wikisql
CREATE TABLE table_2311410_5 ( erin_and_jake VARCHAR, week VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the erin and jake for week 4
SELECT erin_and_jake FROM table_2311410_5 WHERE week = 4
sql_create_context
CREATE TABLE person_info ( RYBH text, XBDM number, XBMC text, XM text, CSRQ time, CSD text, MZDM text, MZMC text, GJDM text, GJMC text, JGDM text, JGMC text, XLDM text, XLMC text, ZYLBDM text, ZYMC text ) CREATE TABLE mzjzjlb ( YLJGDM text, JZLSH ...
SELECT * FROM jyjgzbb WHERE JCZBMC = (SELECT JCZBMC FROM jyjgzbb WHERE JYZBLSH = '75734774691') AND JCZBJGDW = (SELECT JCZBJGDW FROM jyjgzbb WHERE JYZBLSH = '75734774691') AND JCZBJGDL = (SELECT JCZBJGDL FROM jyjgzbb WHERE JYZBLSH = '75734774691')
css
CREATE TABLE table_51527 ( "Round" real, "Overall" real, "Player" text, "Nationality" text, "Club team" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the nationality of the player with an overall of 74
SELECT "Nationality" FROM table_51527 WHERE "Overall" = '74'
wikisql
CREATE TABLE employment ( Company_ID int, People_ID int, Year_working int ) CREATE TABLE company ( Company_ID real, Name text, Headquarters text, Industry text, Sales_in_Billion real, Profits_in_Billion real, Assets_in_Billion real, Market_Value_in_Billion real ) CREATE TAB...
SELECT Headquarters, COUNT(Headquarters) FROM company GROUP BY Headquarters
nvbench
CREATE TABLE table_23952 ( "Position" real, "Race number" text, "Sail number" text, "Yacht" text, "State/country" text, "Yacht type" text, "LOA (Metres)" text, "Skipper" text, "Elapsed time d:hh:mm:ss" text ) -- Using valid SQLite, answer the following questions for the tables prov...
SELECT "LOA (Metres)" FROM table_23952 WHERE "Sail number" = 'M10'
wikisql
CREATE TABLE table_name_44 ( venue VARCHAR, competition VARCHAR, result VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What venue were the 1986 Asian games resulting in 2-0 played at?
SELECT venue FROM table_name_44 WHERE competition = "1986 asian games" AND result = "2-0"
sql_create_context
CREATE TABLE table_24899 ( "Code & location" text, "Missile Type" text, "Defense Area" text, "Dates" text, "Control Site condition/owner" text, "Launch Site condition/owner" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When is every date that ...
SELECT "Dates" FROM table_24899 WHERE "Control Site condition/owner" = 'machine shop on Martin Dr.'
wikisql
CREATE TABLE table_13463790_2 ( city VARCHAR, name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many city with name being providence tower
SELECT COUNT(city) FROM table_13463790_2 WHERE name = "Providence Tower"
sql_create_context