context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
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,...
看看病患83449469做过的检查有什么
SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM t_kc21 JOIN t_kc22 JOIN t_kc21_t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc21_t_kc22.MED_CLINIC_ID AND t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID WHERE t_kc21.PERSON_ID = '83449469' AND t_kc22.MED_INV_ITEM_TYPE = '检查费'
css
CREATE TABLE Comments ( Id number, PostId number, Score number, Text text, CreationDate time, UserDisplayName text, UserId number, ContentLicense text ) CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE Badges...
JanitorTags: tag:Linux but focused on a distro (pacman).
SELECT Id AS "post_link", * FROM Posts JOIN PostTags ON Posts.Id = PostTags.PostId WHERE PostTags.TagId = 4 AND Body LIKE '%pacman%' ORDER BY CreationDate DESC
sede
CREATE TABLE table_203_815 ( id number, "pick #" number, "nfl team" text, "player" text, "position" text, "college" text )
who was the only player from kansas state ?
SELECT "player" FROM table_203_815 WHERE "college" = 'kansas state'
squall
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...
从00年10月1日到10年9月21日这个患者喻萍雅检查了多少次?
SELECT COUNT(*) FROM t_kc21 JOIN t_kc22 JOIN t_kc21_t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc21_t_kc22.MED_CLINIC_ID AND t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID WHERE t_kc21.PERSON_NM = '喻萍雅' AND t_kc22.STA_DATE BETWEEN '2000-10-01' AND '2010-09-21' AND t_kc22.MED_INV_ITEM_TYPE = '检查费'
css
CREATE TABLE course ( crs_code text, dept_code text, crs_description text, crs_credit number ) CREATE TABLE enroll ( class_code text, stu_num number, enroll_grade text ) CREATE TABLE employee ( emp_num number, emp_lname text, emp_fname text, emp_initial text, emp_jobcod...
What are the first names, office locations of all lecturers who have taught some course?
SELECT T2.emp_fname, T4.prof_office, T3.crs_description FROM class AS T1 JOIN employee AS T2 ON T1.prof_num = T2.emp_num JOIN course AS T3 ON T1.crs_code = T3.crs_code JOIN professor AS T4 ON T2.emp_num = T4.emp_num
spider
CREATE TABLE table_4053 ( "Executed person" text, "Date of execution" text, "Place of execution" text, "Crime" text, "Method" text, "Under President" text )
under which president was gunther volz executed?
SELECT "Under President" FROM table_4053 WHERE "Executed person" = 'Gunther Volz'
wikisql
CREATE TABLE table_72445 ( "County" text, "Population" real, "Per capita income" text, "Median household income" text, "Median family income" text )
Name the median family income for riverside
SELECT "Median family income" FROM table_72445 WHERE "County" = 'Riverside'
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, ...
在17年10月30日到18年12月8日期间,列出金宏茂患者所有检验结果指标记录中用的什么检测方法?
SELECT jyjgzbb.JCFF FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb 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 AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE hz_in...
css
CREATE TABLE table_22767 ( "Year" real, "World" real, "Asia" text, "Africa" text, "Europe" text, "Latin America/Caribbean" text, "Northern America" text, "Oceania" text )
what will the population of Asia be when Latin America/Caribbean is 783 (7.5%)?
SELECT "Asia" FROM table_22767 WHERE "Latin America/Caribbean" = '783 (7.5%)'
wikisql
CREATE TABLE Student ( StuID INTEGER, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3) ) CREATE TABLE Faculty ( FacID INTEGER, Lname VARCHAR(15), Fname VARCHAR(15), Rank VARCHAR(15), Sex VARCHAR(1...
How many faculty members do we have for each gender? Draw a bar chart, order by the Y-axis in descending.
SELECT Sex, COUNT(*) FROM Faculty GROUP BY Sex ORDER BY COUNT(*) DESC
nvbench
CREATE TABLE table_name_24 ( silver VARCHAR, bronze VARCHAR, gold VARCHAR, rank VARCHAR )
Which silver has a Gold smaller than 12, a Rank smaller than 5, and a Bronze of 5?
SELECT silver FROM table_name_24 WHERE gold < 12 AND rank < 5 AND bronze = 5
sql_create_context
CREATE TABLE time_interval ( period text, begin_time int, end_time int ) CREATE TABLE flight_leg ( flight_id int, leg_number int, leg_flight int ) CREATE TABLE airline ( airline_code varchar, airline_name text, note text ) CREATE TABLE ground_service ( city_code text, airp...
what are the early morning flights from BOSTON to DENVER
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE (CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'BOSTON' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'DENVER...
atis
CREATE TABLE table_3791 ( "Year" text, "Stage" real, "Start of stage" text, "Distance (km)" text, "Category of climb" text, "Stage winner" text, "Nationality" text, "Yellow jersey" text, "Bend" real )
What is every yellow jersey entry for the distance 125?
SELECT "Yellow jersey" FROM table_3791 WHERE "Distance (km)" = '125'
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, ...
count the number of patients whose insurance is government and procedure short title is rt/left heart card cath?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.insurance = "Government" AND procedures.short_title = "Rt/left heart card cath"
mimicsql_data
CREATE TABLE table_18904831_5 ( record VARCHAR, high_rebounds VARCHAR )
What was the record of the game in which Dydek (10) did the most high rebounds?
SELECT record FROM table_18904831_5 WHERE high_rebounds = "Dydek (10)"
sql_create_context
CREATE TABLE table_7207 ( "Objects" text, "Date" text, "SiO 2" real, "Al 2 O 3" real, "Fe 2 O 3" real, "K 2 O" real, "Na 2 O" real )
What is the highest K 2 O, when Na 2 O is greater than 1.87, when Fe 2 O 3 is greater than 0.07, when Objects is Ritual Disk, and when Al 2 O 3 is less than 0.62?
SELECT MAX("K 2 O") FROM table_7207 WHERE "Na 2 O" > '1.87' AND "Fe 2 O 3" > '0.07' AND "Objects" = 'ritual disk' AND "Al 2 O 3" < '0.62'
wikisql
CREATE TABLE table_72013 ( "Season" text, "Level" text, "Division" text, "Section" text, "Position" text )
Which section is in the 6th position?
SELECT "Section" FROM table_72013 WHERE "Position" = '6th'
wikisql
CREATE TABLE table_69300 ( "Name" text, "Years" text, "Gender" text, "Area" text, "Authority" text, "Decile" real, "Roll" real )
What is the area of the coed school with a state authority and a roll number of 122?
SELECT "Area" FROM table_69300 WHERE "Authority" = 'state' AND "Gender" = 'coed' AND "Roll" = '122'
wikisql
CREATE TABLE table_name_1 ( type VARCHAR, location VARCHAR )
Which type of institution is in Amherst, MA?
SELECT type FROM table_name_1 WHERE location = "amherst, ma"
sql_create_context
CREATE TABLE table_21696 ( "Winner" text, "Country" text, "Winter Olympics" text, "FIS Nordic World Ski Championships" text, "Holmenkollen" text )
What years did Birger Ruud win the FIS Nordic World Ski Championships?
SELECT "FIS Nordic World Ski Championships" FROM table_21696 WHERE "Winner" = 'Birger Ruud'
wikisql
CREATE TABLE table_60686 ( "Date" text, "Tournament" text, "Surface" text, "Opponent" text, "Score" text )
What date was the match against adri n men ndez-maceiras?
SELECT "Date" FROM table_60686 WHERE "Opponent" = 'adrián menéndez-maceiras'
wikisql
CREATE TABLE table_203_365 ( id number, "released" text, "video title" text, "company" text, "director" text, "notes" text )
did shoko goto make more films in 2004 or 2005 ?
SELECT "released" FROM table_203_365 WHERE "released" IN (2004, 2005) GROUP BY "released" ORDER BY COUNT("video title") DESC LIMIT 1
squall
CREATE TABLE table_65116 ( "Date" text, "Venue" text, "Score" text, "Result" text, "Competition" text )
What venue listed is dated February 22, 2003?
SELECT "Venue" FROM table_65116 WHERE "Date" = 'february 22, 2003'
wikisql
CREATE TABLE course ( course_id int, name varchar, department varchar, number varchar, credits varchar, advisory_requirement varchar, enforced_requirement varchar, description varchar, num_semesters int, num_enrolled int, has_discussion varchar, has_lab varchar, has_p...
How often does the course POLSCI 659 meet ?
SELECT DISTINCT course_offering.friday, course_offering.monday, course_offering.saturday, course_offering.sunday, course_offering.thursday, course_offering.tuesday, course_offering.wednesday FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_i...
advising
CREATE TABLE table_40395 ( "Couple" text, "Style" text, "Music" text, "Choreographer(s)" text, "Results" text )
Which couple participated in the Contemporary style of dance?
SELECT "Couple" FROM table_40395 WHERE "Style" = 'contemporary'
wikisql
CREATE TABLE table_28772 ( "Portuguese name" text, "English name" text, "Subdivides in" text, "Equivalence in Varas" text, "Metrical equivalence" text )
Name the metrical equivalence for linha
SELECT "Metrical equivalence" FROM table_28772 WHERE "Portuguese name" = 'Linha'
wikisql
CREATE TABLE table_27132791_3 ( position VARCHAR, college VARCHAR )
If the college is SMU, what is the position?
SELECT position FROM table_27132791_3 WHERE college = "SMU"
sql_create_context
CREATE TABLE table_21876 ( "Season" real, "Date" text, "Winning Driver" text, "Car #" real, "Sponsor" text, "Make" text, "Team" text, "Avg Speed" text, "Margin of Victory" text )
What was the represented team on June 27?
SELECT "Team" FROM table_21876 WHERE "Date" = 'June 27'
wikisql
CREATE TABLE table_8430 ( "Number" text, "Builder" text, "Type" text, "Date" real, "Length" text, "Capacity" text )
Which Type has a Capacity of 28 passengers, and a Number of 16?
SELECT "Type" FROM table_8430 WHERE "Capacity" = '28 passengers' AND "Number" = '16'
wikisql
CREATE TABLE people ( people_id number, district text, name text, party text, age number ) CREATE TABLE debate_people ( debate_id number, affirmative number, negative number, if_affirmative_win others ) CREATE TABLE debate ( debate_id number, date text, venue text, ...
Show the names of people, and dates and venues of debates they are on the negative side, ordered in ascending alphabetical order of name.
SELECT T3.name, T2.date, T2.venue FROM debate_people AS T1 JOIN debate AS T2 ON T1.debate_id = T2.debate_id JOIN people AS T3 ON T1.negative = T3.people_id ORDER BY T3.name
spider
CREATE TABLE table_203_564 ( id number, "hand" text, "1 credit" number, "2 credits" number, "3 credits" number, "4 credits" number, "5 credits" number )
is a 2 credit full house the same as a 5 credit three of a kind ?
SELECT (SELECT "2 credits" FROM table_203_564 WHERE "hand" = 'full house') = (SELECT "5 credits" FROM table_203_564 WHERE "hand" = 'three of a kind')
squall
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...
Next semester , what time does the EDUC 510 lecture begin ?
SELECT DISTINCT course_offering.start_time FROM course INNER JOIN program_course ON program_course.course_id = course.course_id INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester WHERE course.department = 'EDUC' AND course.nu...
advising
CREATE TABLE table_name_19 ( wins INTEGER, position VARCHAR, poles VARCHAR )
What is the smallest Wins with a Position of 20th, and Poles smaller than 0?
SELECT MIN(wins) FROM table_name_19 WHERE position = "20th" AND poles < 0
sql_create_context
CREATE TABLE table_30306 ( "Year Location" text, "Mens Singles" text, "Womens Singles" text, "Mens Doubles" text, "Womens Doubles" text )
Who is listed under mens singles when womens has wang nan zhang yining?
SELECT "Mens Singles" FROM table_30306 WHERE "Womens Doubles" = 'Wang Nan Zhang Yining'
wikisql
CREATE TABLE Behavior_Incident ( date_incident_start VARCHAR, date_incident_end VARCHAR, incident_type_code VARCHAR )
What are the start and end dates for incidents with incident type code 'NOISE'?
SELECT date_incident_start, date_incident_end FROM Behavior_Incident WHERE incident_type_code = "NOISE"
sql_create_context
CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text ) CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, ...
Users with highest reputation both in SO and Math ( geometric mean = average digits).
SELECT s.DisplayName, s.Reputation AS RepSO, m.Reputation AS RepMath, (LOG10(s.Reputation) + LOG10(m.Reputation)) / 2 AS RepAvDigits FROM "stackexchange.math".Users AS m, "stackoverflow".Users AS s WHERE s.Reputation > 10000 AND m.Reputation > 10000 AND s.AccountId = m.AccountId ORDER BY 4 DESC
sede
CREATE TABLE table_37490 ( "Name" text, "Gain" real, "Loss" real, "Long" real, "Avg/G" real )
How much Long has a Loss larger than 2, and a Gain of 157, and an Avg/G smaller than 129?
SELECT SUM("Long") FROM table_37490 WHERE "Loss" > '2' AND "Gain" = '157' AND "Avg/G" < '129'
wikisql
CREATE TABLE table_name_37 ( first_elected INTEGER, party VARCHAR, district VARCHAR )
In what year was the republican incumbent from Kentucky 2 district first elected?
SELECT SUM(first_elected) FROM table_name_37 WHERE party = "republican" AND district = "kentucky 2"
sql_create_context
CREATE TABLE table_69736 ( "Rank" real, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
Name the sum of rank for bronze less than 1 and gold of 1 with total less than 1
SELECT SUM("Rank") FROM table_69736 WHERE "Bronze" < '1' AND "Gold" = '1' AND "Total" < '1'
wikisql
CREATE TABLE table_67963 ( "Year" real, "Class" text, "Team" text, "Points" real, "Wins" real )
What is the least points for class 125cc with 1 win earlier than 1961?
SELECT MIN("Points") FROM table_67963 WHERE "Class" = '125cc' AND "Wins" = '1' AND "Year" < '1961'
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, ...
what is insurance and primary disease of subject name james sloan?
SELECT demographic.insurance, demographic.diagnosis FROM demographic WHERE demographic.name = "James Sloan"
mimicsql_data
CREATE TABLE hz_info ( KH text, KLX number, YLJGDM text ) 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, ...
在医院3470456中科室名有变态反应这几个字的就诊科室的门诊中,有哪些是病患范秀逸的就诊记录流水号
SELECT mzjzjlb.JZLSH FROM person_info JOIN hz_info JOIN mzjzjlb JOIN person_info_hz_info ON person_info.RYBH = person_info_hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND person_info_hz_info.KH = hz_info.KH AND person_info_hz_info.KLX = hz_info.KLX AND pers...
css
CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_typ...
are any organisms found until 09/2102 in the first catheter tip-iv test of patient 28484?
SELECT COUNT(*) > 0 FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 28484) AND microbiologyevents.spec_type_desc = 'catheter tip-iv' AND NOT microbiologyevents.org_name IS NULL AND STRFTIME('%y-%m', microbiologyevents.charttime) <= '21...
mimic_iii
CREATE TABLE table_name_72 ( rounds VARCHAR, entrant VARCHAR, driver VARCHAR )
Which of the Rounds has an Entrant of automobiles Talbot-Darracq, and Pierre Levegh as the driver?
SELECT rounds FROM table_name_72 WHERE entrant = "automobiles talbot-darracq" AND driver = "pierre levegh"
sql_create_context
CREATE TABLE airport_service ( city_code varchar, airport_code varchar, miles_distant int, direction varchar, minutes_distant int ) CREATE TABLE food_service ( meal_code text, meal_number int, compartment text, meal_description varchar ) CREATE TABLE restriction ( restriction_c...
on 7 23 an early flight 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 (((date_day.day_number = 23 AND date_day.month_number = 7 AND date_day.year = 1991 AND days.day_name = date_day.day_name AND flight.departure_tim...
atis
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...
哪些门诊就诊记录是患者31549527的对应的检验报告单的报告日期均在2006年4月16日之后?门诊就诊流水号是什么?
SELECT wdmzjzjlb.JZLSH FROM hz_info JOIN wdmzjzjlb ON hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX WHERE hz_info.RYBH = '31549527' AND NOT wdmzjzjlb.JZLSH IN (SELECT jybgb.JZLSH FROM jybgb WHERE jybgb.BGRQ <= '2006-04-16') UNION SELECT bdmzjzjlb.JZLSH FROM hz_info JOIN...
css
CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE ReviewRejectionReasons ( Id number, Na...
Questions for Bumping by Community.
WITH Questions AS (SELECT Id, PostTypeId FROM Posts WHERE PostTypeId = 1 AND LastActivityDate <= DATEADD(day, -30, GETDATE()) AND AnswerCount != 0), AnswerScore AS (SELECT ParentId, MAX(Score) AS MaxScore FROM Posts WHERE PostTypeId = 2 GROUP BY ParentId), TotalQuestions AS (SELECT PostTypeId, COUNT(*) AS Total FROM Po...
sede
CREATE TABLE table_20205 ( "Ecosystem" text, "Date of issue" text, "Place of issue" text, "No. stamps in sheet" real, "Face Value" text, "Printer" text )
How many stamps have a face value of 37 and were printed in the banknote corporation of america?
SELECT COUNT("No. stamps in sheet") FROM table_20205 WHERE "Face Value" = '37¢' AND "Printer" = 'Banknote Corporation of America'
wikisql
CREATE TABLE table_22056184_1 ( points VARCHAR, poles VARCHAR )
How many points when pole are 1?
SELECT points FROM table_22056184_1 WHERE poles = 1
sql_create_context
CREATE TABLE table_name_23 ( date VARCHAR, set_1 VARCHAR )
What day was there a set 1 of 25-18?
SELECT date FROM table_name_23 WHERE set_1 = "25-18"
sql_create_context
CREATE TABLE table_43798 ( "Event" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
what is the gold when silver is 1, event is 2000 summer paralympics and bronze is more than 3?
SELECT AVG("Gold") FROM table_43798 WHERE "Silver" = '1' AND "Event" = '2000 summer paralympics' AND "Bronze" > '3'
wikisql
CREATE TABLE table_34949 ( "Statue" text, "Liberator" text, "Country" text, "Year Erected" text, "Artist" text )
what year did enrique alciati make a statue
SELECT "Year Erected" FROM table_34949 WHERE "Artist" = 'enrique alciati'
wikisql
CREATE TABLE table_68746 ( "Rank" real, "Heat" real, "Lane" real, "Name" text, "Nationality" text, "Time" text )
What is the time for a lane less than 6, and a heat less than 4 for Joanne Malar?
SELECT "Time" FROM table_68746 WHERE "Lane" < '6' AND "Heat" < '4' AND "Name" = 'joanne malar'
wikisql
CREATE TABLE table_46765 ( "Name" text, "Seasons" real, "Matches" real, "Win %" text, "Draw" real, "Draw %" text, "Lose" real, "Lose %" text )
What is the average number of matches of leonardo in seasons after 1?
SELECT AVG("Matches") FROM table_46765 WHERE "Name" = 'leonardo' AND "Seasons" > '1'
wikisql
CREATE TABLE t_kc21_t_kc22 ( MED_CLINIC_ID text, MED_EXP_DET_ID number ) 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, H...
从2000年8月22日开始到2002年10月30日结束,医院9621160购药医疗记录的总量是多少?
SELECT COUNT(*) FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '9621160' AND t_kc21.IN_HOSP_DATE BETWEEN '2000-08-22' AND '2002-10-30' AND t_kc21.CLINIC_TYPE = '购药'
css
CREATE TABLE table_47939 ( "Tournament" text, "Country" text, "Location" text, "Current Venue" text, "Began" real, "Court surface" text )
For the Indian Wells Masters tournament, what was the country?
SELECT "Country" FROM table_47939 WHERE "Tournament" = 'indian wells masters'
wikisql
CREATE TABLE table_8470 ( "Poll Source" text, "Dates administered" text, "Democrat: Bob Springmeyer" text, "Republican: Jon Huntsman" text, "Lead Margin" real )
Who is the republican Jon Huntsman that was administered June 19, 2008?
SELECT "Republican: Jon Huntsman" FROM table_8470 WHERE "Dates administered" = 'june 19, 2008'
wikisql
CREATE TABLE table_name_58 ( state VARCHAR, royal_house VARCHAR )
What is the state for the royal house of ying?
SELECT state FROM table_name_58 WHERE royal_house = "ying"
sql_create_context
CREATE TABLE table_name_48 ( Id VARCHAR )
What 1995 has 1r as the 1999, and a 1998 of 4r?
SELECT 1995 FROM table_name_48 WHERE 1999 = "1r" AND 1998 = "4r"
sql_create_context
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, ...
在2007年12月12日到2020年1月21日内患者34563100就诊过多少个医生?
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 = '34563100' AND mzjzjlb.JZKSRQ BETWEEN '2007-12-12' AND '2020-01-21'
css
CREATE TABLE table_12608427_8 ( p VARCHAR, name VARCHAR )
What was the position (P) for Clapham?
SELECT p FROM table_12608427_8 WHERE name = "Clapham"
sql_create_context
CREATE TABLE table_11240028_3 ( portrayed_by VARCHAR, character VARCHAR )
Which characters were portrayed by reed garrett?
SELECT portrayed_by FROM table_11240028_3 WHERE character = "Reed Garrett"
sql_create_context
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, ...
what is drug type and drug route of drug name famvir?
SELECT prescriptions.drug_type, prescriptions.route FROM prescriptions WHERE prescriptions.drug = "Famvir"
mimicsql_data
CREATE TABLE table_name_21 ( roll VARCHAR, name VARCHAR )
What is the roll number for East Gore School?
SELECT COUNT(roll) FROM table_name_21 WHERE name = "east gore school"
sql_create_context
CREATE TABLE table_62619 ( "Opposing Teams" text, "Against" real, "Date" text, "Venue" text, "Status" text )
What is the average Against, when Status is 'Five Nations', and when Date is '16/03/1996'?
SELECT AVG("Against") FROM table_62619 WHERE "Status" = 'five nations' AND "Date" = '16/03/1996'
wikisql
CREATE TABLE table_name_62 ( name VARCHAR, snatch VARCHAR, bodyweight VARCHAR, clean_ VARCHAR, _jerk VARCHAR )
What's the name of the athlete with a Snatch larger than 140, Bodyweight smaller than 84.55, and Clean and Jerk of 192.5?
SELECT name FROM table_name_62 WHERE snatch > 140 AND bodyweight < 84.55 AND clean_ & _jerk = "192.5"
sql_create_context
CREATE TABLE FlagTypes ( Id number, Name text, Description text ) CREATE TABLE ReviewTaskResultTypes ( Id number, Name text, Description text ) CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTas...
Top users rep per x weeks.
SELECT SUM(pst.Score), QA, usr.DisplayName, SUM(upv) AS uv, SUM(downv) AS dv FROM (SELECT p.Id AS postid, CASE WHEN p.PostTypeId = 1 THEN 'Q' ELSE 'A' END AS QA, MIN(p.OwnerUserId) AS uid, COUNT(*) AS upv, 0 AS downv FROM Posts AS p INNER JOIN Votes AS v ON v.PostId = p.Id WHERE v.VoteTypeId = 2 GROUP BY p.PostTypeId, ...
sede
CREATE TABLE t_kc24 ( ACCOUNT_DASH_DATE time, ACCOUNT_DASH_FLG number, CASH_PAY number, CIVIL_SUBSIDY number, CKC102 number, CLINIC_ID text, CLINIC_SLT_DATE time, COMP_ID text, COM_ACC_PAY number, COM_PAY number, DATA_ID text, ENT_ACC_PAY number, ENT_PAY number, F...
看一下孙祺然这个病人在哪几次医疗记录中被开出的药品均超过9192.27元?医疗就诊编号是啥
SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.t_kc21_PERSON_NM = '孙祺然' AND NOT t_kc22.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT <= 9192.27)
css
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, ...
What is the total number of Asian patients born before the year 2109?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "ASIAN" AND demographic.dob_year < "2109"
mimicsql_data
CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) CREATE TABLE PostsWithDeleted ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUser...
Shortest answers with score > 1.
SELECT Id AS "post_link", Body FROM Posts WHERE PostTypeId = 2 AND LENGTH(Body) < 100 AND Score < 0 ORDER BY LENGTH(Body) DESC
sede
CREATE TABLE table_name_63 ( package_option VARCHAR, television_service VARCHAR )
What is Package/Option, when Television Service is Sky Inside?
SELECT package_option FROM table_name_63 WHERE television_service = "sky inside"
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 job_history ( EMPLOYEE_ID decimal(6,0), START_DATE date, END_DATE date, JOB_ID varchar(10), ...
For those employees whose salary is in the range of 8000 and 12000 and commission is not null or department number does not equal to 40, return a bar chart about the distribution of hire_date and the average of manager_id bin hire_date by weekday.
SELECT HIRE_DATE, AVG(MANAGER_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40
nvbench
CREATE TABLE address ( district VARCHAR )
How many addresses are in the district of California?
SELECT COUNT(*) FROM address WHERE district = 'California'
sql_create_context
CREATE TABLE table_20866024_3 ( wheelbase__mm_inch_ VARCHAR, model_designation VARCHAR )
What's the wheelbase (in mm/inch) of the model with model designation 97G00?
SELECT wheelbase__mm_inch_ FROM table_20866024_3 WHERE model_designation = "97G00"
sql_create_context
CREATE TABLE Participants_in_Events ( Event_ID INTEGER, Participant_ID INTEGER ) CREATE TABLE Events ( Event_ID INTEGER, Service_ID INTEGER, Event_Details VARCHAR(255) ) CREATE TABLE Services ( Service_ID INTEGER, Service_Type_Code CHAR(15) ) CREATE TABLE Participants ( Participant_ID...
A bar chart about what are the ids and details of events that have more than one participants?, and order X in asc order.
SELECT T1.Event_Details, T1.Event_ID FROM Events AS T1 JOIN Participants_in_Events AS T2 ON T1.Event_ID = T2.Event_ID GROUP BY T1.Event_Details ORDER BY T1.Event_Details
nvbench
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 ( ...
Specify the type and route of adminsitration for the drug Famvir
SELECT prescriptions.drug_type, prescriptions.route FROM prescriptions WHERE prescriptions.drug = "Famvir"
mimicsql_data
CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE job_history ( EMPLOYEE_ID decimal(6,0), START_DATE date, END_DATE date, JOB_ID varchar(10), DEPARTMENT_ID decimal(4,0) ) CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(4...
For those employees who do not work in departments with managers that have ids between 100 and 200, show me about the distribution of hire_date and the sum of manager_id bin hire_date by time in a bar chart, and order by the y axis in ascending.
SELECT HIRE_DATE, SUM(MANAGER_ID) FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY SUM(MANAGER_ID)
nvbench
CREATE TABLE table_6542 ( "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 singles for christian wagener christian esch
SELECT "Men's singles" FROM table_6542 WHERE "Men's doubles" = 'christian wagener christian esch'
wikisql
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 ...
查询花英勋病患的检验报告单中结果指标均异常的检验报告单,需要检验报告的单号
SELECT jybgb.BGDH 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.person_info_XM = '花英勋' AND NOT jybgb.BGDH IN (SELECT jyjgzbb.BGDH FROM jyjgz...
css
CREATE TABLE table_name_72 ( vinculum VARCHAR, parentheses VARCHAR )
How much is vinculum when the parentheses are 0.(81)?
SELECT vinculum FROM table_name_72 WHERE parentheses = "0.(81)"
sql_create_context
CREATE TABLE table_24486 ( "State (class)" text, "Vacator" text, "Reason for change" text, "Successor" text, "Date of successors formal installation" text )
Name the state class for resigned november 3, 1964
SELECT "State (class)" FROM table_24486 WHERE "Reason for change" = 'Resigned November 3, 1964'
wikisql
CREATE TABLE table_60292 ( "Pick #" real, "Player" text, "Position" text, "Nationality" text, "NHL team" text, "College/junior/club team" text )
What is the pick number for position of D from the University of Maine (NCAA)?
SELECT "Pick #" FROM table_60292 WHERE "Position" = 'd' AND "College/junior/club team" = 'university of maine (ncaa)'
wikisql
CREATE TABLE table_23385853_19 ( pos INTEGER, points VARCHAR )
What is the lowest position for a driver with 2 points?
SELECT MAX(pos) FROM table_23385853_19 WHERE points = 2
sql_create_context
CREATE TABLE Student ( StuID INTEGER, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3) ) CREATE TABLE Allergy_Type ( Allergy VARCHAR(20), AllergyType VARCHAR(20) ) CREATE TABLE Has_Allergy ( StuID INTEGE...
Bar graph to show the total number from different allergytype, sort y-axis from high to low order.
SELECT AllergyType, COUNT(*) FROM Allergy_Type GROUP BY AllergyType ORDER BY COUNT(*) DESC
nvbench
CREATE TABLE table_203_374 ( id number, "rank" number, "nation" text, "gold" number, "silver" number, "bronze" number, "total" number )
which is the only country that has won 6 gold medals ?
SELECT "nation" FROM table_203_374 WHERE "gold" = 6
squall
CREATE TABLE reviewer ( rid number, name text ) CREATE TABLE rating ( rid number, mid number, stars number, ratingdate time ) CREATE TABLE movie ( mid number, title text, year number, director text )
Find the titles of all movies directed by steven spielberg.
SELECT title FROM movie WHERE director = 'Steven Spielberg'
spider
CREATE TABLE table_74321 ( "No. in series" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production code" text, "U.S. viewers (million)" text )
How many million U.S. viewers saw the episode with production code 3X5710?
SELECT "U.S. viewers (million)" FROM table_74321 WHERE "Production code" = '3X5710'
wikisql
CREATE TABLE table_204_893 ( id number, "rank" number, "name" text, "nationality" text, "time" text, "notes" text )
how many athletes took more than 8 minutes to run complete the race ?
SELECT COUNT("name") FROM table_204_893 WHERE "time" >= 8
squall
CREATE TABLE table_29177 ( "Rank" real, "Rider" text, "Sat 21 Aug" text, "Mon 23 Aug" text, "Tues 24 Aug" text, "Wed 25 Aug" text, "Thurs 26 Aug" text, "Fri 27 Aug" text, "Sat 28 Aug" text )
How many times was the time 19' 38.87 115.219mph on Fri Aug 27?
SELECT COUNT("Mon 23 Aug") FROM table_29177 WHERE "Fri 27 Aug" = '19'' 38.87 115.219mph'
wikisql
CREATE TABLE jobs ( job_id int, job_title varchar, description varchar, requirement varchar, city varchar, state varchar, country varchar, zip int ) CREATE TABLE instructor ( instructor_id int, name varchar, uniqname varchar ) CREATE TABLE semester ( semester_id int, ...
What individuals have never taught HISTORY 470 ?
SELECT DISTINCT name FROM instructor WHERE NOT name IN (SELECT INSTRUCTORalias1.name FROM course AS COURSEalias0 INNER JOIN course_offering AS COURSE_OFFERINGalias0 ON COURSEalias0.course_id = COURSE_OFFERINGalias0.course_id INNER JOIN offering_instructor AS OFFERING_INSTRUCTOR ON OFFERING_OFFERING_ID = COURSE_OFFERING...
advising
CREATE TABLE table_33614 ( "Approximate Age" text, "Virtues" text, "Psycho Social Crisis" text, "Significant Relationship" text, "Existential Question [ not in citation given ]" text, "Examples" text )
Can you give me the age of the Significant Relationship of Family?
SELECT "Approximate Age" FROM table_33614 WHERE "Significant Relationship" = 'family'
wikisql
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, ...
when did patient 030-67523 have the minimum value of hct last until 37 months ago?
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 = '030-67523')) AND lab.labname = 'hct' AND DATETIME(lab.labresulttime) <= DATETIME(CU...
eicu
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...
how many patients whose lab test abnormal status is delta and lab test name is phosphate, urine?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE lab.flag = "delta" AND lab.label = "Phosphate, Urine"
mimicsql_data
CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id n...
what's the date of patient 8991's birth?
SELECT patients.dob FROM patients WHERE patients.subject_id = 8991
mimic_iii
CREATE TABLE county ( County_Id int, County_name text, Population real, Zip_code text ) CREATE TABLE party ( Party_ID int, Year real, Party text, Governor text, Lieutenant_Governor text, Comptroller text, Attorney_General text, US_Senate text ) CREATE TABLE election ( ...
Show me population by county name in a histogram, rank names in desc order.
SELECT County_name, Population FROM county ORDER BY County_name DESC
nvbench
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 location and diagnoses long title of subject id 55094?
SELECT demographic.admission_location, diagnoses.long_title FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.subject_id = "55094"
mimicsql_data
CREATE TABLE table_24880 ( "No. in series" real, "No. in season" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production code" text )
Who is the writer of episode 13?
SELECT COUNT("Written by") FROM table_24880 WHERE "No. in season" = '13'
wikisql
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) C...
provide the number of patients whose marital status is divorced?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.marital_status = "DIVORCED"
mimicsql_data
CREATE TABLE table_77711 ( "Constructor" text, "Chassis" text, "Engine" text, "Tyres" text, "Driver" text, "Rounds" text )
Who constructed the car that Derek Warwick raced in with a TG181 chassis?
SELECT "Constructor" FROM table_77711 WHERE "Chassis" = 'tg181' AND "Driver" = 'derek warwick'
wikisql
CREATE TABLE table_72149 ( "No" text, "City district (Stadtteil)" text, "Area in km\u00b2" text, "Population" text, "Foreign nationals" text, "Foreign nationals in %" text, "Area district (Ortsbezirk)" text )
What is the city where the number is 47?
SELECT "City district (Stadtteil)" FROM table_72149 WHERE "No" = '47'
wikisql