context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE table_14752049_2 (
international_tourist_arrivals__2010_ VARCHAR,
change__2010_to_2011_ VARCHAR
) | What are the international tourist arrivals in 2010 where change from 2010 to 2011 is +11.2% ? | SELECT international_tourist_arrivals__2010_ FROM table_14752049_2 WHERE change__2010_to_2011_ = "+11.2%" | sql_create_context |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE demographic (... | what is gender and insurance of subject name jesse ran? | SELECT demographic.gender, demographic.insurance FROM demographic WHERE demographic.name = "Jesse Ran" | mimicsql_data |
CREATE TABLE table_name_1 (
wk_7 INTEGER,
wk_2 VARCHAR,
wk_3 VARCHAR,
wk_4 VARCHAR
) | What is the lowest wk 7 with a wk 3 value of 12, a wk 4 less than 9, and a wk 2 greater than 11? | SELECT MIN(wk_7) FROM table_name_1 WHERE wk_3 = 12 AND wk_4 < 9 AND wk_2 > 11 | sql_create_context |
CREATE TABLE table_name_96 (
money___£__ VARCHAR,
country VARCHAR
) | What Money ( ) has a Country of ireland? | SELECT money___£__ FROM table_name_96 WHERE country = "ireland" | sql_create_context |
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
)
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
) | For those records from the products and each product's manufacturer, draw a bar chart about the distribution of founder and the amount of founder , and group by attribute founder, and I want to sort by the x axis in asc. | SELECT Founder, COUNT(Founder) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder ORDER BY Founder | nvbench |
CREATE TABLE offering_instructor (
offering_instructor_id int,
offering_id int,
instructor_id int
)
CREATE TABLE ta (
campus_job_id int,
student_id int,
location varchar
)
CREATE TABLE gsi (
course_offering_id int,
student_id int
)
CREATE TABLE program (
program_id int,
name v... | In Spring or Summer term are there any 100 -level classes ? | SELECT DISTINCT course.department, course.name, course.number, semester.semester FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND course.department = 'EECS' AND course.number BETWEEN 100 AND 100 + 100 AND semester.semester IN ('SP', 'SS', 'SU') AND semester.semester_id = cou... | advising |
CREATE TABLE table_14219514_1 (
home__1st_leg_ VARCHAR
) | How many 2nd legs are there where home (1st leg) is Independiente? | SELECT 2 AS nd_leg FROM table_14219514_1 WHERE home__1st_leg_ = "Independiente" | sql_create_context |
CREATE TABLE table_66692 (
"Date" text,
"Course" text,
"Distance" text,
"Type" text,
"Winner" text
) | who won on 29 may? | SELECT "Winner" FROM table_66692 WHERE "Date" = '29 may' | wikisql |
CREATE TABLE table_name_92 (
date VARCHAR,
score VARCHAR
) | What is the date of the game that ended with a score of 96-89? | SELECT date FROM table_name_92 WHERE score = "96-89" | sql_create_context |
CREATE TABLE table_name_27 (
date VARCHAR,
game VARCHAR
) | What is the date of game 23? | SELECT date FROM table_name_27 WHERE game = 23 | sql_create_context |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE demographic (... | provide the number of patients whose drug route is iv drip? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE prescriptions.route = "IV DRIP" | mimicsql_data |
CREATE TABLE t_kc22 (
AMOUNT number,
CHA_ITEM_LEV number,
DATA_ID text,
DIRE_TYPE number,
DOSE_FORM text,
DOSE_UNIT text,
EACH_DOSAGE text,
EXP_OCC_DATE time,
FLX_MED_ORG_ID text,
FXBZ number,
HOSP_DOC_CD text,
HOSP_DOC_NM text,
MED_CLINIC_ID text,
MED_DIRE_CD tex... | 硫酸氢氯吡格雷片在哪几家医院患者59714640被开出过? | SELECT t_kc21.MED_SER_ORG_NO FROM t_kc21 WHERE t_kc21.PERSON_ID = '59714640' AND t_kc21.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.SOC_SRT_DIRE_NM = '硫酸氢氯吡格雷片') | css |
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... | what are the five most frequent medicines that were prescribed within 2 months to patients 50s after they had been diagnosed with thrombocytopenia, until 4 years ago? | SELECT t3.drugname FROM (SELECT t2.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'thrombocytopenia' AND DATETIME(diagnosis.diagnosis... | eicu |
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
)
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
) | For those records from the products and each product's manufacturer, a bar chart shows the distribution of founder and the sum of manufacturer , and group by attribute founder, order in desc by the total number of manufacturer. | SELECT Founder, SUM(Manufacturer) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder ORDER BY SUM(Manufacturer) DESC | nvbench |
CREATE TABLE table_20859 (
"Series #" real,
"Season #" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text
) | How many directors were there in total for the episode with series #62? | SELECT COUNT("Directed by") FROM table_20859 WHERE "Series #" = '62' | wikisql |
CREATE TABLE table_test_27 (
"id" int,
"anemia" bool,
"bleeding" int,
"left_ventricular_ejection_fraction_lvef" int,
"intra_aortic_balloon_pump_iabp" bool,
"systolic_blood_pressure_sbp" int,
"left_main_stem_coronary_artery_stenosis" int,
"haemoglobin" float,
"renal_disease" bool,
... | platelet count < 100000 / ml | SELECT * FROM table_test_27 WHERE platelet_count < 100000 | criteria2sql |
CREATE TABLE table_1635 (
"Period" text,
"% trains arriving within 5 mins of scheduled time (over three months)" text,
"Change over same quarter the previous year" text,
"% trains arriving within 5 mins of scheduled time Moving Annual Average (MAA)" text,
"Change over previous year as a whole" text
... | When was the percentage of trains arriving within 5 minutes of scheduled time 89.6%? | SELECT "Period" FROM table_1635 WHERE "% trains arriving within 5 mins of scheduled time Moving Annual Average (MAA)" = '89.6%' | wikisql |
CREATE TABLE flight (
aircraft_code_sequence text,
airline_code varchar,
airline_flight text,
arrival_time int,
connections int,
departure_time int,
dual_carrier text,
flight_days text,
flight_id int,
flight_number int,
from_airport varchar,
meal_code text,
stops int,... | give me the earliest flight tomorrow from ST. PETERSBURG to MILWAUKEE on a airline other than TW | 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 = 20 AND date_day.month_number = 1 AND date_day.year = 1991 AND days.day_name = date_day.day_name AND flight.flight_days =... | atis |
CREATE TABLE table_name_27 (
away_team VARCHAR,
venue VARCHAR
) | What is the away team's score at punt road oval? | SELECT away_team FROM table_name_27 WHERE venue = "punt road oval" | sql_create_context |
CREATE TABLE table_16173 (
"Serial number" text,
"Wheel arrangement ( Whyte notation )" text,
"Build date" text,
"Operational owner(s)" text,
"Disposition" text
) | Who were the operational owners during the construction date of April 1892? | SELECT "Operational owner(s)" FROM table_16173 WHERE "Build date" = 'April 1892' | wikisql |
CREATE TABLE table_20029 (
"Date" text,
"Tournament" text,
"Location" text,
"Purse( $ )" real,
"Winner" text,
"Score" text,
"1st Prize( $ )" text
) | Where was Outback Steakhouse Pro-AM held? | SELECT "Location" FROM table_20029 WHERE "Tournament" = 'Outback Steakhouse Pro-Am' | wikisql |
CREATE TABLE table_name_82 (
driver VARCHAR,
points VARCHAR,
team VARCHAR
) | Which driver for Greenfield Mowers Racing has fewer than 36 points? | SELECT driver FROM table_name_82 WHERE points < 36 AND team = "greenfield mowers racing" | sql_create_context |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
... | give me the number of patients whose drug code is ddav4i? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE prescriptions.formulary_drug_cd = "DDAV4I" | mimicsql_data |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob te... | what is minimum days of hospital stay of patients whose primary disease is chest pain? | SELECT MIN(demographic.days_stay) FROM demographic WHERE demographic.diagnosis = "CHEST PAIN" | mimicsql_data |
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... | 从10年12月28日开始到2011年10月6日为止,为病员25627838检测前白蛋白的医务人员工号及姓名各是什么? | SELECT jyjgzbb.JCRGH, jyjgzbb.JCRXM 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.BGD... | css |
CREATE TABLE table_21922 (
"Year" real,
"Date" text,
"Driver" text,
"Team" text,
"Manufacturer" text,
"Laps" text,
"Miles (km)" text,
"Race Time" text,
"Average Speed (mph)" text
) | What team(s) enjoyed an average spped (mph) of 138.14? | SELECT "Team" FROM table_21922 WHERE "Average Speed (mph)" = '138.14' | wikisql |
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location t... | give the discharge location of kelly gallardo. | SELECT demographic.discharge_location FROM demographic WHERE demographic.name = "Kelly Gallardo" | mimicsql_data |
CREATE TABLE table_2008069_2 (
uyghur___k̢ona_yezik̢__ VARCHAR,
chinese VARCHAR
) | Name the uyghur for | SELECT uyghur___k̢ona_yezik̢__ FROM table_2008069_2 WHERE chinese = "瓦恰" | sql_create_context |
CREATE TABLE transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
eventtype text,
careunit text,
wardid number,
intime time,
outtime time
)
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dis... | what is the maximum total cost of hospitals that include accid on street/highway? | SELECT MAX(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.hadm_id IN (SELECT diagnoses_icd.hadm_id FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'accid on street/highway')) GROUP BY cost.hadm_id) AS t1 | mimic_iii |
CREATE TABLE table_11377 (
"Grid" real,
"Constructor" text,
"Qual" real,
"Rank" real,
"Laps" real,
"Time/Retired" text
) | What is the total qual where the grid number is 24? | SELECT SUM("Qual") FROM table_11377 WHERE "Grid" = '24' | wikisql |
CREATE TABLE table_18005 (
"No." real,
"#" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production code" text,
"U.S. viewers (million)" text
) | What is the # for the episode with a Production code of 3T7057? | SELECT "#" FROM table_18005 WHERE "Production code" = '3T7057' | wikisql |
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location t... | tell me the age and health insurance for the patient jerry deberry. | SELECT demographic.age, demographic.insurance FROM demographic WHERE demographic.name = "Jerry Deberry" | mimicsql_data |
CREATE TABLE table_68596 (
"Film" text,
"Director(s)" text,
"Recipient" text,
"Date" text,
"Award" text
) | What film was awarded on 22/3/06? | SELECT "Film" FROM table_68596 WHERE "Date" = '22/3/06' | wikisql |
CREATE TABLE table_name_35 (
time_retired VARCHAR,
laps VARCHAR,
driver VARCHAR
) | what is the time/retired when the laps is less than 54 and the driver is mark donohue? | SELECT time_retired FROM table_name_35 WHERE laps < 54 AND driver = "mark donohue" | sql_create_context |
CREATE TABLE table_name_54 (
position VARCHAR,
height VARCHAR,
player VARCHAR
) | What position that has a Height larger than 179, and Player is Ezgi Arslan? | SELECT position FROM table_name_54 WHERE height > 179 AND player = "ezgi arslan" | sql_create_context |
CREATE TABLE trip (
id INTEGER,
duration INTEGER,
start_date TEXT,
start_station_name TEXT,
start_station_id INTEGER,
end_date TEXT,
end_station_name TEXT,
end_station_id INTEGER,
bike_id INTEGER,
subscription_type TEXT,
zip_code INTEGER
)
CREATE TABLE station (
id INTEG... | List the name and the number of stations for all the cities that have at least 15 stations Show bar chart, could you order in ascending by the X? | SELECT city, COUNT(*) FROM station GROUP BY city ORDER BY city | nvbench |
CREATE TABLE table_34103 (
"Tie no" text,
"Home team" text,
"Score" text,
"Away team" text,
"Attendance" text
) | What was the home team with the away team of rushden & diamonds? | SELECT "Home team" FROM table_34103 WHERE "Away team" = 'rushden & diamonds' | wikisql |
CREATE TABLE table_24384861_1 (
iphone_certified VARCHAR,
version VARCHAR
) | Was the sounddock series I v2 iphone certified? | SELECT iphone_certified FROM table_24384861_1 WHERE version = "SoundDock series I v2" | sql_create_context |
CREATE TABLE table_34719 (
"Name" text,
"Status" text,
"Population" real,
"District" text,
"Former local authority" text
) | What status is shown for Cadeby? | SELECT "Status" FROM table_34719 WHERE "Name" = 'cadeby' | wikisql |
CREATE TABLE ReviewTaskStates (
Id number,
Name text,
Description text
)
CREATE TABLE PostsWithDeleted (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body text,
OwnerUser... | Get linked posts by postid. | SELECT DISTINCT PostId AS "post_link", * FROM PostLinks WHERE RelatedPostId = '##PostId##' | sede |
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
systemicsystolic number,
systemicdiastolic number,
systemicmean number,
observationtime time
)
CREATE TABLE patient (
uniquep... | how many days has it been since the admission of patient 022-199074 to the hospital? | SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', patient.hospitaladmittime)) FROM patient WHERE patient.uniquepid = '022-199074' AND patient.hospitaldischargetime IS NULL | eicu |
CREATE TABLE table_60073 (
"Players" text,
"Position" text,
"Year" text,
"Ht/Wt" text,
"Bats/Throws" text,
"Hometown (Last School)" text
) | What side does Clayton Allison Bat/Throw from? | SELECT "Bats/Throws" FROM table_60073 WHERE "Players" = 'clayton allison' | wikisql |
CREATE TABLE table_name_87 (
place VARCHAR,
country VARCHAR,
score VARCHAR
) | What is the place of the player from the United States with a score of 74-72=146? | SELECT place FROM table_name_87 WHERE country = "united states" AND score = 74 - 72 = 146 | sql_create_context |
CREATE TABLE table_24850630_4 (
winner_2nd VARCHAR,
race VARCHAR
) | who was the winner /2nd for the British Champion Stakes race? | SELECT winner_2nd FROM table_24850630_4 WHERE race = "British Champion Stakes" | sql_create_context |
CREATE TABLE table_name_94 (
result VARCHAR,
runner_up VARCHAR,
final_venue VARCHAR
) | What was the Result in Green Lane with Kirkburton as the Runner-up? | SELECT result FROM table_name_94 WHERE runner_up = "kirkburton" AND final_venue = "green lane" | sql_create_context |
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
RejectionReasonId number,
Comment text
)
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE ReviewTaskResultTypes (
Id number,
Name text,
Description... | select * from users where id like 'sunny%';. | SELECT * FROM Users WHERE Id LIKE '1100%' | sede |
CREATE TABLE table_2930244_4 (
deaths VARCHAR,
number_of_hurricanes VARCHAR
) | How many deaths did the eyar with exactly 6 hurricanes have? | SELECT COUNT(deaths) FROM table_2930244_4 WHERE number_of_hurricanes = 6 | sql_create_context |
CREATE TABLE table_47352 (
"Date" text,
"Home captain" text,
"Away captain" text,
"Venue" text,
"Result" text
) | Who is the home captain when the venue is adelaide oval? | SELECT "Home captain" FROM table_47352 WHERE "Venue" = 'adelaide oval' | wikisql |
CREATE TABLE table_48185 (
"Outcome" text,
"Year" real,
"Championship" text,
"Surface" text,
"Opponent" text,
"Score" text
) | What is Opponent, when Year is greater than 2009, and when Score is 7 5, 6 7 (6 8) , 6 1? | SELECT "Opponent" FROM table_48185 WHERE "Year" > '2009' AND "Score" = '7–5, 6–7 (6–8) , 6–1' | wikisql |
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 ... | 90835300患者被门诊诊断为急性精神分裂症样精神病性障碍,查看检测中三碘甲状腺原氨酸的结果定量及其单位 | SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN hz_info_mzjzjlb ON hz_info.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND hz_info_mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM... | css |
CREATE TABLE table_2214582_1 (
away_leg VARCHAR,
round VARCHAR,
aggregate VARCHAR
) | What is the record for the away leg in round 1 and aggregate 2-0? | SELECT away_leg FROM table_2214582_1 WHERE round = 1 AND aggregate = "2-0" | sql_create_context |
CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId number
)
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationDate time,
CloseReasonTypeId number,
CloseAsOffTopicReasonTypeId number,
DuplicateOfQuestionId n... | The average score across all questions. | SELECT AVG(CAST(p.Score AS FLOAT)) FROM Posts AS p WHERE p.PostTypeId = 1 | sede |
CREATE TABLE table_name_59 (
attendance INTEGER,
home VARCHAR,
points VARCHAR
) | Which Attendance has a Home of philadelphia, and Points smaller than 23? | SELECT SUM(attendance) FROM table_name_59 WHERE home = "philadelphia" AND points < 23 | sql_create_context |
CREATE TABLE table_name_2 (
round VARCHAR,
pick VARCHAR
) | Which Round is pick 112 in? | SELECT round FROM table_name_2 WHERE pick = 112 | sql_create_context |
CREATE TABLE table_32278 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | Who is the away team at junction oval? | SELECT "Away team" FROM table_32278 WHERE "Venue" = 'junction oval' | wikisql |
CREATE TABLE table_train_109 (
"id" int,
"serum_potassium" float,
"systolic_blood_pressure_sbp" int,
"body_mass_index_bmi" float,
"hypertension" bool,
"NOUSE" float
) | body mass index ( bmi ) of >= 18 kg / m2 to <= 32 kg / m2 | SELECT * FROM table_train_109 WHERE body_mass_index_bmi >= 18 AND body_mass_index_bmi <= 32 | criteria2sql |
CREATE TABLE table_name_9 (
apparatus VARCHAR,
rank_final VARCHAR,
competition_description VARCHAR
) | What is Apparatus, when Rank-Final is greater than 6, and when Competition Description is 'U.S. Championships'? | SELECT apparatus FROM table_name_9 WHERE rank_final > 6 AND competition_description = "u.s. championships" | sql_create_context |
CREATE TABLE table_67287 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Attendance" real,
"Record" text
) | When the record was 32-37 what was the score? | SELECT "Score" FROM table_67287 WHERE "Record" = '32-37' | wikisql |
CREATE TABLE table_train_179 (
"id" int,
"systolic_blood_pressure_sbp" int,
"fasting_plasma_glucose_fpg" float,
"diastolic_blood_pressure_dbp" int,
"diabetes" bool,
"body_mass_index_bmi" float,
"triglyceride_tg" float,
"hypertension" bool,
"age" float,
"NOUSE" float
) | blood pressure > 130 mmhg ( systolic ) or > 85 mmhg ( diastolic ) or history of diagnosed hypertension | SELECT * FROM table_train_179 WHERE systolic_blood_pressure_sbp > 130 OR diastolic_blood_pressure_dbp > 85 OR hypertension = 1 | criteria2sql |
CREATE TABLE member_of_club (
stuid number,
clubid number,
position text
)
CREATE TABLE student (
stuid number,
lname text,
fname text,
age number,
sex text,
major number,
advisor number,
city_code text
)
CREATE TABLE club (
clubid number,
clubname text,
clubdes... | List the clubs that have at least a member with advisor '1121'. | SELECT DISTINCT t1.clubname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t3.advisor = 1121 | spider |
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
)
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
) | For those records from the products and each product's manufacturer, give me the comparison about manufacturer over the name , and group by attribute founder, and sort X-axis from high to low order please. | SELECT T1.Name, T1.Manufacturer FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder, T1.Name ORDER BY T1.Name DESC | nvbench |
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),
COMMISSION_PCT decimal(2,2),
MANAGER_ID decimal(6,0),
DEPARTMENT_ID decimal(... | For those employees whose salary is in the range of 8000 and 12000 and commission is not null or department number does not equal to 40, give me the comparison about the sum of salary over the job_id , and group by attribute job_id, and list y axis in asc order please. | SELECT JOB_ID, SUM(SALARY) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 GROUP BY JOB_ID ORDER BY SUM(SALARY) | nvbench |
CREATE TABLE table_69953 (
"Program" text,
"Degree" text,
"Teaching language" text,
"Duration (years)" real,
"full-time/part-time" text,
"ECTS Credit Points" real
) | What is the teaching language for a less than 2 year duration and less than 65 ECTS credit points? | SELECT "Teaching language" FROM table_69953 WHERE "Duration (years)" < '2' AND "ECTS Credit Points" < '65' | wikisql |
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number... | what was the three most frequent specimen tests that patients had within the same month after being diagnosed with abnormal glucose nec until 2101? | SELECT t3.spec_type_desc FROM (SELECT t2.spec_type_desc, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_... | mimic_iii |
CREATE TABLE inventory (
inventory_id number,
film_id number,
store_id number,
last_update time
)
CREATE TABLE country (
country_id number,
country text,
last_update time
)
CREATE TABLE film_actor (
actor_id number,
film_id number,
last_update time
)
CREATE TABLE film_category... | What are the city name, id, and number of addresses corresponding to the city with the most addressed? | SELECT T2.city, COUNT(*), T1.city_id FROM address AS T1 JOIN city AS T2 ON T1.city_id = T2.city_id GROUP BY T1.city_id ORDER BY COUNT(*) DESC LIMIT 1 | spider |
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... | 在03年1月5日到10年11月6日期间,病患20286940的所有检验结果指标记录的检测人为58375381的检验指标流水号分别是多少? | 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 table_28281704_1 (
country VARCHAR,
stadium VARCHAR
) | Name the country for lusail national stadium | SELECT country FROM table_28281704_1 WHERE stadium = "Lusail National stadium" | sql_create_context |
CREATE TABLE transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
eventtype text,
careunit text,
wardid number,
intime time,
outtime time
)
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
... | count the number of current patients whose age is in their 30s. | SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.dischtime IS NULL AND admissions.age BETWEEN 30 AND 39 | mimic_iii |
CREATE TABLE table_13202 (
"Official Name" text,
"Status" text,
"Area km 2" real,
"Population" real,
"Census Ranking" text
) | What is the Population of the Rural Community | SELECT "Population" FROM table_13202 WHERE "Status" = 'rural community' | wikisql |
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
)
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
) | For those records from the products and each product's manufacturer, visualize the relationship between manufacturer and revenue , and group by attribute founder. | SELECT Manufacturer, Revenue FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder | nvbench |
CREATE TABLE table_66485 (
"Rank" real,
"Athlete" text,
"Country" text,
"Time" text,
"Notes" text
) | What is the sum of the ranks for bulgaria? | SELECT SUM("Rank") FROM table_66485 WHERE "Country" = 'bulgaria' | wikisql |
CREATE TABLE university (
School_ID int,
School text,
Location text,
Founded real,
Affiliation text,
Enrollment real,
Nickname text,
Primary_conference text
)
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Per... | Give me the comparison about ACC_Percent over the Team_Name by a bar chart. | SELECT Team_Name, ACC_Percent FROM basketball_match | nvbench |
CREATE TABLE table_29847 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
) | Where was the game played when the record was 16 11? | SELECT "Location Attendance" FROM table_29847 WHERE "Record" = '16–11' | wikisql |
CREATE TABLE course_offering (
offering_id int,
course_id int,
semester int,
section_number int,
start_time time,
end_time time,
monday varchar,
tuesday varchar,
wednesday varchar,
thursday varchar,
friday varchar,
saturday varchar,
sunday varchar,
has_final_proje... | Dr. Sheila Coursey is teaching which classes next semester ? | SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, instructor, offering_instructor, semester WHERE course.course_id = course_offering.course_id AND instructor.name LIKE '%Sheila Coursey%' AND offering_instructor.instructor_id = instructor.instructor_id AND offering_instructor.of... | advising |
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... | 看看08-07-09到18-11-02这段时间,妇科肿瘤外科开掉多少药品111462 | SELECT COUNT(*) FROM t_kc22 WHERE MED_ORG_DEPT_NM = '妇科肿瘤科' AND STA_DATE BETWEEN '2008-07-09' AND '2018-11-02' AND SOC_SRT_DIRE_CD = '111462' | css |
CREATE TABLE table_name_45 (
day_3 VARCHAR,
day_4 VARCHAR
) | What is the day 3 when day 4 is fr.? | SELECT day_3 FROM table_name_45 WHERE day_4 = "fr." | sql_create_context |
CREATE TABLE table_name_49 (
gender VARCHAR,
decile VARCHAR,
local_board VARCHAR,
roll VARCHAR
) | What gender has a local board of albert eden with a roll of more than 232 and Decile of 5? | SELECT gender FROM table_name_49 WHERE local_board = "albert–eden" AND roll > 232 AND decile = "5" | sql_create_context |
CREATE TABLE table_80145 (
"Year" real,
"Number" real,
"Team" text,
"Co-driver" text,
"Position" text,
"Laps" real
) | What is the fewest laps for a team with a position of DNF and a number smaller than 25 before 2001? | SELECT MIN("Laps") FROM table_80145 WHERE "Position" = 'dnf' AND "Number" < '25' AND "Year" < '2001' | wikisql |
CREATE TABLE table_name_2 (
date VARCHAR,
city_location VARCHAR,
round VARCHAR
) | What day was the location Cleveland, Ohio in Round 6? | SELECT date FROM table_name_2 WHERE city_location = "cleveland, ohio" AND round = 6 | sql_create_context |
CREATE TABLE table_20311 (
"Week #" text,
"Theme" text,
"Song choice" text,
"Original artist" text,
"Order #" text,
"Result" text
) | Who was the original artist when the order number is 9? | SELECT "Original artist" FROM table_20311 WHERE "Order #" = '9' | wikisql |
CREATE TABLE PostNotices (
Id number,
PostId number,
PostNoticeTypeId number,
CreationDate time,
DeletionDate time,
ExpiryDate time,
Body text,
OwnerUserId number,
DeletionUserId number
)
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE SuggestedEditVotes (
... | Top 200 users from Norway. | SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation FROM Users WHERE LOWER(Location) LIKE '%norway%' ORDER BY Reputation DESC LIMIT 200 | sede |
CREATE TABLE class_of_service (
booking_class varchar,
rank int,
class_description text
)
CREATE TABLE equipment_sequence (
aircraft_code_sequence varchar,
aircraft_code varchar
)
CREATE TABLE days (
days_code varchar,
day_name varchar
)
CREATE TABLE state (
state_code text,
state... | please show me all round trip flights from BURBANK to TACOMA | 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 (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'TACOMA' AND NOT fare.round_trip_cost IS NULL AND flight_fare.fare_id =... | atis |
CREATE TABLE table_76389 (
"Date" text,
"Tournament" text,
"Surface" text,
"Opponent in the final" text,
"Score" text
) | What is the surface of the tournament with c dric pioline as the opponent in the final? | SELECT "Surface" FROM table_76389 WHERE "Opponent in the final" = 'cédric pioline' | wikisql |
CREATE TABLE table_name_5 (
laps INTEGER,
time VARCHAR
) | What is the largest lap number when the time was +31.982? | SELECT MAX(laps) FROM table_name_5 WHERE time = "+31.982" | sql_create_context |
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 (... | give me the number of patients whose age is less than 83 and drug code is fent100t? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.age < "83" AND prescriptions.formulary_drug_cd = "FENT100T" | mimicsql_data |
CREATE TABLE table_name_73 (
location VARCHAR,
date VARCHAR
) | What is the Location of the Game on October 8? | SELECT location FROM table_name_73 WHERE date = "october 8" | sql_create_context |
CREATE TABLE table_1965 (
"#" real,
"Player" text,
"Country" text,
"Points" real,
"Events" real,
"Reset Points" real
) | Name the number for fiji | SELECT "#" FROM table_1965 WHERE "Country" = 'Fiji' | wikisql |
CREATE TABLE table_18395 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" text,
"Result" text,
"Candidates" text
) | Who was featured in the election of charles edward bennett redistricted from 2nd? | SELECT "Candidates" FROM table_18395 WHERE "Incumbent" = 'Charles Edward Bennett Redistricted from 2nd' | wikisql |
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE cost (
c... | on the first intensive care unit visit, when was the last time that the sao2 of patient 030-77184 was less than 96.0? | SELECT vitalperiodic.observationtime FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '030-77184') AND NOT patient.unitdischargetime IS NU... | eicu |
CREATE TABLE table_76611 (
"Club" text,
"Played" text,
"Drawn" text,
"Lost" text,
"Points for" text,
"Points against" text,
"Tries for" text,
"Tries against" text,
"Try bonus" text
) | What is the points number when 20 shows for played, and lost is 0? | SELECT "Points for" FROM table_76611 WHERE "Played" = '20' AND "Lost" = '0' | wikisql |
CREATE TABLE table_name_69 (
conference VARCHAR,
division VARCHAR,
home_stadium VARCHAR
) | What is the name of the Conference which Division is south, and the Home Stadium is georgia dome? | SELECT conference FROM table_name_69 WHERE division = "south" AND home_stadium = "georgia dome" | sql_create_context |
CREATE TABLE table_69103 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Attendance" text,
"Record" text
) | Which record has a Date of august 28? | SELECT "Record" FROM table_69103 WHERE "Date" = 'august 28' | wikisql |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE procedures (
... | how many male patients had open and other replacement of aortic valve with tissue graft procedure? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.gender = "M" AND procedures.long_title = "Open and other replacement of aortic valve with tissue graft" | mimicsql_data |
CREATE TABLE Student_Course_Enrolment (
registration_id INTEGER,
student_id INTEGER,
course_id INTEGER,
date_of_enrolment DATETIME,
date_of_completion DATETIME
)
CREATE TABLE Students (
student_id INTEGER,
date_of_registration DATETIME,
date_of_latest_logon DATETIME,
login_name VARC... | Visualize the relationship between author_tutor_ATB and gender_mf . | SELECT author_tutor_ATB, gender_mf FROM Course_Authors_and_Tutors ORDER BY personal_name | nvbench |
CREATE TABLE table_203_497 (
id number,
"rank" number,
"nation" text,
"gold" number,
"silver" number,
"bronze" number,
"total" number
) | what was the number of silver medals won by pakistan ? | SELECT "silver" FROM table_203_497 WHERE "nation" = 'pakistan' | squall |
CREATE TABLE table_28059992_5 (
pick__number INTEGER
) | What is the highest numbered draft pick? | SELECT MAX(pick__number) FROM table_28059992_5 | sql_create_context |
CREATE TABLE train (
Train_ID int,
Name text,
Time text,
Service text
)
CREATE TABLE train_station (
Train_ID int,
Station_ID int
)
CREATE TABLE station (
Station_ID int,
Name text,
Annual_entry_exit real,
Annual_interchanges real,
Total_Passengers real,
Location text,
... | Show the names and total passengers for all train stations not in London Visualize by bar chart, rank y axis in desc order. | SELECT Name, Total_Passengers FROM station WHERE Location <> 'London' ORDER BY Total_Passengers DESC | nvbench |
CREATE TABLE table_70046 (
"Round" real,
"Pick #" real,
"Overall" real,
"Name" text,
"Position" text,
"College" text
) | What is the lowest round a fullback went in? | SELECT MIN("Round") FROM table_70046 WHERE "Position" = 'fullback' | wikisql |
CREATE TABLE all_documents (
document_id number,
date_stored time,
document_type_code text,
document_name text,
document_description text,
other_details text
)
CREATE TABLE document_locations (
document_id number,
location_code text,
date_in_location_from time,
date_in_locaton_t... | What are the names of the employees who authorised the destruction and the employees who destroyed the corresponding documents? | SELECT T2.employee_name, T3.employee_name FROM documents_to_be_destroyed AS T1 JOIN employees AS T2 ON T1.destruction_authorised_by_employee_id = T2.employee_id JOIN employees AS T3 ON T1.destroyed_by_employee_id = T3.employee_id | spider |
CREATE TABLE table_name_53 (
date VARCHAR,
record VARCHAR
) | On what date was the record 2 1? | SELECT date FROM table_name_53 WHERE record = "2–1" | sql_create_context |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.