instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE zzmzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH number, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, KH text, KLX number, MJZH text, ML number, MZZYZDZZBM text, MZZYZDZ...
SELECT COUNT(*) FROM person_info JOIN hz_info JOIN zzmzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = zzmzjzjlb.YLJGDM AND hz_info.KH = zzmzjzjlb.KH AND hz_info.KLX = zzmzjzjlb.KLX WHERE person_info.XM = '褚丽姿' AND zzmzjzjlb.JZKSRQ BETWEEN '2008-08-18' AND '2020-08-18' AND zzmzjzjlb.YLJGDM = '3680245' UNI...
css
CREATE TABLE time_zone ( time_zone_code text, time_zone_name text, hours_from_gmt int ) CREATE TABLE flight_leg ( flight_id int, leg_number int, leg_flight int ) CREATE TABLE airline ( airline_code varchar, airline_name text, note text ) CREATE TABLE flight_stop ( flight_id in...
SELECT DISTINCT ground_service.transport_type FROM airport, airport_service, city, ground_service WHERE airport.airport_code = airport_service.airport_code AND city.city_code = airport_service.city_code AND city.city_name = 'PHILADELPHIA' AND ground_service.airport_code = airport.airport_code
atis
CREATE TABLE table_name_50 ( loss VARCHAR, attendance INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many losses have more than 45,036 attendance?
SELECT loss FROM table_name_50 WHERE attendance > 45 OFFSET 036
sql_create_context
CREATE TABLE table_name_17 ( high_points VARCHAR, high_rebounds VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Can you tell me the High points that has the High rebounds of rafer alston (9)?
SELECT high_points FROM table_name_17 WHERE high_rebounds = "rafer alston (9)"
sql_create_context
CREATE TABLE table_name_90 ( player VARCHAR, venue VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What player was at Albion?
SELECT player FROM table_name_90 WHERE venue = "albion"
sql_create_context
CREATE TABLE editor ( Id VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many editors are there?
SELECT COUNT(*) FROM editor
sql_create_context
CREATE TABLE keyphrase ( keyphraseid int, keyphrasename varchar ) CREATE TABLE field ( fieldid int ) CREATE TABLE author ( authorid int, authorname varchar ) CREATE TABLE paperkeyphrase ( paperid int, keyphraseid int ) CREATE TABLE paper ( paperid int, title varchar, venueid ...
SELECT DISTINCT paper.paperid FROM author, paper, writes WHERE author.authorname = 'Liwen Xiong' AND paper.year = 2015 AND writes.authorid = author.authorid AND writes.paperid = paper.paperid
scholar
CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text ) CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, ...
SELECT u.Id AS "user_link", u.Reputation FROM Users AS u INNER JOIN Badges AS b ON b.UserId = u.Id WHERE b.Name = '##Badge##' ORDER BY u.Reputation DESC
sede
CREATE TABLE ground_service ( city_code text, airport_code text, transport_type text, ground_fare int ) CREATE TABLE fare_basis ( fare_basis_code text, booking_class text, class_type text, premium text, economy text, discounted text, night text, season text, basis_da...
SELECT DISTINCT fare_id FROM fare WHERE one_direction_cost = (SELECT MAX(FAREalias1.one_direction_cost) FROM fare AS FAREalias1, flight AS FLIGHTalias0, flight_fare AS FLIGHT_FARE WHERE FLIGHT_FARE_ID = FAREalias1.fare_id AND FLIGHTalias0.flight_id = FLIGHT_FLIGHT_ID)
atis
CREATE TABLE table_33316 ( "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. -- For the match with an away team score of 16.21 (...
SELECT "Home team score" FROM table_33316 WHERE "Away team score" = '16.21 (117)'
wikisql
CREATE TABLE table_name_8 ( points INTEGER, time_retired VARCHAR, laps VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many average points did the player with a time/retired of +16.789 and have more laps than 68 have?
SELECT AVG(points) FROM table_name_8 WHERE time_retired = "+16.789" AND laps > 68
sql_create_context
CREATE TABLE table_71826 ( "Name" text, "Gain" real, "Loss" real, "Long" real, "Avg/G" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many yards lost by the player with more gained than 51 and average/g of 3.6?
SELECT COUNT("Loss") FROM table_71826 WHERE "Avg/G" = '3.6' AND "Gain" > '51'
wikisql
CREATE TABLE table_name_65 ( type VARCHAR, moving_from VARCHAR, source VARCHAR, transfer_window VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the type of the Leeds United source, winter transfer window and moving from Northampton town?
SELECT type FROM table_name_65 WHERE source = "leeds united" AND transfer_window = "winter" AND moving_from = "northampton town"
sql_create_context
CREATE TABLE table_name_87 ( total INTEGER, gold VARCHAR, rank VARCHAR, silver VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How much Total has a Rank smaller than 10, and a Silver larger than 3, and a Gold larger than 3?
SELECT SUM(total) FROM table_name_87 WHERE rank < 10 AND silver > 3 AND gold > 3
sql_create_context
CREATE TABLE table_204_780 ( id number, "year" number, "competition" text, "venue" text, "position" text, "notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- which position was held the most number of times ?
SELECT "position" FROM table_204_780 GROUP BY "position" ORDER BY COUNT(*) DESC LIMIT 1
squall
CREATE TABLE zyjzjlb ( CYBQDM text, CYBQMC text, CYCWH text, CYKSDM text, CYKSMC text, CYSJ time, CYZTDM number, HZXM text, JZKSDM text, JZKSMC text, JZLSH text, KH text, KLX number, MZBMLX number, MZJZLSH text, MZZDBM text, MZZDMC text, MZZYZDZZBM...
SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN person_info_hz_info ON person_info.RYBH = person_info_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...
css
CREATE TABLE table_22587 ( "Period" text, "Internet Explorer" text, "Firefox" text, "Chrome" text, "Safari" text, "Opera" text, "Other Mozilla" text, "Mobile" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- If Internet Explorer is 47.22%,...
SELECT "Safari" FROM table_22587 WHERE "Internet Explorer" = '47.22%'
wikisql
CREATE TABLE table_38532 ( "Game" text, "Date" text, "Referee" text, "Umpire" text, "Head Linesman" text, "Line Judge" text, "Field Judge" text, "Back Judge" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the date of the game whe...
SELECT "Date" FROM table_38532 WHERE "Line Judge" = 'bob beeks' AND "Head Linesman" = 'jerry bergman' AND "Back Judge" = 'paul baetz'
wikisql
CREATE TABLE table_52500 ( "Film" text, "Song" text, "Year" real, "Music Director" text, "Language" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Tell me the song with year before 2013 and music director of yuvan shankar raja and film of billa ii
SELECT "Song" FROM table_52500 WHERE "Year" < '2013' AND "Music Director" = 'yuvan shankar raja' AND "Film" = 'billa ii'
wikisql
CREATE TABLE county_public_safety ( County_ID int, Name text, Population int, Police_officers int, Residents_per_officer int, Case_burden int, Crime_rate real, Police_force text, Location text ) CREATE TABLE city ( City_ID int, County_ID int, Name text, White real, ...
SELECT Police_force, COUNT(*) FROM county_public_safety GROUP BY Police_force ORDER BY Police_force
nvbench
CREATE TABLE plays_games ( stuid number, gameid number, hours_played number ) CREATE TABLE sportsinfo ( stuid number, sportname text, hoursperweek number, gamesplayed number, onscholarship text ) CREATE TABLE video_games ( gameid number, gname text, gtype text ) CREATE TAB...
SELECT stuid FROM sportsinfo WHERE onscholarship = 'Y'
spider
CREATE TABLE nuclear_power_plants ( id text, name text, latitude text, longitude text, country text, status text, reactortype text, reactormodel text, constructionstartat text, operationalfrom text, operationalto text, capacity text, lastupdatedat text, source tex...
SELECT name FROM nuclear_power_plants ORDER BY capacity DESC LIMIT 1
geonucleardata
CREATE TABLE table_1341897_42 ( candidates VARCHAR, incumbent VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many candidates were there in the election for William Jennings Bryan Dorn's seat?
SELECT COUNT(candidates) FROM table_1341897_42 WHERE incumbent = "William Jennings Bryan Dorn"
sql_create_context
CREATE TABLE table_33436 ( "Country Name" text, "1961-65" text, "1966-70" text, "1971-75" text, "1976-80" text, "1981-85" text, "1986-90" text, "1991-95" text, "1996\u20132000" text, "2001-05" text, "2006-10" text ) -- Using valid SQLite, answer the following questions for ...
SELECT "Country Name" FROM table_33436 WHERE "1966-70" = '-100' AND "1991-95" = '-7.36%'
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 MED_EXP_DET_ID FROM t_kc22 WHERE MED_CLINIC_ID = '54609077422' AND (REMOTE_SETTLE_FLG = '异地1' OR REMOTE_SETTLE_FLG = '异地2')
css
CREATE TABLE classroom ( building text, room_number text, capacity number ) CREATE TABLE section ( course_id text, sec_id text, semester text, year number, building text, room_number text, time_slot_id text ) CREATE TABLE advisor ( s_id text, i_id text ) CREATE TABLE s...
SELECT title FROM course GROUP BY title HAVING COUNT(*) > 1
spider
CREATE TABLE person_info ( CSD text, CSRQ time, GJDM text, GJMC text, JGDM text, JGMC text, MZDM text, MZMC text, RYBH text, XBDM number, XBMC text, XLDM text, XLMC text, XM text, ZYLBDM text, ZYMC text ) CREATE TABLE jybgb ( BBCJBW text, BBDM tex...
SELECT jybgb.SHRGH, jybgb.SHRXM FROM jybgb WHERE jybgb.JZLSH = '79056847817'
css
CREATE TABLE table_13579 ( "Date" text, "Venue" text, "Result" text, "Competition" text, "Tally" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the fewest tally for the game played at Vasil Levski National Stadium, Sofia, Bulgaria?
SELECT MIN("Tally") FROM table_13579 WHERE "Venue" = 'vasil levski national stadium, sofia, bulgaria'
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 * FROM person_info JOIN hz_info JOIN zyjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX WHERE person_info.XM = '姜娟秀' AND hz_info.YLJGDM = '5351150' AND zyjzjlb.JZKSMC LIKE '%康复%'
css
CREATE TABLE table_27664 ( "GB" text, "ISO \u2116" text, "Province" text, "Chinese Name" text, "Capital" text, "Population\u00b9" real, "Density\u00b2" text, "Area\u00b3" real, "Abbreviation/Symbol" text ) -- Using valid SQLite, answer the following questions for the tables provide...
SELECT COUNT("ISO \u2116") FROM table_27664 WHERE "Chinese Name" = '青海省 Qīnghǎi Shěng'
wikisql
CREATE TABLE table_name_1 ( total VARCHAR, bronze VARCHAR, gold VARCHAR, rank VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total when gold is 1, and rank is more than 4, and bronze is 0?
SELECT COUNT(total) FROM table_name_1 WHERE gold = 1 AND rank > 4 AND bronze = 0
sql_create_context
CREATE TABLE t_kc24 ( ACCOUNT_DASH_DATE time, ACCOUNT_DASH_FLG number, CASH_PAY number, CIVIL_SUBSIDY number, CKC102 number, CLINIC_ID text, CLINIC_SLT_DATE time, COMP_ID text, COM_ACC_PAY number, COM_PAY number, DATA_ID text, ENT_ACC_PAY number, ENT_PAY number, F...
SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.t_kc21_PERSON_ID = '79161122' AND NOT t_kc22.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT <= 2229.22)
css
CREATE TABLE table_name_63 ( circuit VARCHAR, event VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- The 1997 Japanese Formula 3 Championship is part of what circuit?
SELECT circuit FROM table_name_63 WHERE event = "1997 japanese formula 3 championship"
sql_create_context
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 Name, COUNT(Name) FROM Products WHERE Price <= 200 GROUP BY Name ORDER BY COUNT(Name)
nvbench
CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE icustays ( row_id number, subject_id number, hadm_id number, icustay_id number,...
SELECT COUNT(*) > 0 FROM admissions WHERE admissions.subject_id = 42829 AND admissions.admission_location = 'emergency room admit' AND admissions.dischtime IS NULL
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 prescriptions ( subject_id text, hadm_id...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.gender = "M" AND demographic.admission_type = "URGENT"
mimicsql_data
CREATE TABLE personfriend ( name text, friend text, year number ) CREATE TABLE person ( name text, age number, city text, gender text, job text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many people whose age is greater 30 and job is...
SELECT COUNT(*) FROM person WHERE age > 30 AND job = 'engineer'
spider
CREATE TABLE t_kc24 ( ACCOUNT_DASH_DATE time, ACCOUNT_DASH_FLG number, CASH_PAY number, CIVIL_SUBSIDY number, CKC102 number, CLINIC_ID text, CLINIC_SLT_DATE time, COMP_ID text, COM_ACC_PAY number, COM_PAY number, DATA_ID text, ENT_ACC_PAY number, ENT_PAY number, F...
SELECT COUNT(*) FROM t_kc22 WHERE t_kc22.t_kc21_PERSON_ID = '07777908' AND t_kc22.STA_DATE BETWEEN '2009-02-05' AND '2010-12-23' AND t_kc22.MED_INV_ITEM_TYPE = '检查费'
css
CREATE TABLE table_204_587 ( id number, "drop(s)" text, "multiplayer map(s)" text, "spec ops mission(s)" text, "face off map(s)" text, "xbox 360 release date" text, "playstation 3 release date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- ...
SELECT "drop(s)" FROM table_204_587 WHERE "multiplayer map(s)" = 'oasis' AND "spec ops mission(s)" = 2
squall
CREATE TABLE table_765 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Result" text, "Candidates" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What district was Harold Earthman the incumbent in?
SELECT "District" FROM table_765 WHERE "Incumbent" = 'Harold Earthman'
wikisql
CREATE TABLE table_204_676 ( id number, "year" number, "division" number, "league" text, "regular season" text, "playoffs" text, "open cup" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- tell me the number of times they qualified for the pla...
SELECT COUNT(*) FROM table_204_676 WHERE "playoffs" <> 'did not qualify'
squall
CREATE TABLE table_26360571_2 ( assists VARCHAR, opponent VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- List the number of assists against illinois-chicago.
SELECT assists FROM table_26360571_2 WHERE opponent = "Illinois-Chicago"
sql_create_context
CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE TagSynonyms ( Id number, SourceTagName text, TargetTagName text, CreationDate time, OwnerUserId number, AutoRenameCount number, LastAutoRename time, Score number, ApprovedByUserId number...
SELECT p.ViewCount, p.Id AS "post_link" FROM dbo.Posts AS p INNER JOIN dbo.PostTags AS pt ON p.Id = pt.PostId INNER JOIN dbo.Tags AS t ON pt.TagId = t.Id WHERE p.PostTypeId = 1 AND t.TagName = '##TagName:string?hugo##' ORDER BY p.ViewCount DESC LIMIT 100
sede
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.PERSON_NM = '王灵秀' AND t_kc21.MED_SER_ORG_NO = '5443679' AND t_kc21.MED_ORG_DEPT_NM LIKE '%喉%'
css
CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title 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...
SELECT t2.drug FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE admissions.subject_id = 28443 AND diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'aortic...
mimic_iii
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 MAX(demographic.days_stay) FROM demographic WHERE demographic.age >= "64"
mimicsql_data
CREATE TABLE gwyjzb ( 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_kc24.PER_ACC_PAY) FROM gwyjzb JOIN t_kc24 ON gwyjzb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE gwyjzb.PERSON_NM = '范明喆' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2001-06-01' AND '2003-12-05' UNION SELECT SUM(t_kc24.PER_ACC_PAY) FROM fgwyjzb JOIN t_kc24 ON fgwyjzb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE fgwyjz...
css
CREATE TABLE table_63014 ( "Sunrayia FL" text, "Wins" real, "Byes" real, "Losses" real, "Draws" real, "Against" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the sum of draws for teams with against of 1731 and under 10 losses?
SELECT SUM("Draws") FROM table_63014 WHERE "Against" = '1731' AND "Losses" < '10'
wikisql
CREATE TABLE table_62714 ( "Year" real, "Class" text, "Team" text, "Machine" text, "Points" real, "Rank" text, "Wins" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many wins were there in 1994?
SELECT SUM("Wins") FROM table_62714 WHERE "Year" = '1994'
wikisql
CREATE TABLE table_35820 ( "Rank" real, "Player" text, "Country" text, "Earnings ( $ )" real, "Wins" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many wins did the player who earned $6,607,562 have?
SELECT SUM("Wins") FROM table_35820 WHERE "Earnings ( $ )" = '6,607,562'
wikisql
CREATE TABLE table_name_88 ( gold VARCHAR, bronze VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the number of gold medals when the number of bronze medals is 8?
SELECT gold FROM table_name_88 WHERE bronze = "8"
sql_create_context
CREATE TABLE t_kc21_t_kc22 ( MED_CLINIC_ID text, MED_EXP_DET_ID number ) 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 ...
SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_NM = '秦娟丽' AND NOT t_kc21.MED_CLINIC_ID IN (SELECT t_kc21_t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT <= 8902.92)
css
CREATE TABLE table_name_61 ( country VARCHAR, network VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Country has a Network of nelonen?
SELECT country FROM table_name_61 WHERE network = "nelonen"
sql_create_context
CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) CREATE TABLE SuggestedEdits ( Id number, PostId number, CreationDate time, ApprovalDa...
WITH Raw AS (SELECT Posts.Id AS PostId, MIN(Posts.CreationDate) AS PostCreationDate, MAX(Tags.Count) AS MaxTagCount FROM Posts, PostTags, Tags WHERE Posts.Id = PostTags.PostId AND PostTags.TagId = Tags.Id GROUP BY Posts.Id), Raw2 AS (SELECT Raw.PostId, TIME_TO_STR(MIN(Raw.PostCreationDate), '%Y') AS PostYear, MIN(Tags....
sede
CREATE TABLE station ( id int, network_name text, services text, local_authority text ) CREATE TABLE route ( train_id int, station_id int ) CREATE TABLE train ( id int, train_number int, name text, origin text, destination text, time text, interval text ) CREATE TA...
SELECT local_authority, COUNT(local_authority) FROM station GROUP BY services, local_authority ORDER BY COUNT(local_authority) DESC
nvbench
CREATE TABLE table_1341897_23 ( candidates VARCHAR, district VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the candidates for massachusetts 6
SELECT candidates FROM table_1341897_23 WHERE district = "Massachusetts 6"
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 Affiliation, SUM(Enrollment) FROM university GROUP BY Affiliation ORDER BY Affiliation DESC
nvbench
CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid number, wardid number, admissionheight number, admissionweight number, dischargeweight number, hospitaladmittime time, ...
SELECT STRFTIME('%j', patient.hospitaldischargetime) - STRFTIME('%j', patient.hospitaladmittime) FROM patient WHERE patient.uniquepid = '022-164523' AND NOT patient.hospitaladmittime IS NULL ORDER BY patient.hospitaladmittime DESC LIMIT 1
eicu
CREATE TABLE program_course ( program_id int, course_id int, workload int, category varchar ) CREATE TABLE course_tags_count ( course_id int, clear_grading int, pop_quiz int, group_projects int, inspirational int, long_lectures int, extra_credit int, few_tests int, g...
SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN area ON course.course_id = area.course_id INNER JOIN program_course ON program_course.course_id = course.course_id WHERE (area.area LIKE '%Appl of Radiation%' OR course.description LIKE '%Appl of Radiation%' OR course.name LIKE '%Appl ...
advising
CREATE TABLE table_36431 ( "Season" text, "Race" real, "Podium" real, "Pole" real, "FLap" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Race that has a Podium larger than 1, and a Season of 1982, and a flap smaller than 1 had how many number of rac...
SELECT COUNT("Race") FROM table_36431 WHERE "Podium" > '1' AND "Season" = '1982' AND "FLap" < '1'
wikisql
CREATE TABLE table_16751596_5 ( lead_margin INTEGER, dates_administered VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the maximum lead margin on august 5, 2008?
SELECT MAX(lead_margin) FROM table_16751596_5 WHERE dates_administered = "August 5, 2008"
sql_create_context
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 COUNT(*) AS votes, vt.Name FROM Votes AS v, VoteTypes AS vt WHERE v.VoteTypeId IN (2, 3) AND TIME_TO_STR(v.CreationDate, '%Y') >= 2016 AND v.VoteTypeId = vt.Id GROUP BY vt.Name
sede
CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, ...
SELECT patient.wardid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '016-12011') AND STRFTIME('%y', patient.unitadmittime) = '2104' ORDER BY patient.unitadmittime DESC LIMIT 1
eicu
CREATE TABLE table_14463 ( "Urban area" text, "Population 1.1.2009" text, "Population 1.1.2008" real, "Population 1.1.2007" text, "Population 1.1.2006" real, "Population per square km" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the tota...
SELECT COUNT("Population per square km") FROM table_14463 WHERE "Population 1.1.2006" = '12.757'
wikisql
CREATE TABLE table_60882 ( "Player" text, "Country" text, "Year(s) won" text, "Total" real, "To par" text, "Finish" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What years won have a total of 286?
SELECT "Year(s) won" FROM table_60882 WHERE "Total" = '286'
wikisql
CREATE TABLE table_204_100 ( id number, "date" text, "name of ship" text, "nationality" text, "tonnage" number, "fate" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- boat with the least tonnage that was attacked
SELECT "name of ship" FROM table_204_100 ORDER BY "tonnage" LIMIT 1
squall
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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.short_title = "Crbl art ocl NOS w infrc" AND prescriptions.route = "SC"
mimicsql_data
CREATE TABLE table_name_32 ( year INTEGER, result VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average year with nominated result?
SELECT AVG(year) FROM table_name_32 WHERE result = "nominated"
sql_create_context
CREATE TABLE table_204_944 ( id number, "mine" text, "province" text, "coordinates" text, "town" text, "dates" text, "comments" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many times is temagami listedon the list ?
SELECT COUNT(*) FROM table_204_944 WHERE "town" = 'temagami'
squall
CREATE TABLE jybgb ( YLJGDM text, YLJGDM_MZJZJLB text, YLJGDM_ZYJZJLB text, BGDH text, BGRQ time, JYLX number, JZLSH text, JZLSH_MZJZJLB text, JZLSH_ZYJZJLB text, JZLX number, KSBM text, KSMC text, SQRGH text, SQRXM text, BGRGH text, BGRXM text, SHRGH ...
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 = '18784112' AND hz_info.YLJGDM = '0131624' AND mzjzjlb.JZKSMC LIKE '%神外%'
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 WHERE demographic.age < "62" AND demographic.days_stay > "4"
mimicsql_data
CREATE TABLE gwyjzb ( 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 gwyjzb.OUT_DIAG_DIS_CD, gwyjzb.OUT_DIAG_DIS_NM FROM gwyjzb WHERE gwyjzb.PERSON_ID = '82924837' AND gwyjzb.MED_SER_ORG_NO = '2605232' AND gwyjzb.OUT_DIAG_DOC_NM LIKE '施%' UNION SELECT fgwyjzb.OUT_DIAG_DIS_CD, fgwyjzb.OUT_DIAG_DIS_NM FROM fgwyjzb WHERE fgwyjzb.PERSON_ID = '82924837' AND fgwyjzb.MED_SER_ORG_NO = '2...
css
CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) ) CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,...
SELECT HIRE_DATE, SALARY FROM employees WHERE HIRE_DATE < '2002-06-21' ORDER BY HIRE_DATE
nvbench
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 allergy ( allergy...
SELECT t3.drugname FROM (SELECT t2.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, treatment.treatmenttime, patient.patienthealthsystemstayid FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'therapeutic ant...
eicu
CREATE TABLE table_name_39 ( to_par VARCHAR, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the to par for gene kunes
SELECT to_par FROM table_name_39 WHERE player = "gene kunes"
sql_create_context
CREATE TABLE publication ( publication_id number, book_id number, publisher text, publication_date text, price number ) CREATE TABLE book ( book_id number, title text, issues number, writer text ) -- Using valid SQLite, answer the following questions for the tables provided above....
SELECT DISTINCT publisher FROM publication WHERE price > 5000000
spider
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.dob_year < "2047" AND diagnoses.short_title = "Chr diastolic hrt fail"
mimicsql_data
CREATE TABLE table_name_66 ( round VARCHAR, opponent VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the round number of the match with Michael Buell as the opponent?
SELECT round FROM table_name_66 WHERE opponent = "michael buell"
sql_create_context
CREATE TABLE t_kc22 ( MED_EXP_DET_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, MED_CLINIC_ID text, MED_EXP_BILL_ID text, SOC_SRT_DIRE_CD text, SOC_SRT_DIRE_NM text, DIRE_TYPE number, CHA_ITEM_LEV number, MED_INV_ITEM_TYPE text, MED_DIRE_CD text, MED_DIRE_NM text,...
SELECT 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.PERSON_NM = '曹烨磊' AND t_kc22.MED_INV_ITEM_TYPE = '治疗费'
css
CREATE TABLE table_name_27 ( games INTEGER, goals_for VARCHAR, draws VARCHAR, goals_against VARCHAR, wins VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what's the number of games with a Goals Against smaller than 14, and a Wins larger than 1, an...
SELECT MAX(games) FROM table_name_27 WHERE goals_against < 14 AND wins > 1 AND draws < 2 AND goals_for = 3
sql_create_context
CREATE TABLE team ( Team_id int, Name text ) CREATE TABLE player ( Player_ID int, Player text, Years_Played text, Total_WL text, Singles_WL text, Doubles_WL text, Team int ) CREATE TABLE match_season ( Season real, Player text, Position text, Country int, Team i...
SELECT Country_name, COUNT(*) FROM country AS T1 JOIN match_season AS T2 ON T1.Country_id = T2.Country GROUP BY T1.Country_name ORDER BY COUNT(*)
nvbench
CREATE TABLE table_23449 ( "Index (Year)" text, "Author / Editor / Source" text, "Year of publication" text, "Countries sampled" real, "World Ranking (1)" text, "Ranking L.A. (2)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many years wer...
SELECT COUNT("Index (Year)") FROM table_23449 WHERE "World Ranking (1)" = '21st'
wikisql
CREATE TABLE table_79281 ( "Peak" text, "Country" text, "Elevation (m)" real, "Prominence (m)" real, "Col (m)" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total prominence number in m of ethiopia, which has a col in m of 1728 and an e...
SELECT COUNT("Prominence (m)") FROM table_79281 WHERE "Country" = 'ethiopia' AND "Col (m)" = '1728' AND "Elevation (m)" < '3,358'
wikisql
CREATE TABLE table_171666_1 ( comparable_country VARCHAR, national_share___percentage_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What comparable country has a national share of 1.08?
SELECT comparable_country FROM table_171666_1 WHERE national_share___percentage_ = "1.08"
sql_create_context
CREATE TABLE table_57231 ( "Years" text, "Engine" text, "Power" text, "Torque" text, "Notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the years when the notes is laredo, limited, overland and the engine is 5.7l hemi v8?
SELECT "Years" FROM table_57231 WHERE "Notes" = 'laredo, limited, overland' AND "Engine" = '5.7l hemi v8'
wikisql
CREATE TABLE gwyjzb ( 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 AVG(gwyjzb.MED_AMOUT) FROM gwyjzb WHERE gwyjzb.MED_ORG_DEPT_CD = '1791' AND gwyjzb.IN_HOSP_DATE BETWEEN '2006-04-24' AND '2007-04-05' AND gwyjzb.IN_DIAG_DIS_NM = '前列腺增生' AND gwyjzb.CLINIC_TYPE = '住院' UNION SELECT AVG(fgwyjzb.MED_AMOUT) FROM fgwyjzb WHERE fgwyjzb.MED_ORG_DEPT_CD = '1791' AND fgwyjzb.IN_HOSP_DATE ...
css
CREATE TABLE table_46768 ( "Tournament" text, "2002" text, "2003" text, "2004" text, "2005" text, "2006" text, "2007" text, "2008" text, "2009" text, "2010" text, "2011" text, "2012" text ) -- Using valid SQLite, answer the following questions for the tables provided ab...
SELECT "2004" FROM table_46768 WHERE "Tournament" = 'paris masters'
wikisql
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) C...
SELECT demographic.dod FROM demographic WHERE demographic.subject_id = "2560"
mimicsql_data
CREATE TABLE table_name_45 ( pick VARCHAR, round VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Pick, when Round is 15?
SELECT pick FROM table_name_45 WHERE round = 15
sql_create_context
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.marital_status = "MARRIED" AND diagnoses.icd9_code = "59080"
mimicsql_data
CREATE TABLE View_Unit_Status ( apt_id INTEGER, apt_booking_id INTEGER, status_date DATETIME, available_yn BIT ) CREATE TABLE Apartment_Facilities ( apt_id INTEGER, facility_code CHAR(15) ) CREATE TABLE Apartment_Bookings ( apt_booking_id INTEGER, apt_id INTEGER, guest_id INTEGER, ...
SELECT booking_start_date, COUNT(booking_start_date) FROM Apartment_Bookings AS T1 JOIN Apartments AS T2 ON T1.apt_id = T2.apt_id WHERE T2.apt_type_code = "Duplex"
nvbench
CREATE TABLE table_55380 ( "Sport" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the lowest Silver in the Total Sport has less than 1 Gold and more than 1 Bronze?
SELECT MIN("Silver") FROM table_55380 WHERE "Bronze" > '1' AND "Sport" = 'total' AND "Gold" < '1'
wikisql
CREATE TABLE table_name_42 ( opponent VARCHAR, record VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- which team has a record of 13-18?
SELECT opponent FROM table_name_42 WHERE record = "13-18"
sql_create_context
CREATE TABLE teachers ( classroom VARCHAR, firstname VARCHAR, lastname VARCHAR ) CREATE TABLE list ( firstname VARCHAR, lastname VARCHAR, classroom VARCHAR, grade VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Find all first-grade studen...
SELECT DISTINCT T1.firstname, T1.lastname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE T1.grade = 1 EXCEPT SELECT T1.firstname, T1.lastname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE T2.firstname = "OTHA" AND T2.lastname = "MOYER"
sql_create_context
CREATE TABLE table_76516 ( "Verb" text, "2 (VF)" text, "2 (F)" text, "3 (F)" text, "2/3 (P)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the 2nd verb for Khola?
SELECT "2 (F)" FROM table_76516 WHERE "Verb" = 'khola'
wikisql
CREATE TABLE table_56981 ( "Variant (with Niqqud )" text, "without Niqqud" text, "Phonemic Value" text, "Phonetic Realisation" text, "English example" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the phonetic realisation if the phonemic va...
SELECT "Phonetic Realisation" FROM table_56981 WHERE "Phonemic Value" = '/v/' AND "without Niqqud" = 'as initial letter: ו'
wikisql
CREATE TABLE table_25173505_13 ( buena_vista_edition VARCHAR, special_edition VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- who is the buena vista edidtion where special edition is koichi sakaguchi?
SELECT buena_vista_edition FROM table_25173505_13 WHERE special_edition = "Koichi Sakaguchi"
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 diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE procedures ( ...
SELECT MIN(demographic.age) FROM demographic WHERE demographic.admission_type = "EMERGENCY" AND demographic.diagnosis = "GANGRENE"
mimicsql_data
CREATE TABLE Documents ( Document_ID INTEGER, Document_Type_Code CHAR(15), Project_ID INTEGER, Document_Date DATETIME, Document_Name VARCHAR(255), Document_Description VARCHAR(255), Other_Details VARCHAR(255) ) CREATE TABLE Projects ( Project_ID INTEGER, Project_Details VARCHAR(255)...
SELECT Budget_Type_Code, COUNT(*) FROM Documents_with_Expenses GROUP BY Budget_Type_Code ORDER BY COUNT(*) DESC
nvbench
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.long_title = "Abscess of intestine" AND prescriptions.route = "DIALYS"
mimicsql_data