context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE table_54596 ( "Player" text, "Position" text, "School" text, "Hometown" text, "College" text )
What is the hometown for the player that is defensive back and went to alabama?
SELECT "Hometown" FROM table_54596 WHERE "Position" = 'defensive back' AND "College" = 'alabama'
wikisql
CREATE TABLE instructor ( instructor_id int, name varchar, uniqname varchar ) CREATE TABLE student ( student_id int, lastname varchar, firstname varchar, program_id int, declare_major varchar, total_credit int, total_gpa float, entered_as varchar, admit_term int, pre...
How many 200 -level classes are in the Spring or Summer term ?
SELECT COUNT(DISTINCT course.course_id, semester.semester) FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND course.department = 'EECS' AND course.number BETWEEN 200 AND 200 + 100 AND semester.semester IN ('SP', 'SS', 'SU') AND semester.semester_id = course_offering.semester ...
advising
CREATE TABLE table_name_40 ( result VARCHAR, first_elected VARCHAR, incumbent VARCHAR )
What was the result for james o'h. patterson when first elected in 1904?
SELECT result FROM table_name_40 WHERE first_elected = "1904" AND incumbent = "james o'h. patterson"
sql_create_context
CREATE TABLE table_name_39 ( bronze INTEGER, total VARCHAR, silver VARCHAR, gold VARCHAR )
What is the highest Bronze with a Silver greater than 0 and a Gold of 7 and a total less than 29
SELECT MAX(bronze) FROM table_name_39 WHERE silver > 0 AND gold = 7 AND total < 29
sql_create_context
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 real ) CREATE TABLE phone_market ( Market_ID int, Phone_ID text, Num_of_stoc...
Show different carriers of phones together with the number of phones with each carrier Plot them as bar chart, I want to list from high to low by the X-axis.
SELECT Carrier, COUNT(*) FROM phone GROUP BY Carrier ORDER BY Carrier DESC
nvbench
CREATE TABLE qtb ( CLINIC_ID 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, INSU_TYPE text, IN...
不高于23岁的病人的医疗记录的医疗费总额是多少?计算出平均值
SELECT AVG(t_kc24.MED_AMOUT) FROM t_kc24 WHERE t_kc24.MED_CLINIC_ID IN (SELECT qtb.MED_CLINIC_ID FROM qtb WHERE qtb.PERSON_AGE <= 23 UNION SELECT gyb.MED_CLINIC_ID FROM gyb WHERE gyb.PERSON_AGE <= 23 UNION SELECT zyb.MED_CLINIC_ID FROM zyb WHERE zyb.PERSON_AGE <= 23 UNION SELECT mzb.MED_CLINIC_ID FROM mzb WHERE mzb.PER...
css
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...
患者53311855自二零零四年八月二日开始,截止到二零一七年一月二十九日,由哪几位医务人员为其检测二氧化碳的,查查这些医务人员的工号及姓名
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_name_44 ( built INTEGER, entered_service VARCHAR, knots VARCHAR )
What is the most recent built year when the year of entering service was more recent than 2003, and the knots is less than 27?
SELECT MAX(built) FROM table_name_44 WHERE entered_service > 2003 AND knots < 27
sql_create_context
CREATE TABLE table_name_13 ( outcome VARCHAR, date__final_ VARCHAR )
What was the outcome of the match on February 17, 2003?
SELECT outcome FROM table_name_13 WHERE date__final_ = "february 17, 2003"
sql_create_context
CREATE TABLE TRANSACTIONS ( investor_id VARCHAR, share_count INTEGER ) CREATE TABLE INVESTORS ( Investor_details VARCHAR, investor_id VARCHAR )
Show details of all investors if they make any transaction with share count greater than 100.
SELECT T1.Investor_details FROM INVESTORS AS T1 JOIN TRANSACTIONS AS T2 ON T1.investor_id = T2.investor_id WHERE T2.share_count > 100
sql_create_context
CREATE TABLE table_36302 ( "Distribution" text, "x86-64" text, "ia64" text, "ppc64" text, "sparc32" text, "hppa" text, "mips" text, "s390" text, "s390x" text, "alpha" text, "m68k" text )
Which hppa contains a ppc64 of yes 3+, no for mips and no for alpha?
SELECT "hppa" FROM table_36302 WHERE "mips" = 'no' AND "alpha" = 'no' AND "ppc64" = 'yes 3+'
wikisql
CREATE TABLE table_46968 ( "Municipality" text, "Population" real, "Inhabitants per km\u00b2" real, "Area (in km\u00b2)" real, "Markatal" real, "Island" text, "Region" text )
What is the average Area (in km ), when Markatal is less than 0?
SELECT AVG("Area (in km\u00b2)") FROM table_46968 WHERE "Markatal" < '0'
wikisql
CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) 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 departments ( DEPARTME...
For those employees who did not have any job in the past, give me the comparison about the average of manager_id over the hire_date bin hire_date by time by a bar chart, rank in ascending by the y axis.
SELECT HIRE_DATE, AVG(MANAGER_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) ORDER BY AVG(MANAGER_ID)
nvbench
CREATE TABLE table_22815568_7 ( unemployment_rate VARCHAR, market_income_per_capita VARCHAR )
What is the unemployment rate in those places where the market income per capita is $16,981?
SELECT COUNT(unemployment_rate) FROM table_22815568_7 WHERE market_income_per_capita = "$16,981"
sql_create_context
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...
在患者75572641的医疗记录中,医院给他开出的药物金额多于5155.81元的医疗就诊编号是什么
SELECT gwyjzb.MED_CLINIC_ID FROM gwyjzb WHERE gwyjzb.PERSON_ID = '75572641' AND gwyjzb.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT > 5155.81) UNION SELECT fgwyjzb.MED_CLINIC_ID FROM fgwyjzb WHERE fgwyjzb.PERSON_ID = '75572641' AND fgwyjzb.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID F...
css
CREATE TABLE table_6843 ( "Position" text, "Name" text, "Height (cm)" real, "Weight (kg)" real, "Birthdate" text, "Birthplace" text, "1997\u20131998 Team" text )
What is the sum of Weight for the person born in virginia, minnesota?
SELECT SUM("Weight (kg)") FROM table_6843 WHERE "Birthplace" = 'virginia, minnesota'
wikisql
CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number...
what was the name of the procedure that patient 5310 received two or more times last month.
SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT t1.icd9_code FROM (SELECT procedures_icd.icd9_code, COUNT(procedures_icd.charttime) AS c1 FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 531...
mimic_iii
CREATE TABLE table_16730 ( "Rnd" real, "Race" text, "Date" text, "Location" text, "Pole Position" text, "Fastest Lap" text, "Race Winner" text, "Constructor" text, "Report" text )
How many races had the pole position Alain Prost and the race winner Keke Rosberg?
SELECT COUNT("Race") FROM table_16730 WHERE "Pole Position" = 'Alain Prost' AND "Race Winner" = 'Keke Rosberg'
wikisql
CREATE TABLE table_name_5 ( vol__number INTEGER, publication_date VARCHAR )
What's the Lowest Volume Number that was published November 2004?
SELECT MIN(vol__number) FROM table_name_5 WHERE publication_date = "november 2004"
sql_create_context
CREATE TABLE table_68433 ( "Date" text, "City" text, "Event" text, "Winner" text, "Prize" text )
Who is the winner of the prize of 200,000 as listed?
SELECT "Winner" FROM table_68433 WHERE "Prize" = '£200,000'
wikisql
CREATE TABLE table_name_20 ( wins VARCHAR, f_laps VARCHAR, team VARCHAR )
what is the wins when the f/laps is test driver and team is lotus racing?
SELECT wins FROM table_name_20 WHERE f_laps = "test driver" AND team = "lotus racing"
sql_create_context
CREATE TABLE table_202_285 ( id number, "city" text, "country (noc)" text, "round 1" number, "run-off" number, "round 3" number, "round 4" number, "round 5" number )
how many more votes did athens receive than stockholm in round 1 ?
SELECT (SELECT "round 1" FROM table_202_285 WHERE "city" = 'athens') - (SELECT "round 1" FROM table_202_285 WHERE "city" = 'stockholm')
squall
CREATE TABLE table_61607 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text )
What is Australia's score where they were in place t1?
SELECT "Score" FROM table_61607 WHERE "Country" = 'australia' AND "Place" = 't1'
wikisql
CREATE TABLE field ( fieldid int ) CREATE TABLE paper ( paperid int, title varchar, venueid int, year int, numciting int, numcitedby int, journalid int ) CREATE TABLE paperdataset ( paperid int, datasetid int ) CREATE TABLE journal ( journalid int, journalname varchar ...
venue for Semantic Parsing
SELECT DISTINCT paper.venueid FROM keyphrase, paper, paperkeyphrase WHERE keyphrase.keyphrasename = 'Semantic Parsing' AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paper.paperid = paperkeyphrase.paperid
scholar
CREATE TABLE time_interval ( period text, begin_time int, end_time int ) CREATE TABLE state ( state_code text, state_name text, country_name text ) CREATE TABLE restriction ( restriction_code text, advance_purchase int, stopovers text, saturday_stay_required text, minimum_s...
i need flight information leaving ATLANTA and arriving in BALTIMORE for monday
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BALTIMORE' AND date_day.day_number = 21 AND date_day.month_number = 2 AND...
atis
CREATE TABLE table_name_86 ( year_made INTEGER, wheel_arrangement VARCHAR )
Which of the lowest years had a Wheel arrangement that was 0-4-2t?
SELECT MIN(year_made) FROM table_name_86 WHERE wheel_arrangement = "0-4-2t"
sql_create_context
CREATE TABLE table_11318462_5 ( open_1st_viii VARCHAR, u15_4th_iv VARCHAR )
what are all the open 1st viii with u15 4th iv being gt
SELECT open_1st_viii FROM table_11318462_5 WHERE u15_4th_iv = "GT"
sql_create_context
CREATE TABLE table_name_37 ( score VARCHAR, date VARCHAR )
Which score happened on 11 february 1996?
SELECT score FROM table_name_37 WHERE date = "11 february 1996"
sql_create_context
CREATE TABLE table_name_23 ( opponent VARCHAR, date VARCHAR )
Who was the opponent team on September 30, 1990?
SELECT opponent FROM table_name_23 WHERE date = "september 30, 1990"
sql_create_context
CREATE TABLE table_27157 ( "Year" real, "Mens singles" text, "Womens singles" text, "Mens doubles" text, "Womens doubles" text, "Mixed doubles" text )
Who played Mixed Doubles in 1991?
SELECT "Mixed doubles" FROM table_27157 WHERE "Year" = '1991'
wikisql
CREATE TABLE table_27046 ( "Episode" real, "First Air Date" text, "Rating (18\u201349)" text, "Share (18\u201349)" real, "Viewers (millions)" text, "Rank (timeslot)" text, "Rank (night)" text )
How many episodes had 11.47 million viewers?
SELECT COUNT("Episode") FROM table_27046 WHERE "Viewers (millions)" = '11.47'
wikisql
CREATE TABLE program_course ( program_id int, course_id int, workload int, category 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 int, g...
What are the names of the HISTORY classes that count as PreMajor ?
SELECT DISTINCT course.department, course.name, course.number FROM course, program, program_course WHERE course.department LIKE '%HISTORY%' AND program_course.category LIKE '%PreMajor%' AND program_course.course_id = course.course_id AND program.name LIKE '%CS-LSA%' AND program.program_id = program_course.program_id
advising
CREATE TABLE table_name_14 ( events INTEGER, cuts_made VARCHAR, top_25 VARCHAR )
What is the lowest events that have 17 as the cuts made, with a top-25 less than 8?
SELECT MIN(events) FROM table_name_14 WHERE cuts_made = 17 AND top_25 < 8
sql_create_context
CREATE TABLE table_15875 ( "Player" text, "No." text, "Nationality" text, "Position" text, "Years in Toronto" text, "School/Club Team" text )
During which years was Marcus Banks in Toronto?
SELECT "Years in Toronto" FROM table_15875 WHERE "Player" = 'Marcus Banks'
wikisql
CREATE TABLE table_name_85 ( t_papadopoulos VARCHAR, i_kasoulidis VARCHAR )
What was the percentage for T. Papadopoulos when I. Kasoulidis was 27.1%?
SELECT t_papadopoulos FROM table_name_85 WHERE i_kasoulidis = "27.1%"
sql_create_context
CREATE TABLE table_2114238_1 ( archive VARCHAR, run_time VARCHAR )
Which archive has a run time of 23:48?
SELECT archive FROM table_2114238_1 WHERE run_time = "23:48"
sql_create_context
CREATE TABLE table_name_20 ( year_made VARCHAR, manufacturer VARCHAR )
what is the year made when the manufacturer is 2-6-2 oooo mogul?
SELECT year_made FROM table_name_20 WHERE manufacturer = "2-6-2 — oooo — mogul"
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...
what is ethnicity of subject id 18351?
SELECT demographic.ethnicity FROM demographic WHERE demographic.subject_id = "18351"
mimicsql_data
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...
what is minimum days of hospital stay of patients whose primary disease is colangitis?
SELECT MIN(demographic.days_stay) FROM demographic WHERE demographic.diagnosis = "COLANGITIS"
mimicsql_data
CREATE TABLE table_16076 ( "Round" real, "Choice" real, "Overall" real, "Player name" text, "Position" text, "College" text )
Where does the defensive back position appear first?
SELECT MIN("Round") FROM table_16076 WHERE "Position" = 'Defensive Back'
wikisql
CREATE TABLE zyjybgb ( BBCJBW text, BBDM text, BBMC text, BBZT number, BGDH number, 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, ...
病患华文康做的检查里哪些编号检验报告单对应的检验结果的全部指标都是正常的?上面的单号具体是多少?
SELECT zyjybgb.BGDH FROM person_info JOIN hz_info JOIN mzjzjlb JOIN zyjybgb 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_MZJZJLB WHERE person_info.XM = '华文康' ...
css
CREATE TABLE department ( dept_code text, dept_name text, school_code text, emp_num number, dept_address text, dept_extension text ) CREATE TABLE professor ( emp_num number, dept_code text, prof_office text, prof_extension text, prof_high_degree text ) CREATE TABLE employee...
How many professors attained either Ph.D. or Masters degrees?
SELECT COUNT(*) FROM professor WHERE prof_high_degree = 'Ph.D.' OR prof_high_degree = 'MA'
spider
CREATE TABLE table_name_74 ( points VARCHAR, year VARCHAR, entrant VARCHAR, chassis VARCHAR )
What is the number of points for the Entrant of wolfgang seidel and a Cooper t45 chassis later than 1960?
SELECT COUNT(points) FROM table_name_74 WHERE entrant = "wolfgang seidel" AND chassis = "cooper t45" AND year > 1960
sql_create_context
CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time, drug text, dose_val_rx text, dose_unit_rx text, route text ) CREATE TABLE pat...
how many patients had docusate sodium (liquid) prescriptions in the same hospital visit after being diagnosed with chf nos, the previous year?
SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, diagnoses_icd.charttime, admissions.hadm_id FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title =...
mimic_iii
CREATE TABLE table_24334163_1 ( Winners INTEGER, total_money_won VARCHAR )
What is the highest amount of group legs won when the prize money was 21,850?
SELECT MAX(Winners) AS group_legs_won FROM table_24334163_1 WHERE total_money_won = "£21,850"
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 prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, ...
james sloan has been diagnosed for what disease?
SELECT diagnoses.short_title FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.name = "James Sloan"
mimicsql_data
CREATE TABLE table_16506 ( "Team" text, "Outgoing manager" text, "Manner of departure" text, "Date of vacancy" text, "Replaced by" text, "Date of appointment" text, "Position" text )
Which team has the outgoing manager John Meyler?
SELECT "Team" FROM table_16506 WHERE "Outgoing manager" = 'John Meyler'
wikisql
CREATE TABLE table_name_13 ( visitor VARCHAR, date VARCHAR )
What is Visitor, when Date is 'May 9'?
SELECT visitor FROM table_name_13 WHERE date = "may 9"
sql_create_context
CREATE TABLE table_name_67 ( team__number2 VARCHAR )
what is the 2nd leg when team #2 is algiris kaunas?
SELECT 2 AS nd_leg FROM table_name_67 WHERE team__number2 = "žalgiris kaunas"
sql_create_context
CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId number, OwnerDisplayName text, LastEditorUserId number, LastEditorDisplayName text...
VTC: strong hint of cross-post.
SELECT Id AS "post_link", Title FROM Posts WHERE Body LIKE '%down vote favorite%'
sede
CREATE TABLE table_name_42 ( record VARCHAR, score VARCHAR )
What was the record at the game with a score of 7 5?
SELECT record FROM table_name_42 WHERE score = "7–5"
sql_create_context
CREATE TABLE table_60072 ( "Players" text, "Position" text, "Year" text, "Ht/Wt" text, "Bats/Throws" text, "Hometown (Last School)" text )
What is Jake Johnson's position?
SELECT "Position" FROM table_60072 WHERE "Players" = 'jake johnson'
wikisql
CREATE TABLE table_25429986_1 ( horse VARCHAR, position VARCHAR )
what horse is in the 6th position?
SELECT horse FROM table_25429986_1 WHERE position = "6th"
sql_create_context
CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) CREATE TABLE FlagTypes ( Id number, Name text, Description text ) CREATE T...
Q:A ratio for recent users.
SELECT Id AS "user_link", LastAccessDate, CASE ANSWERS WHEN 0 THEN 'infinity' ELSE CAST(ROUND(QUESTIONS / CAST(ANSWERS AS FLOAT), 2) AS TEXT) END AS "Q:A ratio" FROM (SELECT u.Id, u.LastAccessDate, SUM(CASE p.PostTypeId WHEN 1 THEN 1 ELSE 0 END) AS "Questions", SUM(CASE p.PostTypeId WHEN 2 THEN 1 ELSE 0 END) AS "Answer...
sede
CREATE TABLE table_name_31 ( frequency INTEGER, webcast VARCHAR, callsign VARCHAR )
Which Frequency has a Webcast of , and a Callsign of xemr?
SELECT AVG(frequency) FROM table_name_31 WHERE webcast = "•" AND callsign = "xemr"
sql_create_context
CREATE TABLE table_72908 ( "Class" text, "Part 1" text, "Part 2" text, "Part 3" text, "Part 4" text, "Verb meaning" text )
What is the part 4 of the word with the part 1 'heizan'?
SELECT "Part 4" FROM table_72908 WHERE "Part 1" = 'heizan'
wikisql
CREATE TABLE EMPLOYEE ( EMP_NUM int, EMP_LNAME varchar(15), EMP_FNAME varchar(12), EMP_INITIAL varchar(1), EMP_JOBCODE varchar(5), EMP_HIREDATE datetime, EMP_DOB datetime ) CREATE TABLE COURSE ( CRS_CODE varchar(10), DEPT_CODE varchar(10), CRS_DESCRIPTION varchar(35), CRS_CR...
Visualize a bar chart for how many hours do the students spend studying in each department?, and could you display by the bar in ascending?
SELECT DEPT_CODE, SUM(STU_HRS) FROM STUDENT GROUP BY DEPT_CODE ORDER BY DEPT_CODE
nvbench
CREATE TABLE table_57194 ( "Rank" real, "Constituency" text, "Winning party 2007" text, "Swing to gain" real, "Labour's place 2007" text, "Result" text )
What was the result of rank 1?
SELECT "Result" FROM table_57194 WHERE "Rank" = '1'
wikisql
CREATE TABLE table_train_21 ( "id" int, "pregnancy_or_lactation" bool, "severe_sepsis" bool, "systolic_blood_pressure_sbp" int, "active_infection" bool, "limited_care" bool, "septic_shock" bool, "coagulopathy" bool, "age" float, "lactate" int, "NOUSE" float )
this will include patients that have 2 / 4 systemic inflammatory response syndrome criteria, a suspected infection and either a initial serum lactate > 4 mmol / l or a initial systolic blood pressure < 90 millimeters of mercury.
SELECT * FROM table_train_21 WHERE active_infection = 1 AND (lactate > 4 OR systolic_blood_pressure_sbp < 90)
criteria2sql
CREATE TABLE table_name_64 ( player VARCHAR, mls_team VARCHAR )
Tell me the player from dallas burn
SELECT player FROM table_name_64 WHERE mls_team = "dallas burn"
sql_create_context
CREATE TABLE table_56703 ( "Region" text, "Date" text, "Label" text, "Format" text, "Catalog #" text )
What is the label for the album with a catalog number of 83061-2?
SELECT "Label" FROM table_56703 WHERE "Catalog #" = '83061-2'
wikisql
CREATE TABLE table_42266 ( "Year" real, "Competition" text, "Venue" text, "Position" text, "Event" text )
What is the highest Year, when the Venue is Beijing, PR China?
SELECT MAX("Year") FROM table_42266 WHERE "Venue" = 'beijing, pr china'
wikisql
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 prescriptions...
mention the admission type and death status of the patient with patient id 2560.
SELECT demographic.admission_type, demographic.expire_flag FROM demographic WHERE demographic.subject_id = "2560"
mimicsql_data
CREATE TABLE faculty ( facid number, lname text, fname text, rank text, sex text, phone number, room text, building text ) CREATE TABLE activity ( actid number, activity_name text ) CREATE TABLE faculty_participates_in ( facid number, actid number ) CREATE TABLE partic...
What is the total number of faculty members?
SELECT COUNT(*) FROM faculty
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, show me about the distribution of name and code , and group by attribute headquarter in a bar chart, could you show bar from high to low order please?
SELECT T1.Name, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter, T1.Name ORDER BY T1.Name DESC
nvbench
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 )
Find the total revenue of companies of each founder Visualize by bar chart, and display bars in asc order.
SELECT Founder, SUM(Revenue) FROM Manufacturers GROUP BY Founder ORDER BY Founder
nvbench
CREATE TABLE party ( Party_ID int, Minister text, Took_office text, Left_office text, Region_ID int, Party_name text ) CREATE TABLE party_events ( Event_ID int, Event_Name text, Party_ID int, Member_in_charge_ID int ) CREATE TABLE region ( Region_ID int, Region_name tex...
How many parties of the time they leave office, binning the leave office into WEEKDAY interval, show by the y-axis in ascending.
SELECT Left_office, COUNT(Left_office) FROM party ORDER BY COUNT(Left_office)
nvbench
CREATE TABLE table_80369 ( "Date" text, "Round" text, "Opponent" text, "Venue" text, "Result" text, "Attendance" real, "Scorers" text )
What venue was on 27 May 2000?
SELECT "Venue" FROM table_80369 WHERE "Date" = '27 may 2000'
wikisql
CREATE TABLE table_203_393 ( id number, "year" number, "film" text, "director" text, "cast" text, "details" text )
which film won the most awards ?
SELECT "film" FROM table_203_393 ORDER BY "details" DESC LIMIT 1
squall
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) ...
Among patients admitted before 2156, how many of them had icd9 code 9744?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admityear < "2156" AND procedures.icd9_code = "9744"
mimicsql_data
CREATE TABLE table_2546 ( "High School" text, "Type" text, "Established" real, "Enrollment" real, "Mascot" text, "WIAA Classification" text )
how many wiaa classifications does fort vancouver high school have?
SELECT COUNT("WIAA Classification") FROM table_2546 WHERE "High School" = 'Fort Vancouver'
wikisql
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 jyjgzbb ( BGDH text, BGRQ tim...
患者华红豆自二零一七年十二月二日开始,截止到二零二零年二月十六日,由哪几位医务人员为其检测游离β-绒毛膜促性腺激素的,查查这些医务人员的工号及姓名
SELECT jyjgzbb.JCRGH, jyjgzbb.JCRXM FROM person_info JOIN hz_info JOIN wdmzjzjlb JOIN jybgb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND 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_MZ...
css
CREATE TABLE table_name_53 ( venue VARCHAR, home_team VARCHAR )
If the home team was footscray which venue did they play it?
SELECT venue FROM table_name_53 WHERE home_team = "footscray"
sql_create_context
CREATE TABLE table_name_33 ( starts INTEGER, cuts_made VARCHAR, top_10 VARCHAR )
What is the average number of starts when 11 cuts were made and the top 10 ranking is larger than 4?
SELECT AVG(starts) FROM table_name_33 WHERE cuts_made = 11 AND top_10 > 4
sql_create_context
CREATE TABLE table_41622 ( "City" text, "Country" text, "IATA" text, "ICAO" text, "Airport" text )
What is the IATA for Benghazi, Libya?
SELECT "IATA" FROM table_41622 WHERE "Country" = 'libya' AND "City" = 'benghazi'
wikisql
CREATE TABLE table_7413 ( "Tournament" text, "1995" text, "1996" text, "1997" text, "1998" text, "1999" text, "2000" text, "2001" text, "2002" text, "2003" text, "2004" text, "2005" text, "2006" text )
In the Hamburg Masters Tournament, during which Ji Nov k was absent(A) in 1996, how did he do in 2003?
SELECT "2003" FROM table_7413 WHERE "1996" = 'a' AND "Tournament" = 'hamburg masters'
wikisql
CREATE TABLE table_name_94 ( result VARCHAR, time___et__ VARCHAR, location VARCHAR )
What is the result of the game at the Shea Stadium at 12:30pm (ET)?
SELECT result FROM table_name_94 WHERE time___et__ = "12:30pm" AND location = "shea stadium"
sql_create_context
CREATE TABLE table_61255 ( "Team" text, "Played" real, "Draw" real, "Lost" real, "Goals Scored" real, "Goals Conceded" real, "Points" text )
Count the Draw which has Lost of 0, and a Goals Scored larger than 0?
SELECT SUM("Draw") FROM table_61255 WHERE "Lost" = '0' AND "Goals Scored" > '0'
wikisql
CREATE TABLE table_name_29 ( date VARCHAR, score VARCHAR )
When did the score of 2-0 take place?
SELECT date FROM table_name_29 WHERE score = "2-0"
sql_create_context
CREATE TABLE table_35437 ( "Team" text, "Outgoing manager" text, "Manner of departure" text, "Date of vacancy" text, "Last match" text, "Replaced by" text )
What is the last match with a vacancy date of round 2 and Ney Franco as outgoing manager?
SELECT "Last match" FROM table_35437 WHERE "Date of vacancy" = 'round 2' AND "Outgoing manager" = 'ney franco'
wikisql
CREATE TABLE table_name_48 ( name VARCHAR, out_of VARCHAR, source VARCHAR, rank VARCHAR )
Which Name had the Source, World Bank, and a Rank smaller than 110, Out of a number smaller than 199?
SELECT name FROM table_name_48 WHERE source = "world bank" AND rank < 110 AND out_of < 199
sql_create_context
CREATE TABLE area ( course_id int, area varchar ) CREATE TABLE ta ( campus_job_id int, student_id int, location varchar ) CREATE TABLE course ( course_id int, name varchar, department varchar, number varchar, credits varchar, advisory_requirement varchar, enforced_requi...
Is 441 being taught by Prof. Domenic Desocio next Winter ?
SELECT COUNT(*) > 0 FROM course, course_offering, instructor, offering_instructor, semester WHERE course.course_id = course_offering.course_id AND course.department = 'EECS' AND course.number = 441 AND instructor.name LIKE '%Domenic Desocio%' AND offering_instructor.instructor_id = instructor.instructor_id AND offering...
advising
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...
列出病人89569884医疗记录中医疗费总额不在6947.2元以下的入院诊断疾病编码和名称
SELECT t_kc24.t_kc21_OUT_DIAG_DIS_CD, t_kc24.t_kc21_OUT_DIAG_DIS_NM FROM t_kc24 WHERE t_kc24.t_kc21_PERSON_ID = '89569884' AND t_kc24.MED_CLINIC_ID IN (SELECT t_kc24.MED_CLINIC_ID FROM t_kc24 WHERE t_kc24.MED_AMOUT >= 6947.2)
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...
provide the number of patients whose ethnicity is american indian/alaska native and lab test name is d-dimer?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.ethnicity = "AMERICAN INDIAN/ALASKA NATIVE" AND lab.label = "D-Dimer"
mimicsql_data
CREATE TABLE table_9191 ( "Date" text, "Tournament" text, "Surface" text, "Partner" text, "Opponents" text, "Score" text )
What type of surface was played on July 27, 2013?
SELECT "Surface" FROM table_9191 WHERE "Date" = 'july 27, 2013'
wikisql
CREATE TABLE FlagTypes ( Id number, Name text, Description text ) CREATE TABLE PostHistory ( Id number, PostHistoryTypeId number, PostId number, RevisionGUID other, CreationDate time, UserId number, UserDisplayName text, Comment text, Text text, ContentLicense text )...
Total Posts, Comments, Answers by Week for Bigcommerce tag.
SELECT DISTINCT (p.Id) FROM Posts AS p INNER JOIN PostTags AS pt ON p.Id = pt.PostId INNER JOIN Tags AS t ON pt.TagId = t.Id INNER JOIN Comments AS c ON c.PostId = p.Id WHERE t.TagName LIKE '%bigcommerce%' AND p.CreationDate >= '2019-01-01'
sede
CREATE TABLE table_12350 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Record" text )
On what date was the score 6 4?
SELECT "Date" FROM table_12350 WHERE "Score" = '6–4'
wikisql
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemics...
count the number of patients who have been prescribed the nitroglycerin sl this year.
SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE patient.patientunitstayid IN (SELECT medication.patientunitstayid FROM medication WHERE medication.drugname = 'nitroglycerin sl' AND DATETIME(medication.drugstarttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year'))
eicu
CREATE TABLE PostHistory ( Id number, PostHistoryTypeId number, PostId number, RevisionGUID other, CreationDate time, UserId number, UserDisplayName text, Comment text, Text text, ContentLicense text ) CREATE TABLE ReviewTasks ( Id number, ReviewTaskTypeId number, Cr...
Users with at least number of downvotes on a site.
SELECT Id AS "user_link", DownVotes FROM Users WHERE DownVotes >= '##minvotes##' AND Id > -1 ORDER BY DownVotes DESC
sede
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, ...
during the previous year what were the top three most frequent diagnoses that patients were diagnosed with within the same hospital visit after being diagnosed with cardiac arrest - witnessed, < 15 minutes cpr?
SELECT t3.diagnosisname FROM (SELECT t2.diagnosisname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime, patient.patienthealthsystemstayid FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'cardi...
eicu
CREATE TABLE table_55962 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Decision" text, "Attendance" real, "Record" text )
Name the least attendance with carolina visitor
SELECT MIN("Attendance") FROM table_55962 WHERE "Visitor" = 'carolina'
wikisql
CREATE TABLE table_55937 ( "Rank" real, "Name" text, "Nation" text, "Placings" text, "Total" real )
What is the sum of all total values for Switzerland?
SELECT SUM("Total") FROM table_55937 WHERE "Nation" = 'switzerland'
wikisql
CREATE TABLE table_30133_3 ( gdp_as_of_2012_after_purchasing_power_parity__ppp__calculations__usd_billions_ VARCHAR )
What is the 1985 value for the year when GDP as of 2012 after PPP was 369.38?
SELECT 1985 FROM table_30133_3 WHERE gdp_as_of_2012_after_purchasing_power_parity__ppp__calculations__usd_billions_ = "369.38"
sql_create_context
CREATE TABLE table_name_65 ( engine_configuration_ VARCHAR, _notes_0_100km_h VARCHAR, model VARCHAR )
What is the engine configuration & notes 0-100km/h with a model with 2.3 t5?
SELECT engine_configuration_ & _notes_0_100km_h FROM table_name_65 WHERE model = "2.3 t5"
sql_create_context
CREATE TABLE table_34787 ( "Pick #" text, "Player" text, "Position" text, "Nationality" text, "NHL team" text, "College/junior/club team" text )
To which college/junior/club team did the player that was Pick 12 belong?
SELECT "College/junior/club team" FROM table_34787 WHERE "Pick #" = '12'
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 list of patients less than 79 years of age who have stayed in the hospital for more than 27 days.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.age < "79" AND demographic.days_stay > "27"
mimicsql_data
CREATE TABLE table_name_89 ( population_estimate_2005 INTEGER, area__km_2__ VARCHAR )
what is the population estimate 2005 for the with the area (km2) 3,034.08?
SELECT AVG(population_estimate_2005) FROM table_name_89 WHERE area__km_2__ = 3 OFFSET 034.08
sql_create_context
CREATE TABLE table_75601 ( "Call sign" text, "Frequency MHz" real, "City of license" text, "ERP W" real, "Class" text, "FCC info" text )
Frequency MHz of 88.7 had what average erp w?
SELECT AVG("ERP W") FROM table_75601 WHERE "Frequency MHz" = '88.7'
wikisql
CREATE TABLE table_train_49 ( "id" int, "consent" bool, "palliative_treatment" bool, "acute_mesenteric_ischemia" bool, "receiving_vasopressor" bool, "septic_shock" bool, "NOUSE" float )
present or suspected acute mesenteric ischemia
SELECT * FROM table_train_49 WHERE acute_mesenteric_ischemia = 1
criteria2sql
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...
Return a bar chart about the distribution of All_Games and ACC_Percent , and could you show in desc by the X-axis?
SELECT All_Games, ACC_Percent FROM basketball_match ORDER BY All_Games DESC
nvbench