context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE table_name_24 ( player VARCHAR, country VARCHAR, money___$__ VARCHAR )
What Player is from the Country United States and Money ($) of 356?
SELECT player FROM table_name_24 WHERE country = "united states" AND money___$__ = 356
sql_create_context
CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE Users ( Id number, Reputation number, CreationDate time, DisplayName text, LastAccessDate time, WebsiteUrl text, Location text, AboutMe text, Views number, UpVotes number, DownVotes number, ProfileImage...
Find identical titles (no closed questions, different owner). We also show the creation date of the posts.
SELECT a.Id AS "post_link", a.CreationDate AS "First Date", b.Id AS "post_link", b.CreationDate AS "Second Date" FROM Posts AS a JOIN Posts AS b ON a.Title = b.Title WHERE a.Id < b.Id AND a.OwnerUserId != b.OwnerUserId AND a.ClosedDate IS NULL AND b.ClosedDate IS NULL
sede
CREATE TABLE table_name_71 ( rank VARCHAR, points VARCHAR )
What is the rank associated with 141.48 points?
SELECT rank FROM table_name_71 WHERE points = 141.48
sql_create_context
CREATE TABLE table_name_25 ( place VARCHAR, player VARCHAR )
What is the place of player tom watson?
SELECT place FROM table_name_25 WHERE player = "tom watson"
sql_create_context
CREATE TABLE table_name_45 ( driver VARCHAR, grid VARCHAR )
Which driver has grid value of 18?
SELECT driver FROM table_name_45 WHERE grid = "18"
sql_create_context
CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number ) CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, Deletio...
Select top 20 tags in June 2012.
SELECT Tags.TagName, COUNT(*) AS tagcount FROM Posts INNER JOIN PostTags ON PostTags.PostId = Posts.Id INNER JOIN Tags ON Tags.Id = PostTags.TagId WHERE TIME_TO_STR(Posts.CreationDate, '%Y') = 2012 AND TIME_TO_STR(Posts.CreationDate, '%m') = 6 GROUP BY Tags.TagName ORDER BY tagcount DESC LIMIT 20
sede
CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, va...
tell me the cost for the dis of gallbladder nec diagnosis?
SELECT DISTINCT cost.cost FROM cost WHERE cost.event_type = 'diagnoses_icd' AND cost.event_id IN (SELECT diagnoses_icd.row_id FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'dis of gallbladder nec'))
mimic_iii
CREATE TABLE table_27786562_1 ( starts VARCHAR, driver VARCHAR )
Name the starts for bobby labonte
SELECT starts FROM table_27786562_1 WHERE driver = "Bobby Labonte"
sql_create_context
CREATE TABLE table_45628 ( "Date" text, "H/A/N" text, "Opponent" text, "Score" text, "Record" text )
What is the Cavaliers Record in the game with a Score of 98-99?
SELECT "Record" FROM table_45628 WHERE "Score" = '98-99'
wikisql
CREATE TABLE table_name_39 ( iata VARCHAR, airport VARCHAR )
What is the IATA of Leonardo da Vinci-Fiumicino Airport?
SELECT iata FROM table_name_39 WHERE airport = "leonardo da vinci-fiumicino airport"
sql_create_context
CREATE TABLE table_name_94 ( points INTEGER, goal_difference VARCHAR )
How many total points belong to the team with a goal difference of 8?
SELECT SUM(points) FROM table_name_94 WHERE goal_difference = 8
sql_create_context
CREATE TABLE table_2932 ( "Player" text, "Position" text, "NASL years" text, "NASL club(s)" text, "Accolades (Pre-NASL)" text )
What nasl club won several titles with leeds united?
SELECT "NASL club(s)" FROM table_2932 WHERE "Accolades (Pre-NASL)" = 'Won several titles with Leeds United'
wikisql
CREATE TABLE PostFeedback ( Id number, PostId number, IsAnonymous boolean, VoteTypeId number, CreationDate time ) CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text ) CREA...
Average Response Time for web apps CommCare tag.
WITH commcare_table AS (SELECT T.TagName, CAST((JULIANDAY(CreationDate) - JULIANDAY(P.CreationDate)) * 1440.0 AS INT) AS ResponseMinutes FROM Posts AS P INNER JOIN Posts AS A ON P.AcceptedAnswerId = A.Id INNER JOIN PostTags AS PT ON P.Id = PT.PostId INNER JOIN Tags AS T ON T.Id = PT.TagId WHERE P.PostTypeId = 1 AND (T....
sede
CREATE TABLE table_name_21 ( shooter VARCHAR, rank_points VARCHAR, event VARCHAR, total VARCHAR )
What Shooter has an Event of wc beijing, a Total of 16, and Rank points of 4?
SELECT shooter FROM table_name_21 WHERE event = "wc beijing" AND total = "16" AND rank_points = "4"
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, ...
查一下23984748患者在医院0159261的门诊诊断内容有白内障这几个字的门诊就诊记录
SELECT * 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 = '23984748' AND hz_info.YLJGDM = '0159261' AND txmzjzjlb.JZZDSM LIKE '%白内障%' UNION SELECT * FROM hz_info JOIN ftxmzjzjlb ON hz_info.YLJGDM = ftxmzjzjlb.YLJGDM AND h...
css
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...
在13年5月27日到21年1月31日期间,参保人99198987购买单一药品的最大购买次数有几次
SELECT COUNT(*) FROM qtb JOIN t_kc22 ON qtb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE qtb.PERSON_ID = '99198987' AND t_kc22.STA_DATE BETWEEN '2013-05-27' AND '2021-01-31' GROUP BY t_kc22.SOC_SRT_DIRE_CD ORDER BY COUNT(*) DESC LIMIT 1 UNION SELECT COUNT(*) FROM gyb JOIN t_kc22 ON gyb.MED_CLINIC_ID = t_kc22.MED_CLINIC_I...
css
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...
Comments of a specific user on my answers.
SELECT c.Id AS "comment_link", p.Id AS "post_link" FROM Posts AS p INNER JOIN Comments AS c ON p.Id = c.PostId WHERE c.UserId = '##CommentUser:Int##' AND p.OwnerUserId = '##UserID##' AND p.PostTypeId = 2
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 prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, ...
give the number of patients whose admission location is clinic referral/premature and drug name is clindamycin.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admission_location = "CLINIC REFERRAL/PREMATURE" AND prescriptions.drug = "Clindamycin"
mimicsql_data
CREATE TABLE table_49075 ( "Year" real, "Title" text, "Producer" text, "Narrator" text, "Author" text, "Citation" text )
what is the title when the citation is honor and the narrator is lincoln hoppe?
SELECT "Title" FROM table_49075 WHERE "Citation" = 'honor' AND "Narrator" = 'lincoln hoppe'
wikisql
CREATE TABLE table_name_60 ( class VARCHAR, frequency_mhz VARCHAR, erp_w VARCHAR )
What class is assigned to frequencies larger than 89.3 with an ERP W of 250?
SELECT class FROM table_name_60 WHERE frequency_mhz > 89.3 AND erp_w = 250
sql_create_context
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) 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...
病人名叫周泰宁在11年11月14日到13年6月11日内什么时间审核检验报告单的具体时间都是什么?
SELECT jybgb.SHSJ FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN mzjzjlb_jybgb 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 = mzjzjlb_jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND mzjzjl...
css
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 )
For those records from the products and each product's manufacturer, show me about the distribution of name and the average of code , and group by attribute name in a bar chart, and could you list by the Y in descending?
SELECT T1.Name, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name ORDER BY T1.Code DESC
nvbench
CREATE TABLE table_70569 ( "Rank" real, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
What's the lowest Gold if the Rank is over 4 but the Total is less than 1?
SELECT MIN("Gold") FROM table_70569 WHERE "Rank" > '4' AND "Total" < '1'
wikisql
CREATE TABLE playlisttrack ( playlistid number, trackid number ) CREATE TABLE playlist ( playlistid number, name text ) CREATE TABLE customer ( customerid number, firstname text, lastname text, company text, address text, city text, state text, country text, postalc...
What is all the customer information for customers in NY state?
SELECT * FROM customer WHERE state = "NY"
spider
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 prescriptions...
give the number of patients who died in or before year 2115 with a drug name docusate sodium (liquid).
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.dod_year <= "2115.0" AND prescriptions.drug = "Docusate Sodium (Liquid)"
mimicsql_data
CREATE TABLE table_name_20 ( home_team VARCHAR, away_team VARCHAR )
who is the home team when the away team is wolverhampton wanderers?
SELECT home_team FROM table_name_20 WHERE away_team = "wolverhampton wanderers"
sql_create_context
CREATE TABLE table_204_802 ( id number, "tie no" number, "home team" text, "score" text, "away team" text, "date" text )
what is the total number of games played on 22 november 1988 ?
SELECT COUNT(*) FROM table_204_802 WHERE "date" = '22 november 1988'
squall
CREATE TABLE table_7174 ( "Name" text, "Location" text, "Type" text, "Completed" text, "List entry number" real )
What is the entry number on the list for Fairfield Moravian Church?
SELECT "List entry number" FROM table_7174 WHERE "Name" = 'fairfield moravian church'
wikisql
CREATE TABLE table_67544 ( "Member countries" text, "Population" text, "Area (km\u00b2)" text, "GDP (billion US$)" text, "GDP per capita (US$)" text )
Which country has an area of 871,980 square km?
SELECT "Member countries" FROM table_67544 WHERE "Area (km\u00b2)" = '871,980'
wikisql
CREATE TABLE table_204_842 ( id number, "institution" text, "city" text, "state" text, "team name" text, "affiliation" text, "enrollment" number, "home conference" text )
which institution has the highest enrollment after elmhurst college ?
SELECT "institution" FROM table_204_842 WHERE "enrollment" < (SELECT "enrollment" FROM table_204_842 WHERE "institution" = 'elmhurst college') ORDER BY "enrollment" DESC LIMIT 1
squall
CREATE TABLE requirement ( requirement_id int, requirement varchar, college varchar ) CREATE TABLE program_requirement ( program_id int, category varchar, min_credit int, additional_req varchar ) CREATE TABLE course_offering ( offering_id int, course_id int, semester int, s...
What courses meet the ULCS requirement in Spring and Summer ?
SELECT DISTINCT course.department, course.name, course.number, semester.semester FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester INNER JOIN program_course ON program_course.course_id = course_offering.course_id...
advising
CREATE TABLE table_name_80 ( result VARCHAR, date VARCHAR )
What is the result on September 25, 1966?
SELECT result FROM table_name_80 WHERE date = "september 25, 1966"
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...
医院1518558全部医疗就诊的记录里参照科室编码与入院诊断编码差别查询一下大病支付的部分和医疗总费用相比,比值最小的是多少
SELECT qtb.MED_ORG_DEPT_CD, qtb.IN_DIAG_DIS_CD, MIN(t_kc24.ILL_PAY) FROM qtb JOIN t_kc24 ON qtb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE qtb.MED_SER_ORG_NO = '1518558' GROUP BY qtb.MED_ORG_DEPT_CD, qtb.IN_DIAG_DIS_CD UNION SELECT gyb.MED_ORG_DEPT_CD, gyb.IN_DIAG_DIS_CD, MIN(t_kc24.ILL_PAY) FROM gyb JOIN t_kc24 ON gyb...
css
CREATE TABLE table_train_6 ( "id" int, "bleeding" int, "systolic_blood_pressure_sbp" int, "mean_arterial_pressure_map" int, "active_infection" bool, "hypotension" bool, "age" float, "NOUSE" float )
risk of bleeding
SELECT * FROM table_train_6 WHERE bleeding = 1
criteria2sql
CREATE TABLE table_23755 ( "Condition" text, "Prothrombin time" text, "Partial thromboplastin time" text, "Bleeding time" text, "Platelet count" text )
In what conditions are both the platelet count and prothrombin time unaffected?
SELECT "Condition" FROM table_23755 WHERE "Platelet count" = 'Unaffected' AND "Prothrombin time" = 'Unaffected'
wikisql
CREATE TABLE table_name_18 ( wins INTEGER, years VARCHAR, pct VARCHAR )
Which Wins have Years of 1881, and a Pct larger than 0.75?
SELECT AVG(wins) FROM table_name_18 WHERE years = "1881" AND pct > 0.75
sql_create_context
CREATE TABLE table_29268 ( "No. in series" text, "No. in season" text, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production code" text )
Who wrote the episode in the series 46b?
SELECT "Written by" FROM table_29268 WHERE "No. in series" = '46b'
wikisql
CREATE TABLE table_9945 ( "Place" text, "Athlete" text, "Points" text, "Score" text, "500 m" text, "1500 m" text, "5000 m" text, "10000 m" text )
What was the points when the 5000 m was 7?
SELECT "Points" FROM table_9945 WHERE "5000 m" = '7'
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...
provide the number of patients whose days of hospital stay is greater than 34 and drug code is adva250ih?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.days_stay > "34" AND prescriptions.formulary_drug_cd = "ADVA250IH"
mimicsql_data
CREATE TABLE table_77383 ( "Tournament" text, "1988" text, "1989" text, "1990" text, "1991" text, "1992" text, "1993" text, "1994" text, "1995" text, "1996" text, "1997" text, "1998" text, "1999" text, "2000" text, "2001" text, "2002" text, "2003" text...
What shows for 1992 when 1988 is A, at the Australian Open?
SELECT "1992" FROM table_77383 WHERE "1988" = 'a' AND "Tournament" = 'australian open'
wikisql
CREATE TABLE table_37714 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text )
what country has tiger woods
SELECT "Country" FROM table_37714 WHERE "Player" = 'tiger woods'
wikisql
CREATE TABLE table_name_25 ( margin_of_victory VARCHAR, year VARCHAR, to_par VARCHAR, score VARCHAR )
Which Margin of victory has a Year larger than 1994, and a To par of 14, and a Score of 69-67-69-69=274?
SELECT margin_of_victory FROM table_name_25 WHERE year > 1994 AND to_par = "–14" AND score = 69 - 67 - 69 - 69 = 274
sql_create_context
CREATE TABLE instructor ( ID varchar(5), name varchar(20), dept_name varchar(20), salary numeric(8,2) ) CREATE TABLE department ( dept_name varchar(20), building varchar(15), budget numeric(12,2) ) CREATE TABLE classroom ( building varchar(15), room_number varchar(7), capacity ...
What is the sum of credit value of courses with more than one prerequisite for each department? Return a bar chart, I want to show y-axis from low to high order.
SELECT dept_name, SUM(credits) FROM course AS T1 JOIN prereq AS T2 ON T1.course_id = T2.course_id GROUP BY dept_name ORDER BY SUM(credits)
nvbench
CREATE TABLE table_204_529 ( id number, "year" number, "personnel" text, "album" text, "label" text, "peak positions\nnor" number )
which album did she produce before good rain ?
SELECT "album" FROM table_204_529 WHERE id = (SELECT id FROM table_204_529 WHERE "album" = 'good rain') - 1
squall
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 )
Please tell the revenues of the companies with the highest revenues in each headquarter city.
SELECT Headquarter, MAX(Revenue) FROM Manufacturers GROUP BY Headquarter
nvbench
CREATE TABLE table_62588 ( "Medal" text, "Name" text, "Games" text, "Sport" text, "Event" text )
What Medal did James Odwori receive for Boxing in the 1970 Edinburgh Games?
SELECT "Medal" FROM table_62588 WHERE "Sport" = 'boxing' AND "Games" = '1970 edinburgh' AND "Name" = 'james odwori'
wikisql
CREATE TABLE table_41589 ( "Position" text, "Jersey number" real, "Name v t e" text, "Height (cm)" real, "Weight (kg)" real, "Birthplace" text, "2008-09 team" text, "NHL rights, if any" text )
What is the 2008-09 team of the player who plays the f position and has NHL rights with the New Jersey Devils?
SELECT "2008-09 team" FROM table_41589 WHERE "Position" = 'f' AND "NHL rights, if any" = 'new jersey devils'
wikisql
CREATE TABLE school ( school VARCHAR, TYPE VARCHAR, school_id VARCHAR ) CREATE TABLE school_bus ( school VARCHAR, TYPE VARCHAR, school_id VARCHAR )
Show the school name and type for schools without a school bus.
SELECT school, TYPE FROM school WHERE NOT school_id IN (SELECT school_id FROM school_bus)
sql_create_context
CREATE TABLE market ( Market_ID int, District text, Num_of_employees int, Num_of_shops real, Ranking int ) CREATE TABLE phone_market ( Market_ID int, Phone_ID text, Num_of_stock int ) CREATE TABLE phone ( Name text, Phone_ID int, Memory_in_G int, Carrier text, Price...
I want to compare the number of the names of phones by a bar chart, could you rank by the the number of name in desc?
SELECT Name, COUNT(Name) FROM phone_market AS T1 JOIN market AS T2 ON T1.Market_ID = T2.Market_ID JOIN phone AS T3 ON T1.Phone_ID = T3.Phone_ID GROUP BY Name ORDER BY COUNT(Name) DESC
nvbench
CREATE TABLE table_53953 ( "Title" text, "Urdu" text, "Translation" text, "Date" real, "Content" text )
Which translation was published in 1986?
SELECT "Translation" FROM table_53953 WHERE "Date" = '1986'
wikisql
CREATE TABLE table_47582 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Decision" text, "Attendance" real, "Series" text )
Who was the Home team that had a decider of Conklin?
SELECT "Home" FROM table_47582 WHERE "Decision" = 'conklin'
wikisql
CREATE TABLE table_name_17 ( game_site VARCHAR, week VARCHAR )
I want the game site for week of 11
SELECT game_site FROM table_name_17 WHERE week = 11
sql_create_context
CREATE TABLE table_name_89 ( games VARCHAR, season VARCHAR, points VARCHAR )
What's the total number of games with more than 20 points for the 1976 season?
SELECT COUNT(games) FROM table_name_89 WHERE season = "1976" AND points > 20
sql_create_context
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...
病患柏哲茂在2019-02-14以后做过的检验报告在哪些门诊?列出这些门诊就诊的流水编码
SELECT mzjzjlb.JZLSH FROM person_info JOIN hz_info JOIN mzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX WHERE person_info.XM = '柏哲茂' AND NOT mzjzjlb.JZLSH IN (SELECT jybgb.JZLSH FROM jybgb WHERE jybgb.BGRQ <= '2019-02-14')
css
CREATE TABLE table_name_24 ( opponent VARCHAR, score VARCHAR )
What team was the opponent when the score was 8-2?
SELECT opponent FROM table_name_24 WHERE score = "8-2"
sql_create_context
CREATE TABLE table_train_25 ( "id" int, "bleeding" int, "acute_cerebrovascular_accident_cva" bool, "heart_disease" bool, "trauma" bool, "st_segment_elevation_myocardial_infarction_stemi" bool, "NOUSE" float )
suspected acute cerebrovascular accident ( cva )
SELECT * FROM table_train_25 WHERE acute_cerebrovascular_accident_cva = 1
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...
Give me the comparison about Team_ID over the ACC_Road , and group by attribute ACC_Home, and sort by the Y-axis in ascending.
SELECT ACC_Road, Team_ID FROM basketball_match GROUP BY ACC_Home, ACC_Road ORDER BY Team_ID
nvbench
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, ...
shortest flight from BOSTON to PHILADELPHIA
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 = 'BOSTON' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'PHILAD...
atis
CREATE TABLE table_name_7 ( year INTEGER, event VARCHAR, venue VARCHAR )
What is the lowest year that had foil team as the event at Melbourne?
SELECT MIN(year) FROM table_name_7 WHERE event = "foil team" AND venue = "melbourne"
sql_create_context
CREATE TABLE table_48767 ( "Season" real, "Date" text, "Location" text, "Race" text, "Place" text )
When 7th place, what is the date?
SELECT "Date" FROM table_48767 WHERE "Place" = '7th'
wikisql
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 ( ...
count the number of patients whose primary disease is overdose and age is less than 50?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "OVERDOSE" AND demographic.age < "50"
mimicsql_data
CREATE TABLE employee ( eid number, name text, salary number ) CREATE TABLE aircraft ( aid number, name text, distance number ) CREATE TABLE flight ( flno number, origin text, destination text, distance number, departure_date time, arrival_date time, price number, ...
Show all flight number from Los Angeles.
SELECT flno FROM flight WHERE origin = "Los Angeles"
spider
CREATE TABLE table_name_61 ( attendance VARCHAR, date VARCHAR, competition VARCHAR, venue VARCHAR )
How many people attended the away league competition with a date of 22?
SELECT attendance FROM table_name_61 WHERE competition = "league" AND venue = "away" AND date = 22
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...
在2015年3月27日开始2015年11月9日结束患者彭嘉怡被开出的所有药品的编码是多少?名称是什么?数量是多少?单价是多少?金额是多少?
SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM, t_kc22.QTY, t_kc22.UNIVALENT, t_kc22.AMOUNT FROM gwyjzb JOIN t_kc22 ON gwyjzb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gwyjzb.PERSON_NM = '彭嘉怡' AND gwyjzb.IN_HOSP_DATE BETWEEN '2015-03-27' AND '2015-11-09' UNION SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_...
css
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...
how many patient admitted urgently in hospital have been prescribed the drug with code clin1000i?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admission_type = "URGENT" AND prescriptions.formulary_drug_cd = "CLIN1000I"
mimicsql_data
CREATE TABLE table_10055 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text )
What is the score of player mark hayes?
SELECT "Score" FROM table_10055 WHERE "Player" = 'mark hayes'
wikisql
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...
how many hours does it have been since the first time patient 007-15837 stayed in ward 428 on the current hospital encounter?
SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', patient.unitadmittime)) FROM patient WHERE patient.uniquepid = '007-15837' AND patient.wardid = 428 AND patient.hospitaldischargetime IS NULL ORDER BY patient.unitadmittime LIMIT 1
eicu
CREATE TABLE table_2439728_1 ( mascot VARCHAR, school VARCHAR )
what is the mascot of st. paul's school?
SELECT mascot FROM table_2439728_1 WHERE school = "St. Paul's school"
sql_create_context
CREATE TABLE table_12248 ( "7:00 am" text, "8:00 am" text, "9:00 am" text, "11:00 am" text, "noon" text, "12:30 pm" text, "1:00 pm" text, "1:30 pm" text, "2:00 pm" text, "3:00 pm" text, "3:30 pm" text, "4:00 pm" text, "4:30 pm" text, "5:00 pm" text, "6:30 pm" ...
What is the 9am program on the channel that shows Power Rangers in Space at 4pm?
SELECT "9:00 am" FROM table_12248 WHERE "4:00 pm" = 'power rangers in space'
wikisql
CREATE TABLE table_name_95 ( tyre VARCHAR, date VARCHAR )
What was the Tyre for 19 January?
SELECT tyre FROM table_name_95 WHERE date = "19 january"
sql_create_context
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime t...
what were the three most frequent laboratory tests since 2100 for patients with age 50s?
SELECT t1.labname FROM (SELECT lab.labname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.age BETWEEN 50 AND 59) AND STRFTIME('%y', lab.labresulttime) >= '2100' GROUP BY lab.labname) AS t1 WHERE t1.c1 <= 3
eicu
CREATE TABLE table_name_54 ( film VARCHAR, role VARCHAR, leading_man VARCHAR, director VARCHAR, year VARCHAR )
What film was the director william a. wellman, later than 1931 with a leading man of george brent, and a Role of joan gordon, aka francine la rue?
SELECT film FROM table_name_54 WHERE director = "william a. wellman" AND year > 1931 AND leading_man = "george brent" AND role = "joan gordon, aka francine la rue"
sql_create_context
CREATE TABLE table_23390 ( "No. in series" text, "No. in season" real, "Family/families" text, "Location(s)" text, "Original air date" text )
In how many locations was the episode with the Bailey family filmed?
SELECT COUNT("Location(s)") FROM table_23390 WHERE "Family/families" = 'The Bailey Family'
wikisql
CREATE TABLE table_4237 ( "Series #" real, "Season #" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production code" text, "U.S. viewers (million)" text )
What number episode in the season was titled 'Shattered'?
SELECT MAX("Season #") FROM table_4237 WHERE "Title" = 'Shattered'
wikisql
CREATE TABLE table_name_59 ( losses INTEGER, played VARCHAR, points VARCHAR, position VARCHAR, wins VARCHAR )
What was the highest number of losses for a position less than 6, with more than 11 wins and 36 points, with a played entry of more than 30?
SELECT MAX(losses) FROM table_name_59 WHERE position < 6 AND wins > 11 AND points = 36 AND played > 30
sql_create_context
CREATE TABLE table_11713303_2 ( replaced_by VARCHAR, date_of_appointment VARCHAR, manner_of_departure VARCHAR )
How many have been replaced where the appointment date is 10 December 2007 and the manner of departure is quit?
SELECT COUNT(replaced_by) FROM table_11713303_2 WHERE date_of_appointment = "10 December 2007" AND manner_of_departure = "Quit"
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 demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, ...
how many patients who primarily diagnosed for coronary artery disease or coronary artery bypass graft /sda died in or before the year 2112?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "CORONARY ARTERY DISEASE\CORONARY ARTERY BYPASS GRAFT /SDA" AND demographic.dod_year <= "2112.0"
mimicsql_data
CREATE TABLE table_49095 ( "Res." text, "Record" text, "Opponent" text, "Method" text, "Event" text, "Round" real, "Location" text )
What was the result of the fight when Tetsuji Kato's record was 19-9?
SELECT "Res." FROM table_49095 WHERE "Record" = '19-9'
wikisql
CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE FlagTypes ( Id number, Name text, Description text ) CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text...
Sources and edits with <i>.
SELECT PostHistoryTypeId, PostId AS "post_link", CreationDate, Comment, Text FROM PostHistory WHERE PostHistoryTypeId IN (2, 5) AND Text LIKE '%<i>%' ORDER BY CreationDate DESC
sede
CREATE TABLE table_15887683_8 ( package_option VARCHAR, n° VARCHAR )
Name the package/option for number being 543
SELECT package_option FROM table_15887683_8 WHERE n° = 543
sql_create_context
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses ( ...
what is age of subject id 2560?
SELECT demographic.age FROM demographic WHERE demographic.subject_id = "2560"
mimicsql_data
CREATE TABLE table_7356 ( "Date" text, "Time" text, "Name" text, "Flag" text, "Casualties" real, "Tonnage (GRT)" real, "Cargo" text, "Sunk by..." text )
What is the sum of tonnage with a time at 00:10 and less than 42 casualties?
SELECT SUM("Tonnage (GRT)") FROM table_7356 WHERE "Time" = '00:10' AND "Casualties" < '42'
wikisql
CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttim...
show me the top five most commonly prescribed drugs for patients over the age of 60 or above in this year?
SELECT t1.drug FROM (SELECT prescriptions.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.age >= 60) AND DATETIME(prescriptions.startdate, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0...
mimic_iii
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text,...
what is lab test abnormal status of subject id 2560?
SELECT lab.flag FROM lab WHERE lab.subject_id = "2560"
mimicsql_data
CREATE TABLE table_name_72 ( att_cmp_int VARCHAR, effic VARCHAR )
What is the Att-Cmp-Int for the player with a efficiency of 117.4?
SELECT att_cmp_int FROM table_name_72 WHERE effic = 117.4
sql_create_context
CREATE TABLE table_17356205_1 ( original_air_date VARCHAR, directed_by VARCHAR )
What is the original air date of the episode directed by Terrence Nightingall?
SELECT original_air_date FROM table_17356205_1 WHERE directed_by = "Terrence Nightingall"
sql_create_context
CREATE TABLE table_13638 ( "Stage" text, "Winner" text, "General classification" text, "Points classification" text, "Mountains classification" text, "Young rider classification" text )
What's the mountains classification when the points classification is Alessandro Petacchi and the general classification is Danilo Di Luca?
SELECT "Mountains classification" FROM table_13638 WHERE "Points classification" = 'alessandro petacchi' AND "General classification" = 'danilo di luca'
wikisql
CREATE TABLE table_204_778 ( id number, "code" number, "county" text, "former province" text, "area (km2)" number, "population\ncensus 2009" number, "capital" text )
how many counties have a population greater than 500,000 ?
SELECT COUNT("county") FROM table_204_778 WHERE "population\ncensus 2009" > 500000
squall
CREATE TABLE table_12828723_3 ( won VARCHAR, points_for VARCHAR )
what's the win with points for being 376
SELECT won FROM table_12828723_3 WHERE points_for = "376"
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, ...
门诊诊断为病人患疾病J02.597的的促甲状腺激素受体抗体数值的平均值以及最值分别是多少?
SELECT AVG(jyjgzbb.JCZBJGDL), MIN(jyjgzbb.JCZBJGDL), MAX(jyjgzbb.JCZBJGDL) FROM wdmzjzjlb JOIN jybgb JOIN jyjgzbb ON wdmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND wdmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE wdmzjzjlb.JZZDBM = 'J02.597' AND jyjgzbb.JCZBMC = '...
css
CREATE TABLE table_43620 ( "Developer(s)" text, "Release date" text, "Required OS" text, "Genre" text, "Type" text )
When did Masthead Studios release their game?
SELECT "Release date" FROM table_43620 WHERE "Developer(s)" = 'masthead studios'
wikisql
CREATE TABLE table_29968 ( "Team" text, "Outgoing manager" text, "Manner of departure" text, "Date of vacancy" text, "Replaced by" text, "Date of appointment" text, "Position in table" text )
Which manager was replaced by Thomas Thomasberg?
SELECT "Outgoing manager" FROM table_29968 WHERE "Replaced by" = 'Thomas Thomasberg'
wikisql
CREATE TABLE table_name_99 ( week INTEGER, opponent VARCHAR )
In what week(s) did the Broncos go up against the Cleveland Browns?
SELECT SUM(week) FROM table_name_99 WHERE opponent = "cleveland browns"
sql_create_context
CREATE TABLE Badges ( Id number, UserId number, Name text, Date time, Class number, TagBased boolean ) CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) CREATE TABLE PostHistory ( Id number, ...
Number of Questions after introducing bounties to SO.
SELECT COUNT(Id) FROM Posts WHERE CreationDate >= '2009-01-27' AND PostTypeId = 1
sede
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, ...
门诊给患者王灵慧诊断为混合性焦虑和抑郁障碍,666198这个检测指标的结果定量和单位分别是什么
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_44023 ( "Date" text, "Home" text, "Score" text, "Away" text, "Attendance" real )
Who played hte home team when the score was 2:1?
SELECT "Home" FROM table_44023 WHERE "Score" = '2:1'
wikisql
CREATE TABLE table_33724 ( "Year" real, "Kit Supplier" text, "Sponsor" text, "Shirt Printing" text, "Notes" text )
What is the average of all the years when the notes are electronics brand?
SELECT AVG("Year") FROM table_33724 WHERE "Notes" = 'electronics brand'
wikisql
CREATE TABLE mzjybgb ( BBCJBW text, BBDM text, BBMC text, BBZT number, BGDH number, 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, ...
有多少检验报告单是病人48698459在00年9月24日到2010年6月21日内开出其科室编码以及名称都是什么?
SELECT zyjybgb.KSBM, zyjybgb.KSMC FROM hz_info JOIN mzjzjlb JOIN zyjybgb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = zyjybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = zyjybgb.JZLSH_MZJZJLB WHERE hz_info.RYBH = '48698459' AND zyjybgb.BGRQ BETWEEN '2000-09-24...
css
CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, ExpiryDate time, Body text, OwnerUserId number, DeletionUserId number ) CREATE TABLE VoteTypes ( Id number, Name text ) CREATE TABLE Tags ( Id number, ...
Questions per month, container stuff.
SELECT *, COUNT(*) FROM (SELECT DATE(CAST(TIME_TO_STR(CreationDate, '%Y') AS TEXT) + '-' + CAST(TIME_TO_STR(CreationDate, '%m') AS TEXT) + '-01') AS Month, t.TagName FROM (SELECT p.Id, p.CreationDate FROM Posts AS p JOIN PostTags AS pt ON pt.PostId = p.Id JOIN Tags AS t ON t.Id = pt.TagId) AS pp JOIN PostTags AS pt ON ...
sede
CREATE TABLE table_53796 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text )
Name the team for 48 game
SELECT "Team" FROM table_53796 WHERE "Game" = '48'
wikisql