context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
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 employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varchar(20), ...
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 amount of job_id over the job_id , and group by attribute job_id, I want to rank in desc by the names.
SELECT JOB_ID, COUNT(JOB_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 GROUP BY JOB_ID ORDER BY JOB_ID DESC
nvbench
CREATE TABLE table_name_3 ( fate_and_location VARCHAR, ship VARCHAR )
What was the fate and location of the Ringstad?
SELECT fate_and_location FROM table_name_3 WHERE ship = "ringstad"
sql_create_context
CREATE TABLE t_kc24 ( MED_SAFE_PAY_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, MED_CLINIC_ID text, REF_SLT_FLG number, CLINIC_SLT_DATE time, COMP_ID text, PERSON_ID text, FLX_MED_ORG_ID text, INSU_TYPE text, MED_AMOUT number, PER_ACC_PAY number, OVE_PAY numb...
知道病人个人账户的支出占医疗费总额的比例吗?就是83767721213那个医疗就诊
SELECT (SELECT PER_ACC_PAY FROM t_kc24 WHERE MED_CLINIC_ID = '83767721213') / (SELECT MED_AMOUT FROM t_kc24 WHERE MED_CLINIC_ID = '83767721213')
css
CREATE TABLE table_name_30 ( round VARCHAR, track VARCHAR )
What Round has the Track Winton?
SELECT round FROM table_name_30 WHERE track = "winton"
sql_create_context
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 ( ...
what is the discharge location and primary disease of the patient name kurt buczek?
SELECT demographic.discharge_location, demographic.diagnosis FROM demographic WHERE demographic.name = "Kurt Buczek"
mimicsql_data
CREATE TABLE table_2710 ( "County" text, "Population" real, "Unemployment Rate" text, "Market Income Per Capita" text, "Poverty Rate" text, "Status" text )
What is the population of the country of McDowell?
SELECT "Population" FROM table_2710 WHERE "County" = 'McDowell'
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...
which patients have myco500i drug code?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE prescriptions.formulary_drug_cd = "MYCO500I"
mimicsql_data
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 with unspecified chronic obstructive asthma had a lab test for hematology?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.long_title = "Chronic obstructive asthma, unspecified" AND lab."CATEGORY" = "Hematology"
mimicsql_data
CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number...
how much is patient 89875's hospital bill for his or her stay since 2103?
SELECT SUM(cost.cost) FROM cost WHERE cost.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 89875) AND STRFTIME('%y', cost.chargetime) >= '2103'
mimic_iii
CREATE TABLE table_21079 ( "Name" text, "Latitude" text, "Longitude" text, "Diameter (km)" text, "Year named" real, "Name origin" text )
What is the name of feature with a longitude 246.0e?
SELECT "Name" FROM table_21079 WHERE "Longitude" = '246.0E'
wikisql
CREATE TABLE culture_company ( Company_name text, Type text, Incorporated_in text, Group_Equity_Shareholding real, book_club_id text, movie_id text ) CREATE TABLE movie ( movie_id int, Title text, Year int, Director text, Budget_million real, Gross_worldwide int ) CREAT...
Show all book categories and the number of books in each category, and list by the total number in asc please.
SELECT Category, COUNT(*) FROM book_club GROUP BY Category ORDER BY COUNT(*)
nvbench
CREATE TABLE table_49222 ( "Number" real, "Name" text, "Kilometer" real, "Pavement" text, "Length (m)" real, "Average climb (%)" real )
What is the Length (m) of the Koppenberg course?
SELECT "Length (m)" FROM table_49222 WHERE "Name" = 'koppenberg'
wikisql
CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type text, admission_location text, discharge_location te...
what was the first intake given to patient 20898 on this month/21.
SELECT d_items.label FROM d_items WHERE d_items.itemid IN (SELECT inputevents_cv.itemid FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 20898)) AND DATETIME(inputevents_cv....
mimic_iii
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) CREATE TABLE mzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH text, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, KH te...
姓名是赵静逸的病人促肾上腺皮质激素情况在01年7月27日至07年7月19日之中这段时间内情况怎么样?
SELECT * FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN mzjzjlb_jybgb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = mzjzjlb_jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jy...
css
CREATE TABLE table_name_51 ( away_team VARCHAR, home_team VARCHAR )
What was the away team's score when South Melbourne was the home team?
SELECT away_team AS score FROM table_name_51 WHERE home_team = "south melbourne"
sql_create_context
CREATE TABLE paperdataset ( paperid int, datasetid int ) CREATE TABLE keyphrase ( keyphraseid int, keyphrasename varchar ) CREATE TABLE field ( fieldid int ) CREATE TABLE paper ( paperid int, title varchar, venueid int, year int, numciting int, numcitedby int, journali...
how many papers jamie callan published each year ?
SELECT DISTINCT COUNT(paper.paperid), paper.year FROM author, paper, writes WHERE author.authorname = 'jamie callan' AND writes.authorid = author.authorid AND writes.paperid = paper.paperid GROUP BY paper.year
scholar
CREATE TABLE table_name_48 ( lap_by_lap VARCHAR, ratings VARCHAR, year VARCHAR, pre_race_host VARCHAR )
What Lap-by-lap has Chris Myers as the Pre-Race Host, a Year larger than 2008, and 9.9/22 as its Ratings?
SELECT lap_by_lap FROM table_name_48 WHERE year > 2008 AND pre_race_host = "chris myers" AND ratings = "9.9/22"
sql_create_context
CREATE TABLE table_name_16 ( grid INTEGER, laps INTEGER )
What is the grid sum with more than 50 laps?
SELECT SUM(grid) FROM table_name_16 WHERE laps > 50
sql_create_context
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...
患者王飞燕有哪些门诊就诊的检验报告日期在2020-10-11以后?查询这些门诊就诊的流水号
SELECT txmzjzjlb.JZLSH FROM person_info JOIN hz_info JOIN txmzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = txmzjzjlb.YLJGDM AND hz_info.KH = txmzjzjlb.KH AND hz_info.KLX = txmzjzjlb.KLX WHERE person_info.XM = '王飞燕' AND NOT txmzjzjlb.JZLSH IN (SELECT jybgb.JZLSH FROM jybgb WHERE jybgb.BGRQ <= '2020-10-1...
css
CREATE TABLE t_kc24 ( MED_SAFE_PAY_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, MED_CLINIC_ID text, REF_SLT_FLG number, CLINIC_SLT_DATE time, COMP_ID text, PERSON_ID text, FLX_MED_ORG_ID text, INSU_TYPE text, MED_AMOUT number, PER_ACC_PAY number, OVE_PAY numb...
在项目96414201773中负责开具医疗就诊33846477909的费用明细的医生的编码及姓名各是什么?
SELECT HOSP_DOC_CD, HOSP_DOC_NM FROM t_kc22 WHERE MED_EXP_DET_ID = '96414201773'
css
CREATE TABLE table_name_92 ( year VARCHAR, finish VARCHAR )
What year has a finish of 19?
SELECT year FROM table_name_92 WHERE finish = "19"
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 demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob te...
give the number of patients whose discharge location is disch-tran to psych hospital.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.discharge_location = "DISCH-TRAN TO PSYCH HOSP"
mimicsql_data
CREATE TABLE table_name_35 ( visitor VARCHAR, home VARCHAR )
Who was the visitor when phoenix was at home?
SELECT visitor FROM table_name_35 WHERE home = "phoenix"
sql_create_context
CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER ) CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL )
For those records from the products and each product's manufacturer, show me about the distribution of name and the average of manufacturer , and group by attribute name in a bar chart, and show in descending by the X-axis.
SELECT T1.Name, T1.Manufacturer FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name ORDER BY T1.Name DESC
nvbench
CREATE TABLE table_name_82 ( event VARCHAR, medal VARCHAR, games VARCHAR )
What event did Pakistan get the bronze medal at the 1988 Seoul Games?
SELECT event FROM table_name_82 WHERE medal = "bronze" AND games = "1988 seoul"
sql_create_context
CREATE TABLE table_69424 ( "Year" real, "Entrant" text, "Chassis" text, "Engine" text, "Points" real )
How many points did he average in 1964?
SELECT AVG("Points") FROM table_69424 WHERE "Year" = '1964'
wikisql
CREATE TABLE greatermanchestercrime ( crimeid text, crimets time, location text, lsoa text, type text, outcome text )
How many crimes are under investigation?
SELECT COUNT(*) FROM greatermanchestercrime WHERE outcome = "Under investigation"
greatermanchestercrime
CREATE TABLE table_204_173 ( id number, "rank" number, "group" text, "name" text, "nationality" text, "2.05" text, "2.15" text, "2.19" text, "2.23" text, "2.26" text, "result" text, "notes" text )
what is the nationality of the performer listed before niki palli ?
SELECT "nationality" FROM table_204_173 WHERE id = (SELECT id FROM table_204_173 WHERE "name" = 'niki palli') - 1
squall
CREATE TABLE table_33691 ( "Name" text, "Bullet" text, "Length" text, "Base" text, "Shoulder" text, "Neck" text )
What is the length of the gun that has a shoulder measurement of 12.18 (.480)?
SELECT "Length" FROM table_33691 WHERE "Shoulder" = '12.18 (.480)'
wikisql
CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time,...
when did patient 4326 last get admitted to the hospital during this year?
SELECT admissions.admittime FROM admissions WHERE admissions.subject_id = 4326 AND DATETIME(admissions.admittime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') ORDER BY admissions.admittime DESC LIMIT 1
mimic_iii
CREATE TABLE Tags ( Id number, TagName text, Count number, ExcerptPostId number, WikiPostId number ) CREATE TABLE ReviewTaskResultTypes ( Id number, Name text, Description text ) CREATE TABLE VoteTypes ( Id number, Name text ) CREATE TABLE ReviewTaskResults ( Id number, ...
Get users from your country.
SELECT Id, DisplayName, Reputation, WebsiteUrl, AboutMe FROM Users WHERE Location LIKE '%##Country##%' ORDER BY Reputation DESC
sede
CREATE TABLE table_35650 ( "Season" real, "Episodes" real, "First air date" text, "Last air date" text, "Timeslot" text, "DVD Release" text )
Which season had its last episode air on March 11, 2001?
SELECT "Season" FROM table_35650 WHERE "Last air date" = 'march 11, 2001'
wikisql
CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TA...
when on last month/13 patient 002-20631 had an intake for the last time?
SELECT intakeoutput.intakeoutputtime FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '002-20631')) AND intakeoutput.cellpath LIKE '%intake%...
eicu
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 born before 2071 who had an emergency room hospital admission.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_location = "EMERGENCY ROOM ADMIT" AND demographic.dob_year < "2071"
mimicsql_data
CREATE TABLE table_39023 ( "Country" text, "Date" text, "Label" text, "Format" text, "Catalogue #" text )
What is the date with the catalogue number ptcd-1015-6?
SELECT "Date" FROM table_39023 WHERE "Catalogue #" = 'ptcd-1015-6'
wikisql
CREATE TABLE teachers ( lastname text, firstname text, classroom number ) CREATE TABLE list ( lastname text, firstname text, grade number, classroom number )
What are the grade number and classroom number of each class in the list?
SELECT DISTINCT classroom, grade FROM list
spider
CREATE TABLE table_name_99 ( Id VARCHAR )
Which 2011 has a 2010 of 1r, and a 2009 of 1r?
SELECT 2011 FROM table_name_99 WHERE 2010 = "1r" AND 2009 = "1r"
sql_create_context
CREATE TABLE table_45902 ( "Name" text, "Platform" text, "Supported databases" text, "Tracking Method" text, "Latest stable release" text, "License" text )
What is the latest stable release date for Crawltrack?
SELECT "Latest stable release" FROM table_45902 WHERE "Name" = 'crawltrack'
wikisql
CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER ) CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL )
Return a bar chart on what are the names and prices of all products in the store?, and I want to show in asc by the x axis.
SELECT Name, AVG(Price) FROM Products GROUP BY Name ORDER BY Name
nvbench
CREATE TABLE table_33569 ( "Rank by average" real, "Place" real, "Couple" text, "Total" real, "Number of dances" real, "Average" real )
What was the highest rank by average of a couple who had an average of 25.3 and had more than 10 dances?
SELECT MAX("Rank by average") FROM table_33569 WHERE "Average" = '25.3' AND "Number of dances" > '10'
wikisql
CREATE TABLE resultsdata15 ( sample_pk number, commod text, commtype text, lab text, pestcode text, testclass text, concen number, lod number, conunit text, confmethod text, confmethod2 text, annotate text, quantitate text, mean text, extract text, determi...
Which state has grow the most apples?
SELECT growst FROM sampledata15 WHERE commod = "AP" GROUP BY growst ORDER BY COUNT(*) DESC LIMIT 1
pesticide
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 diagnoses_icd ( row_id number, subject_id number, ...
since 2104, how many patients were given the cystoscopy nec two or more times?
SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, COUNT(*) AS c1 FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'cystoscopy nec') AND ...
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...
在医院2068001患者62939084入院诊断疾病名称包含沙眼的医疗就诊记录编号是什么?
SELECT qtb.MED_CLINIC_ID FROM qtb WHERE qtb.PERSON_ID = '62939084' AND qtb.MED_SER_ORG_NO = '2068001' AND qtb.IN_DIAG_DIS_NM LIKE '%沙眼%' UNION SELECT gyb.MED_CLINIC_ID FROM gyb WHERE gyb.PERSON_ID = '62939084' AND gyb.MED_SER_ORG_NO = '2068001' AND gyb.IN_DIAG_DIS_NM LIKE '%沙眼%' UNION SELECT zyb.MED_CLINIC_ID FROM zyb ...
css
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...
what is primary disease and procedure long title of subject id 76508?
SELECT demographic.diagnosis, procedures.long_title FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.subject_id = "76508"
mimicsql_data
CREATE TABLE table_name_80 ( played INTEGER, scored VARCHAR, draws VARCHAR )
What's the highest Played with a Scored of 15, and Draws that's less than 1?
SELECT MAX(played) FROM table_name_80 WHERE scored = 15 AND draws < 1
sql_create_context
CREATE TABLE table_name_85 ( rank VARCHAR, album VARCHAR )
what is the rank when the album is sean kingston?
SELECT rank FROM table_name_85 WHERE album = "sean kingston"
sql_create_context
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, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE procedures ( ...
For patient James Cepeda, specify the primary disease and duration of stay in the hospital
SELECT demographic.days_stay, demographic.diagnosis FROM demographic WHERE demographic.name = "James Cepeda"
mimicsql_data
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 demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob te...
what is the diagnosis icd9 code and procedure of the patient id 18372?
SELECT diagnoses.icd9_code, procedures.long_title FROM diagnoses INNER JOIN procedures ON diagnoses.hadm_id = procedures.hadm_id WHERE diagnoses.subject_id = "18372"
mimicsql_data
CREATE TABLE table_name_87 ( appeared INTEGER, rr_w_rate VARCHAR, player VARCHAR )
For Angelique Kerber who had an RR Rate of less than 0.33, what's the appeared?
SELECT SUM(appeared) FROM table_name_87 WHERE rr_w_rate < 0.33 AND player = "angelique kerber"
sql_create_context
CREATE TABLE table_name_60 ( alternate VARCHAR, third VARCHAR )
Who is the alternate for the team for which Monika Wagner is the third?
SELECT alternate FROM table_name_60 WHERE third = "monika wagner"
sql_create_context
CREATE TABLE semester ( semester_id int, semester varchar, year int ) 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_...
Is there a section of WOMENSTD 314 after 10:15 P.M. ?
SELECT DISTINCT course_offering.end_time, course_offering.section_number, course_offering.start_time FROM course, course_offering, semester WHERE course_offering.start_time > '10:15' AND course.course_id = course_offering.course_id AND course.department = 'WOMENSTD' AND course.number = 314 AND semester.semester = 'WN' ...
advising
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...
患有精神发育迟滞的人在门诊诊断确诊后其转铁蛋白数值的平均值以及最值数据是什么样子的?
SELECT AVG(jyjgzbb.JCZBJGDL), MIN(jyjgzbb.JCZBJGDL), MAX(jyjgzbb.JCZBJGDL) FROM mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN mzjzjlb_jybgb ON mzjzjlb.YLJGDM = mzjzjlb_jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH AND mzjzjlb_jybgb.YLJGDM = jybgb.YLJ...
css
CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPrivilegedUserGuidance text, MarkdownConcensusDescription text, CreationDate time, CreationModeratorId number, ApprovalDa...
Swift StackOverflow users in Cracow.
SELECT DisplayName AS "display_name", Users.Id AS "user_link", Reputation FROM Tags INNER JOIN PostTags ON PostTags.TagId = Tags.Id INNER JOIN Posts ON Posts.ParentId = PostTags.PostId INNER JOIN Users ON Posts.OwnerUserId = Users.Id INNER JOIN Votes ON Votes.PostId = Posts.Id WHERE LOWER(Location) LIKE '%krak%' AND Ta...
sede
CREATE TABLE table_14663 ( "Player" text, "Height" real, "Position" text, "Year born" real, "Current Club" text )
What team does tariq kirksay, a guard who is taller than 1.8M and born before 1982, represent?
SELECT "Current Club" FROM table_14663 WHERE "Height" > '1.8' AND "Position" = 'guard' AND "Year born" < '1982' AND "Player" = 'tariq kirksay'
wikisql
CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Percent text, ACC_Home text, ACC_Road text, All_Games text, All_Games_Percent int, All_Home text, All_Road text, All_Neutral text ) CREATE TABLE university ( Scho...
Give me the comparison about Team_ID over the All_Road by a bar chart, could you rank from high to low by the X-axis?
SELECT All_Road, Team_ID FROM basketball_match ORDER BY All_Road DESC
nvbench
CREATE TABLE table_1670 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text )
How many games were played by team @ New Jersey?
SELECT COUNT("Score") FROM table_1670 WHERE "Team" = '@ New Jersey'
wikisql
CREATE TABLE table_name_34 ( callsign VARCHAR, branding VARCHAR )
What's the callsign of Mom's Radio 101.9 Zamboanga?
SELECT callsign FROM table_name_34 WHERE branding = "mom's radio 101.9 zamboanga"
sql_create_context
CREATE TABLE table_43556 ( "Branding" text, "Callsign" text, "Frequency" text, "Power (kW)" text, "Location" text )
What's the location of Mom's Radio 95.9 Naga having a power of 10kw?
SELECT "Location" FROM table_43556 WHERE "Power (kW)" = '10kw' AND "Branding" = 'mom''s radio 95.9 naga'
wikisql
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) 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,...
患者的a1酸性糖蛋白在门诊诊断为疾病K80.961的参考值范围有什么下限和上限?
SELECT jyjgzbb.CKZFWXX, jyjgzbb.CKZFWSX FROM mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN hz_info_mzjzjlb ON hz_info_mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH AND hz_info_mzjzjlb.JZLSH = mzjzjlb.JZLSH AND hz_info_mzjzjlb.YLJGDM ...
css
CREATE TABLE circulation_history ( document_id number, draft_number number, copy_number number, employee_id number ) CREATE TABLE ref_shipping_agents ( shipping_agent_code text, shipping_agent_name text, shipping_agent_description text ) CREATE TABLE addresses ( address_id number, ...
What document status codes do we have?
SELECT document_status_code FROM ref_document_status
spider
CREATE TABLE train ( id int, train_number int, name text, origin text, destination text, time text, interval text ) CREATE TABLE route ( train_id int, station_id int ) CREATE TABLE weekly_weather ( station_id int, day_of_week text, high_temperature int, low_temperat...
Stack bar chart of the number of local authority vs services based on local authority
SELECT local_authority, COUNT(local_authority) FROM station GROUP BY services, local_authority
nvbench
CREATE TABLE t_kc24 ( MED_SAFE_PAY_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, MED_CLINIC_ID text, REF_SLT_FLG number, CLINIC_SLT_DATE time, COMP_ID text, PERSON_ID text, FLX_MED_ORG_ID text, INSU_TYPE text, MED_AMOUT number, PER_ACC_PAY number, OVE_PAY numb...
请提供编号67339780这位参保人住院金额里是整数金额的次数
SELECT COUNT(*) FROM t_kc21 WHERE PERSON_ID = '67339780' AND CLINIC_TYPE = '住院' AND MOD(MED_AMOUT, 1) = 0
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 lab ( subject_id text, hadm_id text, ...
what is average age of patients whose admission type is emergency and primary disease is gastrointestinal bleed?
SELECT AVG(demographic.age) FROM demographic WHERE demographic.admission_type = "EMERGENCY" AND demographic.diagnosis = "GASTROINTESTINAL BLEED"
mimicsql_data
CREATE TABLE table_74502 ( "Tournament" text, "Wins" real, "Top-5" real, "Top-10" real, "Top-25" real, "Events" real, "Cuts made" real )
Tell me the total number of top 25 for wins less than 1 and cuts made of 22
SELECT COUNT("Top-25") FROM table_74502 WHERE "Cuts made" = '22' AND "Wins" < '1'
wikisql
CREATE TABLE table_6503 ( "Round" real, "Player" text, "Position" text, "Nationality" text, "College/Junior/Club Team (League)" text )
What was the round number when Michael Hjalm played?
SELECT "Round" FROM table_6503 WHERE "Player" = 'michael hjalm'
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 prescription...
give me the number of patients whose admission location is transfer from hosp/extram and days of hospital stay is greater than 10?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_location = "TRANSFER FROM HOSP/EXTRAM" AND demographic.days_stay > "10"
mimicsql_data
CREATE TABLE manager_award_vote ( award_id TEXT, year INTEGER, league_id TEXT, player_id TEXT, points_won INTEGER, points_max INTEGER, votes_first INTEGER ) CREATE TABLE player_award_vote ( award_id TEXT, year INTEGER, league_id TEXT, player_id TEXT, points_won NUMERIC, ...
Show me the trend about what is the number of wins the team Boston Red Stockings got in the postseasons each year in history?
SELECT year, COUNT(*) FROM postseason AS T1 JOIN team AS T2 ON T1.team_id_winner = T2.team_id_br WHERE T2.name = 'Boston Red Stockings' GROUP BY T1.year
nvbench
CREATE TABLE table_31162 ( "No." real, "#" real, "Episode title" text, "Director" text, "Writer(s)" text, "U.S. original airdate" text, "Prod. code" real )
When the # is 9 what is the U.S original airdate?
SELECT "U.S. original airdate" FROM table_31162 WHERE "#" = '9'
wikisql
CREATE TABLE event ( ID int, Name text, Stadium_ID int, Year text ) CREATE TABLE record ( ID int, Result text, Swimmer_ID int, Event_ID int ) CREATE TABLE stadium ( ID int, name text, Capacity int, City text, Country text, Opening_year int ) CREATE TABLE swimme...
Return a bar chart about the distribution of meter_200 and the average of ID , and group by attribute meter_200.
SELECT meter_200, AVG(ID) FROM swimmer GROUP BY meter_200
nvbench
CREATE TABLE person ( name text, age number, city text, gender text, job text ) CREATE TABLE personfriend ( name text, friend text, year number )
Find the names of all person sorted in the descending order using age.
SELECT name FROM person ORDER BY age DESC
spider
CREATE TABLE table_2886617_4 ( pick VARCHAR, player VARCHAR )
How many times did Alyn McCauley get picked?
SELECT COUNT(pick) FROM table_2886617_4 WHERE player = "Alyn McCauley"
sql_create_context
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...
MODGREEK 105 will have how many professors Spring 2017 ?
SELECT COUNT(DISTINCT instructor.instructor_id) FROM course, course_offering, instructor, offering_instructor, semester WHERE course.course_id = course_offering.course_id AND course.department = 'MODGREEK' AND course.number = 105 AND offering_instructor.instructor_id = instructor.instructor_id AND offering_instructor.o...
advising
CREATE TABLE wrestler ( Wrestler_ID int, Name text, Reign text, Days_held text, Location text, Event text ) CREATE TABLE Elimination ( Elimination_ID text, Wrestler_ID text, Team text, Eliminated_By text, Elimination_Move text, Time text )
How many eliminations did each team have Visualize by bar chart, and rank by the y-axis in ascending.
SELECT Team, COUNT(*) FROM Elimination GROUP BY Team ORDER BY COUNT(*)
nvbench
CREATE TABLE time_interval ( period text, begin_time int, end_time int ) CREATE TABLE code_description ( code varchar, description text ) CREATE TABLE fare_basis ( fare_basis_code text, booking_class text, class_type text, premium text, economy text, discounted text, ni...
what is the schedule of flights from BOSTON to DENVER next monday
SELECT DISTINCT FLIGHT_0.arrival_time, FLIGHT_0.departure_time 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 AS FLIGHT_0, flight AS FLIGHT_1, flight_leg WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = ...
atis
CREATE TABLE table_1952065_4 ( division_championships VARCHAR, teams_with_division_titles VARCHAR )
How many division championships did the Pittsburgh Steelers have?
SELECT division_championships FROM table_1952065_4 WHERE teams_with_division_titles = "Pittsburgh Steelers"
sql_create_context
CREATE TABLE Properties ( property_id INTEGER, property_type_code CHAR(15), property_address VARCHAR(255), other_details VARCHAR(255) ) CREATE TABLE Customers ( customer_id INTEGER, customer_details VARCHAR(255) ) CREATE TABLE Timed_Locations_of_Things ( thing_id INTEGER, Date_and_Time...
What is the proportion of each customer's move in date? You can show me a bar chart that bins move in date into Year interval.
SELECT date_moved_in, COUNT(date_moved_in) FROM Customers AS T1 JOIN Customer_Events AS T2 ON T1.customer_id = T2.customer_id
nvbench
CREATE TABLE table_68131 ( "Player" text, "Height" real, "Position" text, "Year born" real, "Current Club" text )
When was radek necas with less than 2.04 height born?
SELECT AVG("Year born") FROM table_68131 WHERE "Player" = 'radek necas' AND "Height" < '2.04'
wikisql
CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE Tags ( Id number, TagName text, Count number, ExcerptPostId number, WikiPostId number ) CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, ...
Top 5000 users from Roorkee.
SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation FROM Users WHERE LOWER(Location) LIKE '%roorkee%' OR UPPER(Location) LIKE '%ROORKEE' ORDER BY Reputation DESC LIMIT 5000
sede
CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time, drug text, dose_val_rx text, dose_unit_rx text, route text ) CREATE TABLE cos...
what are the five most common lab tests for the patients who received a circumcision before in the same hospital encounter until 2 years ago?
SELECT d_labitems.label FROM d_labitems WHERE d_labitems.itemid IN (SELECT t3.itemid FROM (SELECT t2.itemid, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, procedures_icd.charttime, admissions.hadm_id FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_i...
mimic_iii
CREATE TABLE table_204_297 ( id number, "rank" number, "nation" text, "gold" number, "silver" number, "bronze" number, "total" number )
how many total medals did switzerland and france win ?
SELECT SUM("total") FROM table_204_297 WHERE "nation" IN ('switzerland', 'france')
squall
CREATE TABLE table_name_73 ( snatch VARCHAR, total INTEGER )
How many snatches were there with a total of 267.5?
SELECT COUNT(snatch) FROM table_name_73 WHERE total < 267.5
sql_create_context
CREATE TABLE table_78288 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
In the game where the home team scored 12.17 (89), who was the home team?
SELECT "Home team" FROM table_78288 WHERE "Home team score" = '12.17 (89)'
wikisql
CREATE TABLE flight ( id int, Vehicle_Flight_number text, Date text, Pilot text, Velocity real, Altitude real, airport_id int, company_id int ) CREATE TABLE airport ( id int, City text, Country text, IATA text, ICAO text, name text ) CREATE TABLE operate_company...
Create a pie chart showing how many pilot across pilot.
SELECT Pilot, COUNT(Pilot) FROM flight GROUP BY Pilot
nvbench
CREATE TABLE table_23025 ( "No." real, "Country" text, "Local title" text, "Format" text, "Start Date" text, "End Date" text, "Episodes" text, "Premiere/Air Dates" text )
When did the season that end in July ? start?
SELECT "Start Date" FROM table_23025 WHERE "End Date" = 'July ?'
wikisql
CREATE TABLE table_name_6 ( year INTEGER, location VARCHAR )
What is the largest year located in zagreb, croatia?
SELECT MAX(year) FROM table_name_6 WHERE location = "zagreb, croatia"
sql_create_context
CREATE TABLE ftxmzjzjlb ( 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, MZZYZD...
有沙眼在门诊诊断出的患者他们籍贯代码、名称以及相应人数分别是多少?
SELECT person_info.JGDM, person_info.JGMC, COUNT(person_info.RYBH) FROM person_info JOIN hz_info JOIN txmzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = txmzjzjlb.YLJGDM AND hz_info.KH = txmzjzjlb.KH AND hz_info.KLX = txmzjzjlb.KLX WHERE txmzjzjlb.JZZDSM = '沙眼' GROUP BY person_info.JGDM UNION SELECT pers...
css
CREATE TABLE table_name_82 ( rank INTEGER, u_17_goals VARCHAR, player VARCHAR )
What is the highest Rank, when U-17 Goals is '7', and when Player is 'Cesc F bregas'?
SELECT MAX(rank) FROM table_name_82 WHERE u_17_goals = 7 AND player = "cesc fàbregas"
sql_create_context
CREATE TABLE transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, eventtype text, careunit text, wardid number, intime time, outtime time ) CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id...
in 2104, what are the top five most commonly prescribed drugs to patients within the same hospital visit after having been diagnosed with pois-arom analgesics nec?
SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime, admissions.hadm_id FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_...
mimic_iii
CREATE TABLE table_23912 ( "School" text, "Location(s)" text, "Control" text, "Type" text, "Accreditation" text, "Founded" real, "Enrollment" text )
What is the control for Christopher Newport University?
SELECT "Control" FROM table_23912 WHERE "School" = 'Christopher Newport University'
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 diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE procedures ( ...
what is gender and admission time of subject name erik dickerson?
SELECT demographic.gender, demographic.admittime FROM demographic WHERE demographic.name = "Erik Dickerson"
mimicsql_data
CREATE TABLE table_14212 ( "Title" text, "Series" text, "Director" text, "Production Number" text, "Release date" text )
What is the Release date of the Filmography directed by Robert McKimson in MM Series with Production Number 1665?
SELECT "Release date" FROM table_14212 WHERE "Director" = 'robert mckimson' AND "Series" = 'mm' AND "Production Number" = '1665'
wikisql
CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemicsystolic number, systemicdiastolic number, systemicmean number, observationtime time ) CREATE TABLE lab ( labid numbe...
the first time patient 007-11182 was diagnosed until 3 years ago with acute copd exacerbation?
SELECT diagnosis.diagnosistime FROM diagnosis WHERE diagnosis.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '007-11182')) AND diagnosis.diagnosisname = 'acute copd exacerbati...
eicu
CREATE TABLE table_name_46 ( terminus VARCHAR, color VARCHAR )
The color diamond is assigned to which Terminus?
SELECT terminus FROM table_name_46 WHERE color = "diamond"
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, ...
患者14484033在被门诊诊断为患有帕金森病性痴呆(震颤麻痹性痴呆)的时候其检测指标353555的结果定量及其单位都是什么?
SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW 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...
css
CREATE TABLE time_interval ( period text, begin_time int, end_time int ) CREATE TABLE airline ( airline_code varchar, airline_name text, note text ) CREATE TABLE restriction ( restriction_code text, advance_purchase int, stopovers text, saturday_stay_required text, minimum_...
what flights leave BOSTON and arrive in PHILADELPHIA before 700
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'PHILADELPHIA' AND flight.arrival_time <= 700 AND flight.to_airport = AIRPORT_SERVICE_1.ai...
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...
从03年5月10日至16年7月14日之间科室553的门诊量是多少?
SELECT COUNT(*) FROM mzjzjlb WHERE mzjzjlb.JZKSBM = '553' AND mzjzjlb.JZKSRQ BETWEEN '2003-05-10' AND '2016-07-14'
css
CREATE TABLE table_204_400 ( id number, "district" number, "senator" text, "party" text, "caucus" text, "first elected" number, "counties represented" text )
what is the number of republicans elected in 2010 ?
SELECT COUNT(*) FROM table_204_400 WHERE "party" = 'republican' AND "first elected" = 2010
squall
CREATE TABLE table_name_1 ( winner VARCHAR, score VARCHAR )
Who wins with a score 7 6(4), 6 4
SELECT winner FROM table_name_1 WHERE score = "7–6(4), 6–4"
sql_create_context
CREATE TABLE table_56574 ( "Particle" text, "Symbol" text, "Makeup" text, "Rest mass MeV / c 2" text, "Isospin I" text, "Spin ( Parity ) J P" text, "Commonly decays to" text )
When the Makeup is u s s and the Spin (Parity) J P of 3 2 +, what is the Rest mass MeV/C2?
SELECT "Rest mass MeV / c 2" FROM table_56574 WHERE "Makeup" = 'u s s' AND "Spin ( Parity ) J P" = '3⁄2 +'
wikisql
CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number ) CREATE TABLE SuggestedEdits ( Id number, PostId number, CreationDate time, ApprovalDate time, RejectionDate time, Owner...
All Titles and Body from Posts.
SELECT Title, Body FROM Posts
sede