instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE icustays ( row_id number, subject_id number, hadm_id number, icustay_id number, first_careunit text, last_careunit text, first_wardid number, last_wardid number, intime time, outtime time ) CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, sh...
SELECT (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 = 19427)) AND DATETIME(inputevents_cv.charttime, 'start of month') = DATETIME(CURREN...
mimic_iii
CREATE TABLE table_name_65 ( grid INTEGER, time VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the highest grid when the time is +45.162?
SELECT MAX(grid) FROM table_name_65 WHERE time = "+45.162"
sql_create_context
CREATE TABLE table_name_55 ( appointed_by VARCHAR, title VARCHAR, representative VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Appointed by that has the Title of Ambassador Extraordinary and Plenipotentiary and has a Representative of Spruil...
SELECT appointed_by FROM table_name_55 WHERE title = "ambassador extraordinary and plenipotentiary" AND representative = "spruille braden"
sql_create_context
CREATE TABLE table_2522473_1 ( team VARCHAR, home_ground VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which teams homeeground is Stemmemyren?
SELECT team FROM table_2522473_1 WHERE home_ground = "Stemmemyren"
sql_create_context
CREATE TABLE table_56327 ( "Round" text, "Pick" text, "Player" text, "Position" text, "Nationality" text, "Team" text, "College" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the position of the pick 1 player?
SELECT "Position" FROM table_56327 WHERE "Pick" = '1'
wikisql
CREATE TABLE table_32529 ( "Date" text, "Tournament" text, "Surface" text, "Partner" text, "Opponents in the final" text, "Score" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When did he play with peter nyborg?
SELECT "Date" FROM table_32529 WHERE "Partner" = 'peter nyborg'
wikisql
CREATE TABLE table_21190 ( "Months in Malayalam Era" text, "In Malayalam" text, "Gregorian Calendar" text, "Tamil calendar" text, "Saka era" text, "Sign of Zodiac" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the months in the malayalam e...
SELECT "Months in Malayalam Era" FROM table_21190 WHERE "In Malayalam" = 'കുംഭം'
wikisql
CREATE TABLE table_53431 ( "Name" text, "Hanzi" text, "Hanyu Pinyin" text, "Uyghur ( UEY )" text, "Uyghur Latin ( ULY )" text, "Population (2010 Census)" text, "Area (km\u00b2)" text, "Density (/km\u00b2)" text ) -- Using valid SQLite, answer the following questions for the tables prov...
SELECT "Uyghur Latin ( ULY )" FROM table_53431 WHERE "Population (2010 Census)" = '69,361'
wikisql
CREATE TABLE table_42283 ( "Tournament" text, "1998" text, "1999" text, "2000" text, "2001" text, "2002" text, "2003" text, "2004" text, "2005" text, "2006" text, "2007" text, "2008" text, "2009" text, "2010" text, "2011" text, "2012" text ) -- Using val...
SELECT "2009" FROM table_42283 WHERE "2001" = 'not masters series'
wikisql
CREATE TABLE table_name_41 ( rank INTEGER, points VARCHAR, name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average rank of Roman Koudelka, who has less than 274.4 points?
SELECT AVG(rank) FROM table_name_41 WHERE points < 274.4 AND name = "roman koudelka"
sql_create_context
CREATE TABLE table_name_82 ( height VARCHAR, pos VARCHAR, weight VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the height of the F who weighs less than 195?
SELECT height FROM table_name_82 WHERE pos = "f" AND weight < 195
sql_create_context
CREATE TABLE table_13517 ( "Name" text, "Height" text, "Weight" text, "Spike" text, "2008 club" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Name of the Player from the 2008 Panasonic Panthers Club?
SELECT "Name" FROM table_13517 WHERE "2008 club" = 'panasonic panthers'
wikisql
CREATE TABLE table_name_32 ( score VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- On the date of June 15 what was the score?
SELECT score FROM table_name_32 WHERE date = "june 15"
sql_create_context
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 demographic ( subject_id text, hadm_id t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE procedures.icd9_code = "4105" AND prescriptions.drug_type = "ADDITIVE"
mimicsql_data
CREATE TABLE table_77307 ( "Name" text, "Pos." text, "Height" text, "Weight" text, "Club" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the name when the position is centre?
SELECT "Name" FROM table_77307 WHERE "Pos." = 'centre'
wikisql
CREATE TABLE products_booked ( booked_count INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What are the maximum, minimum, and average booked count for the products booked?
SELECT MAX(booked_count), MIN(booked_count), AVG(booked_count) FROM products_booked
sql_create_context
CREATE TABLE code_description ( code varchar, description text ) CREATE TABLE food_service ( meal_code text, meal_number int, compartment text, meal_description varchar ) CREATE TABLE fare_basis ( fare_basis_code text, booking_class text, class_type text, premium text, econ...
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'PHOENIX' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'DENVER...
atis
CREATE TABLE table_44903 ( "Game" real, "Team" text, "Score" text, "Location Attendance" text, "Series" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the score for game 2?
SELECT "Score" FROM table_44903 WHERE "Game" = '2'
wikisql
CREATE TABLE table_38094 ( "7:00" text, "7:30" text, "8:00" text, "8:30" text, "9:00" text, "9:30" text, "10:00" text, "10:30" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the 8:00 feature with Mad About You as the 8:30 feature...
SELECT "8:00" FROM table_38094 WHERE "8:30" = 'mad about you'
wikisql
CREATE TABLE table_name_17 ( overall INTEGER, round VARCHAR, name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the lowest overall draft pick number for terry daniels who was picked in round 10?
SELECT MIN(overall) FROM table_name_17 WHERE round = 10 AND name = "terry daniels"
sql_create_context
CREATE TABLE table_name_22 ( tries_against VARCHAR, try_bonus VARCHAR, played VARCHAR, drawn VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many tries when 22 are played with 1 draw and a try bonus of 13?
SELECT tries_against FROM table_name_22 WHERE played = "22" AND drawn = "1" AND try_bonus = "13"
sql_create_context
CREATE TABLE table_name_44 ( opponent VARCHAR, week INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which opponent was faced before week 2?
SELECT opponent FROM table_name_44 WHERE week < 2
sql_create_context
CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE icustays ( row_id number, subject_id number, hadm_id number, icustay_id number, first_careunit text, last_careunit text, first_wardid number, last_wardid number, intime time, outtime ti...
SELECT COUNT(*) > 0 FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 1272)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'sao2' AND d_items....
mimic_iii
CREATE TABLE program_requirement ( program_id int, category varchar, min_credit int, additional_req varchar ) CREATE TABLE semester ( semester_id int, semester varchar, year int ) CREATE TABLE area ( course_id int, area varchar ) CREATE TABLE offering_instructor ( offering_ins...
SELECT COUNT(DISTINCT instructor.instructor_id) FROM course, course_offering, instructor, offering_instructor, semester WHERE course.course_id = course_offering.course_id AND course.department = 'MICRBIOL' AND course.number = 995 AND offering_instructor.instructor_id = instructor.instructor_id AND offering_instructor.o...
advising
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(MANAGER_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 GROUP BY JOB_ID
nvbench
CREATE TABLE table_27161 ( "Week" real, "Date" text, "Kickoff" text, "Opponent" text, "Final score" text, "Team record" text, "Game site" text, "Attendance" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the final score when they...
SELECT "Final score" FROM table_27161 WHERE "Opponent" = 'Frankfurt Galaxy'
wikisql
CREATE TABLE table_9528 ( "Game" real, "Date" text, "Team" 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. -- WHAT IS...
SELECT "Score" FROM table_9528 WHERE "Game" > '47' AND "Location Attendance" = 'rose garden 20,250'
wikisql
CREATE TABLE Student_Tests_Taken ( registration_id INTEGER, date_test_taken DATETIME, test_result VARCHAR(255) ) CREATE TABLE Subjects ( subject_id INTEGER, subject_name VARCHAR(120) ) CREATE TABLE Student_Course_Enrolment ( registration_id INTEGER, student_id INTEGER, course_id INTEGE...
SELECT author_id, gender_mf FROM Course_Authors_and_Tutors ORDER BY personal_name
nvbench
CREATE TABLE table_name_27 ( date VARCHAR, decision VARCHAR, visitor VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the date with Ellis as the decision and St. Louis as the visitor?
SELECT date FROM table_name_27 WHERE decision = "ellis" AND visitor = "st. louis"
sql_create_context
CREATE TABLE t_kc22 ( MED_EXP_DET_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, MED_CLINIC_ID text, MED_EXP_BILL_ID text, SOC_SRT_DIRE_CD text, SOC_SRT_DIRE_NM text, DIRE_TYPE number, CHA_ITEM_LEV number, MED_INV_ITEM_TYPE text, MED_DIRE_CD text, MED_DIRE_NM text,...
SELECT COUNT(*) FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.PERSON_NM = '蒋艳卉' AND t_kc22.STA_DATE BETWEEN '2009-09-25' AND '2020-10-29' AND t_kc22.SELF_PAY_PRO < 0.68
css
CREATE TABLE table_name_9 ( runners_up VARCHAR, winners VARCHAR, years_runner_up VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many runners up for the team with under 1 win and a Years runner-up of 1985 , 1996?
SELECT runners_up FROM table_name_9 WHERE winners < 1 AND years_runner_up = "1985 , 1996"
sql_create_context
CREATE TABLE t_kc24 ( ACCOUNT_DASH_DATE time, ACCOUNT_DASH_FLG number, CASH_PAY number, CIVIL_SUBSIDY number, CKC102 number, CLINIC_ID text, CLINIC_SLT_DATE time, COMP_ID text, COM_ACC_PAY number, COM_PAY number, DATA_ID text, ENT_ACC_PAY number, ENT_PAY number, F...
SELECT AVG(t_kc24.MED_AMOUT) FROM t_kc24 WHERE t_kc24.MED_CLINIC_ID IN (SELECT gwyjzb.MED_CLINIC_ID FROM gwyjzb WHERE gwyjzb.PERSON_AGE <= 23 UNION SELECT fgwyjzb.MED_CLINIC_ID FROM fgwyjzb WHERE fgwyjzb.PERSON_AGE <= 23)
css
CREATE TABLE table_name_68 ( date VARCHAR, opponent VARCHAR, week VARCHAR, game_site VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When did the Titans play the Houston Texans at LP Field before Week 13?
SELECT date FROM table_name_68 WHERE week < 13 AND game_site = "lp field" AND opponent = "houston texans"
sql_create_context
CREATE TABLE table_17282875_3 ( team__number2 VARCHAR, team__number1 VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who played San Lorenzo?
SELECT team__number2 FROM table_17282875_3 WHERE team__number1 = "San Lorenzo"
sql_create_context
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE diagnoses.long_title = "Hemorrhage complicating a procedure"
mimicsql_data
CREATE TABLE table_18211 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Status" text, "Opponent" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What party does ron klink represent?
SELECT "Party" FROM table_18211 WHERE "Incumbent" = 'Ron Klink'
wikisql
CREATE TABLE Customers ( customer_id INTEGER, customer_details VARCHAR(255) ) CREATE TABLE Properties ( property_id INTEGER, property_type_code CHAR(15), property_address VARCHAR(255), other_details VARCHAR(255) ) CREATE TABLE Timed_Locations_of_Things ( thing_id INTEGER, Date_and_Time...
SELECT date_moved_in, COUNT(date_moved_in) FROM Customer_Events ORDER BY COUNT(date_moved_in) DESC
nvbench
CREATE TABLE table_73080 ( "Episode title" text, "Subject" text, "Music by" text, "Lyrics by" text, "Performed by" text, "First aired" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When conjunction junction is the episode title and the music is...
SELECT "Performed by" FROM table_73080 WHERE "Music by" = 'Bob Dorough' AND "Episode title" = 'Conjunction Junction'
wikisql
CREATE TABLE table_11153 ( "State" text, "Interview" real, "Swimsuit" real, "Evening Gown" real, "Average" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total number of interview scores that have an evening gown score of 9.543 and an av...
SELECT SUM("Interview") FROM table_11153 WHERE "Evening Gown" = '9.543' AND "Average" > '9.521'
wikisql
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 COUNT(*) FROM (SELECT qtb.MED_ORG_DEPT_CD FROM qtb JOIN t_kc24 ON qtb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE qtb.MED_SER_ORG_NO = '5659309' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2006-02-01' AND '2007-12-20' GROUP BY qtb.MED_ORG_DEPT_CD HAVING SUM(t_kc24.MED_AMOUT) <= 6358.78 UNION SELECT gyb.MED_ORG_DEPT_CD FR...
css
CREATE TABLE table_25221 ( "Rnd" real, "Date" text, "Race Name" text, "Length" text, "Track" text, "Location" text, "Pole Position" text, "Winning Driver" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the race name for rnd being 11...
SELECT "Race Name" FROM table_25221 WHERE "Rnd" = '11'
wikisql
CREATE TABLE t_kc21 ( MED_CLINIC_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, COMP_ID text, PERSON_ID text, PERSON_NM text, IDENTITY_CARD text, SOC_SRT_CARD text, PERSON_SEX number, PERSON_AGE number, IN_HOSP_DATE time, OUT_HOSP_DATE time, DIFF_PLACE_FLG numb...
SELECT DOSE_FORM, SPEC FROM t_kc22 WHERE MED_CLINIC_ID = '78122386244' AND SOC_SRT_DIRE_NM = '重酒石酸卡巴拉汀胶囊'
css
CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TA...
SELECT microlab.culturetakentime FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-22988' AND NOT patient.hospitaldischargetime IS NULL ORDER BY...
eicu
CREATE TABLE table_14342210_6 ( position VARCHAR, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which position did Redden play?
SELECT position FROM table_14342210_6 WHERE player = "Redden"
sql_create_context
CREATE TABLE Fault_Log ( asset_model VARCHAR, asset_id VARCHAR ) CREATE TABLE Assets ( asset_model VARCHAR, asset_id VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which assets did not incur any fault log? List the asset model.
SELECT asset_model FROM Assets WHERE NOT asset_id IN (SELECT asset_id FROM Fault_Log)
sql_create_context
CREATE TABLE table_19483 ( "Pick #" real, "NFL Team" text, "Player" text, "Position" text, "College" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many colleges did pick number 269 attend?
SELECT COUNT("College") FROM table_19483 WHERE "Pick #" = '269'
wikisql
CREATE TABLE table_24852001_2 ( game_site VARCHAR, opponent VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the game site for the matchup against the Frankfurt Galaxy?
SELECT game_site FROM table_24852001_2 WHERE opponent = "Frankfurt Galaxy"
sql_create_context
CREATE TABLE table_54454 ( "Pick" real, "Player" text, "Country of origin*" text, "PBA team" text, "College" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What pick number is Larry Fonacier?
SELECT "Pick" FROM table_54454 WHERE "Player" = 'larry fonacier'
wikisql
CREATE TABLE table_6351 ( "Rank" text, "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 sum of silver medals for teams with more than 14 total medals and more than 16 go...
SELECT SUM("Silver") FROM table_6351 WHERE "Total" > '14' AND "Gold" > '16'
wikisql
CREATE TABLE table_61392 ( "Season" text, "Premier" real, "First" real, "Second" real, "Total" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the sum of Second, when Total is less than 70, when Premier is less than 20, and when First is grea...
SELECT SUM("Second") FROM table_61392 WHERE "Total" < '70' AND "Premier" < '20' AND "First" > '18'
wikisql
CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) CREATE TABLE Comments ( Id number, PostId number, Score number, Text text, CreationDate time, UserDisplayName text, UserId number, ContentLic...
SELECT SuggestedEdits.Id, SuggestedEdits.PostId AS "post_link", SuggestedEditVotes.UserId AS "user_link" FROM SuggestedEdits INNER JOIN SuggestedEditVotes ON SuggestedEdits.Id = SuggestedEditVotes.SuggestedEditId WHERE OwnerUserId = @uid AND SuggestedEditVotes.UserId = -1
sede
CREATE TABLE table_171666_1 ( administrative_division VARCHAR, area__km²_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the administrative division that has an area of 30 km^2?
SELECT administrative_division FROM table_171666_1 WHERE area__km²_ = 30
sql_create_context
CREATE TABLE t_kc24 ( ACCOUNT_DASH_DATE time, ACCOUNT_DASH_FLG number, CASH_PAY number, CIVIL_SUBSIDY number, CKC102 number, CLINIC_ID text, CLINIC_SLT_DATE time, COMP_ID text, COM_ACC_PAY number, COM_PAY number, DATA_ID text, ENT_ACC_PAY number, ENT_PAY number, F...
SELECT COUNT(*) FROM (SELECT t_kc21.MED_ORG_DEPT_CD FROM t_kc21 JOIN t_kc24 ON t_kc21.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE t_kc21.MED_SER_ORG_NO = '3601816' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2005-05-13' AND '2016-07-14' GROUP BY t_kc21.MED_ORG_DEPT_CD HAVING SUM(t_kc24.MED_AMOUT) >= 1904.15) AS T
css
CREATE TABLE table_name_97 ( date VARCHAR, runner_s__up VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the date that has yani tseng as the runner (s)-up?
SELECT date FROM table_name_97 WHERE runner_s__up = "yani tseng"
sql_create_context
CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9cod...
SELECT t3.labname FROM (SELECT t2.labname, 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 = 'atrial fibrillation - with controlled ventricular re...
eicu
CREATE TABLE table_name_93 ( points_against VARCHAR, tries_against VARCHAR, lost VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What point against has tries against of 77, and a lost of 16?
SELECT points_against FROM table_name_93 WHERE tries_against = "77" AND lost = "16"
sql_create_context
CREATE TABLE table_name_6 ( years VARCHAR, roll VARCHAR, area VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Murupara has a roll greater than 296 for what years?
SELECT years FROM table_name_6 WHERE roll > 296 AND area = "murupara"
sql_create_context
CREATE TABLE weekly_weather ( station_id int, day_of_week text, high_temperature int, low_temperature int, precipitation real, wind_speed_mph int ) CREATE TABLE station ( id int, network_name text, services text, local_authority text ) CREATE TABLE route ( train_id int, ...
SELECT day_of_week, AVG(high_temperature) FROM weekly_weather GROUP BY day_of_week ORDER BY AVG(high_temperature) DESC
nvbench
CREATE TABLE table_57161 ( "Entrant" text, "Constructor" text, "Chassis" text, "Driver" text, "Rounds" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which of the Rounds has an Entrant of automobiles Talbot-Darracq, and Pierre Levegh as the driver?
SELECT "Rounds" FROM table_57161 WHERE "Entrant" = 'automobiles talbot-darracq' AND "Driver" = 'pierre levegh'
wikisql
CREATE TABLE table_39273 ( "Res." text, "Record" text, "Opponent" text, "Method" text, "Event" text, "Round" real, "Time" text, "Location" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the time when Shinya Aoki was the opponent...
SELECT "Time" FROM table_39273 WHERE "Opponent" = 'shinya aoki'
wikisql
CREATE TABLE table_11434 ( "Date" text, "Name" text, "Nationality" text, "Casualties" text, "Tonnage" real, "Sunk by\u2026" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What were the casualties of the ship sunk by u-125?
SELECT "Casualties" FROM table_11434 WHERE "Sunk by\u2026" = 'u-125'
wikisql
CREATE TABLE activity ( actid number, activity_name text ) CREATE TABLE faculty_participates_in ( facid number, actid number ) CREATE TABLE participates_in ( stuid number, actid number ) CREATE TABLE student ( stuid number, lname text, fname text, age number, sex text, ...
SELECT T1.facid, COUNT(*) FROM faculty AS T1 JOIN student AS T2 ON T1.facid = T2.advisor GROUP BY T1.facid
spider
CREATE TABLE table_74703 ( "Name" text, "Case type" text, "Bullet diameter" text, "Neck diameter" text, "Base diameter" text, "Rim diameter" text, "Case length" text, "Cartridge length" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Whic...
SELECT "Case length" FROM table_74703 WHERE "Rim diameter" = '13.20 (.518)'
wikisql
CREATE TABLE table_200_12 ( id number, "year" text, "award" text, "category" text, "nominated work" text, "result" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what award did once in a lifetime win ?
SELECT "category" FROM table_200_12 WHERE "nominated work" = 'once in a lifetime'
squall
CREATE TABLE table_63528 ( "Club" text, "Wins" real, "Losses" real, "Draws" real, "Against" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many wins are there when the draws are less than 0?
SELECT SUM("Wins") FROM table_63528 WHERE "Draws" < '0'
wikisql
CREATE TABLE table_22535 ( "Ethnic Group" text, "2001 (%)" text, "2001 (people)" text, "2006 (%)" text, "2006 (people)" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the percentage in 2006 when in 2001 was 66.9 %?
SELECT "2006 (%)" FROM table_22535 WHERE "2001 (%)" = '66.9'
wikisql
CREATE TABLE table_70442 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When has a Record of 1 0?
SELECT "Date" FROM table_70442 WHERE "Record" = '1–0'
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 diagnoses ( ...
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.itemid = "50911"
mimicsql_data
CREATE TABLE Services ( Service_ID INTEGER, Service_Type_Code CHAR(15) ) CREATE TABLE Participants_in_Events ( Event_ID INTEGER, Participant_ID INTEGER ) CREATE TABLE Events ( Event_ID INTEGER, Service_ID INTEGER, Event_Details VARCHAR(255) ) CREATE TABLE Participants ( Participant_ID...
SELECT Participant_Details, Participant_ID FROM Participants ORDER BY Participant_Details DESC
nvbench
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) 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 te...
SELECT jybgb.SQRGH, jybgb.SQRXM FROM jybgb WHERE jybgb.JZLSH = '01915965826' GROUP BY jybgb.SQRGH HAVING COUNT(*) > 9
css
CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE d_icd_diagnoses ( row_id n...
SELECT t3.spec_type_desc FROM (SELECT t2.spec_type_desc, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_...
mimic_iii
CREATE TABLE table_name_53 ( score VARCHAR, place VARCHAR, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What score did Lee Trevino get in T1?
SELECT score FROM table_name_53 WHERE place = "t1" AND player = "lee trevino"
sql_create_context
CREATE TABLE table_79598 ( "Class" text, "Railway number(s)" text, "Quantity" real, "Year(s) of manufacture" text, "Axle arrangement ( UIC )" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What year was the b n2t axle arrangement, which has a quanti...
SELECT "Year(s) of manufacture" FROM table_79598 WHERE "Quantity" = '31' AND "Axle arrangement ( UIC )" = 'b n2t'
wikisql
CREATE TABLE movie ( movie_id int, Title text, Year int, Director text, Budget_million real, Gross_worldwide int ) CREATE TABLE culture_company ( Company_name text, Type text, Incorporated_in text, Group_Equity_Shareholding real, book_club_id text, movie_id text ) CREAT...
SELECT Director, COUNT(Director) FROM movie WHERE Year = 1999 OR Year = 2000 GROUP BY Director ORDER BY COUNT(Director)
nvbench
CREATE TABLE airline ( airline_code varchar, airline_name text, note text ) 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 in...
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, flight WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BOSTON' AND days.day_name = 'SATURDAY' AND flight.flight_days = days.days_code AND ...
atis
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 DISTINCT cost.cost FROM cost WHERE cost.eventtype = 'treatment' AND cost.eventid IN (SELECT treatment.treatmentid FROM treatment WHERE treatment.treatmentname = 'vasodilator - hydralazine')
eicu
CREATE TABLE table_13207 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What day was the visitor Chicago Black Hawks and the record 0-2?
SELECT "Date" FROM table_13207 WHERE "Visitor" = 'chicago black hawks' AND "Record" = '0-2'
wikisql
CREATE TABLE table_203_238 ( id number, "year" number, "competition" text, "venue" text, "position" text, "notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- longest throw
SELECT MAX("notes") FROM table_203_238
squall
CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_ID decimal(4,0) ) CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) ) CREATE TABLE job_history ( EMPLO...
SELECT HIRE_DATE, AVG(EMPLOYEE_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' ORDER BY AVG(EMPLOYEE_ID) DESC
nvbench
CREATE TABLE table_13727 ( "Protocol" text, "Power Line" text, "Radio-Frequency" text, "Open Source?" text, "Needs Neutral Wire?" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the open source of X10 that no neutral wire needed?
SELECT "Open Source?" FROM table_13727 WHERE "Needs Neutral Wire?" = 'no' AND "Protocol" = 'x10'
wikisql
CREATE TABLE table_14434 ( "Date" text, "Label" text, "Region" text, "Format" text, "Catalog" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the format in September 1990 for Catalog 887 847-1?
SELECT "Format" FROM table_14434 WHERE "Catalog" = '887 847-1' AND "Date" = 'september 1990'
wikisql
CREATE TABLE diagnoses ( 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 lab.flag = "delta" AND lab.label = "Lactate Dehydrogenase (LD)"
mimicsql_data
CREATE TABLE customers_cards ( card_id number, customer_id number, card_type_code text, card_number text, date_valid_from time, date_valid_to time, other_card_details text ) CREATE TABLE financial_transactions ( transaction_id number, previous_transaction_id number, account_id n...
SELECT account_id, COUNT(*) FROM financial_transactions GROUP BY account_id
spider
CREATE TABLE table_13594 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the place of the player with a 72-70-67=209 score?
SELECT "Place" FROM table_13594 WHERE "Score" = '72-70-67=209'
wikisql
CREATE TABLE table_76552 ( "Date" text, "Captain 1" text, "Team 2" text, "Captain 2" text, "Venue" text, "Result" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Team 2 has a Captain 1 of final?
SELECT "Team 2" FROM table_76552 WHERE "Captain 1" = 'final'
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 jybgb.BGDH FROM hz_info JOIN wdmzjzjlb JOIN jybgb ON hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX AND wdmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND wdmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE hz_info.RYBH = '54118858' AND NOT jybgb.BGDH IN (SELECT jyjgzbb.BGDH FRO...
css
CREATE TABLE table_55590 ( "Place" real, "Name" text, "From" real, "Until" real, "Titles" text, "Seconds" text, "Thirds" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total Until when the Titles was 5?
SELECT SUM("Until") FROM table_55590 WHERE "Titles" = '5'
wikisql
CREATE TABLE table_test_9 ( "id" int, "ejection_fraction_ef" int, "anemia" bool, "child_pugh_class" string, "systolic_blood_pressure_sbp" int, "leukopenia" int, "heart_disease" bool, "stroke" bool, "av_block" bool, "renal_disease" bool, "hepatic_disease" bool, "estimated_...
SELECT * FROM table_test_9 WHERE renal_disease = 1 OR renal_disease = 1
criteria2sql
CREATE TABLE table_38161 ( "City" text, "Country" text, "IATA" text, "ICAO" text, "Airport" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the ICAO for Hong Kong?
SELECT "ICAO" FROM table_38161 WHERE "Country" = 'hong kong'
wikisql
CREATE TABLE university ( School_ID int, School text, Location text, Founded real, Affiliation text, Enrollment real, Nickname text, Primary_conference text ) CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Per...
SELECT All_Road, School_ID FROM basketball_match ORDER BY School_ID
nvbench
CREATE TABLE table_26385848_1 ( main_language_s_ VARCHAR, year__ceremony_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- In the year (ceremony) 1998 (71st), what are all the main languages?
SELECT main_language_s_ FROM table_26385848_1 WHERE year__ceremony_ = "1998 (71st)"
sql_create_context
CREATE TABLE table_5287 ( "Player" text, "Car." real, "Yards" real, "Avg." real, "TD's" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the amount of Avg that has Yards more 265 and a Car more 105?
SELECT COUNT("Avg.") FROM table_5287 WHERE "Yards" > '265' AND "Car." > '105'
wikisql
CREATE TABLE table_name_53 ( score VARCHAR, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was Lew Worsham's score?
SELECT score FROM table_name_53 WHERE player = "lew worsham"
sql_create_context
CREATE TABLE table_17824 ( "Year" real, "Starts" real, "Cuts made" real, "Wins" real, "2nd" real, "3rd" real, "Top 10" real, "Top 25" real, "Earnings (\u20ac)" real, "Money list rank" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -...
SELECT "Earnings (\u20ac)" FROM table_17824 WHERE "Cuts made" = '19' AND "Money list rank" = '3'
wikisql
CREATE TABLE table_name_90 ( date VARCHAR, opponent VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the date when the opponent is real juventud?
SELECT date FROM table_name_90 WHERE opponent = "real juventud"
sql_create_context
CREATE TABLE table_4915 ( "Date" text, "Round" text, "Circuit" text, "Winning driver" text, "Winning team" text, "Winning car" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the winning driver driving the winning car March - Honda 86j, w...
SELECT "Winning driver" FROM table_4915 WHERE "Winning car" = 'march - honda 86j' AND "Winning team" = 'team nova'
wikisql
CREATE TABLE table_76717 ( "Newspaper/Magazine" text, "Type" text, "Language" text, "Headquarter" text, "Status" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Headquarter, when Type is Independent Online News Portal?
SELECT "Headquarter" FROM table_76717 WHERE "Type" = 'independent online news portal'
wikisql
CREATE TABLE Addresses ( address_id INTEGER, line_1 VARCHAR(120), line_2 VARCHAR(120), line_3 VARCHAR(120), city VARCHAR(80), zip_postcode VARCHAR(20), state_province_county VARCHAR(50), country VARCHAR(50), other_address_details VARCHAR(255) ) CREATE TABLE Behavior_Incident ( i...
SELECT date_address_to, AVG(monthly_rental) FROM Student_Addresses GROUP BY other_details, date_address_to ORDER BY monthly_rental DESC
nvbench
CREATE TABLE table_71465 ( "Episode title" text, "Villain(s)" text, "Identity(ies)" text, "Reason(s)" text, "Original airdate" text, "DVD volume" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What identities have more than 5 DVD volumes?
SELECT "Identity(ies)" FROM table_71465 WHERE "DVD volume" > '5'
wikisql
CREATE TABLE table_56671 ( "Year" text, "Start" text, "Qual" text, "Rank" text, "Finish" text, "Laps" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which year has 112 laps?
SELECT "Year" FROM table_56671 WHERE "Laps" = '112'
wikisql