context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE table_78955 ( "Position" real, "Club" text, "Played" real, "Points" real, "Wins" real, "Draws" real, "Losses" real, "Goals for" real, "Goals against" real, "Goal Difference" real )
What is the lowest amount of draws with less than 12 wins and less than 30 played?
SELECT MIN("Draws") FROM table_78955 WHERE "Wins" < '12' AND "Played" < '30'
wikisql
CREATE TABLE Ref_Calendar ( Calendar_Date DATETIME, Day_Number INTEGER ) CREATE TABLE Ref_Locations ( Location_Code CHAR(15), Location_Name VARCHAR(255), Location_Description VARCHAR(255) ) CREATE TABLE Documents_to_be_Destroyed ( Document_ID INTEGER, Destruction_Authorised_by_Employee_ID ...
Plot calendar date by how many calendar date as a line chart
SELECT Calendar_Date, COUNT(Calendar_Date) FROM Ref_Calendar
nvbench
CREATE TABLE table_56509 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
What team was playing at home when the away team scored 6.18 (54)
SELECT "Home team score" FROM table_56509 WHERE "Away team score" = '6.18 (54)'
wikisql
CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type t...
what is the propranolol hcl price?
SELECT DISTINCT cost.cost FROM cost WHERE cost.event_type = 'prescriptions' AND cost.event_id IN (SELECT prescriptions.row_id FROM prescriptions WHERE prescriptions.drug = 'propranolol hcl')
mimic_iii
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...
give me the number of patients whose language is ptun and year of birth is less than 2066?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.language = "PTUN" AND demographic.dob_year < "2066"
mimicsql_data
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 jobs ( JOB_ID varchar(10), JOB_TI...
For all employees who have the letters D or S in their first name, show me about the change of manager_id over hire_date in a line chart.
SELECT HIRE_DATE, MANAGER_ID FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%'
nvbench
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 PostHistoryTypes ( Id number, Name te...
Total number of questions and net score by tags in the past 30 days.
SELECT Tags.TagName, SUM(Posts.Score) AS "Net Score", COUNT(*) AS Number FROM Posts INNER JOIN PostTags ON PostTags.PostId = Posts.Id INNER JOIN Tags ON Tags.Id = PostTags.TagId WHERE Posts.PostTypeId = 1 AND Posts.CreationDate >= DATEADD(DAY, -30, GETDATE()) AND Posts.CreationDate <= GETDATE() GROUP BY Tags.TagName, P...
sede
CREATE TABLE table_9963 ( "Party" text, "Ward" real, "PR top-up" real, "Total" real, "Percentage" text )
WHAT IS TOTAL NUMBER OF PR TOP-UPS THAT HAVE A PERCENTAGE OF 0.8%, TOTAL LARGER THAN 1?
SELECT COUNT("PR top-up") FROM table_9963 WHERE "Percentage" = '0.8%' AND "Total" > '1'
wikisql
CREATE TABLE table_22158 ( "Year (Ceremony)" text, "Original title" text, "Film title used in nomination" text, "Director" text, "Result" text )
Name the number of director for huelepega: ley de la calle
SELECT COUNT("Director") FROM table_22158 WHERE "Original title" = 'Huelepega: Ley de la Calle'
wikisql
CREATE TABLE table_name_85 ( bronze INTEGER, gold VARCHAR, total VARCHAR, silver VARCHAR )
What is the average bronze when the total is 2, silver is less than 1 and gold is more than 1?
SELECT AVG(bronze) FROM table_name_85 WHERE total = 2 AND silver < 1 AND gold > 1
sql_create_context
CREATE TABLE table_203_723 ( id number, "year" number, "song" text, "us hot 100" number, "us msr" number, "us a.c." number, "can" number, "uk singles" number, "album" text )
what single did the band released after all she wrote ?
SELECT "song" FROM table_203_723 WHERE "year" > (SELECT "year" FROM table_203_723 WHERE "song" = '"all she wrote"') ORDER BY "year" LIMIT 1
squall
CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, ...
what was the last ward id that patient 98554 went in the previous year?
SELECT transfers.wardid FROM transfers WHERE transfers.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 98554) AND NOT transfers.wardid IS NULL AND DATETIME(transfers.intime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') ORDER BY transfers.intime DESC LIMIT 1
mimic_iii
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_CLINIC_ID text, MED_DIRE_CD tex...
小儿麻醉科因疾病T40.906而住院花费所以的平均费用是多少钱从2003年5月11日开始到2016年12月20日结束?
SELECT AVG(t_kc21.MED_AMOUT) FROM t_kc21 WHERE t_kc21.MED_ORG_DEPT_NM = '小儿麻醉科' AND t_kc21.IN_HOSP_DATE BETWEEN '2003-05-11' AND '2016-12-20' AND t_kc21.IN_DIAG_DIS_CD = 'T40.906' AND t_kc21.CLINIC_TYPE = '住院'
css
CREATE TABLE train ( id int, train_number int, name text, origin text, destination text, time text, interval text ) CREATE TABLE station ( id int, network_name text, services text, local_authority text ) CREATE TABLE weekly_weather ( station_id int, day_of_week text...
Give me the times and numbers of all trains that go to Chennai, ordered by time with a bar chart.
SELECT time, train_number FROM train WHERE destination = 'Chennai' ORDER BY time
nvbench
CREATE TABLE table_name_60 ( fatalities VARCHAR, location VARCHAR, aircraft VARCHAR )
Which fatality was at ankara for the aircraft douglas c-47?
SELECT fatalities FROM table_name_60 WHERE location = "ankara" AND aircraft = "douglas c-47"
sql_create_context
CREATE TABLE table_22574 ( "Episode #" real, "Air date" text, "Team 1" text, "Players left after Round 1" text, "Team 2" text )
Who was team 1 when the chalkheads were team 2?
SELECT "Team 1" FROM table_22574 WHERE "Team 2" = 'Chalkheads'
wikisql
CREATE TABLE instructor ( instructor_id int, name varchar, uniqname varchar ) CREATE TABLE course_prerequisite ( pre_course_id int, course_id int ) CREATE TABLE course_tags_count ( course_id int, clear_grading int, pop_quiz int, group_projects int, inspirational int, long_l...
Do any of my classes constitute PreMajor courses ?
SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN student_record ON student_record.course_id = course.course_id INNER JOIN program_course ON student_record.course_id = program_course.course_id WHERE program_course.category LIKE '%PreMajor%' AND student_record.student_id = 1
advising
CREATE TABLE table_60494 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text )
Who had a to par of e and scored 71-69=140?
SELECT "Player" FROM table_60494 WHERE "To par" = 'e' AND "Score" = '71-69=140'
wikisql
CREATE TABLE building ( building_id text, Name text, Street_address text, Years_as_tallest text, Height_feet int, Floors int ) CREATE TABLE Institution ( Institution_id text, Institution text, Location text, Founded real, Type text, Enrollment int, Team text, Pri...
Draw a bar chart of type versus the total number, and order from low to high by the the total number .
SELECT Type, COUNT(*) FROM Institution GROUP BY Type ORDER BY COUNT(*)
nvbench
CREATE TABLE table_203_737 ( id number, "#" number, "employer" text, "# of employees" number )
is the number of employees for the village of mundelein more than the mundelien elementary school district 75 ?
SELECT (SELECT "# of employees" FROM table_203_737 WHERE "employer" = 'village of mundelein') > (SELECT "# of employees" FROM table_203_737 WHERE "employer" = 'mundelein elementary school district 75')
squall
CREATE TABLE table_32719 ( "Date" text, "Tournament" text, "Surface" text, "Opponent in the final" text, "Score" text )
What was the score of the game played on a clay surface on June 6, 2005?
SELECT "Score" FROM table_32719 WHERE "Surface" = 'clay' AND "Date" = 'june 6, 2005'
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 diagnoses ( ...
what is average age of patients whose marital status is single and admission year is greater than or equal to 2154?
SELECT AVG(demographic.age) FROM demographic WHERE demographic.marital_status = "SINGLE" AND demographic.admityear >= "2154"
mimicsql_data
CREATE TABLE League ( id INTEGER, country_id INTEGER, name TEXT ) CREATE TABLE Player_Attributes ( id INTEGER, player_fifa_api_id INTEGER, player_api_id INTEGER, date TEXT, overall_rating INTEGER, potential INTEGER, preferred_foot TEXT, attacking_work_rate TEXT, defensiv...
, could you order by the total number in asc?
SELECT preferred_foot, COUNT(*) FROM Player_Attributes WHERE overall_rating > 80 GROUP BY preferred_foot ORDER BY COUNT(*)
nvbench
CREATE TABLE allergy_type ( allergy text, allergytype text ) CREATE TABLE student ( stuid number, lname text, fname text, age number, sex text, major number, advisor number, city_code text ) CREATE TABLE has_allergy ( stuid number, allergy text )
How many allergies are there?
SELECT COUNT(DISTINCT allergy) FROM allergy_type
spider
CREATE TABLE table_5235 ( "Season" text, "Tier" real, "Division" text, "Pos." real, "Postseason" text, "Cup Competitions" text )
Which tier has a division of LEB 2 and Cup Competitions of Copa LEB Plata runner-up?
SELECT "Tier" FROM table_5235 WHERE "Division" = 'leb 2' AND "Cup Competitions" = 'copa leb plata runner-up'
wikisql
CREATE TABLE table_63429 ( "Contestant Name" text, "Episode #" text, "Date Premiered (2009)" text, "Winning Amount" text, "Eliminated Contestant" text )
What winning amount has himesh reshammiya as the contestant name?
SELECT "Winning Amount" FROM table_63429 WHERE "Contestant Name" = 'himesh reshammiya'
wikisql
CREATE TABLE table_37309 ( "7:00" text, "7:30" text, "8:00" text, "8:30" text, "9:00" text, "9:30" text, "10:00" text, "10:30" text )
What is on at 8:30 on the same channel as Les Machos at 9:00?
SELECT "8:30" FROM table_37309 WHERE "9:00" = 'les machos'
wikisql
CREATE TABLE school_bus ( School_ID int, Driver_ID int, Years_Working int, If_full_time bool ) CREATE TABLE school ( School_ID int, Grade text, School text, Location text, Type text ) CREATE TABLE driver ( Driver_ID int, Name text, Party text, Home_city text, Ag...
Show the average age of drivers from the same home city using a bar graph, and show X in asc order please.
SELECT Home_city, AVG(Age) FROM driver GROUP BY Home_city ORDER BY Home_city
nvbench
CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,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 countries ( COUNTRY...
Return a scatter to show the department id and the corresponding salary.
SELECT T1.SALARY, T1.DEPARTMENT_ID FROM employees AS T1 JOIN departments AS T2 ON T1.DEPARTMENT_ID = T2.DEPARTMENT_ID WHERE T1.EMPLOYEE_ID = T2.MANAGER_ID
nvbench
CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number ) CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, Deletio...
Negative vs. Positive Questions over time.
SELECT CASE WHEN Score >= 0 THEN 1 ELSE -1 END, YEAR(CreationDate), COUNT(1) FROM Posts WHERE PostTypeId = 1 GROUP BY CASE WHEN Score >= 0 THEN 1 ELSE -1 END, YEAR(CreationDate) ORDER BY 2, 1, 3
sede
CREATE TABLE certificate ( eid number, aid number ) CREATE TABLE aircraft ( aid number, name text, distance number ) CREATE TABLE flight ( flno number, origin text, destination text, distance number, departure_date time, arrival_date time, price number, aid number )...
Show ids for all aircrafts with more than 1000 distance.
SELECT aid FROM aircraft WHERE distance > 1000
spider
CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE d_...
how much change in patient 28443's weight last measured on the current hospital visit compared to the value first measured on the current hospital visit?
SELECT (SELECT chartevents.valuenum FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 28443 AND admissions.dischtime IS NULL)) AND chartevents.itemid IN (SELECT d_items.itemid FROM...
mimic_iii
CREATE TABLE table_20892 ( "Archbishop" text, "Born" text, "Ordained Priest" text, "Ordained Bishop" text, "Appointed Archbishop" text, "Vacated throne" text, "Died" text )
When was the archbishop who vacated the throne on August 18, 1885 ordained as a priest?
SELECT "Ordained Priest" FROM table_20892 WHERE "Vacated throne" = 'August 18, 1885'
wikisql
CREATE TABLE table_72855 ( "Episode" text, "Broadcast date" text, "Run time" text, "Viewers (in millions)" text, "Archive" text )
How many viewers were there on 1august1964?
SELECT "Viewers (in millions)" FROM table_72855 WHERE "Broadcast date" = '1August1964'
wikisql
CREATE TABLE Guests ( guest_id INTEGER, gender_code CHAR(1), guest_first_name VARCHAR(80), guest_last_name VARCHAR(80), date_of_birth DATETIME ) CREATE TABLE Apartment_Bookings ( apt_booking_id INTEGER, apt_id INTEGER, guest_id INTEGER, booking_status_code CHAR(15), booking_star...
Show the minimum room count of apartments in different type with a bar chart.
SELECT apt_type_code, MIN(room_count) FROM Apartments GROUP BY apt_type_code
nvbench
CREATE TABLE table_22630 ( "[A] (mol/L)" text, "pH" text, "[H 3 PO 4 ]/[A] (%)" text, "[H 2 PO 4 \u2212 ]/[A] (%)" text, "[HPO 4 2\u2212 ]/[A] (%)" text, "[PO 4 3\u2212 ]/[A] (%)" text )
what is [po 4 3 ]/[a] (%) where [h 2 po 4 ]/[a] (%) is 94.5?
SELECT "[PO 4 3\u2212 ]/[A] (%)" FROM table_22630 WHERE "[H 2 PO 4 \u2212 ]/[A] (%)" = '94.5'
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...
60676464号病人的检验报告单对应的检验结果指标均异常的检验报告单号有哪些
SELECT zyjybgb.BGDH FROM hz_info JOIN mzjzjlb JOIN zyjybgb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = zyjybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = zyjybgb.JZLSH_MZJZJLB WHERE hz_info.RYBH = '60676464' AND NOT zyjybgb.BGDH IN (SELECT jyjgzbb.BGDH FROM ...
css
CREATE TABLE table_33707 ( "City" text, "Province" text, "Country" text, "IATA" text, "ICAO" text, "Airport" text )
WHich province has an IATA of UYN?
SELECT "Province" FROM table_33707 WHERE "IATA" = 'uyn'
wikisql
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 jybgb ( BBCJBW text, BBDM tex...
那个在2001年11月11日到15年3月7日这段时间里,16229426病患的全部检察结果指标记录的检测人为66553479的检查指标流水号是多少?
SELECT jyjgzbb.JYZBLSH FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb 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.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM A...
css
CREATE TABLE table_25820584_7 ( player VARCHAR, year_s_ VARCHAR )
What player(s) appeared in 1969?
SELECT player FROM table_25820584_7 WHERE year_s_ = "1969"
sql_create_context
CREATE TABLE table_27603010_14 ( team__number1 VARCHAR )
What was the 2nd leg score if the team 1 is Deportivo Pasto?
SELECT 2 AS nd_leg FROM table_27603010_14 WHERE team__number1 = "Deportivo Pasto"
sql_create_context
CREATE TABLE PersonFriend ( name varchar(20), friend varchar(20), year INTEGER ) CREATE TABLE Person ( name varchar(20), age INTEGER, city TEXT, gender TEXT, job TEXT )
How many people are under 40 for each gender Plot them as bar chart, and display Y in desc order.
SELECT gender, COUNT(*) FROM Person WHERE age < 40 GROUP BY gender ORDER BY COUNT(*) DESC
nvbench
CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number ) CREATE TAB...
people who answered the same question.
SELECT p1.OwnerUserId, p2.OwnerUserId FROM Posts AS p1 JOIN Posts AS p2 ON p1.ParentId = p2.ParentId WHERE p1.OwnerUserId < p2.OwnerUserId AND p1.PostTypeId = 2 AND p2.PostTypeId = 2
sede
CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, d...
what time patient 027-24468 got a lab test for the first time on the first hospital encounter?
SELECT lab.labresulttime FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '027-24468' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospitala...
eicu
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 regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(4...
For those employees who did not have any job in the past, draw a line chart about the change of employee_id over hire_date .
SELECT HIRE_DATE, EMPLOYEE_ID FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history)
nvbench
CREATE TABLE table_29565673_2 ( w VARCHAR, pa VARCHAR )
What is the win record where the pa record is 62?
SELECT w FROM table_29565673_2 WHERE pa = 62
sql_create_context
CREATE TABLE table_204_994 ( id number, "date" text, "time" text, "opponent#" text, "rank#" text, "site" text, "tv" text, "result" text, "attendance" number )
who is the only team this team faced in january which was during the cotton bowl ?
SELECT "opponent#" FROM table_204_994 WHERE "date" = 1
squall
CREATE TABLE table_1342198_13 ( party VARCHAR, incumbent VARCHAR )
What party does sid simpson represent?
SELECT party FROM table_1342198_13 WHERE incumbent = "Sid Simpson"
sql_create_context
CREATE TABLE table_56820 ( "Outcome" text, "Date" text, "Tournament" text, "Surface" text, "Opponent in the final" text, "Score in the final" text )
Who was the opponent on the 28 july 2013 final?
SELECT "Opponent in the final" FROM table_56820 WHERE "Date" = '28 july 2013'
wikisql
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, ZYLBDM text, ZYMC text ) CREATE TABLE zyjzjlb ( YLJGDM text, JZLSH ...
哪个检验项目代码和名称是对应检验报告单15227854281的
SELECT JYXMDM, JYXMMC FROM jybgb WHERE BGDH = '15227854281'
css
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...
我想知道患者窦嘉美之前就诊的医院
SELECT mzjzjlb.YLJGDM FROM person_info JOIN hz_info JOIN mzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX WHERE person_info.XM = '窦嘉美' UNION SELECT hz_info_zyjzjlb.YLJGDM FROM person_info JOIN hz_info JOIN zyjzjlb JOIN hz_info_zyjzj...
css
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) CREATE TABLE jyjgzbb ( BGDH text, BGRQ time, CKZFWDX text, CKZFWSX number, CKZFWXX number, JCFF text, JCRGH text, JCRXM text, JCXMMC text, JCZBDM text, JCZBJGDL number, JCZBJGDW text, ...
被门诊诊断的病人云思远患有躁狂抑郁性精神病当前为躁狂相的的检测指标350790的结果定量以及单位都是多少?
SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN hz_info_mzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND hz_info_mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND...
css
CREATE TABLE table_19741316_1 ( races INTEGER, position VARCHAR )
What was the number of races in the season in which the team placed on the 14th position?
SELECT MIN(races) FROM table_19741316_1 WHERE position = "14th"
sql_create_context
CREATE TABLE election ( Id VARCHAR )
Show all the information about election.
SELECT * FROM election
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...
名叫周泰和的这个患者以前有哪些治疗项目啊?
SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM gwyjzb JOIN t_kc22 ON gwyjzb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gwyjzb.PERSON_NM = '周泰和' AND t_kc22.MED_INV_ITEM_TYPE = '治疗费' UNION SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM fgwyjzb JOIN t_kc22 ON fgwyjzb.MED_CLINIC_ID = t_kc22.MED_CLIN...
css
CREATE TABLE table_60885 ( "Builder" text, "Model" text, "Years of Daylight Service" text, "Retired" text, "Current Disposition" text )
What is the year of daylight service when the builder was Alco?
SELECT "Years of Daylight Service" FROM table_60885 WHERE "Builder" = 'alco'
wikisql
CREATE TABLE table_75395 ( "Years tallest" text, "Name" text, "Height ft / m" text, "Floors" real, "Year completed" real )
What year was the building completed that has 10 floors?
SELECT AVG("Year completed") FROM table_75395 WHERE "Floors" = '10'
wikisql
CREATE TABLE document_drafts ( document_id number, draft_number number, draft_details text ) CREATE TABLE circulation_history ( document_id number, draft_number number, copy_number number, employee_id number ) CREATE TABLE ref_document_status ( document_status_code text, document_s...
List the document type code for the document with the id 2.
SELECT document_type_code FROM documents WHERE document_id = 2
spider
CREATE TABLE table_name_96 ( weight VARCHAR, club VARCHAR )
What is the weight of the player from pvk jadran club?
SELECT weight FROM table_name_96 WHERE club = "pvk jadran"
sql_create_context
CREATE TABLE table_1909647_2 ( top_5 INTEGER, team_s_ VARCHAR )
What's #14 FitzBradshaw Racing's top 5 result?
SELECT MAX(top_5) FROM table_1909647_2 WHERE team_s_ = "#14 FitzBradshaw Racing"
sql_create_context
CREATE TABLE table_name_9 ( city VARCHAR, charter_date VARCHAR )
What city has a charter date of november 24, 1999?
SELECT city FROM table_name_9 WHERE charter_date = "november 24, 1999"
sql_create_context
CREATE TABLE table_name_36 ( rider VARCHAR, grid VARCHAR )
Who has 37 grids?
SELECT rider FROM table_name_36 WHERE grid = 37
sql_create_context
CREATE TABLE table_44262 ( "Stage (Winner)" text, "General Classification" text, "Young Classification" text, "Sprint Classification" text, "Aggressive Rider" text, "Team Classification" text )
Which young classification has an aggressive rider of Tim Johnson?
SELECT "Young Classification" FROM table_44262 WHERE "Aggressive Rider" = 'tim johnson'
wikisql
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE patient ( uniquepid tex...
what were the five most common specimen test ordered for patients diagnosed with nausea previously within 2 months in 2105?
SELECT t3.culturesite FROM (SELECT t2.culturesite, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'nausea' AND STRFTIME('%y', diagnosis.diagnos...
eicu
CREATE TABLE table_name_79 ( gloss VARCHAR, latin VARCHAR )
What's the gloss with Castitas(Latin)?
SELECT gloss FROM table_name_79 WHERE latin = "castitas"
sql_create_context
CREATE TABLE table_15968 ( "Pick" real, "Player" text, "Position" text, "Nationality" text, "NHL team" text, "College/junior/club team" text )
The nhl team new york islanders is what nationality?
SELECT "Nationality" FROM table_15968 WHERE "NHL team" = 'New York Islanders'
wikisql
CREATE TABLE table_13564637_3 ( try_bonus VARCHAR, won VARCHAR )
what amount of try bonus where the game was won by 11?
SELECT COUNT(try_bonus) FROM table_13564637_3 WHERE won = "11"
sql_create_context
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, ...
count the number of patients whose discharge location is rehab/distinct part hosp and days of hospital stay is greater than 27?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.discharge_location = "REHAB/DISTINCT PART HOSP" AND demographic.days_stay > "27"
mimicsql_data
CREATE TABLE table_203_158 ( id number, "date" text, "time" text, "opponent#" text, "rank#" text, "site" text, "tv" text, "result" text, "attendance" number )
how many games did each team score over 20 points ?
SELECT COUNT(*) FROM table_203_158 WHERE "result" > 20 AND "result" > 20
squall
CREATE TABLE txmzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH number, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, KH text, KLX number, MJZH text, ML number, MZZYZDZZBM text, MZZYZDZ...
编号为34349699182的这次门诊就诊中,就诊的状态和对应的代码分别是什么
SELECT txmzjzjlb.JZZTDM, txmzjzjlb.JZZTMC FROM txmzjzjlb WHERE txmzjzjlb.JZLSH = '34349699182' UNION SELECT ftxmzjzjlb.JZZTDM, ftxmzjzjlb.JZZTMC FROM ftxmzjzjlb WHERE ftxmzjzjlb.JZLSH = '34349699182'
css
CREATE TABLE table_name_50 ( name VARCHAR, round VARCHAR, pick__number VARCHAR )
Which Name has a Round smaller than 5, and a Pick # larger than 13?
SELECT name FROM table_name_50 WHERE round < 5 AND pick__number > 13
sql_create_context
CREATE TABLE table_204_869 ( id number, "species" text, "country of origin" text, "total released" number, "first release" text, "last release" text, "areas of release" text, "areas established" text, "pasture type" text )
how many more bubas bison were released than copris hispanus linnaeus ?
SELECT (SELECT "total released" FROM table_204_869 WHERE "species" = 'bubas bison') - (SELECT "total released" FROM table_204_869 WHERE "species" = 'copris hispanus linnaeus')
squall
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...
哪些门诊就诊记录对应患者37451168的检验报告单的报告日期均在2000年10月7日之前?门诊就诊流水号是多少?
SELECT txmzjzjlb.JZLSH FROM hz_info JOIN txmzjzjlb ON hz_info.YLJGDM = txmzjzjlb.YLJGDM AND hz_info.KH = txmzjzjlb.KH AND hz_info.KLX = txmzjzjlb.KLX WHERE hz_info.RYBH = '37451168' AND NOT txmzjzjlb.JZLSH IN (SELECT jybgb.JZLSH FROM jybgb WHERE jybgb.BGRQ >= '2000-10-07') UNION SELECT ftxmzjzjlb.JZLSH FROM hz_info JOI...
css
CREATE TABLE Comments ( Id number, PostId number, Score number, Text text, CreationDate time, UserDisplayName text, UserId number, ContentLicense text ) CREATE TABLE VoteTypes ( Id number, Name text ) CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description ...
How many questions are reopened after being closed and edited?.
WITH closed_and_edited AS (SELECT c.PostId, MIN(e.CreationDate) AS EditDate FROM PostHistory AS c INNER JOIN PostHistory AS e ON c.PostId = e.PostId AND c.PostHistoryTypeId = 10 AND e.PostHistoryTypeId = 5 AND c.CreationDate < e.CreationDate GROUP BY c.PostId) SELECT COUNT(*) AS "Closed and edited", COUNT(oa.PostId) AS...
sede
CREATE TABLE class_of_service ( booking_class varchar, rank int, class_description text ) CREATE TABLE airline ( airline_code varchar, airline_name text, note text ) CREATE TABLE code_description ( code varchar, description text ) CREATE TABLE flight_stop ( flight_id int, stop...
show UA flights between PITTSBURGH and BALTIMORE
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 = 'BALTIMORE' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'PIT...
atis
CREATE TABLE table_name_29 ( power_output__kw_ VARCHAR, number_in_class VARCHAR )
What is the power output for class 5?
SELECT power_output__kw_ FROM table_name_29 WHERE number_in_class = 5
sql_create_context
CREATE TABLE table_65893 ( "Name" text, "Position" text, "League Apps" text, "League Goals" real, "FA Cup Apps" text, "FA Cup Goals" real, "League Cup Apps" real, "League Cup Goals" real, "Total Apps" text, "Total Goals" real )
How many League Goals have League Cup Goals smaller than 0?
SELECT SUM("League Goals") FROM table_65893 WHERE "League Cup Goals" < '0'
wikisql
CREATE TABLE table_36865 ( "Frequency" text, "Name" text, "Format" text, "Call Sign" text, "Covered Location" text )
What name has the call sign DWYS?
SELECT "Name" FROM table_36865 WHERE "Call Sign" = 'dwys'
wikisql
CREATE TABLE restriction ( restriction_code text, advance_purchase int, stopovers text, saturday_stay_required text, minimum_stay int, maximum_stay int, application text, no_discounts text ) CREATE TABLE flight_stop ( flight_id int, stop_number int, stop_days text, stop_...
get flights between ST. PETERSBURG and CHARLOTTE
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 = 'ST. PETERSBURG' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = ...
atis
CREATE TABLE table_1588 ( "Character" text, "Indianapolis Concerts" text, "Sarasota" text, "Broadway" text, "Brighton Cast" text )
Name the brighton cast for jerry cruncher
SELECT "Brighton Cast" FROM table_1588 WHERE "Character" = 'Jerry Cruncher'
wikisql
CREATE TABLE table_name_57 ( score VARCHAR, goal VARCHAR )
What was the score for a goal of 6?
SELECT score FROM table_name_57 WHERE goal = 6
sql_create_context
CREATE TABLE table_67121 ( "State ranked in partisan order" text, "Percentage Republicans" text, "Percentage Democrats" text, "Republican/ Democratic" text, "Republican seat plurality" text )
What is the Republican seat plurality of North Carolina?
SELECT "Republican seat plurality" FROM table_67121 WHERE "State ranked in partisan order" = 'north carolina'
wikisql
CREATE TABLE table_name_58 ( lost VARCHAR, drawn VARCHAR, points_against VARCHAR )
What is the lost number for the team with 2 drawn games, and 572 points against?
SELECT lost FROM table_name_58 WHERE drawn = "2" AND points_against = "572"
sql_create_context
CREATE TABLE table_63374 ( "Rank" real, "Province" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
How many total medals does rank 3 with less than 40 silver medals?
SELECT MAX("Total") FROM table_63374 WHERE "Silver" < '40' AND "Rank" = '3'
wikisql
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE treatment ( ...
what was the first time patient 018-115975 has had the hospital discharge in this year?
SELECT patient.hospitaldischargetime FROM patient WHERE patient.uniquepid = '018-115975' AND DATETIME(patient.hospitaldischargetime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') ORDER BY patient.hospitaldischargetime LIMIT 1
eicu
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...
这个医疗机构5503215从01年3月19日到14年4月30日内统筹金额消耗量情况是怎么样的?
SELECT SUM(t_kc24.OVE_PAY) FROM t_kc21 JOIN t_kc24 ON t_kc21.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE t_kc21.MED_SER_ORG_NO = '5503215' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2001-03-19' AND '2014-04-30'
css
CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE TagSynonyms ( Id number, SourceTagName text, TargetTagName text, CreationDate time, OwnerU...
select top 20 * from posts.
SELECT Title + ' ,' + Body AS "TB", CAST(AnswerCount AS TEXT) + ' - ' + CAST(FavoriteCount AS TEXT) AS "AL", ViewCount AS "VC" FROM Posts WHERE AnswerCount BETWEEN 0 AND 2000 LIMIT 20
sede
CREATE TABLE t_kc22 ( MED_EXP_DET_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, MED_CLINIC_ID text, MED_EXP_BILL_ID text, SOC_SRT_DIRE_CD text, SOC_SRT_DIRE_NM text, DIRE_TYPE number, CHA_ITEM_LEV number, MED_INV_ITEM_TYPE text, MED_DIRE_CD text, MED_DIRE_NM text,...
医院3046592全部就诊记录里按照科室编码的区别列一下统筹基金花销和总的医疗费用的平均比值
SELECT t_kc21.MED_ORG_DEPT_CD, AVG(t_kc24.OVE_PAY / t_kc24.MED_AMOUT) FROM t_kc21 JOIN t_kc24 ON t_kc21.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE t_kc21.MED_SER_ORG_NO = '3046592' GROUP BY t_kc21.MED_ORG_DEPT_CD
css
CREATE TABLE airport ( Airport_ID int, Airport_Name text, Total_Passengers real, %_Change_2007 text, International_Passengers real, Domestic_Passengers real, Transit_Passengers real, Aircraft_Movements real, Freight_Metric_Tonnes real ) CREATE TABLE aircraft ( Aircraft_ID int(11...
What are the number of the descriptions for the aircrafts?
SELECT Description, COUNT(Description) FROM aircraft GROUP BY Description
nvbench
CREATE TABLE table_7940 ( "Date" text, "Opponent" text, "Venue" text, "Result" text, "Attendance" text )
Who is the opponent of the match on 3 December 1898 in venue h?
SELECT "Opponent" FROM table_7940 WHERE "Venue" = 'h' AND "Date" = '3 december 1898'
wikisql
CREATE TABLE table_name_60 ( venue VARCHAR, score VARCHAR )
Which venue has a scoreof 2 0?
SELECT venue FROM table_name_60 WHERE score = "2–0"
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 zzmzjzjlb ( HXPLC number, HZX...
门诊诊断为嗜眠症的患者的籍贯代码是什么?名称是什么?相应人数是多少?
SELECT person_info.JGDM, person_info.JGMC, COUNT(person_info.RYBH) FROM person_info JOIN hz_info JOIN zzmzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = zzmzjzjlb.YLJGDM AND hz_info.KH = zzmzjzjlb.KH AND hz_info.KLX = zzmzjzjlb.KLX WHERE zzmzjzjlb.JZZDSM = '嗜眠症' GROUP BY person_info.JGDM UNION SELECT per...
css
CREATE TABLE table_23615 ( "Divisions" text, "Prize (EUR)" text, "Odds of winning (1in)" text, "Number of winning tickets" real, "In order to win" text )
What are the number of winning tickets that have 180.00 as the prize (eur)?
SELECT "Number of winning tickets" FROM table_23615 WHERE "Prize (EUR)" = '180.00'
wikisql
CREATE TABLE table_30145 ( "No. in series" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production" text, "U.S. viewers (in millions)" text )
How many viewers watched the episode 'the beast in me'?
SELECT "U.S. viewers (in millions)" FROM table_30145 WHERE "Title" = 'The Beast in Me'
wikisql
CREATE TABLE table_name_71 ( tie_no VARCHAR, away_team VARCHAR )
What is Tie No, when Away Team is 'Millwall'?
SELECT tie_no FROM table_name_71 WHERE away_team = "millwall"
sql_create_context
CREATE TABLE table_name_90 ( visitor VARCHAR, attendance INTEGER )
What Visiting Team(s) had an Attendance of over 18,680
SELECT visitor FROM table_name_90 WHERE attendance > 18 OFFSET 680
sql_create_context
CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) ) 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, JO...
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, give me the comparison about the average of department_id over the job_id , and group by attribute job_id by a bar chart.
SELECT JOB_ID, AVG(DEPARTMENT_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 GROUP BY JOB_ID
nvbench
CREATE TABLE table_203_655 ( id number, "goal" number, "date" text, "venue" text, "opponent" text, "score" text, "result" text, "competition" text )
what was the only opponent that had a result of 4-0 ?
SELECT "opponent" FROM table_203_655 WHERE "result" = '4-0'
squall
CREATE TABLE table_name_79 ( genre VARCHAR, release_year_of_first_charted_record VARCHAR, country_of_origin VARCHAR )
What is the Genre, when the Release-year of first charted record is 1968, and when the Country of origin is United States?
SELECT genre FROM table_name_79 WHERE release_year_of_first_charted_record = 1968 AND country_of_origin = "united states"
sql_create_context
CREATE TABLE table_63451 ( "Rank" real, "Athlete" text, "Country" text, "Time" text, "Notes" text )
What are the notes for South Africa?
SELECT "Notes" FROM table_63451 WHERE "Country" = 'south africa'
wikisql