context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
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 patients have a lab test chart time of 2173-03-23 11:15:00?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE lab.charttime = "2173-03-23 11:15:00"
mimicsql_data
CREATE TABLE table_39247 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Leading scorer" text, "Attendance" real, "Record" text )
What team was the visitor when there were more than 16,182 people in attendance and the record was 6 3?
SELECT "Visitor" FROM table_39247 WHERE "Attendance" > '16,182' AND "Record" = '6–3'
wikisql
CREATE TABLE t_kc21_t_kc22 ( MED_CLINIC_ID text, MED_EXP_DET_ID number ) CREATE TABLE t_kc24 ( ACCOUNT_DASH_DATE time, ACCOUNT_DASH_FLG number, CASH_PAY number, CIVIL_SUBSIDY number, CKC102 number, CLINIC_ID text, CLINIC_SLT_DATE time, COMP_ID text, COM_ACC_PAY number, C...
患者57773140在哪些医疗记录中被开出少于5299.72元的药品金额?请列出他的医疗就诊编号
SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_ID = '57773140' AND NOT t_kc21.MED_CLINIC_ID IN (SELECT t_kc21_t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT >= 5299.72)
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 the number of patients whose lab test name is gentamicin?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE lab.label = "Gentamicin"
mimicsql_data
CREATE TABLE table_57275 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
When the Home team had a score of 16.10 (106), what was the Date?
SELECT "Date" FROM table_57275 WHERE "Home team score" = '16.10 (106)'
wikisql
CREATE TABLE table_41070 ( "Television service" text, "Country" text, "Language" text, "Content" text, "HDTV" text, "Package/Option" text )
What is HDTV, when Language is English, and when Television Service is MTV Dance?
SELECT "HDTV" FROM table_41070 WHERE "Language" = 'english' AND "Television service" = 'mtv dance'
wikisql
CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type text, admission_location text, discharge_location text, insuranc...
what were the top three most frequent diagnoses until 3 years ago that patients were diagnosed within 2 months after receiving fus/refus 9 vertebrae?
SELECT d_icd_diagnoses.short_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.icd9_code IN (SELECT t3.icd9_code FROM (SELECT t2.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, procedures_icd.charttime FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissi...
mimic_iii
CREATE TABLE table_204_828 ( id number, "whitworth size (in)" number, "core diameter (in)" number, "threads per inch" number, "pitch (in)" number, "tapping drill size" text )
which whitworth size has the same number of threads per inch as 3/16 ?
SELECT "whitworth size (in)" FROM table_204_828 WHERE "whitworth size (in)" <> '3/16' AND "threads per inch" = (SELECT "threads per inch" FROM table_204_828 WHERE "whitworth size (in)" = '3/16')
squall
CREATE TABLE table_44103 ( "Date" text, "Name" text, "Nationality" text, "Tonnage (GRT)" real, "Fate" text )
What is the Fate of the San Pablo ship?
SELECT "Fate" FROM table_44103 WHERE "Name" = 'san pablo'
wikisql
CREATE TABLE phone_market ( Market_ID int, Phone_ID text, Num_of_stock int ) CREATE TABLE market ( Market_ID int, District text, Num_of_employees int, Num_of_shops real, Ranking int ) CREATE TABLE phone ( Name text, Phone_ID int, Memory_in_G int, Carrier text, Price...
Bar graph to show mean memory in g from different carrier, rank in asc by the X.
SELECT Carrier, AVG(Memory_in_G) FROM phone GROUP BY Carrier ORDER BY Carrier
nvbench
CREATE TABLE table_name_34 ( opponent VARCHAR, points VARCHAR, january VARCHAR )
what opponent has an average less than 62 and a January average less than 6
SELECT opponent FROM table_name_34 WHERE points < 62 AND january < 6
sql_create_context
CREATE TABLE table_32539 ( "Pool" text, "Age Group" text, "Time" text, "Event" text, "Date" text )
What date did the 90-94 year old have a tie of 1:25.91 at the LC pool?
SELECT "Date" FROM table_32539 WHERE "Age Group" = '90-94' AND "Pool" = 'lc' AND "Time" = '1:25.91'
wikisql
CREATE TABLE store_product ( Store_ID int, Product_ID int ) CREATE TABLE district ( District_ID int, District_name text, Headquartered_City text, City_Population real, City_Area real ) CREATE TABLE store ( Store_ID int, Store_Name text, Type text, Area_size real, Number...
For each type of store, how many of them are there Plot them as bar chart, and sort from low to high by the X.
SELECT Type, COUNT(*) FROM store GROUP BY Type ORDER BY Type
nvbench
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 number of patients are divorced and have their drug route as iv drip?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.marital_status = "DIVORCED" AND prescriptions.route = "IV DRIP"
mimicsql_data
CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE job_history ( EMPLOYEE_ID decimal(6,0), START_DATE date, END_DATE date, JOB_ID varchar(10), DEPARTMENT_ID decimal(4,0) ) CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(4...
For those employees who do not work in departments with managers that have ids between 100 and 200, a bar chart shows the distribution of first_name and salary , list in desc by the x-axis.
SELECT FIRST_NAME, SALARY FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY FIRST_NAME DESC
nvbench
CREATE TABLE table_70106 ( "Year" text, "Men's singles" text, "Women's singles" text, "Men's doubles" text, "Women's doubles" text, "Mixed doubles" text )
Who won Men's singles the year that Hilde Themel won Women's singles?
SELECT "Men's singles" FROM table_70106 WHERE "Women's singles" = 'hilde themel'
wikisql
CREATE TABLE table_21530474_1 ( model_no VARCHAR, chassis_code VARCHAR )
Name the model number for usf46
SELECT model_no FROM table_21530474_1 WHERE chassis_code = "USF46"
sql_create_context
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 vitalperiodi...
for patients who were given laxatives this year, what are the top five most frequent diagnoses that followed in the same hospital encounter?
SELECT t3.diagnosisname FROM (SELECT t2.diagnosisname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, treatment.treatmenttime, patient.patienthealthsystemstayid FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'laxat...
eicu
CREATE TABLE table_26460 ( "Overall Episode #" real, "Original airdate" text, "Iron Chef" text, "Challenger" text, "Challenger Specialty" text, "Theme Ingredient" text, "Winner" text )
How many episodes had Yutaka Ishinabe as the iron chef specializing in french cousin?
SELECT COUNT("Overall Episode #") FROM table_26460 WHERE "Iron Chef" = 'Yutaka Ishinabe' AND "Challenger Specialty" = 'French'
wikisql
CREATE TABLE table_29302781_12 ( week_of VARCHAR, runner_up VARCHAR )
In the week of what was the runner-up Pat Du Pr ?
SELECT week_of FROM table_29302781_12 WHERE runner_up = "Pat Du Pré"
sql_create_context
CREATE TABLE table_43356 ( "Spoofed Title" text, "Actual Title" text, "Writer" text, "Artist" text, "Issue" real )
Game of Thrones was done by which artist?
SELECT "Artist" FROM table_43356 WHERE "Actual Title" = 'game of thrones'
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...
Provide the number of patients with self pay insurance who stayed in the hosptial for more than 20 days.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.insurance = "Self Pay" AND demographic.days_stay > "20"
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 lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text,...
give me the number of patients whose admission year is less than 2195 and lab test name is potassium?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admityear < "2195" AND lab.label = "Potassium"
mimicsql_data
CREATE TABLE table_1341453_34 ( party VARCHAR, first_elected VARCHAR )
What's the party elected in the district that first elected in 1990?
SELECT party FROM table_1341453_34 WHERE first_elected = "1990"
sql_create_context
CREATE TABLE table_62554 ( "Year" real, "Milan \u2013 San Remo" text, "Tour of Flanders" text, "Paris\u2013Roubaix" text, "Li\u00e8ge\u2013Bastogne\u2013Li\u00e8ge" text, "Giro di Lombardia" text )
what kind of Giro di Lombardiahas a Tour of Flanders of tom boonen ( bel ), and a Paris Roubaix of fabian cancellara ( sui )?
SELECT "Giro di Lombardia" FROM table_62554 WHERE "Tour of Flanders" = 'tom boonen ( bel )' AND "Paris\u2013Roubaix" = 'fabian cancellara ( sui )'
wikisql
CREATE TABLE table_19779 ( "Administrative division" text, "Area (km\u00b2)" text, "Population 2000 Census" real, "Population (2010 Census)" real, "Population density 2010 (/km\u00b2)" real )
Name the administrative division for 95391
SELECT "Administrative division" FROM table_19779 WHERE "Population (2010 Census)" = '95391'
wikisql
CREATE TABLE table_name_34 ( week__number VARCHAR, original_artist VARCHAR, order__number VARCHAR )
On which week was the beatles the original artist and the order # smaller than 10?
SELECT week__number FROM table_name_34 WHERE original_artist = "the beatles" AND order__number < 10
sql_create_context
CREATE TABLE table_16765 ( "Race Name" text, "Circuit" text, "Date" text, "Winning driver" text, "Constructor" text, "Report" text )
How many different kinds of reports are there for races that Juan Manuel Fangio won?
SELECT COUNT("Report") FROM table_16765 WHERE "Winning driver" = 'Juan Manuel Fangio'
wikisql
CREATE TABLE offering_instructor ( offering_instructor_id int, offering_id int, instructor_id int ) CREATE TABLE instructor ( instructor_id int, name varchar, uniqname varchar ) CREATE TABLE program_course ( program_id int, course_id int, workload int, category varchar ) CREAT...
Which of the ENVIRON classes don 't meet Fridays ?
SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester WHERE course_offering.friday = 'N' AND course.department = 'ENVIRON' AND semester.semester = 'WN' AN...
advising
CREATE TABLE gwyjzb ( 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 gwyjzb.MED_SER_ORG_NO FROM gwyjzb WHERE gwyjzb.PERSON_NM = '李红豆' AND gwyjzb.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.SOC_SRT_DIRE_NM = '奥氮平片') UNION SELECT fgwyjzb.MED_SER_ORG_NO FROM fgwyjzb WHERE fgwyjzb.PERSON_NM = '李红豆' AND fgwyjzb.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID F...
css
CREATE TABLE table_53650 ( "Rank" real, "Player" text, "Goals" real, "Apps" real, "Avg/Game" real )
What is the average number of goals of the player with 234 apps and a rank above 8?
SELECT AVG("Goals") FROM table_53650 WHERE "Apps" = '234' AND "Rank" < '8'
wikisql
CREATE TABLE table_67713 ( "Status" text, "Name" text, "First Performance" text, "Last Performance" text, "Style" text )
What was the Last Performance when the status is current cast, and a Name of noah parets?
SELECT "Last Performance" FROM table_67713 WHERE "Status" = 'current cast' AND "Name" = 'noah parets'
wikisql
CREATE TABLE event ( ID int, Name text, Stadium_ID int, Year text ) CREATE TABLE stadium ( ID int, name text, Capacity int, City text, Country text, Opening_year int ) CREATE TABLE swimmer ( ID int, name text, Nationality text, meter_100 real, meter_200 text...
Visualize a bar chart about the distribution of meter_400 and ID , display x axis in desc order please.
SELECT meter_400, ID FROM swimmer ORDER BY meter_400 DESC
nvbench
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) CREATE TABLE zzmzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH number, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, K...
从二00二年四月二十五日到二0二0年十二月二十一日这段时间,患者沈宾鸿检测超敏肌钙蛋白T找的哪些医务人员做的,这些医务人员的工号和姓名报一下
SELECT jyjgzbb.JCRGH, jyjgzbb.JCRXM FROM person_info JOIN hz_info JOIN zzmzjzjlb JOIN jybgb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = zzmzjzjlb.YLJGDM AND hz_info.KH = zzmzjzjlb.KH AND hz_info.KLX = zzmzjzjlb.KLX AND zzmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND zzmzjzjlb.JZLSH = jybgb.JZLSH_MZ...
css
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 swimmer ( ID int, name text, Nationality text, meter_100 real, meter_200 text, meter_300 text, meter_40...
Find meter_200 and the sum of meter_100 , and group by attribute meter_200, and visualize them by a bar chart, and display from high to low by the y-axis.
SELECT meter_200, SUM(meter_100) FROM swimmer GROUP BY meter_200 ORDER BY SUM(meter_100) DESC
nvbench
CREATE TABLE code_description ( code varchar, description text ) CREATE TABLE food_service ( meal_code text, meal_number int, compartment text, meal_description varchar ) CREATE TABLE dual_carrier ( main_airline varchar, low_flight_number int, high_flight_number int, dual_airli...
what is restriction ap57
SELECT DISTINCT advance_purchase, application, maximum_stay, minimum_stay, no_discounts, restriction_code, saturday_stay_required, stopovers FROM restriction WHERE restriction_code = 'AP/57'
atis
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 aircraft ( aircraft_code varchar, aircraft_description varchar, manufacturer varchar,...
what are the flights from PITTSBURGH to BALTIMORE
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'PITTSBURGH' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BAL...
atis
CREATE TABLE table_33376 ( "Rank" text, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
Which country has a rand of 2 and a silver less than 6?
SELECT MAX("Total") FROM table_33376 WHERE "Rank" = '2' AND "Silver" < '6'
wikisql
CREATE TABLE SuggestedEdits ( Id number, PostId number, CreationDate time, ApprovalDate time, RejectionDate time, OwnerUserId number, Comment text, Text text, Title text, Tags text, RevisionGUID other ) CREATE TABLE Badges ( Id number, UserId number, Name text, ...
Open, unlocked questions with 'you' in the title.
SELECT p.Id AS "post_link", p.Score FROM Posts AS p JOIN PostHistory AS h ON h.PostId = p.Id WHERE Title LIKE '%Yii%' AND NOT ClosedDate IS NULL GROUP BY p.Id, p.Score HAVING SUM(CASE WHEN h.PostHistoryTypeId = 14 THEN -1 WHEN h.PostHistoryTypeId = 15 THEN 1 ELSE 0 END) >= 0 ORDER BY Score DESC
sede
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...
从08年5月22日起到08年11月21日患者54662739的所有检验结果指标记录中的检测方法可以提供一下吗?
SELECT jyjgzbb.JCFF FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN person_info_hz_info JOIN person_info 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...
css
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text,...
calculate the number of male patients.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.gender = "M"
mimicsql_data
CREATE TABLE table_name_5 ( home VARCHAR, attendance INTEGER )
Which Home has an Attendance larger than 1,858?
SELECT home FROM table_name_5 WHERE attendance > 1 OFFSET 858
sql_create_context
CREATE TABLE table_203_404 ( id number, "pennant\nnumber" text, "name" text, "builder" text, "laid down" text, "launched" text, "completed" text, "fate" text )
what was the first destroyer to be completed ?
SELECT "name" FROM table_203_404 ORDER BY "completed" LIMIT 1
squall
CREATE TABLE table_38496 ( "Number" real, "Station" text, "Japanese" text, "Distance (km)" real, "Stop" text, "Location" text )
What is the distance of Kawage station?
SELECT SUM("Distance (km)") FROM table_38496 WHERE "Station" = 'kawage'
wikisql
CREATE TABLE table_54915 ( "Tournament" text, "Wins" real, "Top-5" real, "Top-25" real, "Events" real, "Cuts made" real )
Tell me the highest cuts made with wins more than 1
SELECT MAX("Cuts made") FROM table_54915 WHERE "Wins" > '1'
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, ...
provide me the number of patients who have been diagnosed with unspecified erythematous condition and have stayed in hospital for more than 7 days.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.days_stay > "7" AND diagnoses.long_title = "Unspecified erythematous condition"
mimicsql_data
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...
从00年8月24日开始03年10月27日结束47979696病患的全部检验结果指标记录的检测人是14267840的检验指标流水号是多少?
SELECT jyjgzbb.JYZBLSH 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.B...
css
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, ...
what is the number of patients with admission location as transfer from hosp/extram who had creation of conduit between left ventricle and aorta?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_location = "TRANSFER FROM HOSP/EXTRAM" AND procedures.long_title = "Creation of conduit between left ventricle and aorta"
mimicsql_data
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 zyjybgb ( BBCJBW text, BBDM t...
在门诊确诊为脑外伤所致精神障碍的病人方歌韵其直接胆红素二代的检查的结果中具体的定量及其单位都是什么?
SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM person_info JOIN hz_info JOIN mzjzjlb JOIN zyjybgb JOIN jyjgzbb 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 = zyjybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = zyjybgb.JZLSH_MZ...
css
CREATE TABLE jybgb ( BBCJBW text, BBDM text, BBMC text, BBZT number, BGDH text, BGJGDM text, BGJGMC text, BGRGH text, BGRQ time, BGRXM text, BGSJ time, CJRQ time, JSBBRQSJ time, JSBBSJ time, JYBBH text, JYJGMC text, JYJSGH text, JYJSQM text, JY...
医生59997347在2014-05-11到2016-10-25期间的门诊病人数是多少
SELECT COUNT(hz_info.RYBH) FROM hz_info JOIN wdmzjzjlb ON hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX WHERE wdmzjzjlb.ZZYSGH = '59997347' AND wdmzjzjlb.JZKSRQ BETWEEN '2014-05-11' AND '2016-10-25' UNION SELECT COUNT(hz_info.RYBH) FROM hz_info JOIN bdmzjzjlb ON hz_info...
css
CREATE TABLE table_71665 ( "Year" text, "Title" text, "Production Company" text, "Role" text, "Notes" text )
What is the name of the role that has a Title of Salud, Dinero y Amor and antagonist in the notes field?
SELECT "Role" FROM table_71665 WHERE "Notes" = 'antagonist' AND "Title" = 'salud, dinero y amor'
wikisql
CREATE TABLE table_43795 ( "Poll Source" text, "Sample Size" real, "Date" text, "Democrat" text, "Republican" text )
Who was the Democrat when the Republican was Mike Huckabee, and the sample size was less than 495?
SELECT "Democrat" FROM table_43795 WHERE "Sample Size" < '495' AND "Republican" = 'mike huckabee'
wikisql
CREATE TABLE table_name_22 ( temperature_classification VARCHAR, glass_bulb_color VARCHAR )
What is the temperature classification of a purple colored glass bulb?
SELECT temperature_classification FROM table_name_22 WHERE glass_bulb_color = "purple"
sql_create_context
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id t...
give me the number of patients whose year of death is less than or equal to 2112 and drug code is sw100?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.dod_year <= "2112.0" AND prescriptions.formulary_drug_cd = "SW100"
mimicsql_data
CREATE TABLE table_204_119 ( id number, "date" text, "time" text, "opponent" text, "site" text, "tv" text, "result" text, "attendance" number, "record" text )
after the game on 11/09/2012 what was the next game to have above 5,500 in attendance ?
SELECT "date" FROM table_204_119 WHERE "date" > (SELECT "date" FROM table_204_119 WHERE "date" = '11/09/2012') AND "attendance" > 5500 ORDER BY "date" LIMIT 1
squall
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 ...
患有疾病V27.340的人在被门诊确诊时其检测指标043045的参考值范围下限和上限都是多些?
SELECT jyjgzbb.CKZFWXX, jyjgzbb.CKZFWSX FROM mzjzjlb JOIN jyjgzbb ON mzjzjlb.YLJGDM = jyjgzbb.jybgb_YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jyjgzbb.jybgb_JZLSH_MZJZJLB WHERE mzjzjlb.JZZDBM = 'V27.340' AND jyjgzbb.JCZBDM = '043045'
css
CREATE TABLE table_16260 ( "Religious group" text, "Population %" text, "Growth (1991\u20132001)" text, "Sex ratio (total)" real, "Literacy (%)" text, "Work participation (%)" text, "Sex ratio (rural)" real, "Sex ratio (urban)" real, "Sex ratio (child)" real )
What is the literacy rate for groups that grew 103.1% between 1991 and 2001?
SELECT "Literacy (%)" FROM table_16260 WHERE "Growth (1991\u20132001)" = '103.1%'
wikisql
CREATE TABLE t_kc21 ( 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, ...
个人自理金额在医疗就诊87151223672中一共是多少?
SELECT t_kc24.PER_SOL FROM t_kc24 JOIN t_kc21_t_kc24 JOIN t_kc21 ON t_kc21_t_kc24.MED_SAFE_PAY_ID = t_kc24.MED_SAFE_PAY_ID AND t_kc21_t_kc24.MED_CLINIC_ID = t_kc21.MED_CLINIC_ID WHERE t_kc21.MED_CLINIC_ID = '87151223672'
css
CREATE TABLE table_46876 ( "Player" text, "Country" text, "Year(s) won" text, "Total" real, "To par" real, "Finish" text )
What is Finish, when Total is '306'?
SELECT "Finish" FROM table_46876 WHERE "Total" = '306'
wikisql
CREATE TABLE table_name_82 ( date VARCHAR, record VARCHAR )
Which Date has a Record of 6-6?
SELECT date FROM table_name_82 WHERE record = "6-6"
sql_create_context
CREATE TABLE comment_instructor ( instructor_id int, student_id int, score int, comment_text varchar ) 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 i...
Are Mondays and Wednesdays good for me to take 334 ?
SELECT COUNT(*) > 0 FROM course, course_offering, semester WHERE course_offering.friday = 'N' AND course_offering.monday = 'Y' AND course_offering.thursday = 'N' AND course_offering.tuesday = 'N' AND course_offering.wednesday = 'Y' AND course.course_id = course_offering.course_id AND course.department = 'EECS' AND cour...
advising
CREATE TABLE table_21935 ( "Name or route" text, "type" text, "elevation groundstation" real, "elevation mountainstation" real, "slope length" real, "capacity in persons/hour" real, "construction year(s)" text )
Name the slope length for gondola
SELECT MIN("slope length") FROM table_21935 WHERE "type" = 'gondola'
wikisql
CREATE TABLE zyjzjlb ( CYBQDM text, CYBQMC text, CYCWH text, CYKSDM text, CYKSMC text, CYSJ time, CYZTDM number, HZXM text, JZKSDM text, JZKSMC text, JZLSH text, KH text, KLX number, MZBMLX number, MZJZLSH text, MZZDBM text, MZZDMC text, MZZYZDZZBM...
患者被门诊诊断为疾病Z80.670的检测指标849746的参考值范围下限和上限分别是什么?
SELECT jyjgzbb.CKZFWXX, jyjgzbb.CKZFWSX FROM mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN jybgb_jyjgzbb ON mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jybgb_jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH AND jybgb_jyjgzbb.JYZBLSH = jyjgzbb.JYZBLSH AND jybgb_jyjgzbb.jyjgzbb_id ...
css
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, ...
what is the drug route of the drug code dones?
SELECT prescriptions.route FROM prescriptions WHERE prescriptions.formulary_drug_cd = "DONE5"
mimicsql_data
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number,...
when did patient 030-42006 have the first stool output on this month/22.
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 = '030-42006')) AND intakeoutput.cellpath LIKE '%output%...
eicu
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, ...
find the number of elective hospital admission patients diagnosed with defibrination syndrome.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admission_type = "ELECTIVE" AND diagnoses.long_title = "Defibrination syndrome"
mimicsql_data
CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE labevents ( row_id number, subject_id number, ...
how many times patient 11095 had received free water bolus on 05/06/2105?
SELECT COUNT(*) 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 = 11095)) AND inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'free water b...
mimic_iii
CREATE TABLE table_203_829 ( id number, "event" text, "record" text, "athlete(s)" text, "date" text, "time (s)" number )
how long did felix loch take to complete the men 's luge ?
SELECT "time (s)" FROM table_203_829 WHERE "athlete(s)" = 'felix loch'
squall
CREATE TABLE PostsWithDeleted ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId number, OwnerDisplayName text, LastEditorUserId number, LastEditorDispl...
Show info about a post with linked questions.
SELECT Posts.Id AS "post_link", Posts.Body, Score, Tags, PostNotices.PostNoticeTypeId FROM Posts JOIN PostNotices ON Posts.Id = PostNotices.PostId WHERE Posts.Id = '##PostId##'
sede
CREATE TABLE table_30231 ( "Week #" real, "Dance/song" text, "Horwood" text, "Goodman" text, "Dixon" text, "Tonioli" text, "Total" text, "Result" text )
What was the result for the dance that tonioli's scored an 8 and horwood scored a 6?
SELECT "Result" FROM table_30231 WHERE "Tonioli" = '8' AND "Horwood" = '6'
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...
在00年1月17日直到11年5月4日这一段时间,病患云天干内所有检验结果指标记录中的仪器编号以及名称分别叫什么?
SELECT jyjgzbb.YQBH, jyjgzbb.YQMC FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb 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 = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybg...
css
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...
how many patients posses self pay insurance and are tested with c-reactive protein in lab?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.insurance = "Self Pay" AND lab.label = "C-Reactive Protein"
mimicsql_data
CREATE TABLE table_58307 ( "Entrant" text, "Constructor" text, "Chassis" text, "Engine" text, "Tyre" text, "Driver" text, "Rounds" text )
None of the rounds has Roger Williamson as a driver.
SELECT "Rounds" FROM table_58307 WHERE "Driver" = 'roger williamson'
wikisql
CREATE TABLE table_9777 ( "Rank" real, "Peak Name" text, "Elevation (ft)" real, "Range" text, "Isolation" real )
WHAT IS THE RANGE WITH ISOLATION SMALLER THAN 2.35, RANK LARGER THAN 38, ELEVATION GREATER THAN 6,080, AND NAMED PLOTT BALSAM?
SELECT "Range" FROM table_9777 WHERE "Isolation" < '2.35' AND "Rank" > '38' AND "Elevation (ft)" > '6,080' AND "Peak Name" = 'plott balsam'
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 prescriptions...
what is the number of patients whose marital status is divorced and ethnicity is unknown/not specified?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.marital_status = "DIVORCED" AND demographic.ethnicity = "UNKNOWN/NOT SPECIFIED"
mimicsql_data
CREATE TABLE table_27615896_18 ( new_points VARCHAR, rk VARCHAR )
How many new points were earned by rk 26?
SELECT new_points FROM table_27615896_18 WHERE rk = 26
sql_create_context
CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABL...
how many days have it been since the last time that patient 73713 stayed on this hospital encounter in careunit sicu?
SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', transfers.intime)) FROM transfers WHERE transfers.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 73713 AND admissions.dischtime IS NULL) AND transfers.careunit = 'sicu' ORDER BY transfers.intime DESC LIMIT 1
mimic_iii
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugst...
when did patient 002-8586 first leave the hospital since 2 years ago?
SELECT patient.hospitaldischargetime FROM patient WHERE patient.uniquepid = '002-8586' AND DATETIME(patient.hospitaldischargetime) >= DATETIME(CURRENT_TIME(), '-2 year') ORDER BY patient.hospitaldischargetime LIMIT 1
eicu
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, ...
Find the number of hispanic or latino-puerto rican patients who were born before 2200.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "HISPANIC/LATINO - PUERTO RICAN" AND demographic.dob_year < "2200"
mimicsql_data
CREATE TABLE table_204_37 ( id number, "#" number, "wrestlers" text, "reign" number, "date" text, "days\nheld" number, "location" text, "event" text, "notes" text )
j money won on march 8 , 2003 . who won the next match ?
SELECT "wrestlers" FROM table_204_37 WHERE "date" > (SELECT "date" FROM table_204_37 WHERE "date" = 'march 8, 2003') ORDER BY "date" LIMIT 1
squall
CREATE TABLE table_15187735_8 ( segment_c VARCHAR, segment_b VARCHAR )
Name the segment c for paint rollers
SELECT segment_c FROM table_15187735_8 WHERE segment_b = "Paint Rollers"
sql_create_context
CREATE TABLE table_45162 ( "Game" real, "March" real, "Opponent" text, "Score" text, "Record" text )
Which game number was played after March 11 and ended with a record of 26-30-10?
SELECT MIN("Game") FROM table_45162 WHERE "Record" = '26-30-10' AND "March" > '11'
wikisql
CREATE TABLE table_45073 ( "Tie no" text, "Home team" text, "Score" text, "Away team" text, "Date" text )
What date has a Tie Number of 4?
SELECT "Date" FROM table_45073 WHERE "Tie no" = '4'
wikisql
CREATE TABLE table_name_16 ( home VARCHAR, visitor VARCHAR )
What is the home team with the ny rangers as the visitor team?
SELECT home FROM table_name_16 WHERE visitor = "ny rangers"
sql_create_context
CREATE TABLE table_74357 ( "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 number episode of the season was titled 'Vision Impossible'?
SELECT MIN("Season #") FROM table_74357 WHERE "Title" = 'Vision Impossible'
wikisql
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...
根据科室编码与入院诊断疾病编码区别显示出医院7999719所有的就诊记载里,有民政补助的部分比上医疗总费用比值的最大值并且按降序来排列
SELECT t_kc21.MED_ORG_DEPT_CD, t_kc21.IN_DIAG_DIS_NM, MAX(t_kc24.CIVIL_SUBSIDY / t_kc24.MED_AMOUT) FROM t_kc21 JOIN t_kc24 ON t_kc21.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE t_kc21.MED_SER_ORG_NO = '7999719' GROUP BY t_kc21.MED_ORG_DEPT_CD, t_kc21.IN_DIAG_DIS_NM ORDER BY MAX(t_kc24.CIVIL_SUBSIDY / t_kc24.MED_AMOUT) D...
css
CREATE TABLE Orders ( order_id INTEGER, customer_id INTEGER, date_order_placed DATETIME, order_details VARCHAR(255) ) CREATE TABLE Invoice_Line_Items ( order_item_id INTEGER, invoice_number INTEGER, product_id INTEGER, product_title VARCHAR(80), product_quantity VARCHAR(50), pro...
Show first name and id for all customers with at least 2 accounts Show bar chart, and display X-axis from low to high order.
SELECT T2.customer_first_name, T1.customer_id FROM Accounts AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id ORDER BY T2.customer_first_name
nvbench
CREATE TABLE VoteTypes ( Id number, Name text ) CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) CREATE TABLE FlagTypes ( Id number, Name text, Description text ) CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationD...
PresenceInsights tag; monthly totals.
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 table_62474 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Game site" text, "Record" text, "Attendance" real )
What was the attendance on september 29?
SELECT MAX("Attendance") FROM table_62474 WHERE "Date" = 'september 29'
wikisql
CREATE TABLE Projects ( project_details VARCHAR, project_id VARCHAR ) CREATE TABLE Documents ( project_id VARCHAR, document_name VARCHAR )
What is the project detail for the project with document 'King Book'?
SELECT T1.project_details FROM Projects AS T1 JOIN Documents AS T2 ON T1.project_id = T2.project_id WHERE T2.document_name = "King Book"
sql_create_context
CREATE TABLE table_34303 ( "Round" real, "Pick" real, "Player" text, "Nationality" text, "School/Club Team" text )
What is the lowest round of the player from UCLA?
SELECT MIN("Round") FROM table_34303 WHERE "School/Club Team" = 'ucla'
wikisql
CREATE TABLE table_name_49 ( type VARCHAR, title VARCHAR )
which Type has a Title of so alive?
SELECT type FROM table_name_49 WHERE title = "so alive"
sql_create_context
CREATE TABLE table_80423 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" text, "Record" text )
What is the score for the game that has an attendance of 5,298?
SELECT "Score" FROM table_80423 WHERE "Attendance" = '5,298'
wikisql
CREATE TABLE table_26139405_1 ( title VARCHAR, viewers__in_millions_ VARCHAR )
What is the name of the episode that had 8.51 million viewers?
SELECT title FROM table_26139405_1 WHERE viewers__in_millions_ = "8.51"
sql_create_context
CREATE TABLE table_name_23 ( team_1 VARCHAR )
What 2nd leg has rk gold club kozina as team 1?
SELECT 2 AS nd_leg FROM table_name_23 WHERE team_1 = "rk gold club kozina"
sql_create_context
CREATE TABLE Tryout ( pID numeric(5,0), cName varchar(20), pPos varchar(8), decision varchar(3) ) CREATE TABLE Player ( pID numeric(5,0), pName varchar(20), yCard varchar(3), HS numeric(5,0) ) CREATE TABLE College ( cName varchar(20), state varchar(2), enr numeric(5,0) )
Return a pie chart on how many students participated in tryouts for each college by descennding count?
SELECT cName, COUNT(*) FROM Tryout GROUP BY cName ORDER BY COUNT(*) DESC
nvbench
CREATE TABLE table_name_76 ( debut_year INTEGER, games VARCHAR, goals VARCHAR, years_at_club VARCHAR )
Which Debut year has Goals of 0, and Years at club of 1963, and Games larger than 5?
SELECT AVG(debut_year) FROM table_name_76 WHERE goals = 0 AND years_at_club = "1963" AND games > 5
sql_create_context
CREATE TABLE table_59697 ( "Nat." text, "Name" text, "Moving to" text, "Type" text, "Transfer window" text, "Transfer fee" text, "Source" text )
WHAT IS THE SOURCE WITH A TYPE OF TRANSFER AND MEX?
SELECT "Source" FROM table_59697 WHERE "Type" = 'transfer' AND "Nat." = 'mex'
wikisql
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id...
count the number of patients whose death status is 0 and diagnoses icd9 code is 5712?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.expire_flag = "0" AND diagnoses.icd9_code = "5712"
mimicsql_data
CREATE TABLE Guests ( guest_id INTEGER, gender_code CHAR(1), guest_first_name VARCHAR(80), guest_last_name VARCHAR(80), date_of_birth DATETIME ) CREATE TABLE Apartment_Bookings ( apt_booking_id INTEGER, apt_id INTEGER, guest_id INTEGER, booking_status_code CHAR(15), booking_star...
Find the number of booking start date for the apartments that have more than two bedrooms for each year with a bar chart, list how many booking start date from low to high order.
SELECT booking_start_date, COUNT(booking_start_date) FROM Apartment_Bookings AS T1 JOIN Apartments AS T2 ON T1.apt_id = T2.apt_id WHERE T2.bedroom_count > 2 ORDER BY COUNT(booking_start_date)
nvbench