context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE t_kc22 ( AMOUNT number, CHA_ITEM_LEV number, DATA_ID text, DIRE_TYPE number, DOSE_FORM text, DOSE_UNIT text, EACH_DOSAGE text, EXP_OCC_DATE time, FLX_MED_ORG_ID text, FXBZ number, HOSP_DOC_CD text, HOSP_DOC_NM text, MED_DIRE_CD text, MED_DIRE_NM text,...
在病人鲁烨烨的医疗记录中开出了多少次价格不超过809.11元的药品?是多少就诊编号?
SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_NM = '鲁烨烨' AND NOT t_kc21.MED_CLINIC_ID IN (SELECT t_kc21_t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT > 809.11)
css
CREATE TABLE table_name_95 ( payload_to_gto VARCHAR, ccbs VARCHAR, payload_to_leo VARCHAR )
What Payload to GTO has CCBs larger than 1, and a Payload to LEO of 29,400kg?
SELECT payload_to_gto FROM table_name_95 WHERE ccbs > 1 AND payload_to_leo = "29,400kg"
sql_create_context
CREATE TABLE table_34431 ( "Tournament" text, "2003" text, "2004" text, "2005" text, "2006" text, "2007" text, "2008" text, "2009" text, "2010" text, "2011" text, "2012" text, "2013" text, "Win %" real )
Which 2010 has a 2006 of w?
SELECT "2010" FROM table_34431 WHERE "2006" = 'w'
wikisql
CREATE TABLE table_name_85 ( against INTEGER, favour VARCHAR, lost VARCHAR, draw VARCHAR )
What is the highest Against where they lost less than 20 games, tied more than 2 of them, and they had Favour less than 11?
SELECT MAX(against) FROM table_name_85 WHERE lost < 20 AND draw > 2 AND favour < 11
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...
编号是5136139的这个医院在2012年9月20日至2019年5月4日之内门诊医疗记录的具体数量是多少?
SELECT COUNT(*) FROM t_kc21 WHERE MED_SER_ORG_NO = '5136139' AND IN_HOSP_DATE BETWEEN '2012-09-20' AND '2019-05-04' AND CLINIC_TYPE = '门诊'
css
CREATE TABLE table_204_711 ( id number, "dance" text, "best dancer(s)" text, "best score" number, "worst dancer(s)" text, "worst score" number )
how many dancers achieved a best score of at least 40 ?
SELECT COUNT("best dancer(s)") FROM table_204_711 WHERE "best score" >= 40
squall
CREATE TABLE table_41718 ( "Tie no" text, "Home team" text, "Score" text, "Away team" text, "Date" text, "Attendance" text )
What is the away team where the home team is Coventry City?
SELECT "Away team" FROM table_41718 WHERE "Home team" = 'coventry city'
wikisql
CREATE TABLE table_name_56 ( method VARCHAR, res VARCHAR, opponent VARCHAR )
What method was used that had a resulting win against opponent, Natsuko Kikukawa?
SELECT method FROM table_name_56 WHERE res = "win" AND opponent = "natsuko kikukawa"
sql_create_context
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...
Find All_Home and School_ID , and group by attribute ACC_Road, and visualize them by a bar chart, and I want to list from low to high by the y-axis please.
SELECT All_Home, School_ID FROM basketball_match GROUP BY ACC_Road, All_Home ORDER BY School_ID
nvbench
CREATE TABLE table_name_44 ( Id VARCHAR )
Name the 2009 ffor 2010 of 1r and 2012 of a and 2008 of 2r
SELECT 2009 FROM table_name_44 WHERE 2010 = "1r" AND 2012 = "a" AND 2008 = "2r"
sql_create_context
CREATE TABLE table_14934885_1 ( date VARCHAR, performer_3 VARCHAR )
How many times was performer 3 Kate Robbins?
SELECT COUNT(date) FROM table_14934885_1 WHERE performer_3 = "Kate Robbins"
sql_create_context
CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) CREATE TABLE SuggestedEdits ( Id number, PostId number, CreationDate time, ApprovalDa...
Quality of content: Average amount of upvotes.
SELECT Month = DATEADD(MONTH, DATEDIFF(MONTH, 0, CreationDate), 0), 'Average amount of upvotes' = SUM(CASE WHEN VoteTypeId = 2 THEN 1 ELSE 0 END) / CAST(COUNT(Id) AS FLOAT) FROM PostFeedback GROUP BY DATEADD(MONTH, DATEDIFF(MONTH, 0, CreationDate), 0) ORDER BY DATEADD(MONTH, DATEDIFF(MONTH, 0, CreationDate), 0)
sede
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 demographic (...
provide the number of patients whose admission type is elective and item id is 51256?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_type = "ELECTIVE" AND lab.itemid = "51256"
mimicsql_data
CREATE TABLE table_17798 ( "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 )
When was the super b capacity reached when the freight carried s tonne was 198818?
SELECT "Super B Capacity Reached [ citation needed ]" FROM table_17798 WHERE "Freight Carried s Tonne" = '198818'
wikisql
CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(40), POSTAL_CODE varchar(12), CITY varchar(30), STATE_PROVINCE varchar(25), COUNTRY_ID varchar(2) ) CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE jobs ( JOB_ID varchar(...
For all employees who have the letters D or S in their first name, visualize a bar chart about the distribution of hire_date and the amount of hire_date bin hire_date by time.
SELECT HIRE_DATE, COUNT(HIRE_DATE) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%'
nvbench
CREATE TABLE student_record ( student_id int, course_id int, semester int, grade varchar, how varchar, transfer_source varchar, earn_credit varchar, repeat_term varchar, test_id varchar ) CREATE TABLE gsi ( course_offering_id int, student_id int ) CREATE TABLE instructor ( ...
Between 522 and 527 , which course is more difficult ?
SELECT DISTINCT course.number FROM course, program_course WHERE (course.number = 522 OR course.number = 527) AND course.department = 'EECS' AND program_course.course_id = course.course_id ORDER BY program_course.workload DESC LIMIT 1
advising
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) ...
did patient 025-44495 ever have any microbiology tests done in 12/2105?
SELECT COUNT(*) > 0 FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '025-44495')) AND STRFTIME('%y-%m', microlab.culturetakentime) = '2105-12'
eicu
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...
NEWARK to CLEVELAND DAILY
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 = 'NEWARK' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'CLEVEL...
atis
CREATE TABLE program_requirement ( program_id int, category varchar, min_credit int, additional_req varchar ) CREATE TABLE semester ( semester_id int, semester varchar, year int ) CREATE TABLE area ( course_id int, area varchar ) CREATE TABLE offering_instructor ( offering_ins...
Are there any Global Sustainable Enterprise courses that satisfy the Other requirement ?
SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN area ON course.course_id = area.course_id INNER JOIN program_course ON program_course.course_id = course.course_id WHERE (area.area LIKE '%Global Sustainable Enterprise%' OR course.description LIKE '%Global Sustainable Enterprise%' OR ...
advising
CREATE TABLE table_25897 ( "Series #" real, "Season #" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production code" text )
List all season numbers with production codes of 5m21.
SELECT "Season #" FROM table_25897 WHERE "Production code" = '5M21'
wikisql
CREATE TABLE table_33044 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
On what date did the away team score 12.9 (81)?
SELECT "Date" FROM table_33044 WHERE "Away team score" = '12.9 (81)'
wikisql
CREATE TABLE table_13949 ( "Date" text, "Tournament" text, "Surface" text, "Opponent in the final" text, "Score" text )
what is the date for the tournament acapulco?
SELECT "Date" FROM table_13949 WHERE "Tournament" = 'acapulco'
wikisql
CREATE TABLE t_kc21_t_kc22 ( MED_CLINIC_ID text, MED_EXP_DET_ID number ) CREATE TABLE t_kc22 ( AMOUNT number, CHA_ITEM_LEV number, DATA_ID text, DIRE_TYPE number, DOSE_FORM text, DOSE_UNIT text, EACH_DOSAGE text, EXP_OCC_DATE time, FLX_MED_ORG_ID text, FXBZ number, H...
统计年龄低于9岁的患者医疗记录的平均医疗费总额有多少?
SELECT AVG(t_kc24.MED_AMOUT) FROM t_kc24 WHERE t_kc24.MED_CLINIC_ID IN (SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_AGE < 9)
css
CREATE TABLE table_29615165_5 ( _percentage_0_19_years VARCHAR, quartier VARCHAR )
How many o-19% are where the quartier is in saint-loup?
SELECT _percentage_0_19_years FROM table_29615165_5 WHERE quartier = "Saint-Loup"
sql_create_context
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...
Count the number of patients taking drug via pb route with aortic insufficiency/re-do sternostomy aortic valve replacement as their primary disease.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.diagnosis = "AORTIC INSUFFICIENCY\RE-DO STERNOTOMY; AORTIC VALVE REPLACEMENT " AND prescriptions.route = "PB"
mimicsql_data
CREATE TABLE table_name_72 ( area_km² VARCHAR, density__hab_km²_ VARCHAR )
What is the area of the city with a density of 955.6?
SELECT area_km² FROM table_name_72 WHERE density__hab_km²_ = "955.6"
sql_create_context
CREATE TABLE table_name_15 ( floors INTEGER, street_address VARCHAR )
How many floors are there at 32 n. main street?
SELECT SUM(floors) FROM table_name_15 WHERE street_address = "32 n. main street"
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 jybgb ( BBCJBW text, BBDM tex...
患者邹嘉禧在09年10月29日到11年7月16日,是找的哪些工号及姓名的医务人员检测指标704270的
SELECT jyjgzbb.JCRGH, jyjgzbb.JCRXM 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 mzjzj...
css
CREATE TABLE table_name_4 ( frequency_mhz VARCHAR, call_sign VARCHAR )
Frequency for kamy?
SELECT frequency_mhz FROM table_name_4 WHERE call_sign = "kamy"
sql_create_context
CREATE TABLE table_6943 ( "Country" text, "Total population (millions)" real, "Total Foreign-born (millions)" real, "Born in other EU state (millions)" real, "Born in a non EU state (millions)" real )
What was the average number of people born in other EU states in millions, when the number of people born in a non EU state in millions was 31.368, and when the total population in millions was higher than 501.098?
SELECT AVG("Born in other EU state (millions)") FROM table_6943 WHERE "Born in a non EU state (millions)" = '31.368' AND "Total population (millions)" > '501.098'
wikisql
CREATE TABLE table_74358 ( "Series #" real, "Season #" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Prod. code" real, "U.S. viewers (millions)" text )
What was the production code of the episode directed by Rondell Sheridan?
SELECT MAX("Prod. code") FROM table_74358 WHERE "Directed by" = 'Rondell Sheridan'
wikisql
CREATE TABLE Courses ( course_id INTEGER, author_id INTEGER, subject_id INTEGER, course_name VARCHAR(120), course_description VARCHAR(255) ) CREATE TABLE Student_Course_Enrolment ( registration_id INTEGER, student_id INTEGER, course_id INTEGER, date_of_enrolment DATETIME, date_o...
Draw a bar chart about the distribution of login_name and author_tutor_ATB .
SELECT login_name, author_tutor_ATB FROM Course_Authors_and_Tutors ORDER BY personal_name
nvbench
CREATE TABLE table_41706 ( "Year" real, "Round" real, "Pick" real, "Player" text, "NBA Team" text )
What was the average pick with Ed O'Bannon and a round smaller than 1?
SELECT AVG("Pick") FROM table_41706 WHERE "Player" = 'ed o''bannon' AND "Round" < '1'
wikisql
CREATE TABLE table_287159_1 ( other_abbreviation VARCHAR, genitive VARCHAR )
What is the other abbreviation of the constellation that has hydrae / ha dri / as genitive?
SELECT other_abbreviation FROM table_287159_1 WHERE genitive = "Hydrae /ˈhaɪdriː/"
sql_create_context
CREATE TABLE table_43382 ( "Name" text, "Processor" text, "Hard Drive" text, "Ethernet Ports" text, "Dimensions" text )
What is the dimensions of the u50 appliance?
SELECT "Dimensions" FROM table_43382 WHERE "Name" = 'u50'
wikisql
CREATE TABLE table_1140076_2 ( constructor VARCHAR, location VARCHAR )
Who was the constructor in the location Monza?
SELECT constructor FROM table_1140076_2 WHERE location = "Monza"
sql_create_context
CREATE TABLE mzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH text, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, KH text, KLX number, MJZH text, ML number, MZZYZDZZBM text, MZZYZDZZMC ...
医院3947713中,编号为30230164的这个病人的就诊科室名称包含肾内科的所有门诊就诊记录的流水号
SELECT mzjzjlb.JZLSH 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 = '30230164' AND hz_info.YLJGDM = '3947713' AND mzjzjlb.JZKSMC LIKE '%肾内科%'
css
CREATE TABLE table_13642023_2 ( gtu_winning_team VARCHAR, to_winning_team VARCHAR )
Who was the GTU winning team when the TO winning team was Steve Ross?
SELECT gtu_winning_team FROM table_13642023_2 WHERE to_winning_team = "Steve Ross"
sql_create_context
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, ...
give me the number of patients whose diagnoses icd9 code is 42842?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE diagnoses.icd9_code = "42842"
mimicsql_data
CREATE TABLE table_name_63 ( government VARCHAR, number VARCHAR )
Which government is number 6?
SELECT government FROM table_name_63 WHERE number = 6
sql_create_context
CREATE TABLE table_67250 ( "Institution" text, "Location" text, "Nickname" text, "Current Conference" text, "Classification" text )
Where is NCAA division ii Franklin Pierce University located at?
SELECT "Location" FROM table_67250 WHERE "Classification" = 'ncaa division ii' AND "Institution" = 'franklin pierce university'
wikisql
CREATE TABLE table_78062 ( "Track" real, "Recorded" text, "Catalogue" text, "Release Date" text, "Song Title" text, "Time" text )
Tell me the recorded for time of 2:50 and released date of 6/6/77 with track more than 20
SELECT "Recorded" FROM table_78062 WHERE "Track" > '20' AND "Release Date" = '6/6/77' AND "Time" = '2:50'
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 prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, ...
what is subject name and discharge time of subject id 2560?
SELECT demographic.name, demographic.dischtime FROM demographic WHERE demographic.subject_id = "2560"
mimicsql_data
CREATE TABLE table_name_37 ( position VARCHAR, no_s_ VARCHAR )
Name the position for numbers of 41
SELECT position FROM table_name_37 WHERE no_s_ = "41"
sql_create_context
CREATE TABLE table_48482 ( "Team 1" text, "Score" text, "Team 2" text, "1st round" text, "2nd round" text )
What is the 1st round with a team 2 paris sg (d1)?
SELECT "1st round" FROM table_48482 WHERE "Team 2" = 'paris sg (d1)'
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, ...
how many female patients had the item id 51351?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.gender = "F" AND lab.itemid = "51351"
mimicsql_data
CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time...
when did patient 12917 come into the hospital through the transfer from hosp/extram since 2103 for the last time?
SELECT admissions.admittime FROM admissions WHERE admissions.subject_id = 12917 AND admissions.admission_location = 'transfer from hosp/extram' AND STRFTIME('%y', admissions.admittime) >= '2103' ORDER BY admissions.admittime DESC LIMIT 1
mimic_iii
CREATE TABLE table_39359 ( "Position" real, "Team" text, "Points" real, "Played" real, "Drawn" real, "Lost" real, "Against" real, "Difference" text )
Which average Against has a Difference of 10, and a Lost smaller than 2?
SELECT AVG("Against") FROM table_39359 WHERE "Difference" = '10' AND "Lost" < '2'
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, ...
what is the diagnosis cost of peptic ulcer disease - gastric?
SELECT DISTINCT cost.cost FROM cost WHERE cost.eventtype = 'diagnosis' AND cost.eventid IN (SELECT diagnosis.diagnosisid FROM diagnosis WHERE diagnosis.diagnosisname = 'peptic ulcer disease - gastric')
eicu
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...
患者被门诊诊断为疾病Z80.670的检测指标849746的参考值范围下限和上限分别是什么?
SELECT jyjgzbb.CKZFWXX, jyjgzbb.CKZFWSX FROM wdmzjzjlb JOIN jybgb JOIN jyjgzbb ON wdmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND wdmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE wdmzjzjlb.JZZDBM = 'Z80.670' AND jyjgzbb.JCZBDM = '849746' UNION SELECT jyjgzbb.CKZFWX...
css
CREATE TABLE table_31575 ( "Season" text, "Manager" text, "Record [a ]" text, "Win %" real, "Post-season record [e ]" text, "Post-season win %" text, "MLB affiliate" text )
Tell me the post-season record for kansas city
SELECT "Post-season record [e ]" FROM table_31575 WHERE "MLB affiliate" = 'kansas city'
wikisql
CREATE TABLE table_22410780_1 ( production_stagemanager VARCHAR, secretary VARCHAR )
How many production stage managers worked with secretary Rachel Hartmann?
SELECT COUNT(production_stagemanager) FROM table_22410780_1 WHERE secretary = "Rachel Hartmann"
sql_create_context
CREATE TABLE jyjgzbb ( JYZBLSH text, YLJGDM text, BGDH text, BGRQ time, JYRQ time, JCRGH text, JCRXM text, SHRGH text, SHRXM text, JCXMMC text, JCZBDM text, JCFF text, JCZBMC text, JCZBJGDX text, JCZBJGDL number, JCZBJGDW text, SBBM text, YQBH text...
在21年8月25日到21年9月5日期间,患者马璇珠曾到医院看过几次病
SELECT (SELECT COUNT(*) 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 = '马璇珠' AND mzjzjlb.JZKSRQ BETWEEN '2021-08-25' AND '2021-09-05') + (SELECT COUNT(*) FROM person_info J...
css
CREATE TABLE table_name_62 ( player VARCHAR, score VARCHAR, to_par VARCHAR )
Who is the player with a score less than 72 and a to par of +1?
SELECT player FROM table_name_62 WHERE score < 72 AND to_par = "+1"
sql_create_context
CREATE TABLE table_11487 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
The away team scored 15.9 (99) at what venue?
SELECT "Venue" FROM table_11487 WHERE "Away team score" = '15.9 (99)'
wikisql
CREATE TABLE table_name_88 ( position VARCHAR, years_in_toronto VARCHAR )
Who has position in year 1996-97 in Toronto?
SELECT position FROM table_name_88 WHERE years_in_toronto = "1996-97"
sql_create_context
CREATE TABLE table_203_830 ( id number, "year" number, "song" text, "chart positions\nus country" number, "chart positions\ncan country" number, "album" text )
how many songs made it into the top 10 us charts ?
SELECT COUNT("song") FROM table_203_830 WHERE "chart positions\nus country" <= 10
squall
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 the number of patients whose admission year is less than 2139 and drug route is nu?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admityear < "2139" AND prescriptions.route = "NU"
mimicsql_data
CREATE TABLE table_3014 ( "Institution" text, "Nickname" text, "Location" text, "Founded" real, "Affiliation" text, "Enrollment" real, "Sport" text )
Name the least enrollment for field hockey, men's swimming
SELECT MIN("Enrollment") FROM table_3014 WHERE "Sport" = 'Field hockey, men''s swimming'
wikisql
CREATE TABLE teachers ( LastName TEXT, FirstName TEXT, Classroom INTEGER ) CREATE TABLE list ( LastName TEXT, FirstName TEXT, Grade INTEGER, Classroom INTEGER )
For each fourth-grade classroom, show the classroom number and the total number of students using it. Show the correlation.
SELECT Classroom, COUNT(*) FROM list WHERE Grade = "4" GROUP BY Classroom
nvbench
CREATE TABLE table_42907 ( "Res." text, "Record" text, "Opponent" text, "Method" text, "Event" text, "Round" real )
Which record's round was 3 when the event was fight festival 27?
SELECT "Record" FROM table_42907 WHERE "Round" = '3' AND "Event" = 'fight festival 27'
wikisql
CREATE TABLE table_name_16 ( task_no INTEGER, head_of_household VARCHAR )
What is the latest task number for which Cathy is head of household?
SELECT MAX(task_no) FROM table_name_16 WHERE head_of_household = "cathy"
sql_create_context
CREATE TABLE fgwyjzb ( CLINIC_ID text, CLINIC_TYPE text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, ...
名叫孙弘量的患者曾做过哪些检查
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 Ref_Shipping_Agents ( document_id VARCHAR, document_status_code VARCHAR, document_type_code VARCHAR ) CREATE TABLE Documents ( document_id VARCHAR, document_status_code VARCHAR, document_type_code VARCHAR )
List the document ids of documents with the status done and type Paper, which not shipped by the shipping agent named USPS.
SELECT document_id FROM Documents WHERE document_status_code = "done" AND document_type_code = "Paper" EXCEPT SELECT document_id FROM Documents JOIN Ref_Shipping_Agents ON Documents.shipping_agent_code = Ref_Shipping_Agents.shipping_agent_code WHERE Ref_Shipping_Agents.shipping_agent_name = "USPS"
sql_create_context
CREATE TABLE table_28848697_4 ( goals_scored VARCHAR, position VARCHAR, tied VARCHAR )
What are goals scored when postition is 17 and tied is 5?
SELECT goals_scored FROM table_28848697_4 WHERE position = 17 AND tied = 5
sql_create_context
CREATE TABLE route ( train_id int, station_id int ) CREATE TABLE weekly_weather ( station_id int, day_of_week text, high_temperature int, low_temperature int, precipitation real, wind_speed_mph int ) CREATE TABLE station ( id int, network_name text, services text, local...
Show me the total number by origin in a histogram, could you list in ascending by the Y?
SELECT origin, COUNT(*) FROM train GROUP BY origin ORDER BY COUNT(*)
nvbench
CREATE TABLE table_204_136 ( id number, "year" number, "final" text, "semi" text )
when was the next time spain was a finalist after 1979 ?
SELECT "year" FROM table_204_136 WHERE "final" = 'spain' AND "year" > 1979 ORDER BY "year" LIMIT 1
squall
CREATE TABLE table_49903 ( "Team" text, "Sport" text, "Played" text, "Venue" text, "Championships" text )
What sport was played between the years of 2008-2010?
SELECT "Sport" FROM table_49903 WHERE "Played" = '2008-2010'
wikisql
CREATE TABLE hz_info ( KH text, KLX number, YLJGDM text, RYBH text ) CREATE TABLE jyjgzbb ( JYZBLSH text, YLJGDM text, BGDH text, BGRQ time, JYRQ time, JCRGH text, JCRXM text, SHRGH text, SHRXM text, JCXMMC text, JCZBDM text, JCFF text, JCZBMC text, ...
检验申请机构和检验机构在检测通知单35069117494的名称分别叫什么名字?
SELECT JYSQJGMC, JYJGMC FROM jybgb WHERE BGDH = '35069117494'
css
CREATE TABLE table_name_5 ( sinclair_total INTEGER, rank VARCHAR, world_record__kg_ VARCHAR )
What was the highest Sinclair Total that had a rank of 3, but a World Record smaller than 217?
SELECT MAX(sinclair_total) FROM table_name_5 WHERE rank = 3 AND world_record__kg_ < 217
sql_create_context
CREATE TABLE table_19164 ( "Member-elect" text, "Party" text, "District" text, "Election date" text, "Congress" text, "Reason for non-seating" text )
What edition of congress for member-elect richard p. giles?
SELECT "Congress" FROM table_19164 WHERE "Member-elect" = 'Richard P. Giles'
wikisql
CREATE TABLE table_61903 ( "Tie no" text, "Home team" text, "Score" text, "Away team" text, "Date" text )
What score has west ham united as the away team?
SELECT "Score" FROM table_61903 WHERE "Away team" = 'west ham united'
wikisql
CREATE TABLE flight_fare ( flight_id int, fare_id int ) CREATE TABLE flight_leg ( flight_id int, leg_number int, leg_flight int ) CREATE TABLE state ( state_code text, state_name text, country_name text ) CREATE TABLE code_description ( code varchar, description text ) CREATE...
COLUMBUS to CHICAGO one way before 1000
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, fare, flight, flight_fare WHERE ((fare.round_trip_required = 'NO' AND flight_fare.fare_id = fare.fare_id AND flight.departure_time < 1000 AND flight.flight_id = flight_fare.f...
atis
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...
在06年2月16日到2012年12月29日内,患者86192991的甲胎蛋白情况如何?
SELECT * FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE hz_info.RYBH = '...
css
CREATE TABLE table_name_55 ( school_club_team VARCHAR, position VARCHAR, player VARCHAR )
Amal McCaskill who plays forward-center played for what school/club team?
SELECT school_club_team FROM table_name_55 WHERE position = "forward-center" AND player = "amal mccaskill"
sql_create_context
CREATE TABLE table_name_55 ( record VARCHAR, date VARCHAR )
What is the record of the game on December 5, 2007?
SELECT record FROM table_name_55 WHERE date = "december 5, 2007"
sql_create_context
CREATE TABLE table_name_55 ( catalog VARCHAR, date VARCHAR )
What was the name of the catalog released on 19 July 2008?
SELECT catalog FROM table_name_55 WHERE date = "19 july 2008"
sql_create_context
CREATE TABLE table_train_7 ( "id" int, "bleeding" int, "hypotension" bool, "burn_injury" int, "hypoperfusion" bool, "hypertension" bool, "age" float, "lactate" int, "NOUSE" float )
at least 18 years of age
SELECT * FROM table_train_7 WHERE age >= 18
criteria2sql
CREATE TABLE Supplier_Addresses ( supplier_id INTEGER, address_id INTEGER, date_from DATETIME, date_to DATETIME ) CREATE TABLE Staff ( staff_id INTEGER, staff_gender VARCHAR(1), staff_name VARCHAR(80) ) CREATE TABLE Staff_Department_Assignments ( staff_id INTEGER, department_id INT...
Give me a pie chart showing the number of products supplied by supplier id 3 for different product type code.
SELECT product_type_code, COUNT(product_type_code) FROM Product_Suppliers AS T1 JOIN Products AS T2 ON T1.product_id = T2.product_id WHERE T1.supplier_id = 3 GROUP BY product_type_code
nvbench
CREATE TABLE schedule ( Cinema_ID int, Film_ID int, Date text, Show_times_per_day int, Price float ) CREATE TABLE film ( Film_ID int, Rank_in_series int, Number_in_season int, Title text, Directed_by text, Original_air_date text, Production_code text ) CREATE TABLE cine...
What is total number of show times per dat for each cinema Show bar chart, order in descending by the bars.
SELECT Name, SUM(T1.Show_times_per_day) FROM schedule AS T1 JOIN cinema AS T2 ON T1.Cinema_ID = T2.Cinema_ID GROUP BY T1.Cinema_ID ORDER BY Name DESC
nvbench
CREATE TABLE Payments ( Payment_ID INTEGER, Settlement_ID INTEGER, Payment_Method_Code VARCHAR(255), Date_Payment_Made DATE, Amount_Payment INTEGER ) CREATE TABLE Customer_Policies ( Policy_ID INTEGER, Customer_ID INTEGER, Policy_Type_Code CHAR(15), Start_Date DATE, End_Date DAT...
For those payments processed with Visa, bin the payment day into the Day of week interval and count them for a bar chart, and sort total number in ascending order.
SELECT Date_Payment_Made, COUNT(Date_Payment_Made) FROM Payments WHERE Payment_Method_Code = 'Visa' ORDER BY COUNT(Date_Payment_Made)
nvbench
CREATE TABLE table_name_94 ( horsepower VARCHAR, vin_code VARCHAR, engine VARCHAR )
Name the horsepower for VIN code of h and engine for 351-2v cleveland v8
SELECT horsepower FROM table_name_94 WHERE vin_code = "h" AND engine = "351-2v cleveland v8"
sql_create_context
CREATE TABLE table_68250 ( "Rank" real, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
What's the highest silver and 1 gold that the nation of djibouti received with a total less than 3?
SELECT MAX("Silver") FROM table_68250 WHERE "Gold" = '1' AND "Nation" = 'djibouti' AND "Total" < '3'
wikisql
CREATE TABLE dual_carrier ( main_airline varchar, low_flight_number int, high_flight_number int, dual_airline varchar, service_name text ) CREATE TABLE flight ( aircraft_code_sequence text, airline_code varchar, airline_flight text, arrival_time int, connections int, departu...
i would like to see the flights from BALTIMORE to PHILADELPHIA
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 = 'PHIL...
atis
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) ...
what is the number of patients whose discharge location is disch-tran to psych hosp and admission year is less than 2187?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.discharge_location = "DISCH-TRAN TO PSYCH HOSP" AND demographic.admityear < "2187"
mimicsql_data
CREATE TABLE mzjzjlb_jybgb ( YLJGDM_MZJZJLB text, BGDH number, YLJGDM number ) 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 n...
在医院8127400中列出患者25092297就诊科室名称包含儿的所有门诊就诊记录的流水号都是啥啊?
SELECT mzjzjlb.JZLSH 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 = '25092297' AND hz_info.YLJGDM = '8127400' AND mzjzjlb.JZKSMC LIKE '%儿%'
css
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...
05993608495被医疗就诊中苯巴比妥片的使用的频次和每次的用量分别是多少?
SELECT t_kc22.USE_FRE, t_kc22.EACH_DOSAGE FROM t_kc22 JOIN t_kc21_t_kc22 JOIN t_kc21 ON t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID AND t_kc21_t_kc22.MED_CLINIC_ID = t_kc21.MED_CLINIC_ID WHERE t_kc21.MED_CLINIC_ID = '05993608495' AND t_kc22.SOC_SRT_DIRE_NM = '苯巴比妥片'
css
CREATE TABLE table_name_40 ( final_score VARCHAR, opponent VARCHAR )
What was the final score when the opponent was Atl tico Choloma?
SELECT final_score FROM table_name_40 WHERE opponent = "atlético choloma"
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 products with a price between 60 and 120, show me about the proportion of price and price in a pie chart.
SELECT Name, Price FROM Products WHERE Price BETWEEN 60 AND 120
nvbench
CREATE TABLE Catalogs ( catalog_id INTEGER, catalog_name VARCHAR(50), catalog_publisher VARCHAR(80), date_of_publication DATETIME, date_of_latest_revision DATETIME ) CREATE TABLE Catalog_Structure ( catalog_level_number INTEGER, catalog_id INTEGER, catalog_level_name VARCHAR(50) ) CREA...
Find the names and publication dates of all catalogs that have catalog level number greater than 5 Bin publication dates into Year interval, and count catalog and group by catalog name, order the number of date of publication from low to high order.
SELECT date_of_publication, COUNT(date_of_publication) FROM Catalogs AS t1 JOIN Catalog_Structure AS t2 ON t1.catalog_id = t2.catalog_id WHERE catalog_level_number > 5 GROUP BY catalog_name ORDER BY COUNT(date_of_publication)
nvbench
CREATE TABLE table_name_60 ( time VARCHAR, athlete VARCHAR, year VARCHAR, place VARCHAR )
Which Time has a Year larger than 1985, and a Place smaller than 2, and an Athlete of riochy sekiya?
SELECT time FROM table_name_60 WHERE year > 1985 AND place < 2 AND athlete = "riochy sekiya"
sql_create_context
CREATE TABLE table_30098144_2 ( jockey VARCHAR, race VARCHAR )
List the rider for the doncaster handicap compeition.
SELECT jockey FROM table_30098144_2 WHERE race = "Doncaster Handicap"
sql_create_context
CREATE TABLE table_22223 ( "Enzyme" text, "Location" text, "Substrate" text, "Product" text, "Chromosome" text, "EC" text, "OMIM" real, "Porphyria" text )
how many porphyria have substrate -aminolevulinic acid
SELECT COUNT("Porphyria") FROM table_22223 WHERE "Substrate" = 'δ-Aminolevulinic acid'
wikisql
CREATE TABLE table_26170 ( "Week" real, "Date" text, "Opponent" text, "Location" text, "Final Score" text, "Attendance" real, "Record" text )
What was the score on September 20?
SELECT "Final Score" FROM table_26170 WHERE "Date" = 'September 20'
wikisql
CREATE TABLE table_40354 ( "number" real, "symbol" text, "name" text, "empirical \u2020" text, "Calculated" text, "van der Waals" text, "Covalent (single bond)" text, "Covalent (triple bond)" text )
What is the name of the element with a calculated value of 56?
SELECT "name" FROM table_40354 WHERE "Calculated" = '56'
wikisql
CREATE TABLE class_of_service ( booking_class varchar, rank int, class_description text ) CREATE TABLE time_interval ( period text, begin_time int, end_time int ) CREATE TABLE time_zone ( time_zone_code text, time_zone_name text, hours_from_gmt int ) CREATE TABLE airport_service (...
does flight DL 1083 from PHILADELPHIA to DENVER fly on SATURDAY
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, days, flight WHERE (((days.day_name = 'SATURDAY' AND flight.flight_days = days.days_code AND flight.flight_number = 1083) AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code A...
atis
CREATE TABLE table_name_50 ( place INTEGER, televotes VARCHAR )
What is the lowest Place, when Televotes is 15424?
SELECT MIN(place) FROM table_name_50 WHERE televotes = 15424
sql_create_context
CREATE TABLE mzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH text, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, KH text, KLX number, MJZH text, ML number, MZZYZDZZBM text, MZZYZDZZMC ...
2004-04-06到2016-04-25,6607183医院内有多少科室在门诊就诊中开出的检验报告单不多于13张
SELECT COUNT(*) FROM (SELECT jybgb.KSBM FROM mzjzjlb JOIN jybgb JOIN mzjzjlb_jybgb ON mzjzjlb.YLJGDM = mzjzjlb_jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND mzjzjlb_jybgb.YLJGDM = jybgb.YLJGDM AND mzjzjlb_jybgb.BGDH = jybgb.BGDH AND mzjzjlb_jybgb.YLJGDM = jybgb.YLJGDM AND mzjzjlb_jybgb.BGDH = jybgb.B...
css
CREATE TABLE table_35599 ( "Length of game" text, "Date" text, "Away team" text, "Score" text, "Home team" text )
What was the length of the game where the Baltimore Colts were at home?
SELECT "Length of game" FROM table_35599 WHERE "Home team" = 'baltimore colts'
wikisql
CREATE TABLE table_name_11 ( Id VARCHAR )
What is the 2012 value with A in 2007 and qf in 2011?
SELECT 2012 FROM table_name_11 WHERE 2007 = "a" AND 2011 = "qf"
sql_create_context