instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE table_41072 ( "Player" text, "Matches" real, "Innings" real, "Not Out" real, "Runs" real, "High Score" text, "Average" text, "Strike Rate" text, "100s" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many average 100s...
SELECT AVG("100s") FROM table_41072 WHERE "Player" = 'tim bresnan'
wikisql
CREATE TABLE table_57172 ( "Tournament" text, "Wins" real, "Top-5" real, "Top-10" real, "Top-25" real, "Events" real, "Cuts made" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many cuts were made when there weren't any wins but had a to...
SELECT SUM("Cuts made") FROM table_57172 WHERE "Wins" < '1' AND "Top-5" = '1' AND "Top-10" > '4'
wikisql
CREATE TABLE employee ( eid number(9,0), name varchar2(30), salary number(10,2) ) CREATE TABLE certificate ( eid number(9,0), aid number(9,0) ) CREATE TABLE aircraft ( aid number(9,0), name varchar2(30), distance number(6,0) ) CREATE TABLE flight ( flno number(4,0), origin var...
SELECT destination, COUNT(*) FROM flight GROUP BY destination ORDER BY destination DESC
nvbench
CREATE TABLE qtb ( CLINIC_ID text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, INSU_TYPE text, IN...
SELECT COUNT(*) FROM qtb JOIN t_kc22 ON qtb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE qtb.PERSON_NM = '蒋阳飙' AND t_kc22.STA_DATE BETWEEN '2011-10-14' AND '2020-11-19' 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.PERSON_NM = '蒋阳...
css
CREATE TABLE table_name_22 ( fcsl_team VARCHAR, mlb_team VARCHAR, round VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the FCSL Team when the MLB Team is Toronto Blue Jays, in the 4th round?
SELECT fcsl_team FROM table_name_22 WHERE mlb_team = "toronto blue jays" AND round = "4th"
sql_create_context
CREATE TABLE table_name_71 ( other_mozilla VARCHAR, safari VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the other mozilla that has 9.41% for the safari?
SELECT other_mozilla FROM table_name_71 WHERE safari = "9.41%"
sql_create_context
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) 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, ...
SELECT jyjgzbb.JCRGH, jyjgzbb.JCRXM 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 jy...
css
CREATE TABLE Ref_Budget_Codes ( Budget_Type_Code CHAR(15), Budget_Type_Description VARCHAR(255) ) CREATE TABLE Documents_with_Expenses ( Document_ID INTEGER, Budget_Type_Code CHAR(15), Document_Details VARCHAR(255) ) CREATE TABLE Ref_Document_Types ( Document_Type_Code CHAR(15), Document_T...
SELECT Document_Date, COUNT(Document_Date) FROM Documents AS T1 JOIN Projects AS T2 ON T1.Project_ID = T2.Project_ID WHERE T2.Project_Details = 'Graph Database project' GROUP BY Document_Name
nvbench
CREATE TABLE country ( Country_ID int, Name text, Population int, Area int, Languages text ) CREATE TABLE roller_coaster ( Roller_Coaster_ID int, Name text, Park text, Country_ID int, Length real, Height real, Speed text, Opened text, Status text ) -- Using val...
SELECT T1.Name, AVG(T2.Speed) FROM country AS T1 JOIN roller_coaster AS T2 ON T1.Country_ID = T2.Country_ID GROUP BY T1.Name ORDER BY T1.Name
nvbench
CREATE TABLE diagnoses ( 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 procedures ( ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.ethnicity = "WHITE" AND procedures.short_title = "Remov biliary/liver tube"
mimicsql_data
CREATE TABLE table_2371 ( "Rd." real, "Race Title" text, "Circuit" text, "City / State" text, "Date" text, "Winner" text, "Team" text, "Report" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What dates was the falken tasmania challenge r...
SELECT "Date" FROM table_2371 WHERE "Team" = 'Triple Eight Race Engineering' AND "Race Title" = 'Falken Tasmania Challenge'
wikisql
CREATE TABLE table_21994 ( "Spaceport" text, "Launch complex" text, "Launcher" text, "Spacecraft" text, "Flights" text, "Years" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What years had 134 orbital flights?
SELECT "Years" FROM table_21994 WHERE "Flights" = '134 Orbital'
wikisql
CREATE TABLE table_name_55 ( week VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which week starts on November 23, 1997?
SELECT week FROM table_name_55 WHERE date = "november 23, 1997"
sql_create_context
CREATE TABLE purchases ( purchase_transaction_id number, purchase_details text ) CREATE TABLE ref_transaction_types ( transaction_type_code text, transaction_type_description text ) CREATE TABLE sales ( sales_transaction_id number, sales_details text ) CREATE TABLE investors ( investor_id...
SELECT transaction_type_code FROM transactions GROUP BY transaction_type_code ORDER BY COUNT(*) DESC LIMIT 1
spider
CREATE TABLE table_53747 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Decision" text, "Attendance" real, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the record on October 24?
SELECT "Record" FROM table_53747 WHERE "Date" = 'october 24'
wikisql
CREATE TABLE table_26267607_2 ( winning_team VARCHAR, round VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- In Round 6, who is the winning team?
SELECT winning_team FROM table_26267607_2 WHERE round = "6"
sql_create_context
CREATE TABLE table_26263 ( "Party" text, "Week 32" text, "Week 33" text, "Week 34" text, "Week 35" text, "Week 36" text, "Week 37" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- List all week 37 results when week 33 is 14.3%.
SELECT "Week 37" FROM table_26263 WHERE "Week 33" = '14.3%'
wikisql
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 procedures.short_title, procedures.long_title FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.name = "Heather Vineyard"
mimicsql_data
CREATE TABLE table_name_95 ( avg_g INTEGER, gain VARCHAR, loss VARCHAR, name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the sum of Avg/G for Dan Dierking when the Loss is 0 and the Gain is more than 34?
SELECT SUM(avg_g) FROM table_name_95 WHERE loss = 0 AND name = "dan dierking" AND gain > 34
sql_create_context
CREATE TABLE table_37331 ( "Unit" text, "Russian" text, "Translation" text, "Ratio" real, "Metric value" text, "Avoirdupois value" text, "Ordinary value" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What ordinary value has a metric value o...
SELECT "Ordinary value" FROM table_37331 WHERE "Metric value" = '29.861 g'
wikisql
CREATE TABLE table_27684 ( "Casinos" real, "County" text, "Road" text, "1-Jul-08" real, "FY07 $millions" text, "FY08 $millions" text, "FY09 $millions" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many casinos are associated with a July...
SELECT "Casinos" FROM table_27684 WHERE "1-Jul-08" = '1865746'
wikisql
CREATE TABLE table_25558 ( "Engine" text, "Crankshaft" text, "Ignition timing" text, "Graphical" text, "Example" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When 1985-2007 yamaha v-max honda vfr800 is the example what is the engine is it?
SELECT "Engine" FROM table_25558 WHERE "Example" = '1985-2007 Yamaha V-Max Honda VFR800'
wikisql
CREATE TABLE table_name_4 ( centennial VARCHAR, altadeña VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Centennial has a Altade a of panthers?
SELECT centennial FROM table_name_4 WHERE altadeña = "panthers"
sql_create_context
CREATE TABLE manufacturers ( revenue INTEGER, Headquarter VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total revenue of all companies whose main office is at Tokyo or Taiwan?
SELECT SUM(revenue) FROM manufacturers WHERE Headquarter = 'Tokyo' OR Headquarter = 'Taiwan'
sql_create_context
CREATE TABLE table_35201 ( "Year" real, "Class" text, "Team" text, "Points" real, "Wins" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What are the sum of points in 1989 with 0 wins?
SELECT SUM("Points") FROM table_35201 WHERE "Wins" = '0' AND "Year" = '1989'
wikisql
CREATE TABLE journal_committee ( Editor_ID int, Journal_ID int, Work_Type text ) CREATE TABLE editor ( Editor_ID int, Name text, Age real ) CREATE TABLE journal ( Journal_ID int, Date text, Theme text, Sales int ) -- Using valid SQLite, answer the following questions for the ...
SELECT Name, Age FROM editor ORDER BY Name DESC
nvbench
CREATE TABLE table_78305 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Week has a Result of w 24-0, and an Attendance smaller than 10,000?
SELECT MAX("Week") FROM table_78305 WHERE "Result" = 'w 24-0' AND "Attendance" < '10,000'
wikisql
CREATE TABLE table_name_96 ( winning_score VARCHAR, runner_s__up VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the Winning Score when Betsy Rawls was the Runner(s)-up?
SELECT winning_score FROM table_name_96 WHERE runner_s__up = "betsy rawls"
sql_create_context
CREATE TABLE table_204_132 ( id number, "year" number, "location" text, "men's individual" text, "women's individual" text, "men's team" text, "women's team" text, "mixed team" text, "ref" number ) -- Using valid SQLite, answer the following questions for the tables provided above....
SELECT COUNT(*) FROM table_204_132 WHERE "location" = 'madrid'
squall
CREATE TABLE qtb ( CLINIC_ID text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, INSU_TYPE text, IN...
SELECT AVG(t_kc24.MED_AMOUT) FROM t_kc24 WHERE t_kc24.MED_CLINIC_ID IN (SELECT qtb.MED_CLINIC_ID FROM qtb WHERE qtb.PERSON_AGE < 15 UNION SELECT gyb.MED_CLINIC_ID FROM gyb WHERE gyb.PERSON_AGE < 15 UNION SELECT zyb.MED_CLINIC_ID FROM zyb WHERE zyb.PERSON_AGE < 15 UNION SELECT mzb.MED_CLINIC_ID FROM mzb WHERE mzb.PERSON...
css
CREATE TABLE table_49995 ( "Tournament" text, "1980" text, "1981" text, "1982" text, "1983" text, "1984" text, "1985" text, "1986" text, "1987" text, "Career SR" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the 1980 val...
SELECT "1980" FROM table_49995 WHERE "1984" = '1r' AND "1981" = '1r'
wikisql
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 SUM(t_kc21.MED_AMOUT) FROM t_kc21 WHERE t_kc21.PERSON_NM = '许斌斌' AND t_kc21.CLINIC_TYPE = '门诊'
css
CREATE TABLE table_204_643 ( id number, "release" number, "artist" text, "title" text, "notes" text, "album" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- which title has the same notes as night with a sky full of stars ?
SELECT "title" FROM table_204_643 WHERE "title" <> 'manten no hoshi no yoru (満天の星の夜 night with a sky full of stars?)' AND "notes" = (SELECT "notes" FROM table_204_643 WHERE "title" = 'manten no hoshi no yoru (満天の星の夜 night with a sky full of stars?)')
squall
CREATE TABLE table_44873 ( "Year" real, "Country" text, "Course" text, "Location" text, "Total score" text, "To par [a ]" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total score for the year 2012?
SELECT "Total score" FROM table_44873 WHERE "Year" = '2012'
wikisql
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 t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.IN_DIAG_DIS_CD = 'B00.463'
css
CREATE TABLE table_name_32 ( third VARCHAR, discipline VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was third at the 0.8km f sprint discipline?
SELECT third FROM table_name_32 WHERE discipline = "0.8km f sprint"
sql_create_context
CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDat...
SELECT 'language' = 'Python', t.TagName, 'posts' = COUNT(pt.PostId) FROM Tags AS t JOIN PostTags AS pt ON t.Id = pt.TagId WHERE t.TagName LIKE 'python-_._' GROUP BY t.TagName UNION ALL SELECT 'Java', t.TagName, COUNT(pt.PostId) FROM Tags AS t JOIN PostTags AS pt ON t.Id = pt.TagId WHERE TagName LIKE 'java-_' OR TagName...
sede
CREATE TABLE table_name_82 ( score VARCHAR, country VARCHAR, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was Fuzzy Zoeller's score in the United States?
SELECT score FROM table_name_82 WHERE country = "united states" AND player = "fuzzy zoeller"
sql_create_context
CREATE TABLE table_49773 ( "Game" real, "Date" text, "Opponent" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location/Attendance" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Wh...
SELECT "High rebounds" FROM table_49773 WHERE "High points" = 'douglas (23)'
wikisql
CREATE TABLE table_23050383_1 ( education VARCHAR, country VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the education in Nepal?
SELECT education FROM table_23050383_1 WHERE country = "Nepal"
sql_create_context
CREATE TABLE table_name_93 ( authority VARCHAR, name VARCHAR, gender VARCHAR, area VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- In the tkkm o manawatu coed school in kelvin grove, what is the Authority listed/
SELECT authority FROM table_name_93 WHERE gender = "coed" AND area = "kelvin grove" AND name = "tkkm o manawatu"
sql_create_context
CREATE TABLE table_17358515_1 ( won INTEGER, goals_for VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many games did the team who scored 60 goals win?
SELECT MIN(won) FROM table_17358515_1 WHERE goals_for = 60
sql_create_context
CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE ReviewTaskResultTypes ( Id number, Name text, Description text ) CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number,...
SELECT Id, Id AS "post_link" FROM Posts WHERE PostTypeId = 1 AND NOT ClosedDate IS NULL ORDER BY Id DESC LIMIT 100
sede
CREATE TABLE table_61588 ( "Province, Community" text, "Contestant" text, "Height" text, "Hometown" text, "Geographical Regions" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Andrea Suarez Lazaro's height?
SELECT "Height" FROM table_61588 WHERE "Contestant" = 'andrea suarez lazaro'
wikisql
CREATE TABLE table_55745 ( "Name" text, "Country" text, "Type" text, "Moving from" text, "Transfer window" text, "Transfer fee" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the transfer fee with a transfer window of summer for schollen
SELECT "Transfer fee" FROM table_55745 WHERE "Transfer window" = 'summer' AND "Name" = 'schollen'
wikisql
CREATE TABLE table_32746 ( "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. -- Where was the game held where Hawthorn was the a...
SELECT "Venue" FROM table_32746 WHERE "Away team" = 'hawthorn'
wikisql
CREATE TABLE Student_Course_Enrolment ( registration_id INTEGER, student_id INTEGER, course_id INTEGER, date_of_enrolment DATETIME, date_of_completion DATETIME ) CREATE TABLE Subjects ( subject_id INTEGER, subject_name VARCHAR(120) ) CREATE TABLE Course_Authors_and_Tutors ( author_id I...
SELECT date_test_taken, COUNT(date_test_taken) FROM Student_Tests_Taken WHERE test_result = "Pass" GROUP BY date_test_taken ORDER BY date_test_taken
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 WHERE demographic.diagnosis = "BRAIN MASS;INTRACRANIAL HEMORRHAGE"
mimicsql_data
CREATE TABLE student ( student_id int, lastname varchar, firstname varchar, program_id int, declare_major varchar, total_credit int, total_gpa float, entered_as varchar, admit_term int, predicted_graduation_semester int, degree varchar, minor varchar, internship varch...
SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester WHERE course.department = 'JUDAIC' AND semester.semester = 'Winter'
advising
CREATE TABLE table_203_550 ( id number, "name" text, "location" text, "county" text, "order" text, "year dissolved" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- in what year was bath abbey dissolved by henry viii ?
SELECT "year dissolved" FROM table_203_550 WHERE "name" = 'bath abbey'
squall
CREATE TABLE table_71964 ( "Week 1" text, "Week 2" text, "Week 6" text, "Week 9" text, "Week 12" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the week 1 nomination when the week 2 nomination was Piia Jarkko?
SELECT "Week 1" FROM table_71964 WHERE "Week 2" = 'piia jarkko'
wikisql
CREATE TABLE table_15775 ( "Date" text, "Venue" text, "Score" text, "Result" text, "Competition" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what was the score for the game on 14 april 2001?
SELECT "Score" FROM table_15775 WHERE "Date" = '14 april 2001'
wikisql
CREATE TABLE table_74167 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What w...
SELECT "Record" FROM table_74167 WHERE "Date" = 'December 27'
wikisql
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "ASIAN" AND demographic.age < "48"
mimicsql_data
CREATE TABLE table_28059992_2 ( cfl_team VARCHAR, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the cfl team for robert beveridge
SELECT cfl_team FROM table_28059992_2 WHERE player = "Robert Beveridge"
sql_create_context
CREATE TABLE table_148 ( "Team" text, "Stadium" text, "Capacity" real, "Highest" real, "Lowest" real, "Average" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the lowest highest attendance for the dumbarton team?
SELECT MIN("Highest") FROM table_148 WHERE "Team" = 'Dumbarton'
wikisql
CREATE TABLE wdmzjzjlb ( 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 wdmzjzjlb.JZLSH FROM hz_info JOIN wdmzjzjlb ON hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX WHERE hz_info.RYBH = '24113912' AND NOT wdmzjzjlb.JZLSH IN (SELECT jybgb.JZLSH FROM jybgb WHERE jybgb.BGRQ <= '2013-05-12') UNION SELECT bdmzjzjlb.JZLSH FROM hz_info JOIN...
css
CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type text, admission_location text, discharge_location text, insuranc...
SELECT prescriptions.drug FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 64185) AND DATETIME(prescriptions.startdate) >= DATETIME(CURRENT_TIME(), '-137 month') ORDER BY prescriptions.startdate LIMIT 1
mimic_iii
CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Percent text, ACC_Home text, ACC_Road text, All_Games text, All_Games_Percent int, All_Home text, All_Road text, All_Neutral text ) CREATE TABLE university ( Scho...
SELECT All_Games, All_Games_Percent FROM basketball_match
nvbench
CREATE TABLE table_28240 ( "NSG Nr." real, "Name of the nature reserve" text, "District / Town" text, "Area (ha)" text, "Date established" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many names does nature reserve 54 have?
SELECT COUNT("Name of the nature reserve") FROM table_28240 WHERE "NSG Nr." = '54'
wikisql
CREATE TABLE table_28146944_2 ( title VARCHAR, no_in_series VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the title of the episode with series number 36?
SELECT title FROM table_28146944_2 WHERE no_in_series = 36
sql_create_context
CREATE TABLE table_63861 ( "Year" real, "Game" text, "Genre" text, "Platform(s)" text, "Developer(s)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What game was developed by Nintendo for the Gamecube platform?
SELECT "Game" FROM table_63861 WHERE "Developer(s)" = 'nintendo' AND "Platform(s)" = 'gamecube'
wikisql
CREATE TABLE table_24780 ( "Year" real, "W: L: D" text, "Position" text, "Chairman" text, "CEO" text, "Coach" text, "Captain" text, "Vice-Captain" text, "Best and Fairest" text, "Leading Goalkicker" text ) -- Using valid SQLite, answer the following questions for the tables pro...
SELECT COUNT("Chairman") FROM table_24780 WHERE "W: L: D" = '13:10:0'
wikisql
CREATE TABLE table_70984 ( "Sydney" text, "Gold Coast" text, "Adelaide" text, "Melbourne" text, "Perth" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Adelaide has Perth no, Gold Coast no, and Sydney yes?
SELECT "Adelaide" FROM table_70984 WHERE "Perth" = 'no' AND "Gold Coast" = 'yes' AND "Sydney" = 'yes'
wikisql
CREATE TABLE projects ( project_id number, organisation_id number, project_details text ) CREATE TABLE research_outcomes ( outcome_code text, outcome_description text ) CREATE TABLE staff_roles ( role_code text, role_description text ) CREATE TABLE organisations ( organisation_id numb...
SELECT grant_id, COUNT(*) FROM documents GROUP BY grant_id ORDER BY COUNT(*) DESC LIMIT 1
spider
CREATE TABLE representative ( Representative_ID int, Name text, State text, Party text, Lifespan text ) CREATE TABLE election ( Election_ID int, Representative_ID int, Date text, Votes real, Vote_Percent real, Seats real, Place real ) -- Using valid SQLite, answer the ...
SELECT Party, COUNT(Party) FROM representative GROUP BY Party
nvbench
CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE inputevents_cv ( row_id number, ...
SELECT COUNT(*) FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 25523)) AND inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'albumin 5%' ...
mimic_iii
CREATE TABLE table_name_42 ( winner VARCHAR, year VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who won in 1965?
SELECT winner FROM table_name_42 WHERE year = "1965"
sql_create_context
CREATE TABLE table_24585157_1 ( series VARCHAR, points VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What series did the racer earn 68 points in?
SELECT series FROM table_24585157_1 WHERE points = "68"
sql_create_context
CREATE TABLE departments ( department_id number, department_name text, manager_id number, location_id number ) CREATE TABLE job_history ( employee_id number, start_date time, end_date time, job_id text, department_id number ) CREATE TABLE regions ( region_id number, region_...
SELECT first_name, last_name, salary 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 WHERE T3.city = 'London'
spider
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 MIN(demographic.age) FROM demographic WHERE demographic.gender = "F" AND demographic.discharge_location = "HOME"
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.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_NM = '蒋红叶' AND t_kc21.MED_SER_ORG_NO = '3289603' AND NOT t_kc21.OUT_DIAG_DIS_NM LIKE '%2%'
css
CREATE TABLE table_name_59 ( opponents VARCHAR, score VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Opponents have a Score of 6 4, 6 3?
SELECT opponents FROM table_name_59 WHERE score = "6–4, 6–3"
sql_create_context
CREATE TABLE restaurant ( id int, name varchar, food_type varchar, city_name varchar, rating "decimal ) CREATE TABLE location ( restaurant_id int, house_number int, street_name varchar, city_name varchar ) CREATE TABLE geographic ( city_name varchar, county varchar, reg...
SELECT location.house_number, restaurant.name FROM geographic, location, restaurant WHERE geographic.region = 'bay area' AND restaurant.city_name = geographic.city_name AND restaurant.food_type = 'american' AND restaurant.id = location.restaurant_id AND restaurant.rating = (SELECT MAX(RESTAURANTalias1.rating) FROM geog...
restaurants
CREATE TABLE date_day ( month_number int, day_number int, year int, day_name varchar ) CREATE TABLE ground_service ( city_code text, airport_code text, transport_type text, ground_fare int ) CREATE TABLE airport_service ( city_code varchar, airport_code varchar, miles_dista...
SELECT DISTINCT ground_service.transport_type FROM city, ground_service WHERE city.city_name = 'SAN FRANCISCO' AND ground_service.city_code = city.city_code
atis
CREATE TABLE table_36046 ( "State" text, "Name" text, "Hometown" text, "Age 1" real, "Talent" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the state represented by the contestant from Mesa, AZ?
SELECT "State" FROM table_36046 WHERE "Hometown" = 'mesa, az'
wikisql
CREATE TABLE table_2562572_12 ( dominant_religion__2002_ VARCHAR, population__2011_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the dominate religion in the location with a population of 4831?
SELECT dominant_religion__2002_ FROM table_2562572_12 WHERE population__2011_ = 4831
sql_create_context
CREATE TABLE table_16967990_1 ( score VARCHAR, _number VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the score for number 4
SELECT score FROM table_16967990_1 WHERE _number = "4"
sql_create_context
CREATE TABLE table_60024 ( "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 nation has more than 1 bronze and less than 3 silver?
SELECT "Nation" FROM table_60024 WHERE "Bronze" > '1' AND "Silver" < '3'
wikisql
CREATE TABLE table_70104 ( "Tournament" text, "2007" text, "2008" text, "2009" text, "2010" text, "2011" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the 2009 for wta premier mandatory tournaments
SELECT "2009" FROM table_70104 WHERE "Tournament" = 'wta premier mandatory tournaments'
wikisql
CREATE TABLE table_37918 ( "Date" text, "Score" text, "Set 1" text, "Set 2" text, "Set 3" text, "Total" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Date has a Set 3 of 21 25?
SELECT "Date" FROM table_37918 WHERE "Set 3" = '21–25'
wikisql
CREATE TABLE transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, eventtype text, careunit text, wardid number, intime time, outtime time ) CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE chart...
SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', labevents.charttime)) FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'pt') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 95892 AND admissions.disc...
mimic_iii
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, ZZBZ number, WDBZ number, JZKSBM text, JZKSMC text, JZKSRQ time, ...
SELECT JZJSSJ FROM mzjzjlb WHERE JZLSH = '51166395425'
css
CREATE TABLE table_name_46 ( country VARCHAR, score VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What country has a 74-72-71-67=284 score?
SELECT country FROM table_name_46 WHERE score = 74 - 72 - 71 - 67 = 284
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 patient.hospitaldischargetime FROM patient WHERE patient.uniquepid = '012-27355' AND DATETIME(patient.hospitaldischargetime) <= DATETIME(CURRENT_TIME(), '-2 year') ORDER BY patient.hospitaldischargetime DESC LIMIT 1
eicu
CREATE TABLE table_53465 ( "Date" text, "Opponent" text, "Home/Away" text, "Field" text, "Result" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Say the field with a result of w 12-11
SELECT "Field" FROM table_53465 WHERE "Result" = 'w 12-11'
wikisql
CREATE TABLE Comments ( Id number, PostId number, Score number, Text text, CreationDate time, UserDisplayName text, UserId number, ContentLicense text ) CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text,...
SELECT Id AS "post_link", Score, FavoriteCount, Score - FavoriteCount AS "diff" FROM Posts WHERE PostTypeId = 1 AND ClosedDate IS NULL AND CommunityOwnedDate IS NULL AND Score < 0 ORDER BY FavoriteCount - Score DESC LIMIT 100
sede
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 prescription...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admission_location = "PHYS REFERRAL/NORMAL DELI" AND diagnoses.icd9_code = "41021"
mimicsql_data
CREATE TABLE table_25601 ( "No." real, "Season" real, "Bowler" text, "Batsmen" text, "For" text, "Against" text, "Ground" text, "Scorecard" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the scorecard when robin uthappa mark bou...
SELECT "Scorecard" FROM table_25601 WHERE "Batsmen" = 'Robin Uthappa Mark Boucher Jacques Kallis'
wikisql
CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time, drug text, dose...
SELECT diagnoses_icd.charttime FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'bladder/urethra inj-clos') AND diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 60595 AND NOT adm...
mimic_iii
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 prescription...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.insurance = "Self Pay" AND procedures.long_title = "Regional lymph node excision"
mimicsql_data
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 text, name text, marital_status text, age text, dob text, gender text, language text, religion text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.icd9_code = "43401" AND prescriptions.route = "SL"
mimicsql_data
CREATE TABLE table_train_23 ( "id" int, "in_another_study" bool, "immune_suppression" bool, "hiv_infection" bool, "fio2" float, "head_injury" bool, "heart_disease" bool, "steroid_therapy" bool, "chemotherapy" bool, "edema" bool, "NOUSE" float ) -- Using valid SQLite, answer...
SELECT * FROM table_train_23 WHERE fio2 > 0.7
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_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM t_kc21 JOIN t_kc22 JOIN t_kc21_t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc21_t_kc22.MED_CLINIC_ID AND t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID WHERE t_kc21.MED_SER_ORG_NO = '1034558' GROUP BY t_kc22.SOC_SRT_DIRE_CD ORDER BY SUM(t_kc22.AMOUNT) DESC LIMIT 2...
css
CREATE TABLE table_15672920_1 ( open_cup VARCHAR, year VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the open cup for 2010
SELECT open_cup FROM table_15672920_1 WHERE year = 2010
sql_create_context
CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type text,...
SELECT prescriptions.dose_val_rx FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 11322 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1) AND prescriptions.drug = 'abciximab' ORDER BY prescriptions.startdate LIMIT 1
mimic_iii
CREATE TABLE table_12160 ( "Rank" real, "Result" real, "Athlete" text, "Date" text, "Location" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What Date has a Rank of 2?
SELECT "Date" FROM table_12160 WHERE "Rank" = '2'
wikisql
CREATE TABLE table_24475 ( "No. in series" text, "No. in season" text, "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 title for episode number in series of 28?
SELECT "Title" FROM table_24475 WHERE "No. in series" = '28'
wikisql
CREATE TABLE jobs ( job_id int, job_title varchar, description varchar, requirement varchar, city varchar, state varchar, country varchar, zip int ) CREATE TABLE course_tags_count ( course_id int, clear_grading int, pop_quiz int, group_projects int, inspirational int...
SELECT DISTINCT course.department, course.name, course.number 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.ins...
advising
CREATE TABLE table_12085 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text, "Money ( $ )" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Can you tell me the Place that has the Score of 70-67-69-69=275?
SELECT "Place" FROM table_12085 WHERE "Score" = '70-67-69-69=275'
wikisql