context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
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...
Find the number of patients who had procedure titled fiber-optic bronchoscopy and have their status as 0.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.expire_flag = "0" AND procedures.long_title = "Fiber-optic bronchoscopy"
mimicsql_data
CREATE TABLE table_17932 ( "Club" text, "Australian Marquee" text, "International Marquee" text, "Junior Marquee player" text, "Captain" text, "Vice-Captain" text )
Name the australian marquee for alessandro del piero
SELECT "Australian Marquee" FROM table_17932 WHERE "International Marquee" = 'Alessandro Del Piero'
wikisql
CREATE TABLE table_name_44 ( rank INTEGER, athlete VARCHAR, react VARCHAR )
What is the lowest rank for Chris Brown with react greater than 0.244?
SELECT MIN(rank) FROM table_name_44 WHERE athlete = "chris brown" AND react > 0.244
sql_create_context
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, ...
how many patients whose primary disease is morbid obesity/sda and lab test fluid is urine?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.diagnosis = "MORBID OBESITY/SDA" AND lab.fluid = "Urine"
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 Tags ( Id number, TagName text, Count number, Ex...
Get Comments By User Id.
SELECT Id AS "comment_link", Score, Text FROM Comments WHERE UPPER(Text) LIKE UPPER('%##CommentText##%') AND UserId = '##UserId##' ORDER BY Score DESC
sede
CREATE TABLE table_22290 ( "Departure" text, "Going to" text, "Calling at" text, "Arrival" text, "Operator" text )
What was the departure time of the train going to Boston?
SELECT "Departure" FROM table_22290 WHERE "Going to" = 'Boston'
wikisql
CREATE TABLE table_19487922_1 ( poles INTEGER, country VARCHAR )
How many poles for the Netherlands?
SELECT MAX(poles) FROM table_19487922_1 WHERE country = "Netherlands"
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 lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text,...
what is the admission location and discharge location of patient id 2560?
SELECT demographic.admission_location, demographic.discharge_location FROM demographic WHERE demographic.subject_id = "2560"
mimicsql_data
CREATE TABLE table_39984 ( "Television service" text, "Language" text, "Content" text, "HDTV" text, "Package/Option" text )
What language has sky famiglia as the package/option?
SELECT "Language" FROM table_39984 WHERE "Package/Option" = 'sky famiglia'
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 flight_leg ( flight_id int, leg_number int, leg_flight int ) CREATE TABLE compartmen...
when are the AA flights from PHOENIX to MILWAUKEE
SELECT DISTINCT flight.departure_time 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 = 'PHOENIX' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = '...
atis
CREATE TABLE time_zone ( time_zone_code text, time_zone_name text, hours_from_gmt int ) CREATE TABLE dual_carrier ( main_airline varchar, low_flight_number int, high_flight_number int, dual_airline varchar, service_name text ) CREATE TABLE food_service ( meal_code text, meal_nu...
on 7 23 all flights on AA from PHILADELPHIA 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 station ( id number, name text, lat number, long number, dock_count number, city text, installation_date text ) CREATE TABLE trip ( id number, duration number, start_date text, start_station_name text, start_station_id number, end_date text, end_stat...
How many trips did not end in San Francisco?
SELECT COUNT(*) FROM trip AS T1 JOIN station AS T2 ON T1.end_station_id = T2.id WHERE T2.city <> "San Francisco"
spider
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...
10年8月23日-21年8月22日,这11年,患者90117993的956786指标情况
SELECT * FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN mzjzjlb_jybgb ON 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 jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb....
css
CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, ...
tell me the name of the lab tests that patient 027-61708 first received?
SELECT lab.labname FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '027-61708')) ORDER BY lab.labresulttime LIMIT 1
eicu
CREATE TABLE technician ( technician_id real, Name text, Team text, Starting_Year real, Age int ) CREATE TABLE repair ( repair_ID int, name text, Launch_Date text, Notes text ) CREATE TABLE machine ( Machine_ID int, Making_Year int, Class text, Team text, Machin...
List the name of technicians whose team is not 'NYY', and count them by a bar chart, could you list Y from high to low order?
SELECT Name, COUNT(Name) FROM technician WHERE Team <> "NYY" GROUP BY Name ORDER BY COUNT(Name) DESC
nvbench
CREATE TABLE table_19691 ( "Date" text, "Episode" real, "Performer 1" text, "Performer 2" text, "Performer 3" text, "Performer 4" text )
Who is the second performer in episode 5?
SELECT "Performer 2" FROM table_19691 WHERE "Episode" = '5'
wikisql
CREATE TABLE table_62057 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" real )
What is the attendance number later than week 9 on November 20, 1983?
SELECT COUNT("Attendance") FROM table_62057 WHERE "Week" > '9' AND "Date" = 'november 20, 1983'
wikisql
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, ...
provide me the diagnosis short title and diagnosis icd9 code for patient with patient id 2560.
SELECT diagnoses.icd9_code, diagnoses.short_title FROM diagnoses WHERE diagnoses.subject_id = "2560"
mimicsql_data
CREATE TABLE table_name_32 ( wins INTEGER, played VARCHAR, scored VARCHAR, conceded VARCHAR )
What is the lowest number of wins of the team with less than 24 scored, 27 conceded, and more than 18 played?
SELECT MIN(wins) FROM table_name_32 WHERE scored < 24 AND conceded = 27 AND played > 18
sql_create_context
CREATE TABLE table_name_97 ( std_rank INTEGER, name VARCHAR, year VARCHAR )
How much Standard Rank has a Name of 311 south wacker drive, and a Year larger than 1990?
SELECT SUM(std_rank) FROM table_name_97 WHERE name = "311 south wacker drive" AND year > 1990
sql_create_context
CREATE TABLE table_train_168 ( "id" int, "cholesterol" float, "hemoglobin_a1c_hba1c" float, "triglyceride_tg" float, "fasting_glucose" int, "NOUSE" float )
fasting glucose 126 _ 270 mg / dl
SELECT * FROM table_train_168 WHERE fasting_glucose >= 126 AND fasting_glucose <= 270
criteria2sql
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...
provide the number of patients whose death status is 1 and diagnoses long title is kidney dialysis as the cause of abnormal reaction of patient, or of later complication, without mention of misadventure at time of procedure?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.expire_flag = "1" AND diagnoses.long_title = "Kidney dialysis as the cause of abnormal reaction of patient, or of later complication, without mention of misadventure at time o...
mimicsql_data
CREATE TABLE table_47497 ( "Position" real, "Team" text, "Played" real, "Drawn" real, "Lost" real, "Goals For" real, "Goals Against" real, "Goal Difference" text, "Points 1" text )
What is the goal difference for the team from Chorley?
SELECT "Goal Difference" FROM table_47497 WHERE "Team" = 'chorley'
wikisql
CREATE TABLE table_203_216 ( id number, "rank" number, "hospital" text, "city" text, "county" text, "# beds" number, "type of hospital" text )
how many more general acute care hospitals are there in california than rehabilitation hospitals ?
SELECT (SELECT COUNT("hospital") FROM table_203_216 WHERE "type of hospital" = 'general acute care') - (SELECT COUNT("hospital") FROM table_203_216 WHERE "type of hospital" = 'rehabilitaion')
squall
CREATE TABLE jybgb_jyjgzbb ( JYZBLSH number, YLJGDM text, jyjgzbb_id number ) 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 tex...
门诊诊断为患者的检测指标569976疾病K19.872的数值的最值以及平均值都分别是多少?
SELECT AVG(jyjgzbb.JCZBJGDL), MIN(jyjgzbb.JCZBJGDL), MAX(jyjgzbb.JCZBJGDL) 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.JY...
css
CREATE TABLE table_203_413 ( id number, "rank" text, "city" text, "population" number, "area\n(km2)" number, "density\n(inhabitants/km2)" number, "altitude\n(mslm)" number )
how many cities have populations greater than arquata scrivia ?
SELECT COUNT("city") FROM table_203_413 WHERE "population" > (SELECT "population" FROM table_203_413 WHERE "city" = 'arquata scrivia')
squall
CREATE TABLE table_name_79 ( rank VARCHAR, bronze VARCHAR, silver VARCHAR )
What is the rank of the team having 3 bronzes and 0 silver?
SELECT rank FROM table_name_79 WHERE bronze = 3 AND silver = 0
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 procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) ...
give me the number of patients whose ethnicity is asian and diagnoses icd9 code is 30501?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.ethnicity = "ASIAN" AND diagnoses.icd9_code = "30501"
mimicsql_data
CREATE TABLE table_31988 ( "Sixes" text, "Player" text, "Opponent" text, "Venue" text, "Date" text )
Where did Zimbabwe play?
SELECT "Venue" FROM table_31988 WHERE "Opponent" = 'zimbabwe'
wikisql
CREATE TABLE table_30083499_1 ( coefficient VARCHAR, player VARCHAR )
What is the coefficient for agust n marches n (1)?
SELECT coefficient FROM table_30083499_1 WHERE player = "Agustín Marchesín (1)"
sql_create_context
CREATE TABLE table_name_40 ( flap INTEGER, pole VARCHAR, podiums VARCHAR )
Can you tell me the sum of FLap that has the Pole larger than 0, and the Podiums of 6?
SELECT SUM(flap) FROM table_name_40 WHERE pole > 0 AND podiums = 6
sql_create_context
CREATE TABLE table_18703133_1 ( wins INTEGER, team VARCHAR )
Name the most wins for sport colombia
SELECT MAX(wins) FROM table_18703133_1 WHERE team = "Sport Colombia"
sql_create_context
CREATE TABLE table_35040 ( "Name" text, "Year" real, "Propulsion" text, "launched by" text, "Country" text )
What is the propulsion for the RB 04 earlier than 1962?
SELECT "Propulsion" FROM table_35040 WHERE "Year" < '1962' AND "Name" = 'rb 04'
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...
在病院1313131看病的病患34943476在入院确诊疾病名称中包含有癫痫的医疗就诊记录编号都有啥?
SELECT qtb.MED_CLINIC_ID FROM qtb WHERE qtb.PERSON_ID = '34943476' AND qtb.MED_SER_ORG_NO = '1313131' AND qtb.IN_DIAG_DIS_NM LIKE '%癫痫%' UNION SELECT gyb.MED_CLINIC_ID FROM gyb WHERE gyb.PERSON_ID = '34943476' AND gyb.MED_SER_ORG_NO = '1313131' AND gyb.IN_DIAG_DIS_NM LIKE '%癫痫%' UNION SELECT zyb.MED_CLINIC_ID FROM zyb ...
css
CREATE TABLE course_tags_count ( course_id int, clear_grading int, pop_quiz int, group_projects int, inspirational int, long_lectures int, extra_credit int, few_tests int, good_feedback int, tough_tests int, heavy_papers int, cares_for_students int, heavy_assignments ...
The courses that fulfill Other program requirements are taught by whom ?
SELECT DISTINCT instructor.name FROM instructor INNER JOIN offering_instructor ON offering_instructor.instructor_id = instructor.instructor_id INNER JOIN course_offering ON offering_instructor.offering_id = course_offering.offering_id INNER JOIN program_course ON program_course.course_id = course_offering.course_id INN...
advising
CREATE TABLE table_36997 ( "Rank" real, "First quarter" text, "Second quarter" text, "Third quarter" text, "Fourth quarter" text )
When the rank is larger than 3 with a second quarter of johnson & johnson 156,515.9, what is the fourth quarter?
SELECT "Fourth quarter" FROM table_36997 WHERE "Rank" > '3' AND "Second quarter" = 'johnson & johnson 156,515.9'
wikisql
CREATE TABLE table_76407 ( "Particle name" text, "Particle symbol" text, "Antiparticle symbol" text, "Quark content" text, "Rest mass ( MeV / c 2 )" text, "J P C" text, "Mean lifetime ( s )" text, "Commonly decays to (>5% of decays)" text )
What is the j p c that commonly decays (>5% of decays) d 0 + 0 or d 0 + ?
SELECT "J P C" FROM table_76407 WHERE "Commonly decays to (>5% of decays)" = 'd 0 + π 0 or d 0 + γ'
wikisql
CREATE TABLE table_1901751_1 ( original_broadway_performer VARCHAR, character VARCHAR )
Who is the original broadway performer for the character Colin Craven?
SELECT original_broadway_performer FROM table_1901751_1 WHERE character = "Colin Craven"
sql_create_context
CREATE TABLE medicine_enzyme_interaction ( enzyme_id int, medicine_id int, interaction_type text ) CREATE TABLE medicine ( id int, name text, Trade_Name text, FDA_approved text ) CREATE TABLE enzyme ( id int, name text, Location text, Product text, Chromosome text, ...
A bar chart about what are the ids and names of the medicine that can interact with two or more enzymes?, and show in descending by the y axis please.
SELECT name, id FROM medicine AS T1 JOIN medicine_enzyme_interaction AS T2 ON T2.medicine_id = T1.id ORDER BY id DESC
nvbench
CREATE TABLE storm ( Storm_ID int, Name text, Dates_active text, Max_speed int, Damage_millions_USD real, Number_Deaths int ) CREATE TABLE affected_region ( Region_id int, Storm_ID int, Number_city_affected real ) CREATE TABLE region ( Region_id int, Region_code text, R...
List name and damage for all storms in a descending order of max speed with a bar chart.
SELECT Name, Damage_millions_USD FROM storm ORDER BY Max_speed DESC
nvbench
CREATE TABLE cite ( citingpaperid int, citedpaperid int ) CREATE TABLE paperfield ( fieldid int, paperid int ) CREATE TABLE author ( authorid int, authorname varchar ) CREATE TABLE dataset ( datasetid int, datasetname varchar ) CREATE TABLE writes ( paperid int, authorid int ...
what are syntactic parsing papers not written by chris dyer
SELECT DISTINCT author.authorname, paper.paperid FROM author, keyphrase, paper, paperkeyphrase, writes WHERE author.authorname <> 'chris dyer' AND keyphrase.keyphrasename = 'syntactic parsing' AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paper.paperid = paperkeyphrase.paperid AND writes.authorid = author....
scholar
CREATE TABLE table_203_83 ( id number, "ranking" number, "company" text, "industry" text, "revenue (usd billions)" text, "fy" text, "capitalization (usd billions)" text, "employees" number, "listing" text, "headquarters" text, "ceo" text )
what company is ranked below apple ?
SELECT "company" FROM table_203_83 WHERE "ranking" = (SELECT "ranking" FROM table_203_83 WHERE "company" = 'apple') + 1
squall
CREATE TABLE table_80196 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" real, "Record" text )
What was the score of the game when their record was 62-67
SELECT "Score" FROM table_80196 WHERE "Record" = '62-67'
wikisql
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...
在住院就诊38259980479中,病患入住的病区是哪个?对应的代码呢?入院的床位号是什么
SELECT zyjzjlb.RZBQDM, zyjzjlb.RZBQMC, zyjzjlb.RYCWH FROM zyjzjlb WHERE zyjzjlb.JZLSH = '38259980479'
css
CREATE TABLE table_66562 ( "Season" text, "Event type" text, "Location" text, "Format" text, "Date" text, "Rank" real )
What event did he compete in at Taipei?
SELECT "Format" FROM table_66562 WHERE "Location" = 'taipei'
wikisql
CREATE TABLE table_21676617_1 ( country_of_owner VARCHAR, horse VARCHAR )
How many countries did Utah Bulwark's owner come from?
SELECT COUNT(country_of_owner) FROM table_21676617_1 WHERE horse = "Utah Bulwark"
sql_create_context
CREATE TABLE person_info_hz_info ( RYBH text, KH number, KLX number, YLJGDM 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...
2008-08-30到2013-04-07期间,34728428患者看过几次门诊在9353416这个医疗机构
SELECT COUNT(*) FROM hz_info JOIN mzjzjlb JOIN person_info_hz_info JOIN person_info ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND person_info_hz_info.KH = hz_info.KH AND person_info_hz_info.KLX = hz_info.KLX AND person_info_hz_info.YLJGDM = hz_info.YLJGDM AND person_in...
css
CREATE TABLE table_66797 ( "January" text, "February" text, "March" text, "April" text, "June" text, "July" text, "August" text, "September" text, "October" text, "November" text, "December" text )
Who is in January where April is chris cranston?
SELECT "January" FROM table_66797 WHERE "April" = 'chris cranston'
wikisql
CREATE TABLE table_55484 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
What is Fitzroy's smallest crowd size?
SELECT MIN("Crowd") FROM table_55484 WHERE "Home team" = 'fitzroy'
wikisql
CREATE TABLE table_15028 ( "Year" real, "Men's singles" text, "Women's singles" text, "Men's doubles" text, "Women's doubles" text, "Mixed doubles" text )
Name the men's doubles for years before 1999 and elizabeth cann for women's singles
SELECT "Men's doubles" FROM table_15028 WHERE "Year" < '1999' AND "Women's singles" = 'elizabeth cann'
wikisql
CREATE TABLE table_14944 ( "Name" text, "Years" text, "Gender" text, "Area" text, "Authority" text, "Decile" real, "Roll" real )
What authority controls the school in Levin that has a decile of 6, and a roll of 226?
SELECT "Authority" FROM table_14944 WHERE "Decile" = '6' AND "Area" = 'levin' AND "Roll" = '226'
wikisql
CREATE TABLE table_name_81 ( season VARCHAR, position VARCHAR )
What season was there a 2nd place finish?
SELECT season FROM table_name_81 WHERE position = "2nd"
sql_create_context
CREATE TABLE TagSynonyms ( Id number, SourceTagName text, TargetTagName text, CreationDate time, OwnerUserId number, AutoRenameCount number, LastAutoRename time, Score number, ApprovedByUserId number, ApprovalDate time ) CREATE TABLE ReviewTaskResultTypes ( Id number, Na...
Score per answer for users with at least 10 answers in the past 30 days in a tag..
SELECT Posts.OwnerUserId AS "user_link", SUM(Score) AS Score, COUNT(*) AS Answers, ROUND(1.0 * SUM(Score) / COUNT(*), 2) AS ScorePerAnswer FROM Posts WHERE Posts.ParentId IN (SELECT Posts.Id FROM Posts INNER JOIN PostTags ON PostTags.PostId = Posts.Id INNER JOIN Tags ON Tags.Id = PostTags.TagId WHERE Tags.TagName = @Ta...
sede
CREATE TABLE table_204_680 ( id number, "released" text, "title" text, "artist" text, "format" text, "language" text )
what number of songs was released in may ?
SELECT COUNT(*) FROM table_204_680 WHERE "released" = 5
squall
CREATE TABLE table_49234 ( "Round" real, "Pick #" real, "Player" text, "Position" text, "College" text )
What is the lowest Pick #, when College is 'Jackson State'?
SELECT MIN("Pick #") FROM table_49234 WHERE "College" = 'jackson state'
wikisql
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...
在04年1月10日到08年8月12日期间,昌阳辉这位参保人门诊手术费有多少元
SELECT SUM(t_kc22.AMOUNT) FROM t_kc22 WHERE t_kc22.t_kc21_PERSON_NM = '昌阳辉' AND t_kc22.t_kc21_CLINIC_TYPE = '门诊' AND t_kc22.STA_DATE BETWEEN '2004-01-10' AND '2008-08-12' AND t_kc22.MED_INV_ITEM_TYPE = '手术费'
css
CREATE TABLE table_17632217_2 ( third_place VARCHAR, runners_up VARCHAR )
Who was placed third when the ruuner up was Guangzhou Apollo?
SELECT third_place FROM table_17632217_2 WHERE runners_up = "Guangzhou Apollo"
sql_create_context
CREATE TABLE table_name_87 ( kilometers VARCHAR, station_code VARCHAR )
What's the Kilometers listed that also has the Station Code of Kuda?
SELECT kilometers FROM table_name_87 WHERE station_code = "kuda"
sql_create_context
CREATE TABLE table_name_13 ( pick VARCHAR, team VARCHAR )
What is the total number pick for seattle mariners team?
SELECT COUNT(pick) FROM table_name_13 WHERE team = "seattle mariners"
sql_create_context
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE patient ( uniquepid text, ...
when was the last time patient 031-23605 got their urine, catheter specimen microbial testing until 08/2104?
SELECT microlab.culturetakentime FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-23605')) AND microlab.culturesite = 'urine, catheter specimen...
eicu
CREATE TABLE table_30120566_1 ( barony VARCHAR, townland VARCHAR, civil_parish VARCHAR )
In what barony are both the townland Dawstown and the civil parish Matehy located?
SELECT barony FROM table_30120566_1 WHERE townland = "Dawstown" AND civil_parish = "Matehy"
sql_create_context
CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(40), POSTAL_CODE varchar(12), CITY varchar(30), STATE_PROVINCE varchar(25), COUNTRY_ID varchar(2) ) CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), ...
For those employees who did not have any job in the past, visualize a bar chart about the distribution of job_id and the sum of department_id , and group by attribute job_id, and could you rank by the total number of department id in asc?
SELECT JOB_ID, SUM(DEPARTMENT_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) GROUP BY JOB_ID ORDER BY SUM(DEPARTMENT_ID)
nvbench
CREATE TABLE Behavior_Incident ( incident_id INTEGER, incident_type_code VARCHAR(10), student_id INTEGER, date_incident_start DATETIME, date_incident_end DATETIME, incident_summary VARCHAR(255), recommendations VARCHAR(255), other_details VARCHAR(255) ) CREATE TABLE Ref_Incident_Type ( ...
Give me the comparison about the average of monthly_rental over the date_address_to bin date_address_to by time by a bar chart.
SELECT date_address_to, AVG(monthly_rental) FROM Student_Addresses ORDER BY monthly_rental DESC
nvbench
CREATE TABLE table_name_92 ( date VARCHAR, tournament VARCHAR, opponent VARCHAR )
What is the date when the tournament is san diego and the opponent is ann grossman?
SELECT date FROM table_name_92 WHERE tournament = "san diego" AND opponent = "ann grossman"
sql_create_context
CREATE TABLE table_name_55 ( isbn_us VARCHAR, title VARCHAR )
What is ISBN US, when Title is 'Mission To Venus'?
SELECT isbn_us FROM table_name_55 WHERE title = "mission to venus"
sql_create_context
CREATE TABLE table_204_886 ( id number, "rank" number, "swimmer" text, "country" text, "time" text, "note" text )
which swimmer had the longest time ?
SELECT "swimmer" FROM table_204_886 ORDER BY "rank" DESC LIMIT 1
squall
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, ...
在2013年11月7日至2018年12月2日期间内患者57563510有多少就诊医生?
SELECT COUNT(DISTINCT mzjzjlb.ZZYSGH) FROM hz_info JOIN mzjzjlb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX WHERE hz_info.RYBH = '57563510' AND mzjzjlb.JZKSRQ BETWEEN '2013-11-07' AND '2018-12-02'
css
CREATE TABLE aircraft ( aircraft_code varchar, aircraft_description varchar, manufacturer varchar, basic_type varchar, engines int, propulsion varchar, wide_body varchar, wing_span int, length int, weight int, capacity int, pay_load int, cruising_speed int, range_...
i'm looking for a flight from PITTSBURGH 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_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'PITTSBURGH' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN...
atis
CREATE TABLE table_name_85 ( overall INTEGER, round VARCHAR, position VARCHAR )
WHAT IS THE AVERAGE OVERALL WITH A ROUND LARGER THAN 9, AND RB POSITION?
SELECT AVG(overall) FROM table_name_85 WHERE round > 9 AND position = "rb"
sql_create_context
CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varchar(20), LAST_NAME varchar(25), EMAIL varchar(25), PHONE_NUMBER varchar(20), HIRE_DATE date, JOB_ID varchar(10), SALARY decimal(8,2), COMMISSION_PCT decimal(2,2), MANAGER_ID decimal(6,0), DEPARTMENT_ID decimal(...
Give me a bar chart to compare the number of departments located in different cities, and I want to order by the Y-axis in asc.
SELECT CITY, COUNT(CITY) FROM locations GROUP BY CITY ORDER BY COUNT(CITY)
nvbench
CREATE TABLE VoteTypes ( Id number, Name text ) CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE Badges ( Id number, UserId number, Name t...
Evolution of mean score and number of questions in 2015 by week. Evolution of mean score and number of questions in 2015 by week
SELECT TIME_TO_STR(p.CreationDate, '%W') AS weekOfCreation, AVG(p.Score) AS meanQuestionScore, COUNT(p.Id) AS NumberOfPosts FROM Posts AS p WHERE p.PostTypeId = 1 AND TIME_TO_STR(p.CreationDate, '%Y') = 2015 GROUP BY TIME_TO_STR(p.CreationDate, '%W') ORDER BY TIME_TO_STR(p.CreationDate, '%W')
sede
CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_ID decimal(4,0) ) CREATE TABLE job_history ( EMPLOYEE_ID decimal(6,0...
For those employees who do not work in departments with managers that have ids between 100 and 200, visualize a bar chart about the distribution of phone_number and commission_pct , and list from low to high by the X.
SELECT PHONE_NUMBER, COMMISSION_PCT FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY PHONE_NUMBER
nvbench
CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid number, wardid number, admissionheight number, admissionweight number, dischargeweight number, hospitaladmittime time, ...
how did patient 027-100528 last be admitted during the previous year to the hospital?
SELECT patient.hospitaladmitsource FROM patient WHERE patient.uniquepid = '027-100528' AND DATETIME(patient.hospitaladmittime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') ORDER BY patient.hospitaladmittime DESC LIMIT 1
eicu
CREATE TABLE STUDENT ( Advisor VARCHAR )
For each advisor, report the total number of students advised by him or her.
SELECT Advisor, COUNT(*) FROM STUDENT GROUP BY Advisor
sql_create_context
CREATE TABLE table_17256857_1 ( car_no VARCHAR, driver VARCHAR )
What is the car number driven by Darren Manning?
SELECT car_no FROM table_17256857_1 WHERE driver = "Darren Manning"
sql_create_context
CREATE TABLE table_221653_1 ( platelet_count VARCHAR, partial_thromboplastin_time VARCHAR, bleeding_time VARCHAR )
What is the platelet count when partial thromboplastin time and bleeding time are unaffected?
SELECT platelet_count FROM table_221653_1 WHERE partial_thromboplastin_time = "Unaffected" AND bleeding_time = "Unaffected"
sql_create_context
CREATE TABLE Settlements ( Settlement_ID INTEGER, Claim_ID INTEGER, Date_Claim_Made DATE, Date_Claim_Settled DATE, Amount_Claimed INTEGER, Amount_Settled INTEGER, Customer_Policy_ID INTEGER ) CREATE TABLE Customers ( Customer_ID INTEGER, Customer_Details VARCHAR(255) ) CREATE TABLE...
Bin the claim date into the Day of Week interval and count them for visualizing a bar chart.
SELECT Date_Claim_Made, COUNT(Date_Claim_Made) FROM Settlements
nvbench
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...
the electrolyte administration - phosphate is how much?
SELECT DISTINCT cost.cost FROM cost WHERE cost.eventtype = 'treatment' AND cost.eventid IN (SELECT treatment.treatmentid FROM treatment WHERE treatment.treatmentname = 'electrolyte administration - phosphate')
eicu
CREATE TABLE table_50557 ( "Round" real, "Pick" real, "Overall" real, "Name" text, "Position" text, "College" text )
What number pick was the player drafted in round 3 at #28 overall?
SELECT AVG("Pick") FROM table_50557 WHERE "Overall" < '28' AND "Round" = '3'
wikisql
CREATE TABLE table_name_51 ( nhl_team VARCHAR, college_junior_club_team VARCHAR )
The Estevan Bruins (WCHL) are affiliated with what NHL team?
SELECT nhl_team FROM table_name_51 WHERE college_junior_club_team = "estevan bruins (wchl)"
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...
哪几位编号及姓名的医师在患者99606748的医疗就诊88854845172中,为其提供开具医疗项目服务的
SELECT t_kc22.HOSP_DOC_CD, t_kc22.HOSP_DOC_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 = '88854845172'
css
CREATE TABLE table_32062 ( "Player" text, "Nationality" text, "Position" text, "Years in Toronto" text, "School/Club Team" text )
How long has Sebastian Telfair played for Toronto?
SELECT "Years in Toronto" FROM table_32062 WHERE "Player" = 'sebastian telfair'
wikisql
CREATE TABLE table_14925084_1 ( population_1891 VARCHAR, area_1891__statute_acres_ VARCHAR )
Name the population 1891 for area being 175836
SELECT COUNT(population_1891) FROM table_14925084_1 WHERE area_1891__statute_acres_ = 175836
sql_create_context
CREATE TABLE table_name_96 ( drawn INTEGER, played INTEGER )
Which of the highest drawn has a played less than 10?
SELECT MAX(drawn) FROM table_name_96 WHERE played < 10
sql_create_context
CREATE TABLE table_204_42 ( id number, "season" number, "level" text, "division" text, "section" text, "position" text, "movements" text )
in how man years did ifk finish in at least 5th place .
SELECT COUNT("season") FROM table_204_42 WHERE "position" <= 5
squall
CREATE TABLE table_name_62 ( wins INTEGER, byes INTEGER )
What's the average number of wins for those with less than 2 byes?
SELECT AVG(wins) FROM table_name_62 WHERE byes < 2
sql_create_context
CREATE TABLE zyjzjlb ( YLJGDM text, JZLSH text, MZJZLSH text, KH text, KLX number, HZXM text, WDBZ number, RYDJSJ time, RYTJDM number, RYTJMC text, JZKSDM text, JZKSMC text, RZBQDM text, RZBQMC text, RYCWH text, CYKSDM text, CYKSMC text, CYBQDM tex...
检验结果指标记录的编码为90964222220的检测指标代码、检测项目名称、以及名称、检测方法都是啥?
SELECT JCXMMC, JCZBDM, JCZBMC, JCFF FROM jyjgzbb WHERE JYZBLSH = '90964222220'
css
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id...
how many patients were there who were aged less than 83 years and with a calculated total co2 lab test done?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.age < "83" AND lab.label = "Calculated Total CO2"
mimicsql_data
CREATE TABLE table_name_53 ( attendance INTEGER, time VARCHAR )
What was the sum of attendance for games with a time of 3:23?
SELECT SUM(attendance) FROM table_name_53 WHERE time = "3:23"
sql_create_context
CREATE TABLE table_16827 ( "Model name" text, "Power (ps)" real, "Torque (Nm@rpm)" text, "Displacement (cm\u00b3)" real, "Engine code" text, "Comment" text )
What is the model of the enginge d5252 t?
SELECT "Model name" FROM table_16827 WHERE "Engine code" = 'D5252 T'
wikisql
CREATE TABLE table_2830 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text )
Who has high points when 50-26 is the record?
SELECT "High points" FROM table_2830 WHERE "Record" = '50-26'
wikisql
CREATE TABLE table_name_92 ( goals INTEGER, team VARCHAR, average VARCHAR )
What Goals has a Team of zamora, and Average larger than 0.89?
SELECT AVG(goals) FROM table_name_92 WHERE team = "zamora" AND average > 0.89
sql_create_context
CREATE TABLE table_name_72 ( opponent VARCHAR, date VARCHAR )
what team played on july 9
SELECT opponent FROM table_name_72 WHERE date = "july 9"
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, ...
门诊诊断为患者的检测指标569976疾病K19.872的数值的最值以及平均值都分别是多少?
SELECT AVG(jyjgzbb.JCZBJGDL), MIN(jyjgzbb.JCZBJGDL), MAX(jyjgzbb.JCZBJGDL) FROM txmzjzjlb JOIN jybgb JOIN jyjgzbb ON txmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND txmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE txmzjzjlb.JZZDBM = 'K19.872' AND jyjgzbb.JCZBDM = '...
css
CREATE TABLE table_203_203 ( id number, "year" number, "majors" number, "atp wins" number, "total wins" number, "earnings (us$)" number, "money list rank" number )
last year to make over 1000000
SELECT MAX("year") FROM table_203_203 WHERE "earnings (us$)" > 1000000
squall
CREATE TABLE hz_info ( KH text, KLX number, YLJGDM text, RYBH text ) CREATE TABLE person_info ( RYBH text, XBDM number, XBMC text, XM text, CSRQ time, CSD text, MZDM text, MZMC text, GJDM text, GJMC text, JGDM text, JGMC text, XLDM text, XLMC text...
在零零年六月二十二日到一三年十二月二十五日期间,有多少在脊柱外科门诊看病的人
SELECT COUNT(*) FROM mzjzjlb WHERE JZKSMC = '脊柱外科' AND JZKSRQ BETWEEN '2000-06-22' AND '2013-12-25'
css
CREATE TABLE course_offering ( offering_id int, course_id int, semester int, section_number int, start_time time, end_time time, monday varchar, tuesday varchar, wednesday varchar, thursday varchar, friday varchar, saturday varchar, sunday varchar, has_final_proje...
Across all departments , how many classes are being offered next semester ?
SELECT COUNT(DISTINCT course_offering.course_id) FROM course_offering, semester WHERE semester.semester = 'FA' AND semester.semester_id = course_offering.semester AND semester.year = 2016
advising
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 mzjzjlb ( HXPLC number, HZXM ...
住院就诊02193612306的主要诊断编码的名称是什么?需要名称列表、编号类型和编号列表
SELECT zyjzjlb.ZYBMLX, zyjzjlb.ZYZDBM, zyjzjlb.ZYZDMC FROM zyjzjlb WHERE zyjzjlb.JZLSH = '02193612306'
css
CREATE TABLE table_75259 ( "Rank" real, "Gold" real, "Silver" real, "Bronze" real, "Total" real, "Participants" real )
What's the total Rank that has a Gold that's smaller than 0?
SELECT SUM("Rank") FROM table_75259 WHERE "Gold" < '0'
wikisql
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 of the patients had urgent admission due to hyperacusis?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admission_type = "URGENT" AND diagnoses.short_title = "Hyperacusis"
mimicsql_data