context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE SuggestedEdits ( Id number, PostId number, CreationDate time, ApprovalDate time, RejectionDate time, OwnerUserId number, Comment text, Text text, Title text, Tags text, RevisionGUID other ) CREATE TABLE ReviewTasks ( Id number, ReviewTaskTypeId number, ...
Questions: Top Scored/Viewed/Favorited by Tag, Year, Month.
SELECT Posts.Id, Posts.Id AS "post_link", Posts.ViewCount AS Views, Posts.Score, Posts.FavoriteCount AS "FavCount", Posts.Tags FROM Posts WHERE Posts.Tags LIKE @Tag AND YEAR(Posts.CreationDate) = @Year AND MONTH(Posts.CreationDate) = @Month ORDER BY Posts.Score DESC, Posts.ViewCount DESC LIMIT 100
sede
CREATE TABLE table_51016 ( "Constituency" text, "Electorate" real, "Votes" real, "Turnout" real, "Spoilt" real, "Percent Yes" real )
WHAT IS THE LOWEST ELECTORATE WITH 31,511 VOTES, AND PERCENT YES SMALLER THAN 57.2?
SELECT MIN("Electorate") FROM table_51016 WHERE "Votes" = '31,511' AND "Percent Yes" < '57.2'
wikisql
CREATE TABLE table_71161 ( "Margin" real, "Score" text, "Opponent" text, "Venue" text, "Year" real )
Name the margin for 2002
SELECT "Margin" FROM table_71161 WHERE "Year" = '2002'
wikisql
CREATE TABLE table_39536 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" real, "Record" text )
Name the date with score of 9-2
SELECT "Date" FROM table_39536 WHERE "Score" = '9-2'
wikisql
CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, ExpiryDate time, Body text, OwnerUserId...
Comments like 'What have you tried?' on accepted answer post.
SELECT c.Text, c.Id AS "comment_link", p.Score, c.CreationDate, p.ViewCount, LENGTH(c.Text) AS "Len", p.Id AS "post_link" FROM Comments AS c INNER JOIN Posts AS p ON c.PostId = p.Id WHERE c.Text LIKE '%hat %ha% tr%' AND c.UserId = '##UserId##' ORDER BY p.CreationDate DESC LIMIT 100
sede
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...
在医院9057855中就诊科室名称包含男科的所有门诊中,患者64012281的就诊记录的流水号是哪些
SELECT txmzjzjlb.JZLSH 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 = '64012281' AND hz_info.YLJGDM = '9057855' AND txmzjzjlb.JZKSMC LIKE '%男科%' UNION SELECT ftxmzjzjlb.JZLSH FROM hz_info JOIN ftxmzjzjlb ON hz_info.YLJG...
css
CREATE TABLE table_name_54 ( category VARCHAR, result VARCHAR, nominee VARCHAR )
Which category was Gene Barry nominated in?
SELECT category FROM table_name_54 WHERE result = "nominated" AND nominee = "gene barry"
sql_create_context
CREATE TABLE table_name_47 ( series VARCHAR, released_by VARCHAR, release_date VARCHAR )
WHAT SERIES WAS RELEASED BY ITV STUDIOS AND A RELEASE DATE OF AUGUST 15, 2012?
SELECT series FROM table_name_47 WHERE released_by = "itv studios" AND release_date = "august 15, 2012"
sql_create_context
CREATE TABLE table_name_95 ( roll VARCHAR, area VARCHAR )
Can you tell me the total number of Roll that has the Area of aranga?
SELECT COUNT(roll) FROM table_name_95 WHERE area = "aranga"
sql_create_context
CREATE TABLE table_55246 ( "Year" text, "President" text, "Vice President" text, "Gen.-Secretary" text, "Treasurer" text )
Which year has a Gen.-Secretary of silvana jansen?
SELECT "Year" FROM table_55246 WHERE "Gen.-Secretary" = 'silvana jansen'
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...
70649441899那个门诊在哪年哪月的哪一天就诊
SELECT txmzjzjlb.JZKSRQ FROM txmzjzjlb WHERE txmzjzjlb.JZLSH = '70649441899' UNION SELECT ftxmzjzjlb.JZKSRQ FROM ftxmzjzjlb WHERE ftxmzjzjlb.JZLSH = '70649441899'
css
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, h...
what are the four most commonly ordered lab tests ordered for patients who have previously been diagnosed with unable to protect airway within 2 months, the last year?
SELECT t3.labname FROM (SELECT t2.labname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'unable to protect airway' AND DATETIME(diagnosis.dia...
eicu
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id t...
how many patients are single and diagnosed with syncope and collapse?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.marital_status = "SINGLE" AND diagnoses.long_title = "Syncope and collapse"
mimicsql_data
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, ...
03年6月6日到08年9月28日这一段时间有几个医生就诊过患者彭俊捷?
SELECT COUNT(mzjzjlb.ZZYSGH) FROM person_info JOIN hz_info JOIN mzjzjlb JOIN hz_info_mzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND hz_info_mzjzjlb.JZLSH = mzjzjlb.JZLSH AND hz_info_mzjzjlb.YLJGDM = hz_info_mzjzjlb.YLJ...
css
CREATE TABLE table_13904 ( "Name" text, "Height" text, "Weight" text, "Spike" text, "2008 club" text )
What is the Weight of the Player from Iskra Odintsovo 2008 Club?
SELECT "Weight" FROM table_13904 WHERE "2008 club" = 'iskra odintsovo'
wikisql
CREATE TABLE table_21469545_2 ( no VARCHAR, margin_of_victory VARCHAR )
Name the number for margin of victory being 3 strokes
SELECT COUNT(no) FROM table_21469545_2 WHERE margin_of_victory = "3 strokes"
sql_create_context
CREATE TABLE table_56450 ( "Player" text, "Tackles" real, "Solo" real, "Assisted" real, "Sack" real, "Yards" real, "TD's" real )
What is the highest Sack with an Assisted larger than 4, with TD's smaller than 0?
SELECT MAX("Sack") FROM table_56450 WHERE "Assisted" > '4' AND "TD's" < '0'
wikisql
CREATE TABLE table_5018 ( "Season" text, "Series" text, "Team" text, "Races" text, "Wins" text, "Poles" text, "F/Laps" text, "Podiums" text, "Points" text, "Position" text )
How many races had 10.5 points?
SELECT "Races" FROM table_5018 WHERE "Points" = '10.5'
wikisql
CREATE TABLE table_11251601_2 ( avg_emission_per_km_2_of_its_land__tons_ INTEGER, country VARCHAR )
WHAT WAS THE AVERAGE EMISSION PER KM 2 IN INDIA?
SELECT MAX(avg_emission_per_km_2_of_its_land__tons_) FROM table_11251601_2 WHERE country = "India"
sql_create_context
CREATE TABLE table_4034 ( "English Name" text, "Simplified" text, "Traditional" text, "Pinyin" text, "Area" real, "Population" real, "Density" real )
What is the area of xin county?
SELECT "Area" FROM table_4034 WHERE "English Name" = 'Xin County'
wikisql
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...
那个叫做朱秀兰的病患在04年4月24日到2021年1月7日内医保的统筹基金支出共有多少钱?
SELECT SUM(t_kc24.OVE_PAY) FROM qtb JOIN t_kc24 ON qtb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE qtb.PERSON_NM = '朱秀兰' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2004-04-24' AND '2021-01-07' UNION SELECT SUM(t_kc24.OVE_PAY) FROM gyb JOIN t_kc24 ON gyb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE gyb.PERSON_NM = '朱秀兰' AND t_kc2...
css
CREATE TABLE table_19506 ( "Rank" real, "State" text, "Revenue (millions)" text, "Population" real, "Revenue per capita" text, "Spending (millions)" text, "Spending per capita" text, "Net contribution per capita" text, "Presidential majority 2000/2004" text, "Presidential majorit...
How many numbers were recorded under revenue when revenue per capita was $6,126?
SELECT COUNT("Revenue (millions)") FROM table_19506 WHERE "Revenue per capita" = '$6,126'
wikisql
CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime...
did patient 006-254182 receive a laboratory test in 09/last year?
SELECT COUNT(*) > 0 FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-254182')) AND DATETIME(lab.labresulttime, 'start of year') = DATETIME(CURRENT_TIME()...
eicu
CREATE TABLE Users ( Id number, Reputation number, CreationDate time, DisplayName text, LastAccessDate time, WebsiteUrl text, Location text, AboutMe text, Views number, UpVotes number, DownVotes number, ProfileImageUrl text, EmailHash text, AccountId number ) CRE...
Dump Project Management Stack Exchange (PMSE) Posts.
SELECT * FROM Posts WHERE OwnerUserId = '##UserId##'
sede
CREATE TABLE area ( course_id int, area varchar ) CREATE TABLE program ( program_id int, name varchar, college varchar, introduction varchar ) CREATE TABLE ta ( campus_job_id int, student_id int, location varchar ) CREATE TABLE course ( course_id int, name varchar, dep...
What subjects does COMM 490 cover ?
SELECT DISTINCT description, name FROM course WHERE department = 'COMM' AND number = 490
advising
CREATE TABLE table_204_238 ( id number, "#" number, "title" text, "producer(s)" text, "performer (s)" text, "time" text )
what is the name of the title after number 9 ?
SELECT "title" FROM table_204_238 WHERE "#" = 9 + 1
squall
CREATE TABLE table_49281 ( "Rank" text, "Company" text, "Headquarters" text, "Industry" text, "Sales (billion $)" real, "Profits (billion $)" real, "Assets (billion $)" real, "Market Value (billion $)" real )
What is the highest Market Value (billion $), when Rank is 02 2, and when Sales (billion $) is greater than 113.1?
SELECT MAX("Market Value (billion $)") FROM table_49281 WHERE "Rank" = '02 2' AND "Sales (billion $)" > '113.1'
wikisql
CREATE TABLE technician ( Team VARCHAR )
Show the team that have at least two technicians.
SELECT Team FROM technician GROUP BY Team HAVING COUNT(*) >= 2
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...
在不同的入院诊断疾病名称以及科室名称的条件下,把那个7863848号医院的全部的医疗就诊记录中患者的平均年龄列出来是哪些呢?
SELECT gwyjzb.MED_ORG_DEPT_NM, gwyjzb.IN_DIAG_DIS_NM, AVG(gwyjzb.PERSON_AGE) FROM gwyjzb WHERE gwyjzb.MED_SER_ORG_NO = '7863848' GROUP BY gwyjzb.MED_ORG_DEPT_NM, gwyjzb.IN_DIAG_DIS_NM UNION SELECT fgwyjzb.MED_ORG_DEPT_NM, fgwyjzb.IN_DIAG_DIS_NM, AVG(fgwyjzb.PERSON_AGE) FROM fgwyjzb WHERE fgwyjzb.MED_SER_ORG_NO = '78638...
css
CREATE TABLE course_prerequisite ( pre_course_id int, course_id int ) CREATE TABLE offering_instructor ( offering_instructor_id int, offering_id int, instructor_id int ) CREATE TABLE instructor ( instructor_id int, name varchar, uniqname varchar ) CREATE TABLE area ( course_id int...
What do you think the hardest class is ?
SELECT DISTINCT course.name, course.number, program_course.workload FROM course, program_course WHERE course.department = 'EECS' AND program_course.course_id = course.course_id AND program_course.workload = (SELECT MAX(PROGRAM_COURSEalias1.workload) FROM course AS COURSEalias1, program_course AS PROGRAM_COURSEalias1 WH...
advising
CREATE TABLE table_17941032_2 ( played VARCHAR, tries_for VARCHAR )
How many times were there plays with a try of 56?
SELECT played FROM table_17941032_2 WHERE tries_for = "56"
sql_create_context
CREATE TABLE time_zone ( time_zone_code text, time_zone_name text, hours_from_gmt int ) CREATE TABLE compartment_class ( compartment varchar, class_type varchar ) CREATE TABLE time_interval ( period text, begin_time int, end_time int ) CREATE TABLE days ( days_code varchar, da...
what is the flight number for the CO flight which leaves DENVER at 1220pm and goes to SAN FRANCISCO
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_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN FRANCISCO' AND flight.departure_time = 1220 AND flight.to_airport = AIRPORT_SERVICE_...
atis
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid number, wa...
find the number of patients who have been admitted in hospital this year.
SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE DATETIME(patient.hospitaladmittime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year')
eicu
CREATE TABLE table_32311 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
How many people watched a Glenferrie Oval?
SELECT COUNT("Crowd") FROM table_32311 WHERE "Venue" = 'glenferrie oval'
wikisql
CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TA...
when was the first time patient 027-140654 received a lab test for the anion gap during their current hospital encounter?
SELECT lab.labresulttime FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '027-140654' AND patient.hospitaldischargetime IS NULL)) AND lab.labname = 'anion ga...
eicu
CREATE TABLE table_11042 ( "Drobo (1st)" text, "Drobo (2nd)" text, "Drobo S" text, "Drobo S (2nd)" text, "Drobo FS" text, "Drobo Mini" text, "Drobo 5D" text )
Which Drobo (2nd) has a Drobo 5d of 2012-11-02?
SELECT "Drobo (2nd)" FROM table_11042 WHERE "Drobo 5D" = '2012-11-02'
wikisql
CREATE TABLE airlines ( name VARCHAR, alid VARCHAR ) CREATE TABLE routes ( alid VARCHAR )
Find the name of airline which runs the most number of routes.
SELECT T1.name FROM airlines AS T1 JOIN routes AS T2 ON T1.alid = T2.alid GROUP BY T1.name ORDER BY COUNT(*) DESC LIMIT 1
sql_create_context
CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code tex...
tell me the name of the specimen test that patient 031-9128 first received in 11/last year?
SELECT microlab.culturesite FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-9128')) AND DATETIME(microlab.culturetakentime, 'start of year') =...
eicu
CREATE TABLE table_19493 ( "Pick #" real, "NFL Team" text, "Player" text, "Position" text, "College" text )
What NFL team does player keith woodside play for?
SELECT "NFL Team" FROM table_19493 WHERE "Player" = 'Keith Woodside'
wikisql
CREATE TABLE table_22640 ( "HR no." text, "HR name" text, "CR no." real, "LMS no." real, "Built" text, "Works" text, "Withdrawn" text )
What is the lowest cr number?
SELECT MIN("CR no.") FROM table_22640
wikisql
CREATE TABLE table_10953197_4 ( writer_s_ VARCHAR, production_code VARCHAR )
Who's the writer for the episode with a production code 2395114?
SELECT writer_s_ FROM table_10953197_4 WHERE production_code = "2395114"
sql_create_context
CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE SuggestedEdits ( Id number, PostId number, CreationDate time, ApprovalDate time, ...
Most duplicated questions in a given tag.
SELECT q.Id AS "Question ID", PostLinks.PostId AS "Dupe Target ID", q.Tags AS "Original Tags" FROM PostLinks JOIN Posts AS q ON q.Id = RelatedPostId JOIN PostTags AS p ON p.PostId = q.Id JOIN Tags AS t ON p.TagId = t.Id WHERE LinkTypeId = 3 ORDER BY q.Id
sede
CREATE TABLE table_57726 ( "Year" real, "Race" text, "Team" text, "Pos." text, "Co-driver" text )
What position did Co-driver Jackie Oliver finish in the 24 hours of Le Mans?
SELECT "Pos." FROM table_57726 WHERE "Race" = '24 hours of le mans' AND "Co-driver" = 'jackie oliver'
wikisql
CREATE TABLE table_22485543_1 ( play_by_play VARCHAR, network VARCHAR, ice_level_reporters VARCHAR )
Who is the play-by-play when nbc is the network and darren pang is the ice level reporters?
SELECT play_by_play FROM table_22485543_1 WHERE network = "NBC" AND ice_level_reporters = "Darren Pang"
sql_create_context
CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(40), POSTAL_CODE varchar(12), CITY ...
For those employees who do not work in departments with managers that have ids between 100 and 200, show me about the distribution of first_name and commission_pct in a bar chart.
SELECT FIRST_NAME, COMMISSION_PCT FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200)
nvbench
CREATE TABLE hz_info ( KH text, KLX number, YLJGDM text, RYBH text ) 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, ...
检验报告单66558446308的就诊类型是哪一种类型?
SELECT JZLX FROM jybgb WHERE BGDH = '66558446308'
css
CREATE TABLE table_1342315_42 ( candidates VARCHAR, incumbent VARCHAR )
Who are the candidates in the race where Wright Patman is the incumbent?
SELECT candidates FROM table_1342315_42 WHERE incumbent = "Wright Patman"
sql_create_context
CREATE TABLE jybgb_jyjgzbb ( JYZBLSH number, YLJGDM text, jyjgzbb_id number ) CREATE TABLE mzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH text, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, ...
提供一下检测指标名称与结果定量单位和记录47933121418一致,但结果定量与其不相同的检验指标记录详情
SELECT * FROM jyjgzbb WHERE jyjgzbb.JCZBMC = (SELECT jyjgzbb.JCZBMC FROM jyjgzbb WHERE jyjgzbb.JYZBLSH = '47933121418') AND jyjgzbb.JCZBJGDW = (SELECT jyjgzbb.JCZBJGDW FROM jyjgzbb WHERE jyjgzbb.JYZBLSH = '47933121418') AND jyjgzbb.JCZBJGDL <> (SELECT jyjgzbb.JCZBJGDL FROM jyjgzbb WHERE jyjgzbb.JYZBLSH = '47933121418')
css
CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPrivilegedUserGuidance text, MarkdownConcensusDescription text, CreationDate time, CreationModeratorId number, ApprovalDa...
Top Android users in Sweden.
WITH USER_BY_TAG AS (SELECT ROW_NUMBER() OVER (ORDER BY COUNT(*) DESC) AS Rank, u.Id AS "user_link", COUNT(*) AS UpVotes FROM Tags AS t INNER JOIN PostTags AS pt ON pt.TagId = t.Id INNER JOIN Posts AS p ON p.ParentId = pt.PostId INNER JOIN Votes AS v ON v.PostId = p.Id AND VoteTypeId = 2 INNER JOIN Users AS u ON u.Id =...
sede
CREATE TABLE table_28652521_1 ( singer_part_number VARCHAR, storage_case VARCHAR )
What's the singer part number of the buttonholer whose storage case is a green plastic box?
SELECT singer_part_number FROM table_28652521_1 WHERE storage_case = "green plastic box"
sql_create_context
CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAddress text ) CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId nu...
Top 500 SciFi Questions (Score/ViewCount).
SELECT Title, Body, ViewCount, Score, Score / (ViewCount * 1.00) AS Ratio FROM Posts AS p JOIN PostTypes AS pt ON p.PostTypeId = pt.Id WHERE pt.Name = 'Question' AND (Score > '##questionScore:int##' OR ViewCount > '##questionViews:int##') ORDER BY Ratio DESC LIMIT 500
sede
CREATE TABLE table_64753 ( "Year" real, "Game" text, "Genre" text, "Platform(s)" text, "Developer(s)" text )
Who was the developer of Resident Evil 4?
SELECT "Developer(s)" FROM table_64753 WHERE "Game" = 'resident evil 4'
wikisql
CREATE TABLE gyb ( 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...
2371026这家医院的全部医疗就诊记录里,依照科室的区别查一查统筹基金的花费比上全部的医疗费得到的平均比值
SELECT qtb.MED_ORG_DEPT_NM, AVG(t_kc24.OVE_PAY) FROM qtb JOIN t_kc24 ON qtb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE qtb.MED_SER_ORG_NO = '2371026' GROUP BY qtb.MED_ORG_DEPT_NM UNION SELECT gyb.MED_ORG_DEPT_NM, AVG(t_kc24.OVE_PAY) FROM gyb JOIN t_kc24 ON gyb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE gyb.MED_SER_ORG_...
css
CREATE TABLE table_name_53 ( year INTEGER, engine VARCHAR, finish VARCHAR )
What is the earliest year of the Honda Engine with a finish of 4?
SELECT MIN(year) FROM table_name_53 WHERE engine = "honda" AND finish = 4
sql_create_context
CREATE TABLE Contacts ( contact_id INTEGER, customer_id INTEGER, gender VARCHAR(1), first_name VARCHAR(80), last_name VARCHAR(50), contact_phone VARCHAR(80) ) CREATE TABLE Addresses ( address_id INTEGER, line_1_number_building VARCHAR(80), city VARCHAR(50), zip_postcode VARCHAR(...
Show me a bar chart with the product name and their frequency, sort by the X in desc.
SELECT product_name, COUNT(product_name) FROM Products GROUP BY product_name ORDER BY product_name DESC
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 cost ( costid num...
what specimen test has patient 031-22988 received for the first time until 03/2104?
SELECT microlab.culturesite FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-22988')) AND STRFTIME('%y-%m', microlab.culturetakentime) <= '2104...
eicu
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 prescriptions...
how many patients with elective admission type had the procedure titled other operations on heart and pericardium?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_type = "ELECTIVE" AND procedures.long_title = "Other operations on heart and pericardium"
mimicsql_data
CREATE TABLE table_name_15 ( score_final INTEGER, competition_description VARCHAR, year VARCHAR )
What is the lowest final score of the American Cup competition before 2009?
SELECT MIN(score_final) FROM table_name_15 WHERE competition_description = "american cup" AND year < 2009
sql_create_context
CREATE TABLE table_43376 ( "Date" text, "Score" text, "Set 1" text, "Set 2" text, "Set 3" text, "Set 4" text, "Set 5" text, "Total" text )
What is the Set 3 when the Total was 98 - 92?
SELECT "Set 3" FROM table_43376 WHERE "Total" = '98 - 92'
wikisql
CREATE TABLE table_31435 ( "Series #" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Viewers (million)" text )
How many million viewers watched 'night moves'?
SELECT "Viewers (million)" FROM table_31435 WHERE "Title" = 'Night Moves'
wikisql
CREATE TABLE table_4182 ( "Outcome" text, "Year" real, "Championship" text, "Surface" text, "Partner" text, "Opponents" text, "Score" text )
On what surface was the Australian Open (6) played on?
SELECT "Surface" FROM table_4182 WHERE "Championship" = 'Australian Open (6)'
wikisql
CREATE TABLE table_51765 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
What day was played in SCG with the attendance more than 24,824?
SELECT "Date" FROM table_51765 WHERE "Crowd" > '24,824' AND "Venue" = 'scg'
wikisql
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemicsysto...
what are the four most commonly prescribed medications during this year for patients who were previously diagnosed with respiratory arrest in the same month?
SELECT t3.drugname FROM (SELECT t2.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'respiratory arrest' AND DATETIME(diagnosis.diagnos...
eicu
CREATE TABLE table_name_44 ( name VARCHAR, fate VARCHAR, cargo VARCHAR )
What is the name of the ship with pit props as Cargo sunk by u-48 *?
SELECT name FROM table_name_44 WHERE fate = "sunk by u-48 *" AND cargo = "pit props"
sql_create_context
CREATE TABLE song ( song_name varchar2(50), artist_name varchar2(50), country varchar2(20), f_id number(10), genre_is varchar2(20), rating number(10), languages varchar2(20), releasedate Date, resolution number(10) ) CREATE TABLE genre ( g_name varchar2(20), rating varchar2(...
What is the average song rating for each language. Plot them as bar chart.
SELECT languages, AVG(rating) FROM song GROUP BY languages
nvbench
CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time, drug text, dose_val_rx text, dose_unit_rx text, route text ) CREATE TABLE pat...
find the number of patients who have been admitted in hospital since 1 year ago.
SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE DATETIME(admissions.admittime) >= DATETIME(CURRENT_TIME(), '-1 year')
mimic_iii
CREATE TABLE table_5570 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" real, "Record" text )
What is the score when a loss was listed with Lannan (4-8)?
SELECT "Score" FROM table_5570 WHERE "Loss" = 'lannan (4-8)'
wikisql
CREATE TABLE phone ( Name text, Phone_ID int, Memory_in_G int, Carrier text, Price real ) 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_stoc...
Can you show a bar chart to visualize the number of carriers?
SELECT Carrier, COUNT(Carrier) FROM phone GROUP BY Carrier
nvbench
CREATE TABLE t_kc22 ( AMOUNT number, CHA_ITEM_LEV number, DATA_ID text, DIRE_TYPE number, DOSE_FORM text, DOSE_UNIT text, EACH_DOSAGE text, EXP_OCC_DATE time, FLX_MED_ORG_ID text, FXBZ number, HOSP_DOC_CD text, HOSP_DOC_NM text, MED_DIRE_CD text, MED_DIRE_NM text,...
列出医疗就诊26604541999中,所有开出的药品里,定价上限金额高于5321.44元的那些药
SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM t_kc22 JOIN t_kc21_t_kc22 JOIN t_kc21 ON t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID AND t_kc21_t_kc22.MED_CLINIC_ID = t_kc21.MED_CLINIC_ID WHERE t_kc21.MED_CLINIC_ID = '26604541999' AND t_kc22.UP_LIMIT_AMO > 5321.44
css
CREATE TABLE table_14250 ( "Elector" text, "Place of birth" text, "Cardinalatial title" text, "Elevated" text, "Elevator" text )
What is listed as the Place of Birth for the Elector of Pandolfo?
SELECT "Place of birth" FROM table_14250 WHERE "Elector" = 'pandolfo'
wikisql
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 diagnoses ( ...
give me the number of patients whose marital status is widowed and lab test name is specific gravity?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.marital_status = "WIDOWED" AND lab.label = "Specific Gravity"
mimicsql_data
CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER ) CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL )
For those records from the products and each product's manufacturer, give me the comparison about the average of price over the name , and group by attribute name by a bar chart, and display total number in descending order.
SELECT T1.Name, T1.Price FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name ORDER BY T1.Price DESC
nvbench
CREATE TABLE table_10685 ( "Date" text, "Tournament" text, "Surface" text, "Opponent" text, "Score" text )
Which tournament was andreas haider-maurer the opponent in?
SELECT "Tournament" FROM table_10685 WHERE "Opponent" = 'andreas haider-maurer'
wikisql
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 admission time and discharge time of subject name bryant johnson?
SELECT demographic.admittime, demographic.dischtime FROM demographic WHERE demographic.name = "Bryant Johnson"
mimicsql_data
CREATE TABLE PostHistory ( Id number, PostHistoryTypeId number, PostId number, RevisionGUID other, CreationDate time, UserId number, UserDisplayName text, Comment text, Text text, ContentLicense text ) CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswer...
All Post History of a post.
SELECT * FROM PostHistory WHERE PostId = '##postid##' ORDER BY CreationDate DESC
sede
CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, ExpiryDate time, Body text, OwnerUserId number, DeletionUserId number ) CREATE TABLE TagSynonyms ( Id number, SourceTagName text, TargetTagName text, C...
Questions and accepted answers are both first-posts.
WITH Raw AS (SELECT MIN(Id) AS Id FROM Posts WHERE OwnerUserId > 0 GROUP BY OwnerUserId) SELECT Q.Id AS "post_link", * FROM Posts AS Q, Posts AS A WHERE Q.AcceptedAnswerId = A.Id AND Q.Id IN (SELECT Id FROM Raw) AND A.Id IN (SELECT Id FROM Raw) AND Q.OwnerUserId > 0 AND A.OwnerUserId > 0 AND Q.OwnerUserId != A.OwnerUse...
sede
CREATE TABLE table_28828 ( "Name" text, "Jewel" text, "Species" text, "Gender" text, "Jewel Power" text, "Attribute" text, "Birthday" text, "Media Debut" text, "Voice actor" text )
how many times is the jewel malachite?
SELECT COUNT("Birthday") FROM table_28828 WHERE "Jewel" = 'Malachite'
wikisql
CREATE TABLE table_name_43 ( against INTEGER, draws INTEGER )
What's the most against when the draws are more than 0?
SELECT MAX(against) FROM table_name_43 WHERE draws > 0
sql_create_context
CREATE TABLE table_31071 ( "Train Number" real, "Train Name" text, "Departure Pune" text, "Arrival Lonavla" text, "Frequency" text, "Origin" text )
which train number arrives in lonavla at 17:45
SELECT "Train Number" FROM table_31071 WHERE "Arrival Lonavla" = '17:45'
wikisql
CREATE TABLE table_name_92 ( city_of_license VARCHAR, founded VARCHAR )
Name the city of license when founded was may 1995
SELECT city_of_license FROM table_name_92 WHERE founded = "may 1995"
sql_create_context
CREATE TABLE program ( program_id int, name varchar, college varchar, introduction varchar ) CREATE TABLE program_requirement ( program_id int, category varchar, min_credit int, additional_req varchar ) CREATE TABLE student_record ( student_id int, course_id int, semester i...
Which courses do I need to take before taking HMP 677 ?
SELECT DISTINCT COURSE_0.department, COURSE_0.name, COURSE_0.number FROM course AS COURSE_0, course AS COURSE_1, course_prerequisite WHERE COURSE_0.course_id = course_prerequisite.pre_course_id AND NOT COURSE_0.course_id IN (SELECT STUDENT_RECORDalias0.course_id FROM student_record AS STUDENT_RECORDalias0 WHERE STUDENT...
advising
CREATE TABLE table_name_33 ( population_per_km²__2009_ INTEGER, province VARCHAR, area__km²_ VARCHAR )
What is the highest Population per km (2009) that is in western province, with an Area (km ) larger than 5,475?
SELECT MAX(population_per_km²__2009_) FROM table_name_33 WHERE province = "western province" AND area__km²_ > 5 OFFSET 475
sql_create_context
CREATE TABLE table_28641 ( "Rank by average" real, "Place" real, "Couple" text, "Total points" text, "Number of dances" real, "Average" text )
What is the least place when the couple is Keiron & Brianne?
SELECT MIN("Place") FROM table_28641 WHERE "Couple" = 'Keiron & Brianne'
wikisql
CREATE TABLE table_47556 ( "Name" text, "Company" text, "Platform" text, "Latest stable release" text, "Price in USD" text )
What is the USD price for Tealeaf?
SELECT "Price in USD" FROM table_47556 WHERE "Company" = 'tealeaf'
wikisql
CREATE TABLE table_name_25 ( outcome VARCHAR, partner VARCHAR, date VARCHAR )
What was the Outcome for the Partner of J rgen Melzer and the Date of January 7, 2012?
SELECT outcome FROM table_name_25 WHERE partner = "jürgen melzer" AND date = "january 7, 2012"
sql_create_context
CREATE TABLE Rooms ( RoomId TEXT, roomName TEXT, beds INTEGER, bedType TEXT, maxOccupancy INTEGER, basePrice INTEGER, decor TEXT ) CREATE TABLE Reservations ( Code INTEGER, Room TEXT, CheckIn TEXT, CheckOut TEXT, Rate REAL, LastName TEXT, FirstName TEXT, Adul...
What is the minimum price of the rooms for each different decor? Show me a bar chart!, sort in descending by the minimal baseprice.
SELECT decor, MIN(basePrice) FROM Rooms GROUP BY decor ORDER BY MIN(basePrice) DESC
nvbench
CREATE TABLE table_7555 ( "Region" text, "Date" text, "Label" text, "Format" text, "Catalog" text )
What region has the catalog sir021-6?
SELECT "Region" FROM table_7555 WHERE "Catalog" = 'sir021-6'
wikisql
CREATE TABLE table_60630 ( "Race Title" text, "Circuit" text, "City / State" text, "Date" text, "Winner" text )
Who was the winner for the circuit Eastern Creek Raceway?
SELECT "Winner" FROM table_60630 WHERE "Circuit" = 'eastern creek raceway'
wikisql
CREATE TABLE jyjgzbb ( BGDH text, BGRQ time, CKZFWDX text, CKZFWSX number, CKZFWXX number, JCFF text, JCRGH text, JCRXM text, JCXMMC text, JCZBDM text, JCZBJGDL number, JCZBJGDW text, JCZBJGDX text, JCZBMC text, JLDW text, JYRQ time, JYZBLSH text, ...
患有慢性根尖周炎的那些人确诊时同型半胱氨酸的参考值范畴下限和上限是多少?
SELECT jyjgzbb.CKZFWXX, jyjgzbb.CKZFWSX FROM mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN jybgb_jyjgzbb ON mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jybgb_jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH AND jybgb_jyjgzbb.JYZBLSH = jyjgzbb.JYZBLSH AND jybgb_jyjgzbb.jyjgzbb_id ...
css
CREATE TABLE table_19763199_4 ( televotes VARCHAR, jury_votes VARCHAR )
How many televotes are there where there is 4 jury votes?
SELECT televotes FROM table_19763199_4 WHERE jury_votes = 4
sql_create_context
CREATE TABLE Attribute_Definitions ( attribute_id INTEGER, attribute_name VARCHAR(30), attribute_data_type VARCHAR(10) ) CREATE TABLE Catalog_Contents ( catalog_entry_id INTEGER, catalog_level_number INTEGER, parent_entry_id INTEGER, previous_entry_id INTEGER, next_entry_id INTEGER, ...
What are the names of catalog entries with level number 8, and count them by a pie chart
SELECT catalog_entry_name, COUNT(catalog_entry_name) FROM Catalog_Contents AS t1 JOIN Catalog_Contents_Additional_Attributes AS t2 ON t1.catalog_entry_id = t2.catalog_entry_id WHERE t2.catalog_level_number = "8" GROUP BY catalog_entry_name
nvbench
CREATE TABLE table_name_72 ( rank VARCHAR, place VARCHAR )
What is the rank for Burghley?
SELECT rank FROM table_name_72 WHERE place = "burghley"
sql_create_context
CREATE TABLE table_23693 ( "Club" text, "Played" text, "Won" text, "Drawn" text, "Lost" text, "Points for" text, "Points against" text, "Points difference" text, "Bonus Points" text, "Points" text )
when points for is 39 what is the total number of drawn
SELECT "Drawn" FROM table_23693 WHERE "Points for" = '39'
wikisql
CREATE TABLE table_24454 ( "Employment Area" text, "October 2010" text, "October 2011" text, "October 2012" text, "Net change" text )
Where is the rate 5.7 in October 2010?
SELECT "Employment Area" FROM table_24454 WHERE "October 2010" = '5.7'
wikisql
CREATE TABLE table_26375386_17 ( result VARCHAR, vote_percentage VARCHAR )
How many results where given for the vote percentage 3.1%?
SELECT COUNT(result) FROM table_26375386_17 WHERE vote_percentage = "3.1%"
sql_create_context
CREATE TABLE table_204_244 ( id number, "year" number, "album" text, "peak\nus" number, "peak\nus\nholiday" number, "certifications\n(sales threshold)" text )
which michael w smith album had the highest ranking on the us chart ?
SELECT "album" FROM table_204_244 ORDER BY "peak\nus" LIMIT 1
squall
CREATE TABLE table_name_14 ( attendance INTEGER, venue VARCHAR, opponent VARCHAR )
What is the total of attendance at Venue h when Auxerre were playing?
SELECT SUM(attendance) FROM table_name_14 WHERE venue = "h" AND opponent = "auxerre"
sql_create_context
CREATE TABLE Tryout ( pID numeric(5,0), cName varchar(20), pPos varchar(8), decision varchar(3) ) CREATE TABLE College ( cName varchar(20), state varchar(2), enr numeric(5,0) ) CREATE TABLE Player ( pID numeric(5,0), pName varchar(20), yCard varchar(3), HS numeric(5,0) )
What is the name of the school that has the smallest enrollment in each state?, could you rank in desc by the Y-axis?
SELECT cName, MIN(enr) FROM College GROUP BY state ORDER BY MIN(enr) DESC
nvbench
CREATE TABLE table_name_45 ( venue VARCHAR, home_team VARCHAR )
What is Collingwood's home venue?
SELECT venue FROM table_name_45 WHERE home_team = "collingwood"
sql_create_context
CREATE TABLE table_35085 ( "Round" real, "Player" text, "Position" text, "Nationality" text, "College/Junior/Club Team (League)" text )
WHich Position is from russia?
SELECT "Position" FROM table_35085 WHERE "Nationality" = 'russia'
wikisql