context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE bdmzjzjlb ( 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...
二零一一年六月二十六日到二零二零年四月二十八日这期间,11573905这名患者的247214这个指标的所有记录
SELECT * FROM hz_info JOIN wdmzjzjlb JOIN jybgb JOIN jyjgzbb ON hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX AND wdmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND wdmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE hz_i...
css
CREATE TABLE table_48411 ( "Name" text, "Gain" real, "Loss" real, "Long" real, "Avg/g" real )
Can you tell me the sum of Loss that has the Gain of 2646?
SELECT SUM("Loss") FROM table_48411 WHERE "Gain" = '2646'
wikisql
CREATE TABLE table_name_73 ( seat_percentage VARCHAR, vote_percentage VARCHAR )
What is the seat percentage when vote percentage is 2.4% (-8.3)?
SELECT seat_percentage FROM table_name_73 WHERE vote_percentage = "2.4% (-8.3)"
sql_create_context
CREATE TABLE table_36990 ( "Round" real, "Player" text, "Position" text, "Nationality" text, "College/Junior/Club Team (League)" text )
What College/Junior/Club Team (League) from Canada has a round smaller than 3?
SELECT "College/Junior/Club Team (League)" FROM table_36990 WHERE "Nationality" = 'canada' AND "Round" < '3'
wikisql
CREATE TABLE program_requirement ( program_id int, category varchar, min_credit int, additional_req varchar ) CREATE TABLE offering_instructor ( offering_instructor_id int, offering_id int, instructor_id int ) CREATE TABLE program ( program_id int, name varchar, college varchar...
What is the most common prerequisite this semester ?
SELECT COUNT(DISTINCT course_prerequisite.course_id), course.department, course.name, course.number FROM course, course_offering, course_prerequisite, semester WHERE course.course_id = course_offering.course_id AND course.course_id = course_prerequisite.pre_course_id AND course.department = 'EECS' AND semester.semester...
advising
CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId number, OwnerDisplayName te...
Hadoop trends (# questions per month).
SELECT DATEADD(mm, (YEAR(Posts.CreationDate) - 1900) * 12 + MONTH(Posts.CreationDate) - 1, 0) AS Month, Tags.TagName, COUNT(*) AS Questions FROM Tags LEFT JOIN PostTags ON PostTags.TagId = Tags.Id LEFT JOIN Posts ON Posts.Id = PostTags.PostId LEFT JOIN PostTypes ON PostTypes.Id = Posts.PostTypeId WHERE Tags.TagName IN ...
sede
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...
Which patients have lora2i?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE prescriptions.formulary_drug_cd = "LORA2I"
mimicsql_data
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, ...
what is the first ward id patient 009-5801 got until 3 years ago.
SELECT patient.wardid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '009-5801') AND DATETIME(patient.unitadmittime) <= DATETIME(CURRENT_TIME(), '-3 year') ORDER BY patient.unitadmittime LIMIT 1
eicu
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 jybgb.BGDH FROM person_info JOIN hz_info JOIN txmzjzjlb JOIN jybgb 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 AND txmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND txmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE person_info.XM = '俞...
css
CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varchar(20), LAST_NAME varchar(25), EMAIL varchar(25), PHONE_NUMBER varchar(20), HIRE_DATE date, JOB_ID varchar(10), SALARY decimal(8,2), CO...
For those employees who did not have any job in the past, return a bar chart about the distribution of job_id and the sum of department_id , and group by attribute job_id, and order by the x axis from high to low please.
SELECT JOB_ID, SUM(DEPARTMENT_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) GROUP BY JOB_ID ORDER BY JOB_ID DESC
nvbench
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...
在15年8月6日到16年2月8日这段时间,患者37516141一共有多少检验报告单,把这些检验报告单的标本采集部位列出来
SELECT jybgb.BBCJBW FROM hz_info JOIN mzjzjlb JOIN jybgb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE hz_info.RYBH = '37516141' AND jybgb.BGRQ BETWEEN '2015-08-06' AND '2016-02-08' UNI...
css
CREATE TABLE table_name_62 ( money___£__ VARCHAR, score VARCHAR )
How much money does the player with a 68-67-69-71=275 score have?
SELECT money___£__ FROM table_name_62 WHERE score = 68 - 67 - 69 - 71 = 275
sql_create_context
CREATE TABLE table_name_68 ( attendance INTEGER, date VARCHAR )
on april 29, what was the attendance?
SELECT SUM(attendance) FROM table_name_68 WHERE date = "april 29"
sql_create_context
CREATE TABLE machine ( Machine_ID int, Making_Year int, Class text, Team text, Machine_series text, value_points real, quality_rank int ) CREATE TABLE technician ( technician_id real, Name text, Team text, Starting_Year real, Age int ) CREATE TABLE repair ( repair_I...
List the name of technicians whose team is not 'NYY', and count them by a bar chart
SELECT Name, COUNT(Name) FROM technician WHERE Team <> "NYY" GROUP BY Name
nvbench
CREATE TABLE table_67721 ( "Place" real, "Team" text, "Played" real, "Draw" real, "Lost" real, "Goals Scored" real, "Goals Conceded" real, "Points" real )
what is the average place when lost is more than 12?
SELECT AVG("Place") FROM table_67721 WHERE "Lost" > '12'
wikisql
CREATE TABLE table_204_256 ( id number, "position" number, "club" text, "played" number, "points" number, "wins" number, "draws" number, "losses" number, "goals for" number, "goals against" number, "goal difference" number )
how many teams are there in total ?
SELECT COUNT("club") FROM table_204_256
squall
CREATE TABLE table_1337525_1 ( region_2 VARCHAR, complete_series VARCHAR )
What is the region 2 for the complete fifth series?
SELECT region_2 FROM table_1337525_1 WHERE complete_series = "The Complete Fifth Series"
sql_create_context
CREATE TABLE table_24574438_1 ( population_density___km_2__ VARCHAR, ds_division VARCHAR )
Name the popultion density being manthai west
SELECT population_density___km_2__ FROM table_24574438_1 WHERE ds_division = "Manthai West"
sql_create_context
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime t...
how many days have elapsed since patient 022-6959's last benadryl prescription in their current hospital encounter?
SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', medication.drugstarttime)) FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '022-695...
eicu
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) ...
find the number of patients whose drug code is dapt500i and lab test fluid is ascites.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE prescriptions.formulary_drug_cd = "DAPT500I" AND lab.fluid = "Ascites"
mimicsql_data
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, 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, ...
从2017年8月1日开始直到2020年3月1日内患者苏秀艾被开出的所有检验报告单的科室序列号以及名称?
SELECT jybgb.KSBM, jybgb.KSMC FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb 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_MZJZJL...
css
CREATE TABLE table_24786958_2 ( game_site VARCHAR, date VARCHAR )
Where was the game played that was on Sunday, May 27?
SELECT game_site FROM table_24786958_2 WHERE date = "Sunday, May 27"
sql_create_context
CREATE TABLE table_55134 ( "Year" real, "Award" text, "Category" text, "Nominated work" text, "Result" text )
What's the earliest year that had a category of best supporting actress at the asian film awards?
SELECT MIN("Year") FROM table_55134 WHERE "Category" = 'best supporting actress' AND "Award" = 'asian film awards'
wikisql
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE medication (...
how many days have elapsed since patient 016-18575 has had his first stress ulcer prophylaxis - famotidine in the current hospital encounter?
SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', treatment.treatmenttime)) FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '016-18575'...
eicu
CREATE TABLE table_name_51 ( crowd INTEGER, venue VARCHAR )
What is the highest crowd at windy hill?
SELECT MAX(crowd) FROM table_name_51 WHERE venue = "windy hill"
sql_create_context
CREATE TABLE table_name_47 ( attendance INTEGER, opponent VARCHAR )
What is the highest number in attendance against the game at Kansas City Chiefs?
SELECT MAX(attendance) FROM table_name_47 WHERE opponent = "at kansas city chiefs"
sql_create_context
CREATE TABLE city ( city_code varchar, city_name varchar, state_code varchar, country_name varchar, time_zone_code varchar ) CREATE TABLE food_service ( meal_code text, meal_number int, compartment text, meal_description varchar ) CREATE TABLE date_day ( month_number int, d...
what is the lowest price fare from ATLANTA to SAN FRANCISCO on flight DL 82 and DL 139
SELECT DISTINCT fare.fare_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, fare, flight AS FLIGHT_0, flight AS FLIGHT_1, flight_fare, flight_leg WHERE ((FLIGHT_1.flight_number = 139 OR FLIGHT_1.flight_number = 82) AND CITY_1.city_code = AIRPORT_SERVICE_...
atis
CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) 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 T...
Visualize a bar chart for simply displaying the email address of the employee and the corresponding salary, and order in desc by the X please.
SELECT EMAIL, SALARY FROM employees ORDER BY EMAIL DESC
nvbench
CREATE TABLE table_49082 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Decision" text, "Attendance" real, "Record" text )
Which Visitor has a Decision of osgood, and a Date of february 15?
SELECT "Visitor" FROM table_49082 WHERE "Decision" = 'osgood' AND "Date" = 'february 15'
wikisql
CREATE TABLE table_17267 ( "Series #" real, "Season #" real, "Title" text, "Directed by" text, "Written by" text, "Musical guest and song" text, "Original air date" text, "Production code" text )
How many musical guests and songs were in episodes with a production code k0519?
SELECT COUNT("Musical guest and song") FROM table_17267 WHERE "Production code" = 'K0519'
wikisql
CREATE TABLE time_zone ( time_zone_code text, time_zone_name text, hours_from_gmt int ) CREATE TABLE airline ( airline_code varchar, airline_name text, note text ) CREATE TABLE flight_leg ( flight_id int, leg_number int, leg_flight int ) CREATE TABLE flight_stop ( flight_id in...
i'd like a flight on 7 9 from ORLANDO to KANSAS CITY in the afternoon
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'KANSAS CITY' AND date_day.day_number = 9 AND date_day.month_number = 7 A...
atis
CREATE TABLE machine ( Machine_ID int, Making_Year int, Class text, Team text, Machine_series text, value_points real, quality_rank int ) CREATE TABLE repair ( repair_ID int, name text, Launch_Date text, Notes text ) CREATE TABLE technician ( technician_id real, Nam...
A pie chart for what are the number of the names of the technicians that are assigned to repair machines with more point values than 70?
SELECT Name, COUNT(Name) FROM repair_assignment AS T1 JOIN machine AS T2 ON T1.Machine_ID = T2.Machine_ID JOIN technician AS T3 ON T1.technician_id = T3.technician_id WHERE T2.value_points > 70 GROUP BY Name
nvbench
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 ftxmzjzjlb ( HXPLC number, HZ...
列出首诊医生以及其他所有接诊医生在门诊就诊16949706262里面的工号都是什么?
SELECT txmzjzjlb.ZZYSGH, txmzjzjlb.QTJZYSGH FROM txmzjzjlb WHERE txmzjzjlb.JZLSH = '16949706262' UNION SELECT ftxmzjzjlb.ZZYSGH, ftxmzjzjlb.QTJZYSGH FROM ftxmzjzjlb WHERE ftxmzjzjlb.JZLSH = '16949706262'
css
CREATE TABLE table_203_416 ( id number, "school name" text, "city" text, "grades" text, "establishment" number, "charter" text )
how many schools were established before 1955 ?
SELECT COUNT("school name") FROM table_203_416 WHERE "establishment" < 1955
squall
CREATE TABLE month ( month_number int, month_name text ) CREATE TABLE compartment_class ( compartment varchar, class_type varchar ) CREATE TABLE state ( state_code text, state_name text, country_name text ) CREATE TABLE dual_carrier ( main_airline varchar, low_flight_number int, ...
please list all airline flights between DENVER and BOSTON
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 = 'DENVER' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BOSTON'...
atis
CREATE TABLE table_36805 ( "Date" text, "Tournament" text, "Winning score" text, "Margin of victory" text, "Runner(s)-up" text )
What was Olazabal's winning score in the event in which Phillip Price finished 2nd?
SELECT "Winning score" FROM table_36805 WHERE "Runner(s)-up" = 'phillip price'
wikisql
CREATE TABLE table_204_62 ( id number, "year" number, "winner" text, "second" text, "third" text, "starters" number )
there have been at most how many starters in a breeders cup juvenile field ?
SELECT MAX("starters") FROM table_204_62
squall
CREATE TABLE table_53122 ( "City district" text, "Area km\u00b2" text, "Population 2007 census(hab)" text, "Housing (2007)" text, "Density (hab/km\u00b2)" text, "Elevation msl" text )
What is the density of San Sebasti n?
SELECT "Density (hab/km\u00b2)" FROM table_53122 WHERE "City district" = 'san sebastián'
wikisql
CREATE TABLE table_60641 ( "Year" real, "Total Horses" real, "Working Horses" text, "Total Cattle" real, "Oxen" real, "Bulls" text, "Cows" real, "Pigs" real, "Sheep and Goats" real )
What is the earliest year that has fewer than 3852.1 cows and 3900.1 working horses?
SELECT MIN("Year") FROM table_60641 WHERE "Working Horses" = '3900.1' AND "Cows" < '3852.1'
wikisql
CREATE TABLE table_47018 ( "Class" text, "Part 1" text, "Part 2" text, "Part 3" text, "Part 4" text, "Verb meaning" text )
What is the part 3 entry that has a part 4 entry of giboran?
SELECT "Part 3" FROM table_47018 WHERE "Part 4" = 'giboran'
wikisql
CREATE TABLE table_54026 ( "Date" text, "Opponents" text, "H / A" text, "Result F\u2013A" text, "Attendance" real, "Group position" text )
Which opponents have an Attendance larger than 61,000, and a Result F A of 3 2?
SELECT "Opponents" FROM table_54026 WHERE "Attendance" > '61,000' AND "Result F\u2013A" = '3–2'
wikisql
CREATE TABLE table_train_14 ( "id" int, "bone_marrow_transplant" bool, "pregnancy_or_lactation" bool, "organ_transplantation" bool, "advanced_pulmonary_fibrosis" bool, "cardiopulmonary_resuscitation" bool, "myocardial_infarction" bool, "NOUSE" float )
a solid organ or bone marrow transplant patients.
SELECT * FROM table_train_14 WHERE organ_transplantation = 1 OR bone_marrow_transplant = 1
criteria2sql
CREATE TABLE table_204_449 ( id number, "no" number, "episode" text, "title" text, "original airdate" text, "viewers" number, "nightly\nrank" number )
what episode had the most viewers ?
SELECT "title" FROM table_204_449 ORDER BY "viewers" DESC LIMIT 1
squall
CREATE TABLE fare_basis ( fare_basis_code text, booking_class text, class_type text, premium text, economy text, discounted text, night text, season text, basis_days text ) CREATE TABLE flight_leg ( flight_id int, leg_number int, leg_flight int ) CREATE TABLE flight_far...
list flights leaving DALLAS on saturday and arriving in SAN FRANCISCO before 1600
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 = 26 AND date_day.month_number = 7 AND date_day.year = 1991 AND days.day_name = date_day.day_name AND flight.arrival_time <...
atis
CREATE TABLE table_33516 ( "Date" text, "Result" text, "Score" text, "Stadium" text, "City" text, "Crowd" real )
In what city is the Don Valley Stadium located?
SELECT "City" FROM table_33516 WHERE "Stadium" = 'don valley stadium'
wikisql
CREATE TABLE table_660 ( "No. in series" real, "No. in season" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "U.S. viewers (million)" text )
What's the season number of the episode titled 'Quitters'?
SELECT MIN("No. in season") FROM table_660 WHERE "Title" = 'Quitters'
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 the number of patients whose year of birth is less than 2146 and procedure icd9 code is 9755?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.dob_year < "2146" AND procedures.icd9_code = "9755"
mimicsql_data
CREATE TABLE table_name_76 ( roll VARCHAR, authority VARCHAR, area VARCHAR )
What is the roll number of the school with a state authority in Waiotira?
SELECT roll FROM table_name_76 WHERE authority = "state" AND area = "waiotira"
sql_create_context
CREATE TABLE mzjzjlb_jybgb ( YLJGDM_MZJZJLB text, BGDH number, YLJGDM number ) CREATE TABLE mzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH text, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, ...
列出在05年2月7日到2015年9月7日内03628207患者被开出的所有检验报告单的检验报告单号是多少?
SELECT jybgb.BGDH FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN mzjzjlb_jybgb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = mzjzjlb_jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND mzjzjlb_jybgb.YLJGDM = jybgb.YLJGDM AND mzjzjlb_jybgb.BGDH ...
css
CREATE TABLE table_9637 ( "Morse Taper number" real, "Taper" text, "B (max)" real, "C (max)" real, "D (max)" real )
What is the B (max) average when the C (max) is greater than 156, the taper is 1:19.231, and the D (max) is less than 34.9?
SELECT AVG("B (max)") FROM table_9637 WHERE "C (max)" > '156' AND "Taper" = '1:19.231' AND "D (max)" < '34.9'
wikisql
CREATE TABLE table_14986 ( "Name" text, "Years" text, "Gender" text, "Area" text, "Authority" text, "Decile" real, "Roll" real )
How many deciles have Years of 1 8, and a Roll of 49?
SELECT COUNT("Decile") FROM table_14986 WHERE "Years" = '1–8' AND "Roll" = '49'
wikisql
CREATE TABLE company ( Company_ID real, Name text, Headquarters text, Industry text, Sales_in_Billion real, Profits_in_Billion real, Assets_in_Billion real, Market_Value_in_Billion real ) CREATE TABLE people ( People_ID int, Age int, Name text, Nationality text, Grad...
Show the different headquarters and number of companies at each headquarter with a bar chart, order y axis in ascending order.
SELECT Headquarters, COUNT(*) FROM company GROUP BY Headquarters ORDER BY COUNT(*)
nvbench
CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE presc...
count the numbers of people that have been admitted to the hospital since 5 years ago.
SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE DATETIME(admissions.admittime) >= DATETIME(CURRENT_TIME(), '-5 year')
mimic_iii
CREATE TABLE Claims ( Date_Claim_Made VARCHAR )
Of all the claims, what was the earliest date when any claim was made?
SELECT Date_Claim_Made FROM Claims ORDER BY Date_Claim_Made LIMIT 1
sql_create_context
CREATE TABLE table_name_74 ( score VARCHAR, home_team VARCHAR )
What was the score of the game when the home team was Lincoln City?
SELECT score FROM table_name_74 WHERE home_team = "lincoln city"
sql_create_context
CREATE TABLE table_17794 ( "Year" real, "Road Opened" text, "Road Closed" text, "Freight Carried s Tonne" real, "Super B Capacity Reached [ citation needed ]" text, "Number of Truck Loads North" real )
What is the least amount of freight carried when the super b capacity reached was February 26?
SELECT MIN("Freight Carried s Tonne") FROM table_17794 WHERE "Super B Capacity Reached [ citation needed ]" = 'February 26'
wikisql
CREATE TABLE jybgb ( BBCJBW text, BBDM text, BBMC text, BBZT number, BGDH text, BGJGDM text, BGJGMC text, BGRGH text, BGRQ time, BGRXM text, BGSJ time, CJRQ time, JSBBRQSJ time, JSBBSJ time, JYBBH text, JYJGMC text, JYJSGH text, JYJSQM text, JY...
之前,患者28448699在哪里就诊的?
SELECT mzjzjlb.YLJGDM 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 = '28448699' UNION SELECT zyjzjlb.YLJGDM FROM hz_info JOIN zyjzjlb ON hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX ...
css
CREATE TABLE Projects ( Project_ID INTEGER, Project_Details VARCHAR(255) ) CREATE TABLE Ref_Budget_Codes ( Budget_Type_Code CHAR(15), Budget_Type_Description VARCHAR(255) ) CREATE TABLE Ref_Document_Types ( Document_Type_Code CHAR(15), Document_Type_Name VARCHAR(255), Document_Type_Descrip...
what are the different budget type codes, and how many documents are there for each?, I want to list by the total number in desc please.
SELECT Budget_Type_Code, COUNT(*) FROM Documents_with_Expenses GROUP BY Budget_Type_Code ORDER BY COUNT(*) 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 demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob te...
provide the number of patients whose diagnoses icd9 code is 6826 and lab test abnormal status is abnormal?
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.icd9_code = "6826" AND lab.flag = "abnormal"
mimicsql_data
CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE icustays ( row_id number, subject_id number, hadm_id number, icustay_id number, first_careunit text, last_careunit text, ...
how many patients received mri chest & heart 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 = 'mri chest & heart') G...
mimic_iii
CREATE TABLE table_26741 ( "April 2013 Cum. Rank" real, "Name" text, "Rank 2012" real, "Rank 2013" real, "Base" text, "2013 rev (bil. USD )" text, "2013 Profit (mil. USD )" text, "Assets 2013 (bil.$)" text, "Market cap March 15 (mil.$)" real )
Name the 2013 profit for assets being 11.2
SELECT "2013 Profit (mil. USD )" FROM table_26741 WHERE "Assets 2013 (bil.$)" = '11.2'
wikisql
CREATE TABLE table_28005160_2 ( country VARCHAR, sponsored_name VARCHAR )
What country are the new orleans shell shockers from?
SELECT country FROM table_28005160_2 WHERE sponsored_name = "New Orleans Shell Shockers"
sql_create_context
CREATE TABLE movie ( mid number, title text, year number, director text ) CREATE TABLE reviewer ( rid number, name text ) CREATE TABLE rating ( rid number, mid number, stars number, ratingdate time )
For each director, return the director's name together with the title of the movie they directed that received the highest rating among all of their movies, and the value of that rating. Ignore movies whose director is NULL.
SELECT T2.title, T1.stars, T2.director, MAX(T1.stars) FROM rating AS T1 JOIN movie AS T2 ON T1.mid = T2.mid WHERE director <> "null" GROUP BY director
spider
CREATE TABLE table_name_50 ( category VARCHAR, recipients_and_nominees VARCHAR )
Which Category were Libby Goldstein and Junie Lowry-Johnson recipients and nominees for?
SELECT category FROM table_name_50 WHERE recipients_and_nominees = "libby goldstein and junie lowry-johnson"
sql_create_context
CREATE TABLE table_64860 ( "Player" text, "Country" text, "Year won" real, "Total" real, "To par" real )
What is the Total of the Player with a To par of 6 and Year won after 1993?
SELECT MIN("Total") FROM table_64860 WHERE "Year won" > '1993' AND "To par" = '6'
wikisql
CREATE TABLE table_1160 ( "Draw" real, "Artist" text, "Song" text, "Televote" real, "Points" real, "Professional Jury" real, "TRM Committee" real, "Total" real, "Place" real )
Name the least draw for elena dermidjean
SELECT MIN("Draw") FROM table_1160 WHERE "Artist" = 'Elena Dermidjean'
wikisql
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 number of patients whose days of hospital stay is greater than 30 and diagnoses long title is contact dermatitis and other eczema, unspecified cause?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.days_stay > "30" AND diagnoses.long_title = "Contact dermatitis and other eczema, unspecified cause"
mimicsql_data
CREATE TABLE table_39422 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" real )
What is the result of the game on October 25, 1959 with more than 26,198 fans in attendance?
SELECT "Result" FROM table_39422 WHERE "Attendance" > '26,198' AND "Date" = 'october 25, 1959'
wikisql
CREATE TABLE table_name_39 ( drawn INTEGER, played INTEGER )
What is the lowest number of games drawn associated with over 39 games played?
SELECT MIN(drawn) FROM table_name_39 WHERE played > 39
sql_create_context
CREATE TABLE table_name_60 ( pick VARCHAR, college VARCHAR )
Which pick came from Pittsburgh?
SELECT COUNT(pick) FROM table_name_60 WHERE college = "pittsburgh"
sql_create_context
CREATE TABLE table_name_33 ( attendance INTEGER, date VARCHAR )
What was the average attendance on October 30, 1938?
SELECT AVG(attendance) FROM table_name_33 WHERE date = "october 30, 1938"
sql_create_context
CREATE TABLE table_48724 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" real )
What team was the opponent on October 15, 1967?
SELECT "Opponent" FROM table_48724 WHERE "Date" = 'october 15, 1967'
wikisql
CREATE TABLE endowment ( endowment_id int, School_id int, donator_name text, amount real ) CREATE TABLE School ( School_id text, School_name text, Location text, Mascot text, Enrollment int, IHSAA_Class text, IHSAA_Football_Class text, County text ) CREATE TABLE budget ...
List each donator name and the amount of endowment in descending order of the amount of endowment. Plot them as bar chart.
SELECT donator_name, SUM(amount) FROM endowment GROUP BY donator_name ORDER BY SUM(amount) DESC
nvbench
CREATE TABLE t_kc21 ( MED_CLINIC_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, COMP_ID text, PERSON_ID text, PERSON_NM text, IDENTITY_CARD text, SOC_SRT_CARD text, PERSON_SEX number, PERSON_AGE number, IN_HOSP_DATE time, OUT_HOSP_DATE time, DIFF_PLACE_FLG numb...
哪位医师是负责开具医疗就诊94275814777中费用明细项目53189607075,把医师的编码和姓名找出来
SELECT HOSP_DOC_CD, HOSP_DOC_NM FROM t_kc22 WHERE MED_EXP_DET_ID = '53189607075'
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...
统筹基金支出在医疗就诊30482936497中占医疗费总额百分之几?
SELECT (SELECT OVE_PAY FROM t_kc24 WHERE MED_CLINIC_ID = '30482936497') / (SELECT MED_AMOUT FROM t_kc24 WHERE MED_CLINIC_ID = '30482936497')
css
CREATE TABLE table_name_24 ( school VARCHAR, team_name VARCHAR )
Which school are the Red Devils from?
SELECT school FROM table_name_24 WHERE team_name = "red devils"
sql_create_context
CREATE TABLE table_44073 ( "Subject" real, "Proximity" text, "Honor" text, "Singular" text, "Plural" text )
What is the lowest Subject, when Plural is t der (their)?
SELECT MIN("Subject") FROM table_44073 WHERE "Plural" = 'tãder (their)'
wikisql
CREATE TABLE table_47426 ( "Date" text, "Tournament" text, "Winning score" text, "Margin of victory" text, "Runner(s)-up" text )
What tournament was Kirk Triplett a runner-up in?
SELECT "Tournament" FROM table_47426 WHERE "Runner(s)-up" = 'kirk triplett'
wikisql
CREATE TABLE table_171 ( "#" real, "Episode" text, "Air Date" text, "Timeslot (EST)" text, "Rating" text, "Share" text, "18\u201349 Rating" text, "Viewers (millions)" text, "Rank" text )
What was the share for the episode with the air date december 10, 2008?
SELECT "Share" FROM table_171 WHERE "Air Date" = 'December 10, 2008'
wikisql
CREATE TABLE table_60855 ( "Position" real, "Club" text, "Played" real, "Wins" real, "Draws" real, "Losses" real, "Goals for" real, "Goals against" real, "Points" real, "Goal Difference" real )
Can you tell me the highest Points that has the Played smaller than 30?
SELECT MAX("Points") FROM table_60855 WHERE "Played" < '30'
wikisql
CREATE TABLE table_name_52 ( rank VARCHAR, name VARCHAR )
What is the rank of Point Hyllie?
SELECT rank FROM table_name_52 WHERE name = "point hyllie"
sql_create_context
CREATE TABLE table_7997 ( "Date" text, "Season" text, "Playing for" text, "Opponent" text, "Final score" text )
What was the opponent in the 2008 09 season, with a final score of 2 3 l?
SELECT "Opponent" FROM table_7997 WHERE "Season" = '2008–09' AND "Final score" = '2–3 l'
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, ...
until 4 years ago, had patient 009-13409 had a procedure?
SELECT COUNT(*) > 0 FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '009-13409')) AND DATETIME(treatment.treatmenttime) <= DATETIME(CURRENT_TIME(...
eicu
CREATE TABLE table_39347 ( "County" text, "1948" real, "1956" real, "1966" real, "1977" real, "1992" real, "2002" real, "2011" real )
Which 1992 is the lowest one that has a 1977 smaller than 385577, and a 2011 larger than 340310, and a 2002 larger than 300123, and a 1948 larger than 280524?
SELECT MIN("1992") FROM table_39347 WHERE "1977" < '385577' AND "2011" > '340310' AND "2002" > '300123' AND "1948" > '280524'
wikisql
CREATE TABLE table_name_78 ( year_s__won VARCHAR, player VARCHAR )
What year did Tom Watson win?
SELECT year_s__won FROM table_name_78 WHERE player = "tom watson"
sql_create_context
CREATE TABLE table_72647 ( "Category" text, "Type" text, "Attribute" text, "Description" text, "Bubbles" text, "Cancelable" text )
what's the bubbles with attribute being onpopuphidden
SELECT "Bubbles" FROM table_72647 WHERE "Attribute" = 'onpopuphidden'
wikisql
CREATE TABLE table_name_43 ( year INTEGER, engine_s_ VARCHAR )
Name the sum of year for engine of brm p202 3.0 v12 brm p200 3.0 v12
SELECT SUM(year) FROM table_name_43 WHERE engine_s_ = "brm p202 3.0 v12 brm p200 3.0 v12"
sql_create_context
CREATE TABLE table_1990460_1 ( division INTEGER, regular_season VARCHAR )
What's the lowest division number of the 6th, Great Lakes season?
SELECT MIN(division) FROM table_1990460_1 WHERE regular_season = "6th, Great Lakes"
sql_create_context
CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) CREATE TABLE PostNotices ( Id num...
Angular vs Ember vs React last Month.
SELECT rate.TagName AS Tag, ROW_NUMBER() OVER (ORDER BY rate.Rate DESC) AS Rank, rate.Rate AS NumQuestions FROM (SELECT COUNT(PostId) AS Rate, TagName FROM Tags, PostTags, Posts WHERE Tags.Id = PostTags.TagId AND Posts.Id = PostId AND Posts.CreationDate > DATEADD(Month, -1, GETDATE()) AND TagName IN ('angularjs', 'embe...
sede
CREATE TABLE table_name_69 ( size INTEGER, county VARCHAR )
Which Size has a County of 62 perry?
SELECT MAX(size) FROM table_name_69 WHERE county = "62 perry"
sql_create_context
CREATE TABLE table_204_521 ( id number, "rank" number, "name" text, "nationality" text, "time (hand)" text, "notes" text )
how many athletes were faster than bill chisholm ?
SELECT COUNT("name") FROM table_204_521 WHERE "time (hand)" < (SELECT "time (hand)" FROM table_204_521 WHERE "name" = 'bill chisholm')
squall
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...
what is average age of patients whose death status is 0 and primary disease is newborn?
SELECT AVG(demographic.age) FROM demographic WHERE demographic.expire_flag = "0" AND demographic.diagnosis = "NEWBORN"
mimicsql_data
CREATE TABLE EMPLOYEE ( EMP_NUM int, EMP_LNAME varchar(15), EMP_FNAME varchar(12), EMP_INITIAL varchar(1), EMP_JOBCODE varchar(5), EMP_HIREDATE datetime, EMP_DOB datetime ) CREATE TABLE PROFESSOR ( EMP_NUM int, DEPT_CODE varchar(10), PROF_OFFICE varchar(50), PROF_EXTENSION v...
Bar chart x axis crs code y axis the total number, order names from high to low order.
SELECT CRS_CODE, COUNT(*) FROM CLASS GROUP BY CRS_CODE ORDER BY CRS_CODE DESC
nvbench
CREATE TABLE table_1749567_2 ( number INTEGER, name VARCHAR )
The Eyserweg race was which race #?
SELECT MAX(number) FROM table_1749567_2 WHERE name = "Eyserweg"
sql_create_context
CREATE TABLE table_35832 ( "RNA Segment (Gene)" real, "Size ( s base pair )" real, "Protein" text, "Molecular weight kDa" text, "Location" text, "Copies per particle" text )
What is the highest RNA segment having a protein of vp2 and a base pair size over 2690?
SELECT MAX("RNA Segment (Gene)") FROM table_35832 WHERE "Protein" = 'vp2' AND "Size ( s base pair )" > '2690'
wikisql
CREATE TABLE table_56133 ( "Nation" text, "Gold" text, "Silver" text, "Bronze" text, "Total" real )
What is the nation for 6 total?
SELECT "Nation" FROM table_56133 WHERE "Total" = '6'
wikisql
CREATE TABLE table_name_71 ( winner VARCHAR, location VARCHAR, tournament VARCHAR )
What is the name of the Winner in north carolina at the greater greensboro open?
SELECT winner FROM table_name_71 WHERE location = "north carolina" AND tournament = "greater greensboro open"
sql_create_context
CREATE TABLE county_public_safety ( Police_force VARCHAR )
Please show the police forces and the number of counties with each police force.
SELECT Police_force, COUNT(*) FROM county_public_safety GROUP BY Police_force
sql_create_context
CREATE TABLE table_39109 ( "Season" text, "Points" text, "Finish" text, "Playoffs" text, "Head Coach" text )
What was the playoff status when the head coach was Brent Sutter, the finish was 4th central, and the points were 82?
SELECT "Playoffs" FROM table_39109 WHERE "Head Coach" = 'brent sutter' AND "Finish" = '4th central' AND "Points" = '82'
wikisql
CREATE TABLE table_name_5 ( title VARCHAR, download VARCHAR, issue_date VARCHAR )
What is the title of the July 2 song that is downloaded as Crazy Frog?
SELECT title FROM table_name_5 WHERE download = "crazy frog" AND issue_date = "july 2"
sql_create_context