instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE table_name_61 ( date VARCHAR, away_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- On what date was South Melbourne the away team?
SELECT date FROM table_name_61 WHERE away_team = "south melbourne"
sql_create_context
CREATE TABLE Ref_Detention_Type ( detention_type_code VARCHAR(10), detention_type_description VARCHAR(80) ) CREATE TABLE Detention ( detention_id INTEGER, detention_type_code VARCHAR(10), teacher_id INTEGER, datetime_detention_start DATETIME, datetime_detention_end DATETIME, detention_s...
SELECT date_of_notes, COUNT(date_of_notes) FROM Assessment_Notes ORDER BY COUNT(date_of_notes) DESC
nvbench
CREATE TABLE table_name_76 ( tournament VARCHAR, year VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- I want the tournament for 1889
SELECT tournament FROM table_name_76 WHERE year = 1889
sql_create_context
CREATE TABLE employees ( id INTEGER, last_name VARCHAR(20), first_name VARCHAR(20), title VARCHAR(30), reports_to INTEGER, birth_date TIMESTAMP, hire_date TIMESTAMP, address VARCHAR(70), city VARCHAR(40), state VARCHAR(40), country VARCHAR(40), postal_code VARCHAR(10), ...
SELECT T1.name, COUNT(*) FROM genres AS T1 JOIN tracks AS T2 ON T2.genre_id = T1.id GROUP BY T1.id ORDER BY COUNT(*) DESC LIMIT 5
nvbench
CREATE TABLE table_16078390_2 ( founded INTEGER, team_nickname VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What year was the team named the Raiders established?
SELECT MAX(founded) FROM table_16078390_2 WHERE team_nickname = "Raiders"
sql_create_context
CREATE TABLE table_name_38 ( country VARCHAR, to_par VARCHAR, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What country has a to par larger than 5 and a player John Mahaffey?
SELECT country FROM table_name_38 WHERE to_par > 5 AND player = "john mahaffey"
sql_create_context
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.age < "54" AND procedures.icd9_code = "3142"
mimicsql_data
CREATE TABLE table_51805 ( "Round" real, "Player" text, "Position" text, "Nationality" text, "College/Junior/Club Team (League)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Tell me the position for round less than 3
SELECT "Position" FROM table_51805 WHERE "Round" < '3'
wikisql
CREATE TABLE table_name_18 ( year INTEGER, manufacturer VARCHAR, finish VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Smaller than 37, the highest year for Ford?
SELECT MAX(year) FROM table_name_18 WHERE manufacturer = "ford" AND finish < 37
sql_create_context
CREATE TABLE t_kc22 ( AMOUNT number, CHA_ITEM_LEV number, DATA_ID text, DIRE_TYPE number, DOSE_FORM text, DOSE_UNIT text, EACH_DOSAGE text, EXP_OCC_DATE time, FLX_MED_ORG_ID text, FXBZ number, HOSP_DOC_CD text, HOSP_DOC_NM text, MED_CLINIC_ID text, MED_DIRE_CD tex...
SELECT gwyjzb.IN_DIAG_DIS_NM, AVG(gwyjzb.PERSON_AGE) FROM gwyjzb WHERE gwyjzb.MED_SER_ORG_NO = '0907445' GROUP BY gwyjzb.IN_DIAG_DIS_NM UNION SELECT fgwyjzb.IN_DIAG_DIS_NM, AVG(fgwyjzb.PERSON_AGE) FROM fgwyjzb WHERE fgwyjzb.MED_SER_ORG_NO = '0907445' GROUP BY fgwyjzb.IN_DIAG_DIS_NM
css
CREATE TABLE table_36236 ( "Frequency" real, "Callsign" text, "Brand" text, "City of License" text, "Website" text, "Webcast" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which website includes a webcast of listen live, a frequency under 680, ...
SELECT "Website" FROM table_36236 WHERE "City of License" = 'san antonio' AND "Webcast" = 'listen live' AND "Frequency" = '680'
wikisql
CREATE TABLE table_57708 ( "Date" text, "Course" text, "Distance" text, "Type" text, "Winner" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who won the course Brescia?
SELECT "Winner" FROM table_57708 WHERE "Course" = 'brescia'
wikisql
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 ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender 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 = "Coagulat defect NEC/NOS" AND prescriptions.route = "IM"
mimicsql_data
CREATE TABLE table_204_820 ( id number, "date" text, "constituency" text, "c/u" text, "former incumbent" text, "winner" text, "cause" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- did charles william wyndham or the marquess of worcester cho...
SELECT "former incumbent" FROM table_204_820 WHERE "former incumbent" IN ('charles william wyndham', 'marquess of worcester') AND "cause" = 'chose to sit for bristol'
squall
CREATE TABLE table_35853 ( "Name" text, "Hanzi" text, "Hanyu Pinyin" text, "Population (2010-11-01)" text, "Area (km\u00b2)" text, "Density (/km\u00b2)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Hanzi for p ngf ng q ?
SELECT "Hanzi" FROM table_35853 WHERE "Hanyu Pinyin" = 'píngfáng qū'
wikisql
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime t...
SELECT COUNT(*) FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '003-34282')) AND lab.labname = 'esr' AND STRFTIME('%y-%m', lab.labresulttime) >= '2105-09'
eicu
CREATE TABLE table_39410 ( "Eviction No." real, "Nominee" text, "Vote to Save" text, "Vote to Evict" text, "Net vote" text, "Eviction result" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Vote to Evict has a Vote to Save of 21.22%?
SELECT "Vote to Evict" FROM table_39410 WHERE "Vote to Save" = '21.22%'
wikisql
CREATE TABLE table_name_67 ( position VARCHAR, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Jeremy Duchesne's position?
SELECT position FROM table_name_67 WHERE player = "jeremy duchesne"
sql_create_context
CREATE TABLE table_name_3 ( home_team VARCHAR, venue VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the score of the home team in the match at Western Oval?
SELECT home_team AS score FROM table_name_3 WHERE venue = "western oval"
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 medication.drugstarttime FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-103228' AND NOT patient.hospitaldischargetime IS NULL ORDE...
eicu
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 ACC_Road, Team_ID FROM basketball_match GROUP BY All_Home, ACC_Road ORDER BY ACC_Road DESC
nvbench
CREATE TABLE table_14058433_4 ( points_against VARCHAR, lost VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what's the points against with lost being 13
SELECT points_against FROM table_14058433_4 WHERE lost = "13"
sql_create_context
CREATE TABLE table_62765 ( "Frequency" text, "Call sign" text, "Format" text, "Owner" text, "Notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the format for the one which has a call sign of cite-fm-1?
SELECT "Format" FROM table_62765 WHERE "Call sign" = 'cite-fm-1'
wikisql
CREATE TABLE table_76696 ( "Position" text, "Team #1" text, "Agg." text, "Team #2" text, "1st leg" text, "2nd leg" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the 1st leg with a 4-3 agg.?
SELECT "1st leg" FROM table_76696 WHERE "Agg." = '4-3'
wikisql
CREATE TABLE table_75697 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What week was the game on September 12, 1982 with an attendance greater than 51,999?
SELECT SUM("Week") FROM table_75697 WHERE "Attendance" > '51,999' AND "Date" = 'september 12, 1982'
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 ACC_Regular_Season, ACC_Percent FROM basketball_match ORDER BY ACC_Regular_Season DESC
nvbench
CREATE TABLE offering_instructor ( offering_instructor_id int, offering_id int, instructor_id int ) CREATE TABLE program_course ( program_id int, course_id int, workload int, category varchar ) CREATE TABLE instructor ( instructor_id int, name varchar, uniqname varchar ) CREAT...
SELECT COUNT(*) = 0 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_offering.friday = ...
advising
CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost numb...
SELECT COUNT(DISTINCT t2.subject_id) FROM (SELECT t1.subject_id, t1.charttime 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_icd_diagnoses WHERE d_icd_di...
mimic_iii
CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, ...
SELECT TOP(10) AS ViewCount, Id AS "post_link" FROM Posts ORDER BY ViewCount DESC
sede
CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number ) CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number...
SELECT p.Id AS "post_link", p.CreationDate, p.Score, p.ViewCount, p.ClosedDate FROM Posts AS p WHERE p.PostTypeId = 1 AND MONTH(p.CreationDate) = MONTH(CURRENT_TIMESTAMP()) - 1 AND YEAR(p.CreationDate) = YEAR(CURRENT_TIMESTAMP()) ORDER BY p.Score DESC
sede
CREATE TABLE exhibition ( exhibition_id VARCHAR, ticket_price VARCHAR ) CREATE TABLE exhibition_record ( exhibition_id VARCHAR, attendance VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many exhibitions have a attendance more than 100 or have a ...
SELECT COUNT(*) FROM exhibition_record AS T1 JOIN exhibition AS T2 ON T1.exhibition_id = T2.exhibition_id WHERE T1.attendance > 100 OR T2.ticket_price < 10
sql_create_context
CREATE TABLE table_name_42 ( result VARCHAR, game VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the result of game 3?
SELECT result FROM table_name_42 WHERE game = "game 3"
sql_create_context
CREATE TABLE table_name_49 ( population INTEGER, type VARCHAR, region VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many people have a vl type in a region greater than 3?
SELECT SUM(population) FROM table_name_49 WHERE type = "vl" AND region > 3
sql_create_context
CREATE TABLE table_name_41 ( pos VARCHAR, laps VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What position did lap 296 come in?
SELECT pos FROM table_name_41 WHERE laps = 296
sql_create_context
CREATE TABLE EMPLOYEE ( EMP_NUM int, EMP_LNAME varchar(15), EMP_FNAME varchar(12), EMP_INITIAL varchar(1), EMP_JOBCODE varchar(5), EMP_HIREDATE datetime, EMP_DOB datetime ) CREATE TABLE STUDENT ( STU_NUM int, STU_LNAME varchar(15), STU_FNAME varchar(15), STU_INIT varchar(1),...
SELECT SCHOOL_CODE, COUNT(*) FROM DEPARTMENT AS T1 JOIN PROFESSOR AS T2 ON T1.DEPT_CODE = T2.DEPT_CODE GROUP BY T1.SCHOOL_CODE ORDER BY COUNT(*)
nvbench
CREATE TABLE table_51886 ( "Position" real, "Club" text, "Played" real, "Points" real, "Wins" real, "Draws" real, "Losses" real, "Goals for" real, "Goals against" real, "Goal Difference" real ) -- Using valid SQLite, answer the following questions for the tables provided above....
SELECT MIN("Goal Difference") FROM table_51886 WHERE "Goals against" = '61' AND "Draws" < '11'
wikisql
CREATE TABLE table_52549 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the name of the home team that played Ca...
SELECT "Home team" FROM table_52549 WHERE "Away team" = 'carlton'
wikisql
CREATE TABLE table_14319023_2 ( boys_doubles VARCHAR, girls_doubles VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When the girls doubles is ayu pratiwi anggi widia what is the boys doubles?
SELECT boys_doubles FROM table_14319023_2 WHERE girls_doubles = "Ayu Pratiwi Anggi Widia"
sql_create_context
CREATE TABLE table_16080 ( "Round" real, "Choice" real, "Overall" real, "Player name" text, "Position" text, "College" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What college did Bill Cappleman go to?
SELECT "College" FROM table_16080 WHERE "Player name" = 'Bill Cappleman'
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 jyjgzbb.JCRGH, jyjgzbb.JCRXM FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN hz_info_mzjzjlb ON hz_info.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND hz_info_mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyj...
css
CREATE TABLE table_23580 ( "Title" text, "Author" text, "Reader" text, "Format" text, "Company" text, "Release Date" text, "Notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many companies released an audiobook titled deadly download...
SELECT COUNT("Company") FROM table_23580 WHERE "Title" = 'Deadly Download'
wikisql
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 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 < "2184" AND lab.fluid = "Joint Fluid"
mimicsql_data
CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code te...
SELECT t3.drug FROM (SELECT t2.drug, 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_icd_diagnoses WHERE ...
mimic_iii
CREATE TABLE table_48053 ( "Rider" text, "Manufacturer" text, "Laps" real, "Time" text, "Grid" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average Grid for the Rider Toni Elias with Laps more than 30?
SELECT AVG("Grid") FROM table_48053 WHERE "Rider" = 'toni elias' AND "Laps" > '30'
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 t.TagName, COUNT(DISTINCT questions.Id) AS "numquestions", COUNT(*) AS "numanswers", SUM(CASE WHEN questions.AcceptedAnswerId = answers.Id THEN 1 ELSE 0 END) AS "numaccepted", SUM(CASE WHEN questions.AcceptedAnswerId = answers.Id THEN 1 ELSE 0 END) * 100.0 / COUNT(DISTINCT questions.Id) AS "acceptedpercent" FROM...
sede
CREATE TABLE table_name_54 ( title VARCHAR, character VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the title of the TV series with a character of Sheyda/Ashraf?
SELECT title FROM table_name_54 WHERE character = "sheyda/ashraf"
sql_create_context
CREATE TABLE Shops ( Shop_ID INTEGER, Shop_Details VARCHAR(255) ) CREATE TABLE Street_Markets ( Market_ID INTEGER, Market_Details VARCHAR(255) ) CREATE TABLE Visitors ( Tourist_ID INTEGER, Tourist_Details VARCHAR(255) ) CREATE TABLE Tourist_Attractions ( Tourist_Attraction_ID INTEGER, ...
SELECT Visit_Date, COUNT(Visit_Date) FROM Visits ORDER BY Visit_Date DESC
nvbench
CREATE TABLE table_27887723_1 ( winner VARCHAR, location VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- who was the winner for souderton, pa?
SELECT winner FROM table_27887723_1 WHERE location = "Souderton, PA"
sql_create_context
CREATE TABLE jyjgzbb ( BGDH text, BGRQ time, CKZFWDX text, CKZFWSX number, CKZFWXX number, JCFF text, JCRGH text, JCRXM text, JCXMMC text, JCZBDM text, JCZBJGDL number, JCZBJGDW text, JCZBJGDX text, JCZBMC text, JLDW text, JYRQ time, JYZBLSH text, ...
SELECT jyjgzbb.JYZBLSH FROM 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 AND jybgb.YLJGDM = ...
css
CREATE TABLE table_80264 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" real, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the opponent at the game when the record was 28 45?
SELECT "Opponent" FROM table_80264 WHERE "Record" = '28–45'
wikisql
CREATE TABLE table_26919_7 ( akkadian VARCHAR, geez VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- if the geez is libb, what is the akkadian?
SELECT akkadian FROM table_26919_7 WHERE geez = "libb"
sql_create_context
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.diagnosis = "AORTIC VALVE INSUFFIENCY\AORTIC VALVE REPLACEMENT /SDA" AND procedures.short_title = "Other skin & subq i & d"
mimicsql_data
CREATE TABLE table_19643196_1 ( year VARCHAR, transmission VARCHAR, engine VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which year had a transmission of Voith D863.4 and a Cummins ISM engine?
SELECT year FROM table_19643196_1 WHERE transmission = "Voith D863.4" AND engine = "Cummins ISM"
sql_create_context
CREATE TABLE table_72158 ( "No." real, "Date" text, "Tournament" text, "Winning score" text, "To par" text, "Margin of victory" text, "Runner(s)-up" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What date were the runner ups pat hurst juli ...
SELECT "Date" FROM table_72158 WHERE "Runner(s)-up" = 'Pat Hurst Juli Inkster'
wikisql
CREATE TABLE table_77355 ( "Name" text, "Birth" text, "Marriage" text, "Became Dauphine" text, "Ceased to be Dauphine" text, "Death" text, "Husband" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- when was the death of the person with husband...
SELECT "Death" FROM table_77355 WHERE "Husband" = 'charles, 1st dauphin'
wikisql
CREATE TABLE student_record ( student_id int, course_id int, semester int, grade varchar, how varchar, transfer_source varchar, earn_credit varchar, repeat_term varchar, test_id varchar ) CREATE TABLE ta ( campus_job_id int, student_id int, location varchar ) CREATE TAB...
SELECT DISTINCT name, number FROM course WHERE credits = 10 AND department = 'EECS'
advising
CREATE TABLE Stay ( StayID INTEGER, Patient INTEGER, Room INTEGER, StayStart DATETIME, StayEnd DATETIME ) CREATE TABLE Procedures ( Code INTEGER, Name VARCHAR(30), Cost REAL ) CREATE TABLE Affiliated_With ( Physician INTEGER, Department INTEGER, PrimaryAffiliation BOOLEAN )...
SELECT T1.Name, COUNT(T1.Name) FROM Physician AS T1 JOIN Trained_In AS T2 ON T1.EmployeeID = T2.Physician JOIN Procedures AS T3 ON T3.Code = T2.Treatment WHERE T3.Cost > 5000 GROUP BY T1.Name ORDER BY COUNT(T1.Name)
nvbench
CREATE TABLE table_48315 ( "Wicket" text, "Runs" text, "Batsmen" text, "Opponent" text, "Venue" text, "Season" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What season did they play queensland at wicket 4?
SELECT "Season" FROM table_48315 WHERE "Opponent" = 'queensland' AND "Wicket" = '4'
wikisql
CREATE TABLE table_name_31 ( time VARCHAR, home VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Time with a Home that is high park demons?
SELECT time FROM table_name_31 WHERE home = "high park demons"
sql_create_context
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 * 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 AND jybgb.YLJGDM = jyjgzbb.YLJGDM...
css
CREATE TABLE table_name_24 ( production_number VARCHAR, director VARCHAR, title VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the production number for the episode directed by Robert McKimson named Mice Follies?
SELECT COUNT(production_number) FROM table_name_24 WHERE director = "robert mckimson" AND title = "mice follies"
sql_create_context
CREATE TABLE table_32308 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many people were in the crowd when the away ...
SELECT "Crowd" FROM table_32308 WHERE "Away team score" = '9.12 (66)'
wikisql
CREATE TABLE table_204_740 ( id number, "pos" text, "no" number, "driver" text, "constructor" text, "laps" number, "time/retired" text, "grid" number, "points" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many drivers ended t...
SELECT COUNT("driver") FROM table_204_740 WHERE "time/retired" = 'engine'
squall
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_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.t_kc21_PERSON_ID = '63491444' AND NOT t_kc22.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT <= 3235.03)
css
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE medication ( med...
SELECT DISTINCT t1.c1 FROM (SELECT lab.labresult, PERCENT_RANK() OVER (ORDER BY lab.labresult) AS c1 FROM lab WHERE lab.labname = 'chloride' AND lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.age = (SELECT patient.age FROM patient WHERE patient.uniquepid = '021-111547' AND patient...
eicu
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 COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_type = "EMERGENCY" AND procedures.long_title = "Initial insertion of dual-chamber device"
mimicsql_data
CREATE TABLE flight_leg ( flight_id int, leg_number int, leg_flight int ) CREATE TABLE date_day ( month_number int, day_number int, year int, day_name varchar ) CREATE TABLE airport_service ( city_code varchar, airport_code varchar, miles_distant int, direction varchar, ...
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 = 'PHILADELPHIA' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'O...
atis
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 jyjgzbb.YQBH, jyjgzbb.YQMC FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN jybgb_jyjgzbb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jybgb_jyjgzbb.YLJGDM AN...
css
CREATE TABLE table_79054 ( "Name" text, "Type" text, "Height of ground station(m)" real, "Height of mountain station(m)" real, "Construction year" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How much Height of ground station(m) has a Name of lute...
SELECT COUNT("Height of ground station(m)") FROM table_79054 WHERE "Name" = 'lutersee' AND "Height of mountain station(m)" > '2398'
wikisql
CREATE TABLE Tags ( Id number, TagName text, Count number, ExcerptPostId number, WikiPostId number ) CREATE TABLE PostFeedback ( Id number, PostId number, IsAnonymous boolean, VoteTypeId number, CreationDate time ) CREATE TABLE VoteTypes ( Id number, Name text ) CREATE...
SELECT * FROM Users
sede
CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) 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), SALARY decimal(8,2), CO...
SELECT JOB_ID, COUNT(JOB_ID) FROM employees WHERE HIRE_DATE < '2002-06-21' GROUP BY JOB_ID ORDER BY COUNT(JOB_ID)
nvbench
CREATE TABLE t_kc24 ( ACCOUNT_DASH_DATE time, ACCOUNT_DASH_FLG number, CASH_PAY number, CIVIL_SUBSIDY number, CKC102 number, CLINIC_ID text, CLINIC_SLT_DATE time, COMP_ID text, COM_ACC_PAY number, COM_PAY number, DATA_ID text, ENT_ACC_PAY number, ENT_PAY number, F...
SELECT * FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '6264917' AND t_kc21.IN_HOSP_DATE BETWEEN '2001-05-03' AND '2011-04-15' EXCEPT SELECT * FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '6264917' AND t_kc21.IN_HOSP_DATE BETWEEN '2001-05-03' AND '2011-04-15' AND t_kc21.REMOTE_SETTLE_FLG = '异地1' OR t_kc21.REMOTE_SETTLE_FLG = ...
css
CREATE TABLE table_38293 ( "Pos." real, "Car #" real, "Driver" text, "Make" text, "Team" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Pos has a Car # of 33?
SELECT SUM("Pos.") FROM table_38293 WHERE "Car #" = '33'
wikisql
CREATE TABLE table_7060 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Leading scorer" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What date was the game played with the Cavaliers at home and the Warriors visiting?
SELECT "Date" FROM table_7060 WHERE "Home" = 'cavaliers' AND "Visitor" = 'warriors'
wikisql
CREATE TABLE table_11286 ( "Driver" text, "Constructor" text, "Laps" real, "Time/Retired" text, "Grid" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which constructor has a Grid smaller than 18, and a Driver of mika h kkinen?
SELECT "Constructor" FROM table_11286 WHERE "Grid" < '18' AND "Driver" = 'mika häkkinen'
wikisql
CREATE TABLE table_test_32 ( "id" int, "anemia" bool, "symptomatic_disease" bool, "language" string, "deceased" bool, "abdominal_pain" bool, "fever" bool, "arthralgia" bool, "unable_provide_consent" bool, "headache" bool, "myalgia" bool, "rash" bool, "thrombocytopenia...
SELECT * FROM table_test_32 WHERE fever = 1 OR (CASE WHEN headache = 1 THEN 1 ELSE 0 END + CASE WHEN rash = 1 THEN 1 ELSE 0 END + CASE WHEN myalgia = 1 THEN 1 ELSE 0 END + CASE WHEN arthralgia = 1 THEN 1 ELSE 0 END + CASE WHEN abdominal_pain = 1 THEN 1 ELSE 0 END + CASE WHEN hemorrhage = 1 THEN 1 ELSE 0 END + CASE WHEN...
criteria2sql
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_Games, School_ID FROM basketball_match ORDER BY School_ID DESC
nvbench
CREATE TABLE customer_orders ( order_id number, customer_id number, order_status_code text, order_date time ) CREATE TABLE customers ( customer_id number, payment_method_code text, customer_code text, customer_name text, customer_address text, customer_phone text, customer_e...
SELECT DISTINCT T1.customer_name FROM customers AS T1 JOIN customer_orders AS T2 ON T1.customer_id = T2.customer_id JOIN order_items AS T3 ON T2.order_id = T3.order_id JOIN products AS T4 ON T3.product_id = T4.product_id WHERE T4.product_name = "keyboard"
spider
CREATE TABLE Engineer_Visits ( contact_staff_id VARCHAR ) CREATE TABLE Fault_Log ( recorded_by_staff_id VARCHAR ) CREATE TABLE Staff ( staff_name VARCHAR, staff_id VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the name and id of the staff ...
SELECT T1.staff_name, T1.staff_id FROM Staff AS T1 JOIN Fault_Log AS T2 ON T1.staff_id = T2.recorded_by_staff_id EXCEPT SELECT T3.staff_name, T3.staff_id FROM Staff AS T3 JOIN Engineer_Visits AS T4 ON T3.staff_id = T4.contact_staff_id
sql_create_context
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_location = "TRSF WITHIN THIS FACILITY" AND lab.itemid = "51181"
mimicsql_data
CREATE TABLE table_203_620 ( id number, "tie no" number, "home team" text, "score" text, "away team" text, "attendance" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the number of spectators in attendance in the hull city vs. oldham a...
SELECT "attendance" FROM table_203_620 WHERE "away team" = 'oldham athletic'
squall
CREATE TABLE grapes ( ID INTEGER, Grape TEXT, Color TEXT ) CREATE TABLE appellations ( No INTEGER, Appelation TEXT, County TEXT, State TEXT, Area TEXT, isAVA TEXT ) CREATE TABLE wine ( No INTEGER, Grape TEXT, Winery TEXT, Appelation TEXT, State TEXT, Name TE...
SELECT Year, AVG(Price) FROM wine GROUP BY Year ORDER BY Year DESC
nvbench
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 COUNT(*) FROM hz_info JOIN txmzjzjlb ON hz_info.YLJGDM = txmzjzjlb.YLJGDM AND hz_info.KH = txmzjzjlb.KH AND hz_info.KLX = txmzjzjlb.KLX WHERE hz_info.RYBH = '34728428' AND txmzjzjlb.JZKSRQ BETWEEN '2008-08-30' AND '2013-04-07' AND txmzjzjlb.YLJGDM = '9353416' UNION SELECT COUNT(*) FROM hz_info JOIN ftxmzjzjlb ON...
css
CREATE TABLE table_34586 ( "Date" text, "Tournament" text, "Location" text, "Winner" text, "Score" text, "Winner's share ( $ )" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the winners share ($) that has atlanta classic as the tourname...
SELECT "Winner's share ( $ )" FROM table_34586 WHERE "Tournament" = 'atlanta classic'
wikisql
CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartr...
SELECT t1.treatmentname FROM (SELECT treatment.treatmentname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.age >= 60) AND DATETIME(treatment.treatmenttime) <= DATETIME(CURRENT_TIME(), '-1 year') GROUP BY...
eicu
CREATE TABLE table_73176 ( "Conventional" text, "Sarikoli (in IPA )" text, "Uyghur ( K\u0322ona Yezik\u0322 )" text, "Uyghur ( Yen\u0261i Yezik\u0322 )" text, "Chinese" text, "Pinyin" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the pinyi...
SELECT "Pinyin" FROM table_73176 WHERE "Conventional" = 'Mazar'
wikisql
CREATE TABLE entrepreneur ( entrepreneur_id number, people_id number, company text, money_requested number, investor text ) CREATE TABLE people ( people_id number, name text, height number, weight number, date_of_birth text ) -- Using valid SQLite, answer the following questio...
SELECT T2.name FROM entrepreneur AS T1 JOIN people AS T2 ON T1.people_id = T2.people_id ORDER BY T2.weight DESC LIMIT 1
spider
CREATE TABLE Museums ( Museum_ID INTEGER, Museum_Details VARCHAR(255) ) CREATE TABLE Features ( Feature_ID INTEGER, Feature_Details VARCHAR(255) ) CREATE TABLE Shops ( Shop_ID INTEGER, Shop_Details VARCHAR(255) ) CREATE TABLE Visits ( Visit_ID INTEGER, Tourist_Attraction_ID INTEGER, ...
SELECT T1.Name, T1.Tourist_Attraction_ID FROM Tourist_Attractions AS T1 JOIN Visits AS T2 ON T1.Tourist_Attraction_ID = T2.Tourist_Attraction_ID
nvbench
CREATE TABLE table_name_75 ( bronze INTEGER, total VARCHAR, nation VARCHAR, silver VARCHAR, rank VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the leowest number of Bronze medals for Jamaica who ranked less than 4 and had more than 0 sil...
SELECT MIN(bronze) FROM table_name_75 WHERE silver > 0 AND rank < 4 AND nation = "jamaica" AND total < 22
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 demographic.dob, demographic.gender FROM demographic WHERE demographic.subject_id = "87275"
mimicsql_data
CREATE TABLE table_14945 ( "Code Name" text, "Function (figure)" text, "Real Name" text, "Birthplace" text, "Serial number" text, "Primary military speciality" text, "Secondary military speciality" text ) -- Using valid SQLite, answer the following questions for the tables provided above. ...
SELECT "Function (figure)" FROM table_14945 WHERE "Serial number" = 'af 934103'
wikisql
CREATE TABLE table_name_32 ( tuner VARCHAR, model VARCHAR, type VARCHAR, digital VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- I want the tuner for hybrid video recorder and Digital of dvb-t (zl10353), and a Model of hvr-900
SELECT tuner FROM table_name_32 WHERE type = "hybrid video recorder" AND digital = "dvb-t (zl10353)" AND model = "hvr-900"
sql_create_context
CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(40), POSTAL_CODE varchar(12), CITY varchar(30), STATE_PROVINCE varchar(25), COUNTRY_ID varchar(2) ) CREATE TABLE departments ( DEPARTME...
SELECT HIRE_DATE, DEPARTMENT_ID FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' ORDER BY HIRE_DATE
nvbench
CREATE TABLE table_name_97 ( podiums VARCHAR, races_† VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the number of podiums for the races of 13/15?
SELECT podiums FROM table_name_97 WHERE races_† = "13/15"
sql_create_context
CREATE TABLE table_18462 ( "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. -- Name the candidates for south carolina 3
SELECT "Candidates" FROM table_18462 WHERE "District" = 'South Carolina 3'
wikisql
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, h...
SELECT microlab.organism FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-1337')) AND microlab.culturesite = 'urine, catheter specimen' AND DAT...
eicu
CREATE TABLE table_22546460_4 ( best_female_artist VARCHAR, best_female_lyricist VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What won the Best Female Artist if People's Male MC won the Best Female Lyricist?
SELECT best_female_artist FROM table_22546460_4 WHERE best_female_lyricist = "People's Male MC"
sql_create_context
CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_ID decimal(4,0) ) CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varchar(20), LAST_NAME varchar(25), EMAIL varchar(25), PHONE_NUMBER varchar(20), ...
SELECT HIRE_DATE, SUM(DEPARTMENT_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40
nvbench
CREATE TABLE Documents_with_expenses ( budget_type_code VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Show budget type codes and the number of documents in each budget type.
SELECT budget_type_code, COUNT(*) FROM Documents_with_expenses GROUP BY budget_type_code
sql_create_context
CREATE TABLE table_8930 ( "Year" real, "Date" text, "Winner" text, "Result" text, "Location" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Result, when Year is 1948, and when Date is November 7?
SELECT "Result" FROM table_8930 WHERE "Year" = '1948' AND "Date" = 'november 7'
wikisql