instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE table_name_75 ( team VARCHAR, sport VARCHAR, class VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which baseball team is class AAA?
SELECT team FROM table_name_75 WHERE sport = "baseball" AND class = "aaa"
sql_create_context
CREATE TABLE table_name_52 ( school VARCHAR, enrollment VARCHAR, county VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which School has an Enrollment larger than 264, and a County of 46 la porte?
SELECT school FROM table_name_52 WHERE enrollment > 264 AND county = "46 la porte"
sql_create_context
CREATE TABLE table_name_87 ( nation VARCHAR, gold VARCHAR, silver VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which nations have more than 1 gold medal and 4 silver medals?
SELECT nation FROM table_name_87 WHERE gold > 1 AND silver = 4
sql_create_context
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 t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_NM = '华安然' AND NOT t_kc21.MED_CLINIC_ID IN (SELECT t_kc21_t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT <= 1404.19)
css
CREATE TABLE zyb ( CLINIC_ID text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, INSU_TYPE text, IN...
SELECT qtb.MED_ORG_DEPT_NM, qtb.IN_DIAG_DIS_CD, AVG(qtb.PERSON_AGE) FROM qtb WHERE qtb.MED_SER_ORG_NO = '2686792' GROUP BY qtb.MED_ORG_DEPT_NM, qtb.IN_DIAG_DIS_CD UNION SELECT gyb.MED_ORG_DEPT_NM, gyb.IN_DIAG_DIS_CD, AVG(gyb.PERSON_AGE) FROM gyb WHERE gyb.MED_SER_ORG_NO = '2686792' GROUP BY gyb.MED_ORG_DEPT_NM, gyb.IN_...
css
CREATE TABLE table_name_7 ( attendance INTEGER, opponents VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many people attended the game against the Kaizer Chiefs?
SELECT SUM(attendance) FROM table_name_7 WHERE opponents = "kaizer chiefs"
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 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.diagnosis = "AORTIC VALVE INSUFFIENCY\AORTIC VALVE REPLACEMENT /SDA" AND demographic.dod_year <= "2164.0"
mimicsql_data
CREATE TABLE table_74612 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the home team's score at the game that ...
SELECT "Home team score" FROM table_74612 WHERE "Crowd" > '24,000'
wikisql
CREATE TABLE artist ( artist_name text, country text, gender text, preferred_genre text ) CREATE TABLE song ( song_name text, artist_name text, country text, f_id number, genre_is text, rating number, languages text, releasedate time, resolution number ) CREATE TABL...
SELECT song_name FROM song WHERE languages = "english"
spider
CREATE TABLE table_train_62 ( "id" int, "do_not_resuscitate_dnr" bool, "cd4_count" int, "oxygen_therapy_by_face_mask" bool, "intention_to_central_venous_catheter" bool, "blood_transfusion" bool, "tolerate_microscan_procedure" bool, "NOUSE" float ) -- Using valid SQLite, answer the foll...
SELECT * FROM table_train_62 WHERE tolerate_microscan_procedure = 0 OR oxygen_therapy_by_face_mask = 0
criteria2sql
CREATE TABLE table_39627 ( "Game" real, "October" real, "Opponent" text, "Score" text, "Record" text, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the lowest number of points of the game before game 2 before October 10?
SELECT MIN("Points") FROM table_39627 WHERE "October" < '10' AND "Game" < '2'
wikisql
CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Percent text, ACC_Home text, ACC_Road text, All_Games text, All_Games_Percent int, All_Home text, All_Road text, All_Neutral text ) CREATE TABLE university ( Scho...
SELECT All_Games, All_Games_Percent FROM basketball_match
nvbench
CREATE TABLE table_58468 ( "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 highest rank for a nation with 26 golds and over 17 silvers?
SELECT MAX("Rank") FROM table_58468 WHERE "Gold" = '26' AND "Silver" > '17'
wikisql
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE patient ( ...
SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE patient.patientunitstayid IN (SELECT microlab.patientunitstayid FROM microlab WHERE microlab.culturesite = 'blood, venipuncture' AND STRFTIME('%y', microlab.culturetakentime) = '2104')
eicu
CREATE TABLE table_name_76 ( home_team VARCHAR, away_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which home team has an Away team of essendon?
SELECT home_team AS score FROM table_name_76 WHERE away_team = "essendon"
sql_create_context
CREATE TABLE transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, eventtype text, careunit text, wardid number, intime time, outtime time ) CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) ...
SELECT inputevents_cv.charttime 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 = 5142)) AND DATETIME(inputevents_cv.charttime, 'start of month') = DATETIME(CURRENT_TIME(), '...
mimic_iii
CREATE TABLE table_name_21 ( voltage VARCHAR, model_number VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Voltage for Model Number c3 866?
SELECT voltage FROM table_name_21 WHERE model_number = "c3 866"
sql_create_context
CREATE TABLE table_11677760_1 ( nba_draft VARCHAR, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many times was the player felipe lopez?
SELECT COUNT(nba_draft) FROM table_11677760_1 WHERE player = "Felipe Lopez"
sql_create_context
CREATE TABLE table_name_87 ( date VARCHAR, week VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What day did the team play week 13?
SELECT date FROM table_name_87 WHERE week = 13
sql_create_context
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.insurance = "Government" AND procedures.icd9_code = "2219"
mimicsql_data
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE lab ( labid number, pa...
SELECT MIN(t1.c1) FROM (SELECT COUNT(DISTINCT diagnosis.patientunitstayid) AS c1 FROM diagnosis WHERE diagnosis.diagnosisname = 'thrombocytopenia' AND DATETIME(diagnosis.diagnosistime) <= DATETIME(CURRENT_TIME(), '-4 year') GROUP BY STRFTIME('%y-%m-%d', diagnosis.diagnosistime)) AS t1
eicu
CREATE TABLE table_30383 ( "\u2116" real, "#" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production code" text, "U.S. viewers (millions)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who wrote...
SELECT "Written by" FROM table_30383 WHERE "#" = '18'
wikisql
CREATE TABLE table_29971 ( "No." real, "Player" text, "Club" text, "Test career" text, "Tests" real, "Catches" real, "Stumpings" real, "Total dismissals" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the most amount of stumpings...
SELECT MAX("Stumpings") FROM table_29971
wikisql
CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_ID decimal(4,0) ) 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...
SELECT JOB_ID, SUM(DEPARTMENT_ID) FROM employees WHERE HIRE_DATE < '2002-06-21' GROUP BY JOB_ID ORDER BY JOB_ID
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 Headquarter, COUNT(Headquarter) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter ORDER BY Headquarter
nvbench
CREATE TABLE table_58812 ( "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 was the Tie no when Manchester United was the home team?
SELECT "Tie no" FROM table_58812 WHERE "Home team" = 'manchester united'
wikisql
CREATE TABLE table_name_83 ( round VARCHAR, result VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What round had a result of 6 7 (6 8) , 1 6?
SELECT round FROM table_name_83 WHERE result = "6–7 (6–8) , 1–6"
sql_create_context
CREATE TABLE table_75825 ( "Season" text, "Competition" text, "Round" text, "Opponent" text, "Home" text, "Away" text, "Series" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Home has a Competition of european cup, and a Round of qf?
SELECT "Home" FROM table_75825 WHERE "Competition" = 'european cup' AND "Round" = 'qf'
wikisql
CREATE TABLE table_name_33 ( selection INTEGER, player VARCHAR, round VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Selection has a Player of jamaar taylor, and a Round larger than 6?
SELECT MIN(selection) FROM table_name_33 WHERE player = "jamaar taylor" AND round > 6
sql_create_context
CREATE TABLE table_53717 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Decision" text, "Attendance" real, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which home has a Date of november 7?
SELECT "Home" FROM table_53717 WHERE "Date" = 'november 7'
wikisql
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), LOCATION_ID decimal(4,0) ) CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0),...
SELECT JOB_ID, AVG(DEPARTMENT_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) GROUP BY JOB_ID ORDER BY JOB_ID DESC
nvbench
CREATE TABLE table_12018 ( "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. -- Which Crowd has an Away team score of 11.7 (73),...
SELECT MAX("Crowd") FROM table_12018 WHERE "Away team score" = '11.7 (73)' AND "Away team" = 'hawthorn'
wikisql
CREATE TABLE table_49050 ( "Source Version" text, "Target Version" text, "Last Release" text, "License" text, "Website" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Target Version, when Last Release is 2009-08-09, 1.2.9?
SELECT "Target Version" FROM table_49050 WHERE "Last Release" = '2009-08-09, 1.2.9'
wikisql
CREATE TABLE table_27057070_3 ( date_of_appointment VARCHAR, team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many date of appointment entries are there when the team is khazar lankaran?
SELECT COUNT(date_of_appointment) FROM table_27057070_3 WHERE team = "Khazar Lankaran"
sql_create_context
CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, ...
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 = 20713))
mimic_iii
CREATE TABLE table_204_929 ( id number, "location" text, "name of mill and\ngrid reference" text, "type" text, "maps" text, "first mention\nor built" text, "last mention\nor demise" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what locat...
SELECT "location" FROM table_204_929 GROUP BY "location" ORDER BY SUM("maps") DESC LIMIT 1
squall
CREATE TABLE table_name_96 ( world_record VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- For what 188kg is the world record clean & jerk?
SELECT 188 AS kg FROM table_name_96 WHERE world_record = "clean & jerk"
sql_create_context
CREATE TABLE gas_station ( Station_ID int, Open_Year int, Location text, Manager_Name text, Vice_Manager_Name text, Representative_Name text ) CREATE TABLE station_company ( Station_ID int, Company_ID int, Rank_of_the_Year int ) CREATE TABLE company ( Company_ID int, Rank i...
SELECT Main_Industry, SUM(Market_Value) FROM company GROUP BY Main_Industry ORDER BY SUM(Market_Value) DESC
nvbench
CREATE TABLE artists ( id number, name text ) CREATE TABLE customers ( id number, first_name text, last_name text, company text, address text, city text, state text, country text, postal_code text, phone text, fax text, email text, support_rep_id number ) CR...
SELECT title, phone, hire_date FROM employees WHERE first_name = "Nancy" AND last_name = "Edwards"
spider
CREATE TABLE table_19709 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Record" text, "Game Site" text, "Attendance" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the highest attendance?
SELECT MAX("Attendance") FROM table_19709
wikisql
CREATE TABLE table_name_20 ( role VARCHAR, broadcaster VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the role for BBC1?
SELECT role FROM table_name_20 WHERE broadcaster = "bbc1"
sql_create_context
CREATE TABLE event ( ID int, Name text, Stadium_ID int, Year text ) CREATE TABLE stadium ( ID int, name text, Capacity int, City text, Country text, Opening_year int ) CREATE TABLE swimmer ( ID int, name text, Nationality text, meter_100 real, meter_200 text...
SELECT meter_400, ID FROM swimmer
nvbench
CREATE TABLE table_name_84 ( pictorials VARCHAR, interview_subject VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- In the issue in which the Interview subject was Jesse Jackson, who were there Pictorials of?
SELECT pictorials FROM table_name_84 WHERE interview_subject = "jesse jackson"
sql_create_context
CREATE TABLE Employees ( Employee_ID INTEGER, Role_Code CHAR(15), Employee_Name VARCHAR(255), Gender_MFU CHAR(1), Date_of_Birth DATETIME, Other_Details VARCHAR(255) ) CREATE TABLE Roles ( Role_Code CHAR(15), Role_Name VARCHAR(255), Role_Description VARCHAR(255) ) CREATE TABLE Ref_D...
SELECT Date_in_Locaton_To, COUNT(Date_in_Locaton_To) FROM Document_Locations GROUP BY Location_Code ORDER BY Date_in_Locaton_To DESC
nvbench
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 mzjzjlb ( HXPLC number, HZXM ...
SELECT zyjzjlb.JZLSH FROM hz_info JOIN zyjzjlb ON hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX WHERE hz_info.RYBH = '66129206' AND NOT zyjzjlb.JZLSH IN (SELECT zyjybgb.JZLSH FROM zyjybgb WHERE zyjybgb.BGRQ <= '2016-07-31' UNION SELECT mzjybgb.JZLSH FROM mzjybgb WHERE mzjybgb...
css
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, days AS DAYS_0, days AS DAYS_1, fare, fare_basis, flight, flight_fare WHERE ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'ATLANTA' AND DAYS_0.day_n...
atis
CREATE TABLE table_name_55 ( player VARCHAR, team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- WHAT PLAYER HAS THE OAKLAND ATHLETICS?
SELECT player FROM table_name_55 WHERE team = "oakland athletics"
sql_create_context
CREATE TABLE table_name_35 ( tie_no VARCHAR, home_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the tie number for the home team Orient?
SELECT tie_no FROM table_name_35 WHERE home_team = "orient"
sql_create_context
CREATE TABLE table_name_71 ( engine_s_ VARCHAR, chassis VARCHAR, year VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the engine(s) on the car before 1978 with ensign n177 chassis?
SELECT engine_s_ FROM table_name_71 WHERE chassis = "ensign n177" AND year < 1978
sql_create_context
CREATE TABLE table_name_56 ( performer_3 VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Date of 15 july 1994 involves which performer 3?
SELECT performer_3 FROM table_name_56 WHERE date = "15 july 1994"
sql_create_context
CREATE TABLE table_name_67 ( rank VARCHAR, lane VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Can you tell me the Total number of Rankthat has the Lane of 4?
SELECT COUNT(rank) FROM table_name_67 WHERE lane = 4
sql_create_context
CREATE TABLE tags ( index number, id number, tag text ) CREATE TABLE torrents ( groupname text, totalsnatched number, artist text, groupyear number, releasetype text, groupid number, id number ) -- Using valid SQLite, answer the following questions for the tables provided abov...
SELECT COUNT(*) FROM (SELECT groupname FROM torrents GROUP BY groupname HAVING COUNT(*) > 1)
whatcdhiphop
CREATE TABLE table_6585 ( "Designation (bore)" text, "Length Overall" text, "Weight of Gun" text, "Weight of Shot" text, "Weight of Shell" text, "Service Charge" text, "Range (yards)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is th...
SELECT "Weight of Shot" FROM table_6585 WHERE "Designation (bore)" = 'xx-inch'
wikisql
CREATE TABLE ReviewTasks ( Id number, ReviewTaskTypeId number, CreationDate time, DeletionDate time, ReviewTaskStateId number, PostId number, SuggestedEditId number, CompletedByReviewTaskId number ) CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE PostHistory...
SELECT PostId AS "post_link" FROM PostHistory WHERE PostHistoryTypeId = 10 AND Comment = 103 ORDER BY CreationDate DESC LIMIT 100
sede
CREATE TABLE table_61866 ( "Name" text, "Date" text, "Year" real, "Country" text, "Killed" text, "Injured" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which rampage killed 8 in Israel?
SELECT "Name" FROM table_61866 WHERE "Killed" = '8' AND "Country" = 'israel'
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 zyjzjlb JOIN hz_info_zyjzjlb ON hz_info.YLJGDM = hz_info_zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX AND hz_info_zyjzjlb.JZLSH = zyjzjlb.JZLSH AND hz_info_zyjzjlb.YLJGDM = hz_info_zyjzjlb.YLJGDM AND hz_info_zyjzjlb.JZLSH = zyjzjlb.JZLSH AND hz_info_zyjzjlb.zyjzjlb...
css
CREATE TABLE table_24759 ( "Year" real, "Tournaments played" real, "Cuts made" real, "Wins" real, "3rds" real, "Top 10s" real, "Best finish" text, "Earnings ($)" text, "Money list rank" real, "Scoring average" text ) -- Using valid SQLite, answer the following questions for the...
SELECT "Money list rank" FROM table_24759 WHERE "Earnings ($)" = '309,886'
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 t1.drugstarttime FROM (SELECT patient.uniquepid, medication.drugstarttime FROM medication JOIN patient ON medication.patientunitstayid = patient.patientunitstayid WHERE medication.drugname = 'methylprednisolone sodium succ 125 mg ij solr' AND patient.uniquepid = '006-149778' AND STRFTIME('%y-%m', medication.drug...
eicu
CREATE TABLE table_train_228 ( "id" int, "ejection_fraction_ef" int, "hiv_infection" bool, "heart_disease" bool, "body_weight" float, "body_mass_index_bmi" float, "allergy_to_beef" bool, "NOUSE" float ) -- Using valid SQLite, answer the following questions for the tables provided above...
SELECT * FROM table_train_228 WHERE heart_disease = 1 AND ejection_fraction_ef < 30
criteria2sql
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(t_kc21.PERSON_ID) FROM t_kc21 WHERE t_kc21.IN_DIAG_DIS_CD = 'F33.464'
css
CREATE TABLE table_47548 ( "Volume:Issue" text, "Issue Date(s)" text, "Weeks on Top" text, "Song" text, "Artist" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What song came from volume:issue 68:20-24?
SELECT "Song" FROM table_47548 WHERE "Volume:Issue" = '68:20-24'
wikisql
CREATE TABLE table_22948559_1 ( production_code VARCHAR, written_by VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the production code by paul lieberstein
SELECT production_code FROM table_22948559_1 WHERE written_by = "Paul Lieberstein"
sql_create_context
CREATE TABLE table_44211 ( "Name of peak" text, "Height (m)" real, "Height (ft)" real, "Prominence (m)" real, "Prominence (ft)" real, "Nearest Higher Neighbor" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total prominence in ft of ...
SELECT COUNT("Prominence (ft)") FROM table_44211 WHERE "Name of peak" = 'kangchenjunga central' AND "Prominence (m)" < '32'
wikisql
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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE prescriptions.formulary_drug_cd = "HUMU100I"
mimicsql_data
CREATE TABLE table_67496 ( "State" text, "Electors" real, "Bush" real, "Kerry" real, "Nader" real, "Badnarik" real, "Peroutka" real, "Cobb" real, "Others" real, "Margin" text, "Total" real ) -- Using valid SQLite, answer the following questions for the tables provided above...
SELECT MAX("Peroutka") FROM table_67496 WHERE "Others" = '46' AND "Electors" < '15'
wikisql
CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid number, wardid number, admissionheight number, admissionweight number, dischargeweight number, hospitaladmittime time, ...
SELECT COUNT(*) > 0 FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '021-25408') AND NOT patient.unitdischargetime IS NULL ORDER BY patie...
eicu
CREATE TABLE WINE ( Winery VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many wines are produced at Robert Biale winery?
SELECT COUNT(*) FROM WINE WHERE Winery = "Robert Biale"
sql_create_context
CREATE TABLE table_1341577_36 ( incumbent VARCHAR, first_elected VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which incumbent was first elected in 1958?
SELECT incumbent FROM table_1341577_36 WHERE first_elected = 1958
sql_create_context
CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number...
SELECT admissions.subject_id FROM admissions WHERE admissions.hadm_id IN (SELECT diagnoses_icd.hadm_id FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'abn react-urinary cath') AND DATETIME(diagnoses_icd.charttime, 'start of y...
mimic_iii
CREATE TABLE table_55956 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What did the away team score at Junction oval?
SELECT "Away team score" FROM table_55956 WHERE "Venue" = 'junction oval'
wikisql
CREATE TABLE zyjzjlb_jybgb ( YLJGDM_ZYJZJLB text, BGDH number, YLJGDM number ) 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 AVG(jyjgzbb.JCZBJGDL), MIN(jyjgzbb.JCZBJGDL), MAX(jyjgzbb.JCZBJGDL) FROM mzjzjlb JOIN jybgb JOIN jyjgzbb ON mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE mzjzjlb.JZZDBM = 'A48.710' AND jyjgzbb.JCZBMC = '促甲状腺激素受体...
css
CREATE TABLE table_12772 ( "Position" real, "Club" text, "Played" real, "Points" real, "Wins" real, "Draws" real, "Losses" real, "Goals for" real, "Goals against" real, "Goal Difference" real ) -- Using valid SQLite, answer the following questions for the tables provided above....
SELECT COUNT("Points") FROM table_12772 WHERE "Wins" > '14' AND "Goal Difference" = '14' AND "Draws" > '6'
wikisql
CREATE TABLE table_17978052_2 ( comment VARCHAR, borough_or_census_area VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the comment on the Denali area?
SELECT comment FROM table_17978052_2 WHERE borough_or_census_area = "Denali"
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 microlab ( microl...
SELECT t3.treatmentname FROM (SELECT t2.treatmentname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'chronic respiratory failure' AND DATETIM...
eicu
CREATE TABLE table_name_52 ( transfer_window VARCHAR, name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Brown's transfer window?
SELECT transfer_window FROM table_name_52 WHERE name = "brown"
sql_create_context
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 AVG(t_kc24.PER_ACC_PAY) FROM gwyjzb JOIN t_kc24 ON gwyjzb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE gwyjzb.MED_SER_ORG_NO = '2770364' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2000-06-07' AND '2017-04-04' UNION SELECT AVG(t_kc24.PER_ACC_PAY) FROM fgwyjzb JOIN t_kc24 ON fgwyjzb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHE...
css
CREATE TABLE table_23483182_1 ( directed_by VARCHAR, production_code VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who directed 414?
SELECT directed_by FROM table_23483182_1 WHERE production_code = 414
sql_create_context
CREATE TABLE table_73436 ( "Game" real, "Date" text, "Opponent" text, "Result" text, "Cowboys points" real, "Opponents" real, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When did the Cowboys score 13 points in 1966?
SELECT "Date" FROM table_73436 WHERE "Cowboys points" = '13'
wikisql
CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE transfers ( row_id number...
SELECT prescriptions.drug FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 15945) AND DATETIME(prescriptions.startdate, 'start of day') = DATETIME(CURRENT_TIME(), 'start of day', '-0 day') EXCEPT SELECT prescriptions.drug FROM prescriptions WHERE...
mimic_iii
CREATE TABLE table_76369 ( "Poll source" text, "Dates administered" text, "Arlen Specter*" text, "Pat Toomey" text, "Tom Ridge*" text, "Peg Luksik" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Dates administered has an Arlen Specter* of ...
SELECT "Dates administered" FROM table_76369 WHERE "Arlen Specter*" = '––' AND "Peg Luksik" = '9%'
wikisql
CREATE TABLE table_34196 ( "Club" text, "Nickname" text, "Years in Competition" text, "No. of Premierships" real, "Premiership Years" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Nickname in the Competition of 1982-1994?
SELECT "Nickname" FROM table_34196 WHERE "Years in Competition" = '1982-1994'
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 diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) C...
SELECT prescriptions.formulary_drug_cd, prescriptions.route FROM prescriptions WHERE prescriptions.drug = "Doxazosin"
mimicsql_data
CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPrivilegedUserGuidance text, MarkdownConcensusDescription text, CreationDate time, CreationModeratorId number, ApprovalDa...
SELECT * FROM Posts WHERE Id < 150000
sede
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, JSBBSJ time, JYBBH text, JYJGMC text, JYJSGH text, JYJSQM text, JY...
SELECT jybgb.KSBM, jybgb.KSMC FROM person_info JOIN hz_info JOIN mzjzjlb JOIN 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 = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE person_info.XM = '严...
css
CREATE TABLE table_name_96 ( name VARCHAR, title VARCHAR, royal_house VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the name listed for the royal house of jiang and a title of duke?
SELECT name FROM table_name_96 WHERE title = "duke" AND royal_house = "jiang"
sql_create_context
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE diagnoses.short_title = "Crbl art ocl NOS w infrc"
mimicsql_data
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 regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALA...
SELECT JOB_ID, SUM(EMPLOYEE_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 GROUP BY JOB_ID ORDER BY SUM(EMPLOYEE_ID) 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 demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob te...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_location = "CLINIC REFERRAL/PREMATURE" AND lab.label = "Monocytes"
mimicsql_data
CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE icustays ( row_id number, s...
SELECT labevents.charttime FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 70516) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'anion gap') AND DATETIME(labevents.charttime, 'start of year') = DATETIME(CURRE...
mimic_iii
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 zyjzjlb.ZYZDBM, zyjzjlb.ZYZDMC 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_...
css
CREATE TABLE volume ( volume_id number, volume_issue text, issue_date text, weeks_on_top number, song text, artist_id number ) CREATE TABLE music_festival ( id number, music_festival text, date_of_ceremony text, category text, volume number, result text ) CREATE TABLE a...
SELECT MAX(weeks_on_top), MIN(weeks_on_top) FROM volume
spider
CREATE TABLE table_29404 ( "Club" text, "Played" text, "Won" text, "Drawn" text, "Lost" text, "Points for" text, "Points against" text, "Tries for" text, "Points" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the won for played...
SELECT "Won" FROM table_29404 WHERE "Played" = '22' AND "Lost" = '15' AND "Points against" = '511'
wikisql
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE cost ( costid number, ...
SELECT COUNT(*) > 0 FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '013-38992')) AND vitalperiodic.respiration > 19.0 AND NOT vitalperio...
eicu
CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL ) CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER ) -- Using valid SQLite, answer the following questions for the...
SELECT T2.Name, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name
nvbench
CREATE TABLE stadium ( ID int, name text, Capacity int, City text, Country text, Opening_year int ) CREATE TABLE record ( ID int, Result text, Swimmer_ID int, Event_ID int ) CREATE TABLE swimmer ( ID int, name text, Nationality text, meter_100 real, meter_20...
SELECT Nationality, AVG(meter_100) FROM swimmer GROUP BY Nationality ORDER BY AVG(meter_100) DESC
nvbench
CREATE TABLE table_46485 ( "Order" text, "Episode" text, "Rating" real, "Share" real, "Rating/share (18\u201349)" text, "Viewers (millions)" real, "Rank (Night)" real, "Rank (Timeslot)" real, "Rank (Week)" real ) -- Using valid SQLite, answer the following questions for the tables ...
SELECT SUM("Share") FROM table_46485 WHERE "Rating" > '1.2' AND "Rank (Timeslot)" = '3' AND "Viewers (millions)" = '6.07'
wikisql
CREATE TABLE table_2562572_33 ( largest_ethnic_group__2002_ VARCHAR, cyrillic_name_other_names VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the largest ethnic group in (hungarian: kispiac)?
SELECT largest_ethnic_group__2002_ FROM table_2562572_33 WHERE cyrillic_name_other_names = "Мале Пијаце (Hungarian: Kispiac)"
sql_create_context
CREATE TABLE COURSE ( CRS_CODE varchar(10), DEPT_CODE varchar(10), CRS_DESCRIPTION varchar(35), CRS_CREDIT float(8) ) CREATE TABLE EMPLOYEE ( EMP_NUM int, EMP_LNAME varchar(15), EMP_FNAME varchar(12), EMP_INITIAL varchar(1), EMP_JOBCODE varchar(5), EMP_HIREDATE datetime, EMP...
SELECT DEPT_CODE, MIN(STU_GPA) FROM STUDENT GROUP BY DEPT_CODE ORDER BY DEPT_CODE DESC
nvbench
CREATE TABLE table_73933 ( "Represents" text, "Contestant" text, "Age" real, "Height (cm)" text, "Height (ft)" text, "Hometown" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the most age
SELECT MAX("Age") FROM table_73933
wikisql
CREATE TABLE table_204_737 ( id number, "year" number, "order" text, "quantity" number, "ger nos." text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what order is listed first at the top of the table ?
SELECT "order" FROM table_204_737 WHERE id = 1
squall