context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE mzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH text, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, KH text, KLX number, MJZH text, ML number, MZZYZDZZBM text, MZZYZDZZMC ...
过去患者48404711在有哪些门诊诊断?
SELECT mzjzjlb.JZZDBM, mzjzjlb.JZZDSM FROM hz_info JOIN mzjzjlb JOIN hz_info_mzjzjlb ON hz_info.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND hz_info_mzjzjlb.JZLSH = mzjzjlb.JZLSH AND hz_info_mzjzjlb.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info_mzjzjlb.JZLSH = mzjzjlb.JZLS...
css
CREATE TABLE table_name_92 ( became_consort VARCHAR, marriage VARCHAR )
Name the became consort for marriage of 4 april 1721
SELECT became_consort FROM table_name_92 WHERE marriage = "4 april 1721"
sql_create_context
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE microlab ( microlabid number, ...
had ever been the heartrate of patient 016-6009 been ever less than 94.0 in 11/this year?
SELECT COUNT(*) > 0 FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '016-6009')) AND vitalperiodic.heartrate < 94.0 AND NOT vitalperiodic...
eicu
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 zyjzjlb ( CYBQDM text, CYBQMC...
号码为70180070721的检验报告单的申请科室名称还有编码都是啥?
SELECT jybgb.SQKS, jybgb.SQKSMC FROM jybgb WHERE jybgb.BGDH = '70180070721'
css
CREATE TABLE table_203_156 ( id number, "team" text, "outgoing manager" text, "manner of departure" text, "date of vacancy" text, "replaced by" text, "date of appointment" text, "position in table" text )
who is the last manager shown to have been appointed ?
SELECT "outgoing manager" FROM table_203_156 ORDER BY "date of appointment" DESC LIMIT 1
squall
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) CREATE TABLE mzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH text, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, KH te...
审核检验报告单19700369409的人姓名以及工号都是什么?
SELECT jybgb.SHRGH, jybgb.SHRXM FROM jybgb WHERE jybgb.BGDH = '19700369409'
css
CREATE TABLE Customers ( customer_id INTEGER, payment_method_code VARCHAR(15), customer_number VARCHAR(20), customer_name VARCHAR(80), customer_address VARCHAR(255), customer_phone VARCHAR(80), customer_email VARCHAR(80) ) CREATE TABLE Order_Items ( order_item_id INTEGER, order_id I...
Compare the frequency of product names using a bar chart, and list from low to high by the y axis please.
SELECT product_name, COUNT(product_name) FROM Products GROUP BY product_name ORDER BY COUNT(product_name)
nvbench
CREATE TABLE table_75711 ( "Parish" text, "Type" text, "Area (Hectare)" real, "Population (2001)" real, "Pop Density /Hectare" real )
What is the area for Worth Parish?
SELECT "Area (Hectare)" FROM table_75711 WHERE "Parish" = 'worth'
wikisql
CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, ...
calculate the five year survival rate among the patients who were prescribed lr after being diagnosed with cv dis nec-deliver w p/p.
SELECT SUM(CASE WHEN patients.dod IS NULL THEN 1 WHEN STRFTIME('%j', patients.dod) - STRFTIME('%j', t4.charttime) > 5 * 365 THEN 1 ELSE 0 END) * 100 / COUNT(*) FROM (SELECT t2.subject_id, t2.charttime FROM (SELECT t1.subject_id, t1.charttime FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd...
mimic_iii
CREATE TABLE table_name_33 ( series VARCHAR, director VARCHAR, title VARCHAR )
What's the series of Buddy The Woodsman by director Jack King?
SELECT series FROM table_name_33 WHERE director = "jack king" AND title = "buddy the woodsman"
sql_create_context
CREATE TABLE table_21636599_2 ( insurgents VARCHAR, total_per_period VARCHAR )
How many insurgents are there when the total per period is 156?
SELECT insurgents FROM table_21636599_2 WHERE total_per_period = 156
sql_create_context
CREATE TABLE bank ( branch_ID int, bname varchar(20), no_of_customers int, city varchar(10), state varchar(20) ) CREATE TABLE customer ( cust_ID varchar(3), cust_name varchar(20), acc_type char(1), acc_bal int, no_of_loans int, credit_score int, branch_ID int, state ...
Find the name and credit score of the customers who have some loans, I want to order X in asc order please.
SELECT cust_name, credit_score FROM customer AS T1 JOIN loan AS T2 ON T1.cust_ID = T2.cust_ID ORDER BY cust_name
nvbench
CREATE TABLE table_66118 ( "School" text, "Location" text, "Mascot" text, "# / County" text, "Enrollment" real, "IHSAA Class / Football/Soccer" text, "Year Joined" real, "Previous Conference" text )
Which #/ County has a Year Joined larger than 1926, and a Previous Conference of olympic?
SELECT "# / County" FROM table_66118 WHERE "Year Joined" > '1926' AND "Previous Conference" = 'olympic'
wikisql
CREATE TABLE budget ( School_id int, Year int, Budgeted int, total_budget_percent_budgeted real, Invested int, total_budget_percent_invested real, Budget_invested_percent text ) CREATE TABLE endowment ( endowment_id int, School_id int, donator_name text, amount real ) CREAT...
Return a bar chart showing the number of schools in each county, and rank y axis from high to low order please.
SELECT County, COUNT(*) FROM School GROUP BY County ORDER BY COUNT(*) DESC
nvbench
CREATE TABLE table_13735 ( "Score" text, "Shooter" text, "Date" text, "Comp" text, "Place" text )
What is the Comp of the Shooter with a Score of 489.5?
SELECT "Comp" FROM table_13735 WHERE "Score" = '489.5'
wikisql
CREATE TABLE table_204_4 ( id number, "date" text, "race" text, "competition" text, "rider" text, "country" text, "location" text )
how many times was tom boonen listed as the rider ?
SELECT COUNT(*) FROM table_204_4 WHERE "rider" = 'tom boonen'
squall
CREATE TABLE t_kc21_t_kc22 ( MED_CLINIC_ID text, MED_EXP_DET_ID number ) 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, C...
负责医疗就诊43416366229里面的费用明细项目09851232608的医疗机构科室编码是什么?名称是什么?
SELECT t_kc22.MED_ORG_DEPT_CD, t_kc22.MED_ORG_DEPT_NM FROM t_kc22 WHERE t_kc22.MED_EXP_DET_ID = '09851232608'
css
CREATE TABLE table_203_471 ( id number, "#" number, "date" text, "opponent" text, "score" text, "site/stadium" text, "win" text, "loss" text, "save" text, "attendance" number, "overall record" text, "ncaat record" text )
how many attended the june 22 game ?
SELECT "attendance" FROM table_203_471 WHERE "date" = 'june 22'
squall
CREATE TABLE table_71092 ( "Artist" text, "Country of origin" text, "Period active" text, "Release-year of first charted record" real, "Genre" text, "Claimed sales" text )
Name the genre for release-year of firsst charted less than 1980 and origin of jamaica
SELECT "Genre" FROM table_71092 WHERE "Release-year of first charted record" < '1980' AND "Country of origin" = 'jamaica'
wikisql
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_days text ) CREATE TABLE airline ( airline_code varchar, airline_name text, note text ) CREATE TABLE time_int...
how many people fit on a 72S airplane
SELECT DISTINCT aircraft_code FROM aircraft WHERE aircraft_code = '72S'
atis
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...
在医疗就诊38722788451中,给病人85683704开的药有哪些?每次的用量和使用频次如何
SELECT SOC_SRT_DIRE_NM, EACH_DOSAGE, USE_FRE FROM t_kc22 WHERE MED_CLINIC_ID = '38722788451'
css
CREATE TABLE table_32521 ( "Athlete Name" text, "Jump 1" text, "Jump 2" text, "Jump 3" text, "Best Jump" text )
What is the Jump 2 of the person that has a Jump 1 of 7.14
SELECT "Jump 2" FROM table_32521 WHERE "Jump 1" = '7.14'
wikisql
CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, eventtype text, careunit text, wardid number, intime time, outtime time ) CR...
what was the name of the organism that was found this month in the last test of the microbiology of the urine of patient 18677?
SELECT microbiologyevents.org_name FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 18677) AND microbiologyevents.spec_type_desc = 'urine' AND NOT microbiologyevents.org_name IS NULL AND DATETIME(microbiologyevents.charttime, 'start of ...
mimic_iii
CREATE TABLE table_15420044_1 ( team VARCHAR, difference VARCHAR )
Which teams had a difference of 8 between goals scored and goals conceeded
SELECT team FROM table_15420044_1 WHERE difference = "8"
sql_create_context
CREATE TABLE offering_instructor ( offering_instructor_id int, offering_id int, instructor_id int ) CREATE TABLE student ( student_id int, lastname varchar, firstname varchar, program_id int, declare_major varchar, total_credit int, total_gpa float, entered_as varchar, a...
Who was the most recent RCLANG 193 teacher ?
SELECT DISTINCT instructor.name FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN offering_instructor ON offering_instructor.offering_id = course_offering.offering_id INNER JOIN instructor ON offering_instructor.instructor_id = instructor.instructor_id WHERE course_offeri...
advising
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 ACC_Percent over the Team_Name by a bar chart, and rank from low to high by the ACC_Percent please.
SELECT Team_Name, ACC_Percent FROM basketball_match ORDER BY ACC_Percent
nvbench
CREATE TABLE table_55174 ( "Driver" text, "Constructor" text, "Laps" real, "Time/Retired" text, "Grid" real )
Which Time/Retired entry has greater than 51 laps and driver Cristiano da Matta?
SELECT "Time/Retired" FROM table_55174 WHERE "Laps" > '51' AND "Driver" = 'cristiano da matta'
wikisql
CREATE TABLE table_1137703_2 ( date VARCHAR, winning_driver VARCHAR, pole_position VARCHAR )
On which date was the winning driver Alain Prost and and had Damon Hill in the pole position?
SELECT date FROM table_1137703_2 WHERE winning_driver = "Alain Prost" AND pole_position = "Damon Hill"
sql_create_context
CREATE TABLE table_27021001_1 ( status VARCHAR, district VARCHAR )
What is the status for district georgia's 10th?
SELECT status FROM table_27021001_1 WHERE district = "Georgia's 10th"
sql_create_context
CREATE TABLE captain ( Captain_ID int, Name text, Ship_ID int, age text, Class text, Rank text ) CREATE TABLE Ship ( Ship_ID int, Name text, Type text, Built_Year real, Class text, Flag text )
Show me a bar chart for how many captains with younger than 50 are in each rank?, display in ascending by the bars.
SELECT Rank, COUNT(*) FROM captain WHERE age < 50 GROUP BY Rank ORDER BY Rank
nvbench
CREATE TABLE table_228973_9 ( title VARCHAR, original_air_date VARCHAR )
If the original air date is February 4, 2003, what is the episode title?
SELECT title FROM table_228973_9 WHERE original_air_date = "February 4, 2003"
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...
在11年4月1日到12年4月8日期间,病患03015928买西药的次数是多少?
SELECT COUNT(*) FROM gwyjzb JOIN t_kc22 ON gwyjzb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gwyjzb.PERSON_ID = '03015928' AND t_kc22.STA_DATE BETWEEN '2011-04-01' AND '2012-04-08' AND t_kc22.MED_INV_ITEM_TYPE = '西药费' UNION SELECT COUNT(*) FROM fgwyjzb JOIN t_kc22 ON fgwyjzb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE f...
css
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 text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) ...
count the number of patients whose age is less than 79 and procedure icd9 code is 9703?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.age < "79" AND procedures.icd9_code = "9703"
mimicsql_data
CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, ExpiryDate time, Body text, OwnerUserId number, DeletionUserId number ) CREATE TABLE PostsWithDeleted ( Id number, PostTypeId number, AcceptedAnswerId numb...
List of questions of a given user.
WITH Rankings AS (SELECT Id, Ranking = ROW_NUMBER() OVER (ORDER BY Reputation DESC) FROM Users), Counts AS (SELECT Count = COUNT(*) FROM Users WHERE Reputation > 100) SELECT Id, Ranking, CAST(Ranking AS FLOAT(20, 5)) / (SELECT Count FROM Counts) AS Percentile FROM Rankings WHERE Id = '##UserId##'
sede
CREATE TABLE table_name_75 ( tie_no VARCHAR, score VARCHAR, away_team VARCHAR )
What is the Tie no when Swansea City is the Away team with a Score of 2 2?
SELECT tie_no FROM table_name_75 WHERE score = "2–2" AND away_team = "swansea city"
sql_create_context
CREATE TABLE table_204_314 ( id number, "pos" number, "team" text, "played" number, "won" number, "draw" number, "lost" number, "goals for" number, "goals against" number, "goal difference" number, "points" number, "notes" text )
what is the most wins ?
SELECT MAX("won") FROM table_204_314
squall
CREATE TABLE table_name_73 ( high_rebounds VARCHAR, date VARCHAR )
For the game played on November 29, who had the highest rebounds?
SELECT high_rebounds FROM table_name_73 WHERE date = "november 29"
sql_create_context
CREATE TABLE table_44599 ( "Region" text, "Date" text, "Label" text, "Catalog" text, "Format" text )
What was the format for the region of europe?
SELECT "Format" FROM table_44599 WHERE "Region" = 'europe'
wikisql
CREATE TABLE people ( People_ID int, Sex text, Name text, Date_of_Birth text, Height real, Weight real ) CREATE TABLE candidate ( Candidate_ID int, People_ID int, Poll_Source text, Date text, Support_rate real, Consider_rate real, Oppose_rate real, Unsure_rate re...
A bar chart shows the distribution of Name and Height , and order X-axis in descending order.
SELECT Name, Height FROM people ORDER BY Name DESC
nvbench
CREATE TABLE table_77759 ( "Year" text, "Yards" real, "Avg." real, "Net Avg." real, "In 20" real )
What number of Yards has 32 as an In 20?
SELECT COUNT("Yards") FROM table_77759 WHERE "In 20" = '32'
wikisql
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ...
Among patients admitted on phys referral/normal deli, calculate the number of those who died in or before the year 2184.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_location = "PHYS REFERRAL/NORMAL DELI" AND demographic.dod_year <= "2148.0"
mimicsql_data
CREATE TABLE t_kc24 ( ACCOUNT_DASH_DATE time, ACCOUNT_DASH_FLG number, CASH_PAY number, CIVIL_SUBSIDY number, CKC102 number, CLINIC_ID text, CLINIC_SLT_DATE time, COMP_ID text, COM_ACC_PAY number, COM_PAY number, DATA_ID text, ENT_ACC_PAY number, ENT_PAY number, F...
自2010.11.2起,到2016.8.24止,患者褚雨伯被开出药品477789-7一共有多少次
SELECT COUNT(*) FROM t_kc22 WHERE t_kc22.t_kc21_PERSON_NM = '褚雨伯' AND t_kc22.STA_DATE BETWEEN '2010-11-02' AND '2016-08-24' AND t_kc22.SOC_SRT_DIRE_CD = '477789-7'
css
CREATE TABLE table_76310 ( "Round" real, "Pick" real, "Overall" real, "Name" text, "Position" text, "College" text )
What is the sum of Overall, when Name is 'Tim Smiley', and when Round is less than 5?
SELECT SUM("Overall") FROM table_76310 WHERE "Name" = 'tim smiley' AND "Round" < '5'
wikisql
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 code over the name , and group by attribute name by a bar chart, I want to order in ascending by the X.
SELECT T2.Name, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name ORDER BY T2.Name
nvbench
CREATE TABLE table_35326 ( "Team" text, "Location" text, "Venue" text, "Capacity" real, "Position in 1996" text )
What team plays in Dinamo, Brest?
SELECT "Team" FROM table_35326 WHERE "Venue" = 'dinamo, brest'
wikisql
CREATE TABLE student_record ( student_id int, course_id int, semester int, grade varchar, how varchar, transfer_source varchar, earn_credit varchar, repeat_term varchar, test_id varchar ) CREATE TABLE gsi ( course_offering_id int, student_id int ) CREATE TABLE instructor ( ...
What class fulfills the PreMajor requirement with the least hassle ?
SELECT DISTINCT course.department, course.name, course.number, program_course.workload, program_course.workload FROM course, program_course WHERE program_course.category LIKE '%PreMajor%' AND program_course.course_id = course.course_id AND program_course.workload = (SELECT MIN(PROGRAM_COURSEalias1.workload) FROM progra...
advising
CREATE TABLE table_name_84 ( away_team VARCHAR, home_team VARCHAR )
What was the score for Geelong?
SELECT away_team AS score FROM table_name_84 WHERE home_team = "geelong"
sql_create_context
CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAddress text ) CREATE TABLE C...
Close and reopen votes by week.
SELECT DATEADD(week, DATEDIFF(week, @start, CreationDate), @start) AS "week", SUM(CASE WHEN PostHistoryTypeId = 10 THEN 1 ELSE 0 END) AS "closevotes", SUM(CASE WHEN PostHistoryTypeId = 11 THEN 1 ELSE 0 END) AS "reopenvotes" FROM PostHistory WHERE PostHistoryTypeId IN (10, 11) AND CreationDate >= @start AND CreationDate...
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, ...
在医疗就诊40465384086中给许慧英这个病人做检验的科室是哪些?对应的编码是什么
SELECT zyjybgb.JYKSBM, zyjybgb.JYKSMC FROM zyjybgb WHERE zyjybgb.JZLSH = '40465384086' UNION SELECT mzjybgb.JYKSBM, mzjybgb.JYKSMC FROM mzjybgb WHERE mzjybgb.JZLSH = '40465384086'
css
CREATE TABLE table_22815568_6 ( county VARCHAR, poverty_rate VARCHAR )
If the poverty rate is 12.9%, what is the county?
SELECT county FROM table_22815568_6 WHERE poverty_rate = "12.9%"
sql_create_context
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospit...
patient 007-4322 has excreted any blood loss since 07/2103?
SELECT COUNT(*) > 0 FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '007-4322')) AND intakeoutput.cellpath LIKE '%output%' AND intakeoutput...
eicu
CREATE TABLE table_63657 ( "Tie no" text, "Home team" text, "Score" text, "Away team" text, "Attendance" text )
What is the Tie no of the game with an Attendance of 4,658?
SELECT "Tie no" FROM table_63657 WHERE "Attendance" = '4,658'
wikisql
CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE Tags ( Id number, TagName text, Count number, ExcerptPostId number, WikiPo...
Top 100 java questions that are inactive for last six months. Top 100 java questions that are inactive for last six months and still unanswered. This query helpful to achieve 'Archaeologist' badge in stack overflow.
SELECT * FROM Posts WHERE LastActivityDate < (CURRENT_TIMESTAMP() - 180) AND AcceptedAnswerId IS NULL AND Tags LIKE '%<python>%' AND ClosedDate IS NULL AND AnswerCount = 0 ORDER BY LastActivityDate DESC LIMIT 1000
sede
CREATE TABLE table_203_610 ( id number, "institution" text, "location" text, "nickname" text, "founded" number, "historical affiliation" text, "enrollment" number, "primary conference" text )
which college was the last to be founded .
SELECT "institution" FROM table_203_610 ORDER BY "founded" DESC LIMIT 1
squall
CREATE TABLE table_name_84 ( category VARCHAR, nominee_s_ VARCHAR, year VARCHAR )
What is the category when Hy Conrad nominated in 2003?
SELECT category FROM table_name_84 WHERE nominee_s_ = "hy conrad" AND year = 2003
sql_create_context
CREATE TABLE table_1341663_19 ( first_elected VARCHAR, incumbent VARCHAR )
What year was Jerry Huckaby first elected?
SELECT first_elected FROM table_1341663_19 WHERE incumbent = "Jerry Huckaby"
sql_create_context
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...
医疗记录中年龄低于23岁的患者的医疗费平均金额是多少
SELECT AVG(MED_AMOUT) FROM t_kc24 WHERE MED_CLINIC_ID IN (SELECT MED_CLINIC_ID FROM t_kc21 WHERE PERSON_AGE < 23)
css
CREATE TABLE table_12715053_1 ( trademark VARCHAR, molecular_target VARCHAR )
What is the trademark listed for the molecular target : dna-binding?
SELECT trademark FROM table_12715053_1 WHERE molecular_target = "DNA-Binding"
sql_create_context
CREATE TABLE table_name_66 ( place VARCHAR, money___£__ VARCHAR, score VARCHAR )
What is the place of the player with 140,000 and a 68-68-75-68=279 score?
SELECT place FROM table_name_66 WHERE money___£__ = "140,000" AND score = 68 - 68 - 75 - 68 = 279
sql_create_context
CREATE TABLE table_name_23 ( Id VARCHAR )
Who held the same position in 2014 that Jarrah Rubinstein held in 2013?
SELECT 2014 FROM table_name_23 WHERE 2013 = "jarrah rubinstein"
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 demographic ...
what is the number of patients whose diagnoses icd9 code is 2920?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE diagnoses.icd9_code = "2920"
mimicsql_data
CREATE TABLE table_204_419 ( id number, "year" text, "tournament" text, "venue" text, "played" number, "won" number, "lost" number, "tied" number, "n/r" number, "result" text )
how many times has australia been runner up ?
SELECT COUNT(*) FROM table_204_419 WHERE "venue" = 'australia' AND "result" = 'runner-up'
squall
CREATE TABLE table_name_8 ( score VARCHAR, opponent VARCHAR )
What was the score when the opponent was Montreal Canadiens?
SELECT score FROM table_name_8 WHERE opponent = "montreal canadiens"
sql_create_context
CREATE TABLE table_name_89 ( Id VARCHAR )
How many sets were played in 2007 at the tournament that had 4R in 2011 and 2R in 2009?
SELECT 2007 FROM table_name_89 WHERE 2011 = "4r" AND 2009 = "2r"
sql_create_context
CREATE TABLE table_4648 ( "Name" text, "City" text, "Metres" real, "Feet" real, "Floors" real, "Finalized" text )
Which building was built in 2015, has less than 40 floors and is larger than 509 feet?
SELECT MAX("Metres") FROM table_4648 WHERE "Finalized" = '2015' AND "Floors" < '40' AND "Feet" > '509'
wikisql
CREATE TABLE STUDENT ( STU_NUM int, STU_LNAME varchar(15), STU_FNAME varchar(15), STU_INIT varchar(1), STU_DOB datetime, STU_HRS int, STU_CLASS varchar(2), STU_GPA float(8), STU_TRANSFER numeric, DEPT_CODE varchar(18), STU_PHONE varchar(4), PROF_NUM int ) CREATE TABLE DE...
Give the proportion of what is the first name and GPA of every student that has a GPA lower than average?
SELECT STU_FNAME, SUM(STU_GPA) FROM STUDENT WHERE STU_GPA < (SELECT AVG(STU_GPA) FROM STUDENT) GROUP BY STU_FNAME
nvbench
CREATE TABLE table_25030512_24 ( party VARCHAR, first_elected VARCHAR )
Name the party for 1998 first elected
SELECT party FROM table_25030512_24 WHERE first_elected = "1998"
sql_create_context
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) C...
what is the number of patients whose admission type is urgent and ethnicity is hispanic or latino?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_type = "URGENT" AND demographic.ethnicity = "HISPANIC OR LATINO"
mimicsql_data
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...
在0七年三月四日到一九年十二月三日这段时间内,医院2510888医治的住院病人共有多少
SELECT COUNT(*) FROM zyb WHERE zyb.MED_TYPE = '2510888' AND zyb.IN_HOSP_DAYS BETWEEN '2007-03-04' AND '2019-12-03'
css
CREATE TABLE table_1013129_2 ( nationality VARCHAR, college_junior_club_team VARCHAR )
What are the nationalities of the player picked from Thunder Bay Flyers (ushl)
SELECT nationality FROM table_1013129_2 WHERE college_junior_club_team = "Thunder Bay Flyers (USHL)"
sql_create_context
CREATE TABLE table_name_64 ( vol__number INTEGER, title VARCHAR )
How many Volume Numbers have the title of Darkness Falls?
SELECT SUM(vol__number) FROM table_name_64 WHERE title = "darkness falls"
sql_create_context
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, ...
what number of patients with hematology as lab test category had diagnoses titled closed fracture of subtrochanteric section of neck of femur?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.long_title = "Closed fracture of subtrochanteric section of neck of femur" AND lab."CATEGORY" = "Hematology"
mimicsql_data
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, visualize the relationship between code and price , and group by attribute founder.
SELECT T1.Code, T1.Price FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder
nvbench
CREATE TABLE table_65631 ( "Constituency number" text, "Name" text, "Reserved for ( SC / ST /None)" text, "District" text, "Number of electorates (2009)" real )
How many constituents does udaipura have?
SELECT "Constituency number" FROM table_65631 WHERE "Name" = 'udaipura'
wikisql
CREATE TABLE table_79227 ( "Place" real, "Team" text, "Played" real, "Draw" real, "Lost" real, "Goals Scored" real, "Goals Conceded" real, "Points" real )
How many goals were conceded by the team with more than 21 points more than 5 draws and less than 18 games played?
SELECT SUM("Goals Conceded") FROM table_79227 WHERE "Draw" > '5' AND "Points" > '21' AND "Played" < '18'
wikisql
CREATE TABLE table_2818164_5 ( title VARCHAR, production_code VARCHAR )
What is the name of the episode with 418 as the production code?
SELECT title FROM table_2818164_5 WHERE production_code = 418
sql_create_context
CREATE TABLE Financial_Transactions ( transaction_id INTEGER, account_id INTEGER, invoice_number INTEGER, transaction_type VARCHAR(15), transaction_date DATETIME, transaction_amount DECIMAL(19,4), transaction_comment VARCHAR(255), other_transaction_details VARCHAR(255) ) CREATE TABLE Or...
How many accounts are opened in each day? Bin the account open day by weekday and group by other account details in a stacked bar chart.
SELECT date_account_opened, COUNT(date_account_opened) FROM Accounts GROUP BY other_account_details
nvbench
CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number ) CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, Rejectio...
Which votes did I gave?. Give me a list of votes I casted.
SELECT Votes.PostId, Posts.Title FROM Votes INNER JOIN Posts ON Posts.Id = Votes.PostId WHERE Votes.UserId = @UserId
sede
CREATE TABLE table_24335 ( "Year" real, "Date" text, "Driver" text, "Team" text, "Manufacturer" text, "Laps" text, "Miles (km)" text, "Race Time" text, "Average Speed (mph)" text, "Report" text )
Name the race time for 2002
SELECT "Race Time" FROM table_24335 WHERE "Year" = '2002'
wikisql
CREATE TABLE table_71022 ( "Draw" real, "Artist" text, "Song" text, "Votes" real, "Place" real )
What is the sum of the draw for the song 'Beautiful Inside' which has a place larger than 2?
SELECT SUM("Draw") FROM table_71022 WHERE "Song" = 'beautiful inside' AND "Place" > '2'
wikisql
CREATE TABLE table_28519 ( "No. in series" real, "No. in season" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production code" text, "U.S. viewers (million)" text )
how many u.s. viewers (million) have seen a production written by chris sheridan & danny smith
SELECT COUNT("U.S. viewers (million)") FROM table_28519 WHERE "Written by" = 'Chris Sheridan & Danny Smith'
wikisql
CREATE TABLE table_16432543_1 ( enrollment VARCHAR, nickname VARCHAR )
Total enrollment at the school with the nickname Blue Hens
SELECT COUNT(enrollment) FROM table_16432543_1 WHERE nickname = "Blue Hens"
sql_create_context
CREATE TABLE table_49087 ( "Rank" real, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
What is the sum of Total, when Silver is greater than 1, when Rank is 9, and when Bronze is greater than 0?
SELECT SUM("Total") FROM table_49087 WHERE "Silver" > '1' AND "Rank" = '9' AND "Bronze" > '0'
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...
在13-09-23到19-11-29内,患者17320230所有检验报告单的审核日期时间给列出来
SELECT jybgb.SHSJ FROM hz_info JOIN mzjzjlb JOIN jybgb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE hz_info.RYBH = '17320230' AND jybgb.BGRQ BETWEEN '2013-09-23' AND '2019-11-29' UNION...
css
CREATE TABLE table_name_89 ( result VARCHAR, opponent_number VARCHAR )
What is the result for opponent TCU?
SELECT result FROM table_name_89 WHERE opponent_number = "tcu"
sql_create_context
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 zyjzjlb_jybgb ( YLJGDM_ZYJZJLB te...
患者彭云亭的检验报告结果指标均异常的检验报告单号是什么
SELECT jybgb.BGDH FROM person_info JOIN hz_info JOIN mzjzjlb JOIN 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 = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE person_info.XM = '彭云亭' AND NOT ...
css
CREATE TABLE table_58215 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
What was the home team's score at Victoria Park?
SELECT "Home team score" FROM table_58215 WHERE "Venue" = 'victoria park'
wikisql
CREATE TABLE table_name_75 ( result VARCHAR, incumbent VARCHAR )
When the incumbent was William Elliott, what was the result?
SELECT result FROM table_name_75 WHERE incumbent = "william elliott"
sql_create_context
CREATE TABLE table_name_29 ( highest_average_point_ratings INTEGER, genre VARCHAR, number_of_episodes VARCHAR )
What was the highest average point rating for a modern suspense show with 21 episodes?
SELECT SUM(highest_average_point_ratings) FROM table_name_29 WHERE genre = "modern suspense" AND number_of_episodes = 21
sql_create_context
CREATE TABLE table_name_3 ( year VARCHAR, nominee VARCHAR, award_ceremony VARCHAR, result VARCHAR )
How many times is the award ceremony laurence olivier award, result is won and the nominee is imelda staunton?
SELECT COUNT(year) FROM table_name_3 WHERE award_ceremony = "laurence olivier award" AND result = "won" AND nominee = "imelda staunton"
sql_create_context
CREATE TABLE table_name_6 ( report VARCHAR, date VARCHAR )
What Report has the Date of June 5, 2005?
SELECT report FROM table_name_6 WHERE date = "june 5, 2005"
sql_create_context
CREATE TABLE table_name_13 ( pole_position VARCHAR, circuit VARCHAR )
Who has the pole position for the n rburgring circuit?
SELECT pole_position FROM table_name_13 WHERE circuit = "nürburgring"
sql_create_context
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
calculate the number of patients admitted on phys referral/normal deli who had a lab test for joint fluid
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_location = "PHYS REFERRAL/NORMAL DELI" AND lab.fluid = "Joint Fluid"
mimicsql_data
CREATE TABLE table_name_31 ( air_date VARCHAR, test_taker VARCHAR )
On which air date was Robert the test-taker?
SELECT air_date FROM table_name_31 WHERE test_taker = "robert"
sql_create_context
CREATE TABLE time_interval ( period text, begin_time int, end_time int ) CREATE TABLE equipment_sequence ( aircraft_code_sequence varchar, aircraft_code varchar ) CREATE TABLE airline ( airline_code varchar, airline_name text, note text ) CREATE TABLE fare ( fare_id int, from_...
what flights are available wednesday afternoon from DENVER 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, date_day, days, flight WHERE ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN FRANCISCO' AND date_day.day_number = 23 AND date_day.month_number = ...
atis
CREATE TABLE students ( student_id VARCHAR ) CREATE TABLE student_course_registrations ( student_id VARCHAR )
List the id of students who registered some courses and the number of their registered courses?
SELECT T1.student_id, COUNT(*) FROM students AS T1 JOIN student_course_registrations AS T2 ON T1.student_id = T2.student_id GROUP BY T1.student_id
sql_create_context
CREATE TABLE table_19552 ( "Pick #" real, "Player" text, "Position" text, "Nationality" text, "NHL team" text, "College/junior/club team" text )
who is the the player with pick # being 132
SELECT "Player" FROM table_19552 WHERE "Pick #" = '132'
wikisql
CREATE TABLE table_22015 ( "Club" text, "Played" text, "Won" text, "Drawn" text, "Lost" text, "Points for" text, "Points against" text, "Tries for" text, "Tries against" text, "Try bonus" text, "Losing bonus" text, "Points" text )
When 98 is the points what is the club?
SELECT "Club" FROM table_22015 WHERE "Points" = '98'
wikisql
CREATE TABLE table_2231241_1 ( election VARCHAR, seat_no_1 VARCHAR, seat_no_5 VARCHAR )
which election had seat no 1 filled by jacques lachapelle but seat no 5 was filled by g. sanscartier
SELECT election FROM table_2231241_1 WHERE seat_no_1 = "Jacques Lachapelle" AND seat_no_5 = "G. Sanscartier"
sql_create_context
CREATE TABLE mzb ( 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...
列出就诊结算日期在2005-12-31到2011-07-11内期间,患者吴涵润的所有医疗就诊记录编号是哪些?
SELECT qtb.MED_CLINIC_ID 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 '2005-12-31' AND '2011-07-11' UNION SELECT gyb.MED_CLINIC_ID FROM gyb JOIN t_kc24 ON gyb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE gyb.PERSON_NM = '吴涵润' AND t_kc24.CL...
css