instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE table_71123 ( "Year" real, "Entrant" text, "Chassis" text, "Engine" text, "Tyres" text, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the highest points with g Tyres and Minardi m187?
SELECT MAX("Points") FROM table_71123 WHERE "Tyres" = 'g' AND "Chassis" = 'minardi m187'
wikisql
CREATE TABLE table_20707 ( "School" text, "Location" text, "Founded" real, "Affiliation" text, "Enrollment" real, "Nickname" text, "Primary conference" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the total number of affiliation for e...
SELECT COUNT("Affiliation") FROM table_20707 WHERE "Enrollment" = '14898'
wikisql
CREATE TABLE table_train_161 ( "id" int, "white_blood_cell_count_wbc" int, "systolic_blood_pressure_sbp" int, "c_peptide_level" float, "diastolic_blood_pressure_dbp" int, "heart_rate" int, "glycosylated_hemoglobin" float, "NOUSE" float ) -- Using valid SQLite, answer the following ques...
SELECT * FROM table_train_161 WHERE c_peptide_level < 1
criteria2sql
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.OUT_DIAG_DIS_CD, t_kc21.OUT_DIAG_DIS_NM FROM t_kc21 WHERE t_kc21.MED_CLINIC_ID = '86947036895'
css
CREATE TABLE table_name_15 ( mountains_classification VARCHAR, general_classification VARCHAR, winner VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the mountains classification of winner Carlos Sastre when the general classification is Denis Menc...
SELECT mountains_classification FROM table_name_15 WHERE general_classification = "denis menchov" AND winner = "carlos sastre"
sql_create_context
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 MIN(t1.c1) FROM (SELECT COUNT(DISTINCT diagnosis.patientunitstayid) AS c1 FROM diagnosis WHERE diagnosis.diagnosisname = 'sinusitis - radiographically demonstrated' AND DATETIME(diagnosis.diagnosistime) <= DATETIME(CURRENT_TIME(), '-2 year') GROUP BY STRFTIME('%y-%m', diagnosis.diagnosistime)) AS t1
eicu
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE 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 WHERE demographic.insurance = "Private" AND demographic.days_stay > "7"
mimicsql_data
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE lab ( labid number, patientuni...
SELECT patient.admissionheight FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '012-35195') AND NOT patient.admissionheight IS NULL ORDER BY patient.unitadmittime LIMIT 1
eicu
CREATE TABLE drivers ( driverid number, driverref text, number number, code text, forename text, surname text, dob text, nationality text, url text ) CREATE TABLE circuits ( circuitid number, circuitref text, name text, location text, country text, lat number...
SELECT DISTINCT name FROM races ORDER BY name DESC
spider
CREATE TABLE table_59136 ( "Statistic" text, "Name" text, "Total" text, "School" text, "Opponent" text, "Stage" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Calvin Abueva Calvin Abueva had what statistic?
SELECT "Statistic" FROM table_59136 WHERE "Name" = 'calvin abueva calvin abueva'
wikisql
CREATE TABLE table_21536557_2 ( time__cet_ VARCHAR, name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is every time(cet) for the name of Lillehammer 2?
SELECT time__cet_ FROM table_21536557_2 WHERE name = "Lillehammer 2"
sql_create_context
CREATE TABLE table_59137 ( "Statistic" text, "Name" text, "Total" text, "School" text, "Opponent" text, "Stage" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When the opposing team was SSC-R what was the statistic?
SELECT "Statistic" FROM table_59137 WHERE "Opponent" = 'ssc-r'
wikisql
CREATE TABLE table_203_280 ( id number, "week" number, "date" text, "opponent" text, "result" text, "record" text, "game site" text, "tv time" text, "attendance" number, "bye" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- when w...
SELECT "date" FROM table_203_280 WHERE "result" = 'l' ORDER BY id LIMIT 1
squall
CREATE TABLE pilot ( pilot_id number, pilot_name text, rank number, age number, nationality text, position text, join_year number, team text ) CREATE TABLE pilot_record ( record_id number, pilot_id number, aircraft_id number, date text ) CREATE TABLE aircraft ( airc...
SELECT T3.pilot_name, T2.fleet_series FROM pilot_record AS T1 JOIN aircraft AS T2 ON T1.aircraft_id = T2.aircraft_id JOIN pilot AS T3 ON T1.pilot_id = T3.pilot_id ORDER BY T3.rank
spider
CREATE TABLE table_203_438 ( id number, "year" number, "title" text, "role" text, "notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what year was beyond the sea released ?
SELECT "year" FROM table_203_438 WHERE "title" = 'beyond the sea'
squall
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.JCZBJGDL, jyjgzbb.JCZBJGDW FROM hz_info JOIN zzmzjzjlb JOIN jybgb JOIN jyjgzbb ON hz_info.YLJGDM = zzmzjzjlb.YLJGDM AND hz_info.KH = zzmzjzjlb.KH AND hz_info.KLX = zzmzjzjlb.KLX AND zzmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND zzmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jyb...
css
CREATE TABLE table_203_349 ( id number, "no. in\nseries" number, "no. in\nseason" number, "title" text, "directed by" text, "written by" text, "original air date" text, "production\ncode" text, "u.s. viewers\n(millions)" number ) -- Using valid SQLite, answer the following question...
SELECT COUNT("title") FROM table_203_349 WHERE "original air date" = 8
squall
CREATE TABLE table_2076522_2 ( accreditation VARCHAR, school VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the accrediation for united tribes technical college?
SELECT accreditation FROM table_2076522_2 WHERE school = "United Tribes Technical College"
sql_create_context
CREATE TABLE table_name_18 ( round INTEGER, college VARCHAR, pick VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average round of the player from the college of baylor with a pick less than 28?
SELECT AVG(round) FROM table_name_18 WHERE college = "baylor" AND pick < 28
sql_create_context
CREATE TABLE table_name_21 ( component VARCHAR, integrated VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What component has an integrated of one?
SELECT component FROM table_name_21 WHERE integrated = "one"
sql_create_context
CREATE TABLE weather ( date TEXT, max_temperature_f INTEGER, mean_temperature_f INTEGER, min_temperature_f INTEGER, max_dew_point_f INTEGER, mean_dew_point_f INTEGER, min_dew_point_f INTEGER, max_humidity INTEGER, mean_humidity INTEGER, min_humidity INTEGER, max_sea_level_pre...
SELECT date, COUNT(date) FROM weather WHERE mean_sea_level_pressure_inches BETWEEN 30.3 AND 31 ORDER BY COUNT(date)
nvbench
CREATE TABLE table_18946749_4 ( prominence__m_ VARCHAR, rank VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many values of prominence(m) occur at rank 5?
SELECT COUNT(prominence__m_) FROM table_18946749_4 WHERE rank = 5
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 qtb JOIN t_kc22 ON qtb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE qtb.MED_SER_ORG_NO = '1380649' AND t_kc22.SOC_SRT_DIRE_NM = '川石斛颗粒' UNION SELECT COUNT(*) FROM gyb JOIN t_kc22 ON gyb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gyb.MED_SER_ORG_NO = '1380649' AND t_kc22.SOC_SRT_DIRE_NM = '川石斛颗粒' UNIO...
css
CREATE TABLE table_name_84 ( country VARCHAR, to_par VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What country has a To par of e?
SELECT country FROM table_name_84 WHERE to_par = "e"
sql_create_context
CREATE TABLE table_dev_31 ( "id" int, "gender" string, "pre_dm" bool, "hemoglobin_a1c_hba1c" float, "renal_disease" bool, "diabetic" string, "fasting_blood_glucose_fbg" float, "creatinine_clearance_cl" float, "estimated_glomerular_filtration_rate_egfr" int, "fasting_plasma_glucos...
SELECT * FROM table_dev_31 WHERE (baseline_hemoglobin_hgb < 10.5 AND gender = 'female') OR (baseline_hemoglobin_hgb < 13 AND gender = 'male')
criteria2sql
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 prescriptions ( subject_id text, hadm_id...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.gender = "M" AND demographic.days_stay > "5"
mimicsql_data
CREATE TABLE table_11764007_2 ( week_sent_to_third_island VARCHAR, week_arrived_on_main_island VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What week was the member who arrived on the main island in week 6 sent to the third island?
SELECT week_sent_to_third_island FROM table_11764007_2 WHERE week_arrived_on_main_island = "6"
sql_create_context
CREATE TABLE table_10849 ( "Season" real, "Overall" real, "Slalom" real, "Giant Slalom" text, "Super G" text, "Downhill" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which giant slalom had an Overall number of 25?
SELECT "Giant Slalom" FROM table_10849 WHERE "Overall" = '25'
wikisql
CREATE TABLE table_name_37 ( date VARCHAR, circuit VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- On what Date is the Circuit at Sandown Raceway?
SELECT date FROM table_name_37 WHERE circuit = "sandown raceway"
sql_create_context
CREATE TABLE table_204_154 ( id number, "player" text, "matches" number, "innings" number, "runs" number, "average" number, "100s" number, "50s" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many more runs does john have than albe...
SELECT (SELECT "runs" FROM table_204_154 WHERE "player" = 'john challen') - (SELECT "runs" FROM table_204_154 WHERE "player" = 'albert clapp')
squall
CREATE TABLE table_73000 ( "Round" real, "Date" text, "Grand Prix" text, "Circuit" text, "Pole Position" text, "Fastest Lap" text, "Race Winner" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What grand prixs did Daijiro Hiura win?
SELECT "Grand Prix" FROM table_73000 WHERE "Race Winner" = 'Daijiro Hiura'
wikisql
CREATE TABLE diagnoses ( 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 ) C...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.days_stay > "4" AND prescriptions.formulary_drug_cd = "CITA20"
mimicsql_data
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.admission_type = "URGENT" AND demographic.dob_year < "2024"
mimicsql_data
CREATE TABLE table_name_19 ( gold INTEGER, rank VARCHAR, total VARCHAR, bronze VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the gold number when total is more than 1, and bronze is 0, and rank is 5?
SELECT SUM(gold) FROM table_name_19 WHERE total > 1 AND bronze = 0 AND rank = "5"
sql_create_context
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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.short_title = "Polyp of nasal cavity" AND prescriptions.route = "NU"
mimicsql_data
CREATE TABLE table_name_93 ( date VARCHAR, length_of_game VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the date of the game that lasted 75:43?
SELECT date FROM table_name_93 WHERE length_of_game = "75:43"
sql_create_context
CREATE TABLE table_33330 ( "Player" text, "Nationality" text, "Position" text, "From" text, "School/Country" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the school or country for the guard from 2000?
SELECT "School/Country" FROM table_33330 WHERE "Position" = 'guard' AND "From" = '2000'
wikisql
CREATE TABLE table_45147 ( "Res." text, "Record" text, "Opponent" text, "Method" text, "Event" text, "Round" real, "Time" text, "Location" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the method of resolution for the fight agai...
SELECT "Method" FROM table_45147 WHERE "Opponent" = 'akihiro gono'
wikisql
CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE cost ( row_id numbe...
SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE NOT admissions.dischtime IS NULL AND DATETIME(admissions.dischtime) >= DATETIME(CURRENT_TIME(), '-6 year')
mimic_iii
CREATE TABLE table_name_8 ( tournament VARCHAR, year INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What tournament was after 2009?
SELECT tournament FROM table_name_8 WHERE year > 2009
sql_create_context
CREATE TABLE table_name_9 ( attendance VARCHAR, week VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the attendance of the game in week 6?
SELECT attendance FROM table_name_9 WHERE week = 6
sql_create_context
CREATE TABLE table_name_36 ( rank INTEGER, time VARCHAR, lane VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Rank of the Swimmer with a Time of 2:25.65 in a Lane larger than 3?
SELECT AVG(rank) FROM table_name_36 WHERE time = "2:25.65" AND lane > 3
sql_create_context
CREATE TABLE table_63605 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Opponent of the game in Week 3?
SELECT "Opponent" FROM table_63605 WHERE "Week" = '3'
wikisql
CREATE TABLE zzmzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH number, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, KH text, KLX number, MJZH text, ML number, MZZYZDZZBM text, MZZYZDZ...
SELECT jyjgzbb.JYZBLSH FROM hz_info JOIN zzmzjzjlb JOIN jybgb JOIN jyjgzbb ON hz_info.YLJGDM = zzmzjzjlb.YLJGDM AND hz_info.KH = zzmzjzjlb.KH AND hz_info.KLX = zzmzjzjlb.KLX AND zzmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND zzmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.B...
css
CREATE TABLE table_34610 ( "Title" text, "Season" text, "Winner" text, "Score" text, "Runner-up" text, "Venue" text, "Attendance" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What season had Kanto Gakuin University as the winner, with an a...
SELECT "Season" FROM table_34610 WHERE "Winner" = 'kanto gakuin university' AND "Attendance" = 'n/a' AND "Title" = '37th'
wikisql
CREATE TABLE table_27279050_1 ( poles VARCHAR, points VARCHAR, nation VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many pole position achieved 0 points from Mexico?
SELECT COUNT(poles) FROM table_27279050_1 WHERE points = "0" AND nation = "Mexico"
sql_create_context
CREATE TABLE table_65435 ( "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 total when the rank is total and the silver is less than 10?
SELECT SUM("Total") FROM table_65435 WHERE "Rank" = 'total' AND "Silver" < '10'
wikisql
CREATE TABLE Student ( StuID INTEGER, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3) ) CREATE TABLE Allergy_Type ( Allergy VARCHAR(20), AllergyType VARCHAR(20) ) CREATE TABLE Has_Allergy ( StuID INTEGE...
SELECT AllergyType, COUNT(AllergyType) FROM Allergy_Type AS T1 JOIN Has_Allergy AS T2 ON T1.Allergy = T2.Allergy JOIN Student AS T3 ON T3.StuID = T2.StuID WHERE T3.Fname = "Lisa" GROUP BY AllergyType ORDER BY AllergyType DESC
nvbench
CREATE TABLE diagnoses ( 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 ) C...
SELECT demographic.age FROM demographic WHERE demographic.name = "Bruce Harris"
mimicsql_data
CREATE TABLE table_72255 ( "Series #" real, "Season #" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the date of the episode written by Michael Poryes?
SELECT "Original air date" FROM table_72255 WHERE "Written by" = 'Michael Poryes'
wikisql
CREATE TABLE table_6478 ( "Games" real, "Drawn" real, "Lost" real, "Points difference" text, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- which Points has Games smaller than 7?
SELECT MAX("Points") FROM table_6478 WHERE "Games" < '7'
wikisql
CREATE TABLE table_name_88 ( gold INTEGER, nation VARCHAR, silver VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total amount of Gold from guatemala and silver smaller than 0?
SELECT SUM(gold) FROM table_name_88 WHERE nation = "guatemala" AND silver < 0
sql_create_context
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.Name, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name ORDER BY T1.Code DESC
nvbench
CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAddress text ) CREATE TABLE PostFeedback ( Id number, PostId number, IsAno...
SELECT Id AS "user_link", age FROM Users WHERE DisplayName LIKE 'Richard J. Ross III'
sede
CREATE TABLE diagnoses ( 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 ) C...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.discharge_location = "DISCH-TRAN TO PSYCH HOSP" AND demographic.diagnosis = "T5 FRACTURE"
mimicsql_data
CREATE TABLE table_name_32 ( lost INTEGER, played INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the average lost when played is more than 14?
SELECT AVG(lost) FROM table_name_32 WHERE played > 14
sql_create_context
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id...
SELECT demographic.dod FROM demographic WHERE demographic.name = "Kelly Gallardo"
mimicsql_data
CREATE TABLE table_name_36 ( date VARCHAR, venue VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which date had a venue of the Gold Coast Convention Centre?
SELECT date FROM table_name_36 WHERE venue = "gold coast convention centre"
sql_create_context
CREATE TABLE table_18238 ( "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 result of the election in the Virginia 3 district?
SELECT "Result" FROM table_18238 WHERE "District" = 'Virginia 3'
wikisql
CREATE TABLE table_15887683_16 ( country VARCHAR, content VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many countries have content of arte?
SELECT COUNT(country) FROM table_15887683_16 WHERE content = "arte"
sql_create_context
CREATE TABLE t_kc24 ( MED_SAFE_PAY_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, MED_CLINIC_ID text, REF_SLT_FLG number, CLINIC_SLT_DATE time, COMP_ID text, PERSON_ID text, FLX_MED_ORG_ID text, INSU_TYPE text, MED_AMOUT number, PER_ACC_PAY number, OVE_PAY numb...
SELECT OUT_DIAG_DOC_CD, OUT_DIAG_DOC_NM FROM t_kc21 WHERE PERSON_ID = '53365571' AND IN_HOSP_DATE BETWEEN '2002-10-09' AND '2011-08-01' GROUP BY OUT_DIAG_DOC_CD ORDER BY COUNT(*) DESC LIMIT 1
css
CREATE TABLE table_name_44 ( market_value__billion_ INTEGER, profits__billion_$_ VARCHAR, assets__billion_$_ VARCHAR, company VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the lowest Market Value (billion $) which has Assets (billion $) larger ...
SELECT MIN(market_value__billion_) AS $_ FROM table_name_44 WHERE assets__billion_$_ > 276.81 AND company = "toyota" AND profits__billion_$_ > 17.21
sql_create_context
CREATE TABLE table_30073089_2 ( discipline VARCHAR, fis_points VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the discipline for 1561 fis points
SELECT discipline FROM table_30073089_2 WHERE fis_points = 1561
sql_create_context
CREATE TABLE comment_instructor ( instructor_id int, student_id int, score int, comment_text varchar ) CREATE TABLE course_prerequisite ( pre_course_id int, course_id int ) CREATE TABLE course_offering ( offering_id int, course_id int, semester int, section_number int, star...
SELECT DISTINCT department, name, number FROM course WHERE credits = 13 AND department = 'SOC' AND number < 400 + 100 AND number >= 400
advising
CREATE TABLE table_name_15 ( points INTEGER, team VARCHAR, position VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Points has a Team of s o paulo athletic, and a Position larger than 5?
SELECT SUM(points) FROM table_name_15 WHERE team = "são paulo athletic" AND position > 5
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 lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admityear < "2144" AND lab.label = "Heparin, LMW"
mimicsql_data
CREATE TABLE table_name_46 ( score VARCHAR, opponent VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the score when the opponent was Detroit Pistons?
SELECT score FROM table_name_46 WHERE opponent = "detroit pistons"
sql_create_context
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 Founder, AVG(Revenue) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder ORDER BY Founder DESC
nvbench
CREATE TABLE table_name_59 ( opponent VARCHAR, week VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Tell me the opponent of week 14
SELECT opponent FROM table_name_59 WHERE week = 14
sql_create_context
CREATE TABLE instructor ( dept_name VARCHAR, salary INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Find the minimum salary for the departments whose average salary is above the average payment of all instructors.
SELECT MIN(salary), dept_name FROM instructor GROUP BY dept_name HAVING AVG(salary) > (SELECT AVG(salary) FROM instructor)
sql_create_context
CREATE TABLE camera_lens ( id int, brand text, name text, focal_length_mm real, max_aperture real ) CREATE TABLE photos ( id int, camera_lens_id int, mountain_id int, color text, name text ) CREATE TABLE mountain ( id int, name text, Height real, Prominence real...
SELECT Height, Prominence FROM mountain WHERE Range <> 'Aberdare Range'
nvbench
CREATE TABLE table_25637 ( "No." real, "Place & date" text, "Target" text, "Area damaged" text, "Cause of damage" text, "Intercepted by Patriot" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the place and date that the Apartments area ...
SELECT "Place & date" FROM table_25637 WHERE "Area damaged" = 'Apartments area'
wikisql
CREATE TABLE table_27572 ( "Player" text, "Games Played" real, "Rebounds" real, "Assists" real, "Steals" real, "Blocks" real, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which player had 9 blocks?
SELECT "Player" FROM table_27572 WHERE "Blocks" = '9'
wikisql
CREATE TABLE table_name_62 ( time VARCHAR, meet VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Time, when Meet is 'Duel in the Pool', and when Date is '19 December 2009'?
SELECT time FROM table_name_62 WHERE meet = "duel in the pool" AND date = "19 december 2009"
sql_create_context
CREATE TABLE table_name_82 ( to_par VARCHAR, place VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the to par when the place is 8?
SELECT to_par FROM table_name_82 WHERE place = "8"
sql_create_context
CREATE TABLE table_18092 ( "Club" text, "Played" text, "Won" text, "Drawn" text, "Lost" text, "Points for" text, "Points against" text, "Tries for" text, "Tries against" text, "Try bonus" text, "Losing bonus" text, "Points" text ) -- Using valid SQLite, answer the follo...
SELECT "Points against" FROM table_18092 WHERE "Points" = '31'
wikisql
CREATE TABLE table_10260 ( "Player" text, "No.(s)" text, "Height in Ft." text, "Position" text, "Years for Rockets" text, "School/Club Team/Country" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which player plays for Illinois?
SELECT "Player" FROM table_10260 WHERE "School/Club Team/Country" = 'illinois'
wikisql
CREATE TABLE table_name_42 ( home_captain VARCHAR, venue VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Home Captain has Venue of Bourda?
SELECT home_captain FROM table_name_42 WHERE venue = "bourda"
sql_create_context
CREATE TABLE table_name_21 ( score VARCHAR, away_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the score when the away team was brighton & hove albion?
SELECT score FROM table_name_21 WHERE away_team = "brighton & hove albion"
sql_create_context
CREATE TABLE hz_info ( KH text, KLX number, YLJGDM text, RYBH text ) CREATE TABLE mzjzjlb ( YLJGDM text, JZLSH text, KH text, KLX number, MJZH text, HZXM text, NLS number, NLY number, ZSEBZ number, JZZTDM number, JZZTMC text, JZJSSJ time, TXBZ number,...
SELECT SQKS, SQKSMC FROM jybgb WHERE BGDH = '00808054413'
css
CREATE TABLE table_37699 ( "District" text, "Incumbent" text, "Party" text, "First elected" text, "Result" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What are incumbent William Vandever's results?
SELECT "Result" FROM table_37699 WHERE "Incumbent" = 'william vandever'
wikisql
CREATE TABLE table_50090 ( "Name" text, "Branch" text, "Term began" text, "Term ended" text, "Time in office" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What time in office does the U.S. Navy have?
SELECT "Time in office" FROM table_50090 WHERE "Branch" = 'u.s. navy'
wikisql
CREATE TABLE table_name_62 ( bronze INTEGER, gold VARCHAR, silver VARCHAR, rank VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average Bronze when silver is more than 2, and rank is 2, and gold more than 2
SELECT AVG(bronze) FROM table_name_62 WHERE silver > "2" AND rank = "2" AND gold > 2
sql_create_context
CREATE TABLE table_name_89 ( rank INTEGER, time VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- With a time of 53.33, who ranked the highest?
SELECT MAX(rank) FROM table_name_89 WHERE time = 53.33
sql_create_context
CREATE TABLE table_5882 ( "Res." text, "Record" text, "Opponent" text, "Method" text, "Event" text, "Location" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the opponent that led to a record of 23-5?
SELECT "Opponent" FROM table_5882 WHERE "Record" = '23-5'
wikisql
CREATE TABLE table_18424435_3 ( written_by VARCHAR, canadian_viewers__million_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who wrote the episodes watched by 1.575 million people in Canada?
SELECT written_by FROM table_18424435_3 WHERE canadian_viewers__million_ = "1.575"
sql_create_context
CREATE TABLE ground_service ( city_code text, airport_code text, transport_type text, ground_fare int ) CREATE TABLE time_interval ( period text, begin_time int, end_time int ) CREATE TABLE flight_fare ( flight_id int, fare_id int ) CREATE TABLE flight ( aircraft_code_sequence...
SELECT DISTINCT airline.airline_code FROM airline, airport_service, city, flight WHERE city.city_code = airport_service.city_code AND city.city_name = 'ATLANTA' AND flight.airline_code = airline.airline_code AND flight.from_airport = airport_service.airport_code
atis
CREATE TABLE storm ( storm_id number, name text, dates_active text, max_speed number, damage_millions_usd number, number_deaths number ) CREATE TABLE region ( region_id number, region_code text, region_name text ) CREATE TABLE affected_region ( region_id number, storm_id nu...
SELECT T1.region_name, COUNT(*) FROM region AS T1 JOIN affected_region AS T2 ON T1.region_id = T2.region_id GROUP BY T1.region_id
spider
CREATE TABLE table_23957 ( "Game" real, "Date" text, "Opponent" text, "Result" text, "Orangemen points" real, "Opponents" real, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When did they play against West Virginia?
SELECT "Date" FROM table_23957 WHERE "Opponent" = 'West Virginia'
wikisql
CREATE TABLE table_24713 ( "Rank" real, "Team Name" text, "Basic Elements" text, "Tumbling" text, "Stunts" text, "Tosses/Pyramids" text, "Deductions" text, "Total" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which team names have 44.5...
SELECT "Team Name" FROM table_24713 WHERE "Tumbling" = '44.5'
wikisql
CREATE TABLE table_name_49 ( original_nonequity_tour_cast VARCHAR, original_broadway_cast VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the original nonequity tour when the original broadway was Kevin Chamberlin?
SELECT original_nonequity_tour_cast FROM table_name_49 WHERE original_broadway_cast = "kevin chamberlin"
sql_create_context
CREATE TABLE table_name_42 ( constructor VARCHAR, driver VARCHAR, free_practice_driver_s_ VARCHAR, chassis VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- who is the constructor when the free practice driver(s) is n/a, the chassis is 005 and the drive...
SELECT constructor FROM table_name_42 WHERE free_practice_driver_s_ = "n/a" AND chassis = "005" AND driver = "takuma sato"
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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.short_title = "Polycythemia vera" AND prescriptions.drug_type = "MAIN"
mimicsql_data
CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE outputevents ( row_id number, subject_id number, ...
SELECT (SELECT chartevents.valuenum 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 = 28443) AND icustays.outtime IS NULL) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_i...
mimic_iii
CREATE TABLE captain ( Captain_ID int, Name text, Ship_ID int, age text, Class text, Rank text ) CREATE TABLE Ship ( Ship_ID int, Name text, Type text, Built_Year real, Class text, Flag text ) -- Using valid SQLite, answer the following questions for the tables provide...
SELECT Class, COUNT(Class) FROM Ship WHERE NOT Ship_ID IN (SELECT Ship_ID FROM captain) GROUP BY Class
nvbench
CREATE TABLE table_11643 ( "Round" text, "Player" text, "Position" text, "Team" text, "College" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What college has the Chicago stags and position is G?
SELECT "College" FROM table_11643 WHERE "Team" = 'chicago stags' AND "Position" = 'g'
wikisql
CREATE TABLE table_25397 ( "Player" text, "Games Played" real, "Field Goals" real, "Three Pointers" real, "Free Throws" real, "Rebounds" real, "Assists" real, "Blocks" real, "Steals" real, "Points" real ) -- Using valid SQLite, answer the following questions for the tables prov...
SELECT MIN("Three Pointers") FROM table_25397 WHERE "Rebounds" = '178'
wikisql
CREATE TABLE table_name_2 ( type VARCHAR, nat VARCHAR, name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Marcell Jansen of the nation GER has what for the type?
SELECT type FROM table_name_2 WHERE nat = "ger" AND name = "marcell jansen"
sql_create_context
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 QTY * UNIVALENT FROM t_kc22 WHERE MED_EXP_DET_ID = '06485196651'
css
CREATE TABLE table_name_91 ( grid INTEGER, rider VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many Grid has a Rider of ryuichi kiyonari?
SELECT SUM(grid) FROM table_name_91 WHERE rider = "ryuichi kiyonari"
sql_create_context