instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE table_79317 ( "Game" real, "Date" text, "Opponent" text, "Score" text, "Location/Attendance" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Game # that scored 87-92?
SELECT SUM("Game") FROM table_79317 WHERE "Score" = '87-92'
wikisql
CREATE TABLE table_203_204 ( id number, "year" number, "film" text, "language" text, "actors" text, "music" text, "banner" text, "note" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many films were directed in the year 1961 by sridh...
SELECT COUNT("film") FROM table_203_204 WHERE "year" = 1961
squall
CREATE TABLE table_name_88 ( home VARCHAR, score VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was at home when the score was 2:2?
SELECT home FROM table_name_88 WHERE score = "2:2"
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 (SELECT vitalperiodic.systemicsystolic FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '027-124213') AND NOT patient.unitdischarge...
eicu
CREATE TABLE table_6298 ( "Player" text, "Sacks" real, "INT'S" real, "Yards" real, "Average" real, "Long" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many INTs were there with an average less than 8, 0 long, and the player is Mike Douglas...
SELECT COUNT("INT'S") FROM table_6298 WHERE "Average" < '8' AND "Long" = '0' AND "Player" = 'mike douglass'
wikisql
CREATE TABLE table_204_862 ( id number, "rank" number, "bib" number, "athlete" text, "country" text, "run 1" text, "run 2" text, "total" text, "behind" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how long was daniel pfister behi...
SELECT "behind" FROM table_204_862 WHERE "athlete" = 'daniel pfister'
squall
CREATE TABLE t_kc24 ( MED_SAFE_PAY_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, MED_CLINIC_ID text, REF_SLT_FLG number, CLINIC_SLT_DATE time, COMP_ID text, PERSON_ID text, FLX_MED_ORG_ID text, INSU_TYPE text, MED_AMOUT number, PER_ACC_PAY number, OVE_PAY numb...
SELECT SUM(t_kc22.AMOUNT) FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.PERSON_ID = '40751656' AND t_kc21.CLINIC_TYPE = '门诊' AND t_kc22.STA_DATE BETWEEN '2000-02-19' AND '2009-09-05' AND t_kc22.MED_INV_ITEM_TYPE = '西药费'
css
CREATE TABLE table_name_19 ( away_team VARCHAR, home_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the away team when Lincoln City was the home team?
SELECT away_team FROM table_name_19 WHERE home_team = "lincoln city"
sql_create_context
CREATE TABLE table_54687 ( "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 lowest interview of Texas, with an average larger than 9.531?
SELECT MIN("Interview") FROM table_54687 WHERE "State" = 'texas' AND "Average" > '9.531'
wikisql
CREATE TABLE table_42095 ( "Outcome" text, "Date" real, "Championship" text, "Surface" text, "Opponent in the final" text, "Score in the final" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is the Opponent in the final after 1983 with an Ou...
SELECT "Opponent in the final" FROM table_42095 WHERE "Outcome" = 'runner-up' AND "Date" > '1983'
wikisql
CREATE TABLE table_name_73 ( nation VARCHAR, lead VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Nation has a Lead of alexandra bruckmiller?
SELECT nation FROM table_name_73 WHERE lead = "alexandra bruckmiller"
sql_create_context
CREATE TABLE table_203_70 ( id number, "rank" number, "nation" text, "gold" number, "silver" number, "bronze" number, "total" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many bronze medals does togo have ?
SELECT "bronze" FROM table_203_70 WHERE "nation" = 'togo'
squall
CREATE TABLE hz_info ( KH text, KLX number, YLJGDM text, RYBH text ) CREATE TABLE person_info ( RYBH text, XBDM number, XBMC text, XM text, CSRQ time, CSD text, MZDM text, MZMC text, GJDM text, GJMC text, JGDM text, JGMC text, XLDM text, XLMC text...
SELECT mzjzjlb.JZLSH FROM hz_info JOIN mzjzjlb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX WHERE hz_info.RYBH = '91780713' AND hz_info.YLJGDM = '1411436' AND mzjzjlb.JZKSMC LIKE '%母乳喂养%'
css
CREATE TABLE building ( building_id text, Name text, Street_address text, Years_as_tallest text, Height_feet int, Floors int ) CREATE TABLE protein ( common_name text, protein_name text, divergence_from_human_lineage real, accession_number text, sequence_length real, seq...
SELECT Institution, COUNT(*) FROM Institution AS T1 JOIN protein AS T2 ON T1.Institution_id = T2.Institution_id GROUP BY T1.Institution_id ORDER BY Institution
nvbench
CREATE TABLE table_2690 ( "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. -- What is the location is the winning ...
SELECT "Location" FROM table_2690 WHERE "Winning Driver" = 'Bill Vukovich II'
wikisql
CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time, drug text, dose_val_rx text, dose_unit_rx text, route text )...
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, procedures_icd.charttime FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FR...
mimic_iii
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 patient ( uniquep...
SELECT patient.admissionweight FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '027-186593') AND NOT patient.admissionweight IS NULL AND STRFTIME('%y-%m', patient.unitadmittime) <= '2103-12' ORDER BY patient.unitadmittime LIMIT 1
eicu
CREATE TABLE table_36854 ( "City" text, "State/Territory" text, "IATA" text, "ICAO" text, "Airport" text, "Begin" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which city has tasmania as the state/territory and a ICAO of ymhb?
SELECT "City" FROM table_36854 WHERE "State/Territory" = 'tasmania' AND "ICAO" = 'ymhb'
wikisql
CREATE TABLE table_204_735 ( id number, "rank" number, "team" text, "names" text, "time" text, "qualification" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- which team took a shorter amount of time , ukraine or united states ?
SELECT "team" FROM table_204_735 WHERE "team" IN ('ukraine', 'united states') ORDER BY "time" LIMIT 1
squall
CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, val...
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, procedures_icd.charttime, admissions.hadm_id FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_icd.icd9_code = (SELECT d_icd_pro...
mimic_iii
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 lab ( subject_id text, hadm_id text, ...
SELECT MIN(demographic.age) FROM demographic WHERE demographic.gender = "F" AND demographic.diagnosis = "LEFT FEMUR FRACTURE"
mimicsql_data
CREATE TABLE table_name_11 ( result VARCHAR, week VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- On week 13 what was the score of the game?
SELECT result FROM table_name_11 WHERE week = 13
sql_create_context
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 Team_Name, ACC_Percent FROM basketball_match
nvbench
CREATE TABLE table_4913 ( "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. -- For the race held on 10/08/86, what was the circuit?
SELECT "Circuit" FROM table_4913 WHERE "Date" = '10/08/86'
wikisql
CREATE TABLE table_7686 ( "Ballarat FL" text, "Wins" real, "Byes" real, "Losses" real, "Draws" real, "Against" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Can you tell me the sum of Draws that had the Wins smaller than 3, and the Byes larger ...
SELECT SUM("Draws") FROM table_7686 WHERE "Wins" < '3' AND "Byes" > '2'
wikisql
CREATE TABLE Users ( Id number, Reputation number, CreationDate time, DisplayName text, LastAccessDate time, WebsiteUrl text, Location text, AboutMe text, Views number, UpVotes number, DownVotes number, ProfileImageUrl text, EmailHash text, AccountId number ) CRE...
SELECT COUNT(*) FROM Users WHERE NOT EmailHash IS NULL
sede
CREATE TABLE table_name_97 ( d_45_o VARCHAR, d_46_o VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the D 45 O with D 46 O of r 31
SELECT d_45_o FROM table_name_97 WHERE d_46_o = "r 31 √"
sql_create_context
CREATE TABLE table_name_96 ( to_par INTEGER, year_s__won VARCHAR, total VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which player who won in 1977 and scored great than 155 was the closest to par?
SELECT MAX(to_par) FROM table_name_96 WHERE year_s__won = "1977" AND total > 155
sql_create_context
CREATE TABLE table_name_64 ( nominee VARCHAR, category VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Nominee from the Category that is best costume design?
SELECT nominee FROM table_name_64 WHERE category = "best costume design"
sql_create_context
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) CREATE TABLE jybgb ( BBCJBW text, BBDM text, BBMC text, BBZT number, BGDH text, BGJGDM text, BGJGMC text, BGRGH text, BGRQ time, BGRXM text, BGSJ time, CJRQ time, JSBBRQSJ time, ...
SELECT (SELECT COUNT(*) FROM person_info JOIN hz_info JOIN mzjzjlb 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 WHERE person_info.XM = '魏冠宇' AND mzjzjlb.JZKSRQ BETWEEN '2009-09-02' AND '2018-12-28') + (SELECT COUNT(*) FROM person_info J...
css
CREATE TABLE table_19892 ( "Series Ep." text, "Episode" real, "Netflix" text, "Segment A" text, "Segment B" text, "Segment C" text, "Segment D" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was segment A when segment B was snowboards?
SELECT "Segment A" FROM table_19892 WHERE "Segment B" = 'Snowboards'
wikisql
CREATE TABLE table_75689 ( "Year" real, "Winner" text, "Jockey" text, "Trainer" text, "Owner" text, "Distance (Miles)" text, "Time" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the time for the winning horse Salford ii?
SELECT "Time" FROM table_75689 WHERE "Winner" = 'salford ii'
wikisql
CREATE TABLE table_13846 ( "Model number" text, "sSpec number" text, "Cores" text, "Frequency" text, "Turbo" text, "L2 cache" text, "L3 cache" text, "GPU model" text, "GPU frequency" text, "Socket" text, "I/O bus" text, "Release date" text, "Part number(s)" text, ...
SELECT "Turbo" FROM table_13846 WHERE "Cores" = 'standard power'
wikisql
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 wdmzjzjlb.JZLSH FROM person_info JOIN hz_info JOIN wdmzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX WHERE person_info.XM = '孙丹红' AND hz_info.YLJGDM = '9381500' AND wdmzjzjlb.JZKSMC LIKE '%产%' UNION SELECT bdmzjzjlb.JZ...
css
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) C...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.days_stay > "1" AND diagnoses.icd9_code = "E8791"
mimicsql_data
CREATE TABLE table_name_12 ( samples_taken INTEGER, melamine_content_mg_kg_ VARCHAR, producer VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many samples taken from producer Qingdao Suncare Nutritional Technology with a melamine content less than 53....
SELECT SUM(samples_taken) FROM table_name_12 WHERE melamine_content_mg_kg_ < 53.4 AND producer = "qingdao suncare nutritional technology"
sql_create_context
CREATE TABLE table_26986076_1 ( sat_28_aug VARCHAR, wed_25_aug VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- If the time on Wed aug 25 was 20' 09.25 112.324mph, what was the time on sat Aug 28?
SELECT sat_28_aug FROM table_26986076_1 WHERE wed_25_aug = "20' 09.25 112.324mph"
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 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 procedures ON demographic.hadm_id = procedures.hadm_id WHERE procedures.long_title = "Venous catheterization, not elsewhere classified"
mimicsql_data
CREATE TABLE table_204_771 ( id number, "rank" number, "nation" text, "gold" number, "silver" number, "bronze" number, "total" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- which nations won only 1 gold medal ?
SELECT "nation" FROM table_204_771 WHERE "gold" = 1
squall
CREATE TABLE table_name_5 ( score VARCHAR, march VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Score of the game on March 18?
SELECT score FROM table_name_5 WHERE march = 18
sql_create_context
CREATE TABLE table_name_17 ( bats VARCHAR, uni_number VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which batter has a uni# of 31?
SELECT bats FROM table_name_17 WHERE uni_number = 31
sql_create_context
CREATE TABLE Student_Tests_Taken ( registration_id INTEGER, date_test_taken DATETIME, test_result VARCHAR(255) ) CREATE TABLE Student_Course_Enrolment ( registration_id INTEGER, student_id INTEGER, course_id INTEGER, date_of_enrolment DATETIME, date_of_completion DATETIME ) CREATE TABL...
SELECT T2.middle_name, T1.student_id FROM Student_Course_Enrolment AS T1 JOIN Students AS T2 ON T1.student_id = T2.student_id
nvbench
CREATE TABLE jyjgzbb ( JYZBLSH text, YLJGDM text, BGDH text, BGRQ time, JYRQ time, JCRGH text, JCRXM text, SHRGH text, SHRXM text, JCXMMC text, JCZBDM text, JCFF text, JCZBMC text, JCZBJGDX text, JCZBJGDL number, JCZBJGDW text, SBBM text, YQBH text...
SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb 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 ...
css
CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId number, OwnerDisplayName text, LastEditorUserId number, LastEditorDisplayName text...
SELECT * FROM information_schema.columns WHERE table_name = 'POSTS' AND column_name = 'score'
sede
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text,...
SELECT lab.flag FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.name = "Stephanie Suchan"
mimicsql_data
CREATE TABLE election ( Election_ID int, Counties_Represented text, District int, Delegate text, Party int, First_Elected real, Committee text ) CREATE TABLE party ( Party_ID int, Year real, Party text, Governor text, Lieutenant_Governor text, Comptroller text, A...
SELECT T2.Party, COUNT(T2.Party) FROM election AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID GROUP BY T2.Party ORDER BY T2.Party DESC
nvbench
CREATE TABLE table_name_74 ( death VARCHAR, birth VARCHAR, rank VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What year is the death for a birth of 1873 and higher than rank 28?
SELECT death FROM table_name_74 WHERE birth = 1873 AND rank > 28
sql_create_context
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE allergy ( allergyid number...
SELECT SUM(cost.cost) FROM cost WHERE cost.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '025-55786' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospitaladmittime LIMIT 1)
eicu
CREATE TABLE table_name_66 ( share_of_seats VARCHAR, general_election VARCHAR, seats VARCHAR, name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Share of seats has Seats smaller than 52, and a Name of sdp liberal alliance, and a General electi...
SELECT share_of_seats FROM table_name_66 WHERE seats < 52 AND name = "sdp–liberal alliance" AND general_election = 1983
sql_create_context
CREATE TABLE people ( People_ID int, Sex text, Name text, Date_of_Birth text, Height real, Weight real ) CREATE TABLE candidate ( Candidate_ID int, People_ID int, Poll_Source text, Date text, Support_rate real, Consider_rate real, Oppose_rate real, Unsure_rate re...
SELECT Sex, SUM(Height) FROM people GROUP BY Sex ORDER BY SUM(Height) DESC
nvbench
CREATE TABLE table_name_27 ( wins INTEGER, cuts_made VARCHAR, events VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the highest wins a tournament with 3 cuts and more than 4 events has?
SELECT MAX(wins) FROM table_name_27 WHERE cuts_made = 3 AND events > 4
sql_create_context
CREATE TABLE table_256286_8 ( type VARCHAR, _percentage_yes VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the type of ballot measures if the % of yes vote is 32.47%?
SELECT type FROM table_256286_8 WHERE _percentage_yes = "32.47%"
sql_create_context
CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varchar(20), LAST_NAME varchar(25), EMAIL varchar(25), PHONE_NUMBER varchar(20), HIRE_DATE date, JOB_ID varchar(10), ...
SELECT JOB_ID, AVG(EMPLOYEE_ID) FROM employees WHERE HIRE_DATE < '2002-06-21' GROUP BY JOB_ID ORDER BY JOB_ID
nvbench
CREATE TABLE program_requirement ( program_id int, category varchar, min_credit int, additional_req varchar ) CREATE TABLE offering_instructor ( offering_instructor_id int, offering_id int, instructor_id int ) CREATE TABLE program ( program_id int, name varchar, college varchar...
SELECT DISTINCT instructor.name FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN offering_instructor ON offering_instructor.offering_id = course_offering.offering_id INNER JOIN instructor ON offering_instructor.instructor_id = instructor.instructor_id WHERE course_offeri...
advising
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 COUNTRY_NAME, SUM(EMPLOYEE_ID) FROM employees AS T1 JOIN departments AS T2 ON T1.DEPARTMENT_ID = T2.DEPARTMENT_ID JOIN locations AS T3 ON T2.LOCATION_ID = T3.LOCATION_ID JOIN countries AS T4 ON T3.COUNTRY_ID = T4.COUNTRY_ID GROUP BY COUNTRY_NAME ORDER BY COUNTRY_NAME
nvbench
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 T1.Name, T2.Revenue FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name, T1.Name ORDER BY T2.Revenue DESC
nvbench
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 prescription...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.expire_flag = "1" AND demographic.diagnosis = "STERNAL WOUND INFECTION"
mimicsql_data
CREATE TABLE t_kc21_t_kc24 ( MED_CLINIC_ID text, MED_SAFE_PAY_ID number ) CREATE TABLE t_kc24 ( ACCOUNT_DASH_DATE time, ACCOUNT_DASH_FLG number, CASH_PAY number, CIVIL_SUBSIDY number, CKC102 number, CLINIC_ID text, CLINIC_SLT_DATE time, COMP_ID text, COM_ACC_PAY number, ...
SELECT t_kc21.OUT_DIAG_DOC_CD, t_kc21.OUT_DIAG_DOC_NM FROM t_kc21 WHERE t_kc21.MED_CLINIC_ID = '12315818260'
css
CREATE TABLE table_21573750_2 ( asian_team_classification VARCHAR, asian_rider_classification VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When samai amari is the asian rider classification how many asian team classifications are there?
SELECT COUNT(asian_team_classification) FROM table_21573750_2 WHERE asian_rider_classification = "Samai Amari"
sql_create_context
CREATE TABLE table_63238 ( "Engine" text, "Production" text, "Transmission" text, "Power" text, "Torque" text, "Acceleration 0\u2013100km/h (0\u201362mph)" text, "Top Speed" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the accelera...
SELECT "Acceleration 0\u2013100km/h (0\u201362mph)" FROM table_63238 WHERE "Transmission" = '5-speed manual'
wikisql
CREATE TABLE table_41013 ( "Bowl Game" text, "Date" text, "Stadium" text, "City" text, "Television" text, "Conference Matchups" text, "Payout ( US$ )" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the conference matchup in the bowl...
SELECT "Conference Matchups" FROM table_41013 WHERE "Payout ( US$ )" = '$3 million'
wikisql
CREATE TABLE mzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH text, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, KH text, KLX number, MJZH text, ML number, MZZYZDZZBM text, MZZYZDZZMC ...
SELECT mzjzjlb.JZLSH FROM hz_info JOIN mzjzjlb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX WHERE hz_info.person_info_XM = '韩向彤' AND hz_info.YLJGDM = '9745753' AND NOT mzjzjlb.JZKSMC LIKE '%科室%'
css
CREATE TABLE table_167354_2 ( rank_07_11 VARCHAR, world_ranking VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many figures are there for Rank 07-11 when the world ranking is 4?
SELECT COUNT(rank_07_11) FROM table_167354_2 WHERE world_ranking = "4"
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 COUNT(*) FROM t_kc21 WHERE MED_SER_ORG_NO = '3132833' AND IN_HOSP_DATE BETWEEN '2007-09-13' AND '2018-12-25'
css
CREATE TABLE table_29686983_1 ( fastest_lap VARCHAR, round VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- who had the fastest lap for round 1?
SELECT fastest_lap FROM table_29686983_1 WHERE round = 1
sql_create_context
CREATE TABLE table_26350 ( "equation:" text, "k_{\\mathrm{H,pc}} = \\frac{p}{c_\\mathrm{aq}}" text, "k_{\\mathrm{H,cp}} = \\frac{c_\\mathrm{aq}}{p}" text, "k_{\\mathrm{H,px}} = \\frac{p}{x}" text, "k_{\\mathrm{H,cc}} = \\frac{c_{\\mathrm{aq}}}{c_{\\mathrm{gas}}}" text ) -- Using valid SQLite, answ...
SELECT COUNT("k_{\\mathrm{H,cc}} = \\frac{c_{\\mathrm{aq}}}{c_{\\mathrm{gas}}}") FROM table_26350 WHERE "k_{\\mathrm{H,px}} = \\frac{p}{x}" = '14.97 × 10'
wikisql
CREATE TABLE table_name_45 ( score VARCHAR, result VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Result of l, and a Date of 15-oct-64 had what score?
SELECT score FROM table_name_45 WHERE result = "l" AND date = "15-oct-64"
sql_create_context
CREATE TABLE table_name_2 ( name VARCHAR, since VARCHAR, ends VARCHAR, nat VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Name has Ends of 30 june 2010, and a Nation of eng, and Since larger than 2007?
SELECT name FROM table_name_2 WHERE ends = "30 june 2010" AND nat = "eng" AND since > 2007
sql_create_context
CREATE TABLE Badges ( Id number, UserId number, Name text, Date time, Class number, TagBased boolean ) CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE PostHistoryTypes ( Id number, Name tex...
SELECT p.Id AS "post_link", 'site://posts/' + CAST(p.Id AS TEXT) + '/edit|' + 'Edit' AS "edit_link", p.CreationDate FROM Posts AS p WHERE ((REPLACE(REPLACE(p.Body, '\\', ''), CHAR(9), 'X') LIKE '%\X%')) ORDER BY p.CreationDate DESC
sede
CREATE TABLE table_name_65 ( _ VARCHAR, knots_knots VARCHAR, name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the pseudoknot prediction of the software named tfold?
SELECT knots_knots AS :_pseudoknot_prediction, _ FROM table_name_65 WHERE name = "tfold"
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 treatment ( treat...
SELECT COUNT(*) > 0 FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '017-88691')) AND medication.drugname = 'sennosides-docusate sodium 8.6-50 ...
eicu
CREATE TABLE table_13716 ( "Sr No" real, "Name" text, "Locale" text, "Height" text, "Floors" real, "Building Type" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many times is the building type residential and the locale yashodham?
SELECT COUNT("Sr No") FROM table_13716 WHERE "Building Type" = 'residential' AND "Locale" = 'yashodham'
wikisql
CREATE TABLE table_name_15 ( venue VARCHAR, score VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the venue when the score is 10-0 on 1997-06-22?
SELECT venue FROM table_name_15 WHERE score = "10-0" AND date = "1997-06-22"
sql_create_context
CREATE TABLE table_2110959_1 ( standing VARCHAR, pct__percentage VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the standing in the season that the pct% was 0.769?
SELECT standing FROM table_2110959_1 WHERE pct__percentage = "0.769"
sql_create_context
CREATE TABLE table_27533947_1 ( best_winning_average VARCHAR, games_won VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- If the games won are 5, what is the best winning average?
SELECT best_winning_average FROM table_27533947_1 WHERE games_won = 5
sql_create_context
CREATE TABLE table_name_99 ( score VARCHAR, tie_no VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the score if the Tie no is 32?
SELECT score FROM table_name_99 WHERE tie_no = "32"
sql_create_context
CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE PostHistory ( Id number, PostHistoryTypeId number, PostId number, RevisionGUID other, CreationDate time, UserId number, UserDisplayName text, Comment text, ...
WITH GetCountOfAcceptedAnswersPerUser AS (SELECT COUNT(P.AcceptedAnswerId) AS "count_of_accepted_answers", P.OwnerUserId, U.DisplayName FROM Posts AS P INNER JOIN Users AS U ON P.OwnerUserId = U.Id WHERE OwnerUserId = @UserId OR @UserId IS NULL GROUP BY P.OwnerUserId, U.DisplayName ORDER BY 'count_of_accepted_answers' ...
sede
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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admission_location = "CLINIC REFERRAL/PREMATURE" AND diagnoses.long_title = "Diverticulosis of colon with hemorrhage"
mimicsql_data
CREATE TABLE table_name_21 ( crowd VARCHAR, away_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the crowd size for the game where Footscray was the away team?
SELECT COUNT(crowd) FROM table_name_21 WHERE away_team = "footscray"
sql_create_context
CREATE TABLE table_28498999_6 ( player VARCHAR, points VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the number of people where the pieces is 3015
SELECT COUNT(player) FROM table_28498999_6 WHERE points = 3015
sql_create_context
CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABL...
SELECT d_icd_diagnoses.long_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'tb lung cavity-exam unkn' UNION SELECT d_icd_procedures.long_title FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'tb lung cavity-exam unkn'
mimic_iii
CREATE TABLE manufacturer ( Manufacturer_ID int, Open_Year real, Name text, Num_of_Factories int, Num_of_Shops int ) CREATE TABLE furniture_manufacte ( Manufacturer_ID int, Furniture_ID int, Price_in_Dollar real ) CREATE TABLE furniture ( Furniture_ID int, Name text, Num_of...
SELECT Name, Num_of_Component FROM furniture WHERE Num_of_Component > 10
nvbench
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 countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE regions ( REGION_ID decimal(5,0), ...
SELECT HIRE_DATE, AVG(MANAGER_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' ORDER BY AVG(MANAGER_ID)
nvbench
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE demographic ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.gender = "F" AND diagnoses.icd9_code = "41519"
mimicsql_data
CREATE TABLE Users ( Id number, Reputation number, CreationDate time, DisplayName text, LastAccessDate time, WebsiteUrl text, Location text, AboutMe text, Views number, UpVotes number, DownVotes number, ProfileImageUrl text, EmailHash text, AccountId number ) CRE...
SELECT P.Id AS "post_link", CAST(P.Score AS FLOAT) / CAST(P.ViewCount AS FLOAT) AS SVRatio, P.Score AS Score, P.ViewCount AS Views, P.CreationDate AS CreationDate FROM Posts AS P WHERE P.PostTypeId = 1 AND P.OwnerUserId = '##userid##' AND P.Score >= @MinScore AND P.ViewCount >= @MinViews ORDER BY SVRatio DESC
sede
CREATE TABLE table_55508 ( "Stations" text, "Place" text, "Managed By" text, "Platforms" real, "Zone" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Zone is the lowest when Managed By Southern and has Platforms under 2?
SELECT MIN("Zone") FROM table_55508 WHERE "Managed By" = 'southern' AND "Platforms" < '2'
wikisql
CREATE TABLE table_5056 ( "Position" real, "Team" text, "Points" real, "Played" real, "Drawn" real, "Lost" real, "Against" real, "Difference" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the highest number of games played when...
SELECT MAX("Played") FROM table_5056 WHERE "Against" > '14' AND "Lost" = '3'
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 SUM(t_kc24.OVE_PAY) FROM t_kc21 JOIN t_kc24 ON t_kc21.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE t_kc21.PERSON_NM = '鲁和颂' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2002-03-16' AND '2004-10-26'
css
CREATE TABLE table_name_14 ( to_par VARCHAR, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the To Par score for player Justin Leonard?
SELECT to_par FROM table_name_14 WHERE player = "justin leonard"
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 HOSP_DOC_CD, HOSP_DOC_NM FROM t_kc22 WHERE MED_EXP_DET_ID = '77010612991'
css
CREATE TABLE table_name_20 ( region VARCHAR, catalog VARCHAR, format VARCHAR, label VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Region has a Format of cd album, and a Label of kemado records, and a Catalog of kem 071?
SELECT region FROM table_name_20 WHERE format = "cd album" AND label = "kemado records" AND catalog = "kem 071"
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 prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, ...
SELECT demographic.marital_status, demographic.ethnicity FROM demographic WHERE demographic.subject_id = "76446"
mimicsql_data
CREATE TABLE table_name_55 ( position VARCHAR, school VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the position of the player from Dartmouth Ohio State?
SELECT position FROM table_name_55 WHERE school = "dartmouth ohio state"
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 procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses ( ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.age < "85" AND prescriptions.drug = "Paroxetine HCl"
mimicsql_data
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 t_kc21.IN_DIAG_DIS_CD, t_kc21.IN_DIAG_DIS_NM FROM t_kc21 WHERE t_kc21.PERSON_ID = '75917305' AND t_kc21.MED_CLINIC_ID IN (SELECT t_kc24.MED_CLINIC_ID FROM t_kc24 WHERE t_kc24.MED_AMOUT >= 353.37)
css
CREATE TABLE author ( authorid int, authorname varchar ) CREATE TABLE venue ( venueid int, venuename varchar ) CREATE TABLE paperfield ( fieldid int, paperid int ) CREATE TABLE writes ( paperid int, authorid int ) CREATE TABLE paperdataset ( paperid int, datasetid int ) CREA...
SELECT DISTINCT COUNT(1), dataset.datasetid FROM dataset, keyphrase, paperdataset, paperkeyphrase WHERE keyphrase.keyphrasename = 'structured prediction' AND paperdataset.datasetid = dataset.datasetid AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paperkeyphrase.paperid = paperdataset.paperid GROUP BY datas...
scholar
CREATE TABLE table_name_63 ( location VARCHAR, score VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Location, when the Score is 35-31?
SELECT location FROM table_name_63 WHERE score = "35-31"
sql_create_context
CREATE TABLE film ( Film_ID int, Rank_in_series int, Number_in_season int, Title text, Directed_by text, Original_air_date text, Production_code text ) CREATE TABLE cinema ( Cinema_ID int, Name text, Openning_year int, Capacity int, Location text ) CREATE TABLE schedule...
SELECT Name, Price FROM schedule AS T1 JOIN film AS T2 ON T1.Film_ID = T2.Film_ID JOIN cinema AS T3 ON T1.Cinema_ID = T3.Cinema_ID GROUP BY Title, Name ORDER BY Price
nvbench
CREATE TABLE table_80269 ( "Episode title" text, "Villain(s)" text, "Identity(ies)" text, "Original airdate" text, "DVD volume" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the original airdate for mr. buckston
SELECT "Original airdate" FROM table_80269 WHERE "Identity(ies)" = 'mr. buckston'
wikisql
CREATE TABLE Comments ( Id number, PostId number, Score number, Text text, CreationDate time, UserDisplayName text, UserId number, ContentLicense text ) CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time...
SELECT PostId AS "post_link", UserId AS "user_link", PostHistoryTypes.Name AS Action, CreationDate AS DoneOn, PostHistory.* FROM PostHistory, PostHistoryTypes WHERE PostHistory.PostId = '##POSTID##' AND PostHistory.PostHistoryTypeId = PostHistoryTypes.Id ORDER BY CreationDate DESC
sede