context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE table_35374 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Record" text, "Game Site" text, "Attendance" real )
Which result happened more recently than week 2, and had a date of November 30, 1958?
SELECT "Result" FROM table_35374 WHERE "Week" > '2' AND "Date" = 'november 30, 1958'
wikisql
CREATE TABLE table_42276 ( "Week" real, "Date" text, "Opponent" text, "Game Site" text, "Final Score" text, "Record" text, "TV Time" text, "Attendance" text )
What was the final score for the game with 65,309 people in attendance?
SELECT "Final Score" FROM table_42276 WHERE "Attendance" = '65,309'
wikisql
CREATE TABLE table_37373 ( "Date" text, "League position" text, "Opponents" text, "Venue" text, "Result" text, "Score F\u2013A" text, "Attendance" real )
What is the largest number in attendance at H venue opposing Liverpool with a result of D?
SELECT MAX("Attendance") FROM table_37373 WHERE "Venue" = 'h' AND "Result" = 'd' AND "Opponents" = 'liverpool'
wikisql
CREATE TABLE table_56167 ( "Rd #" real, "Pick #" real, "Player" text, "Team (League)" text, "Reg GP" real, "Pl GP" real )
What is the total number of playoff games played by the Seattle Thunderbirds team where the number of regular games played is less than 5 and pick number is less than 131?
SELECT COUNT("Pl GP") FROM table_56167 WHERE "Reg GP" < '5' AND "Team (League)" = 'seattle thunderbirds' AND "Pick #" < '131'
wikisql
CREATE TABLE journal_committee ( Editor_ID int, Journal_ID int, Work_Type text ) CREATE TABLE journal ( Journal_ID int, Date text, Theme text, Sales int ) CREATE TABLE editor ( Editor_ID int, Name text, Age real )
Show the names of editors that are on the committee of journals with sales bigger than 3000, and count them by a pie chart
SELECT Name, COUNT(Name) FROM journal_committee AS T1 JOIN editor AS T2 ON T1.Editor_ID = T2.Editor_ID JOIN journal AS T3 ON T1.Journal_ID = T3.Journal_ID WHERE T3.Sales > 3000 GROUP BY Name
nvbench
CREATE TABLE table_12275654_1 ( year VARCHAR, mens_singles VARCHAR, womens_singles VARCHAR )
How many times did Niels Christian Kaldau win the men's single and Pi Hongyan win the women's single in the same year?
SELECT COUNT(year) FROM table_12275654_1 WHERE mens_singles = "Niels Christian Kaldau" AND womens_singles = "Pi Hongyan"
sql_create_context
CREATE TABLE table_67943 ( "Date" text, "Round" text, "Opponents" text, "Result F\u2013A" text, "Attendance" real )
Name the opponents for round of round 5
SELECT "Opponents" FROM table_67943 WHERE "Round" = 'round 5'
wikisql
CREATE TABLE table_203_157 ( id number, "year" number, "film" text, "role" text, "language" text, "notes" text )
how long has neha been acting ?
SELECT MAX("year") - MIN("year") FROM table_203_157
squall
CREATE TABLE jyjgzbb ( BGDH text, BGRQ time, CKZFWDX text, CKZFWSX number, CKZFWXX number, JCFF text, JCRGH text, JCRXM text, JCXMMC text, JCZBDM text, JCZBJGDL number, JCZBJGDW text, JCZBJGDX text, JCZBMC text, JLDW text, JYRQ time, JYZBLSH text, ...
自09年9月22日起,到11年5月20日为止,医疗机构0695523的转诊门诊有多少就诊记录
SELECT COUNT(*) FROM mzjzjlb JOIN hz_info_mzjzjlb JOIN hz_info ON hz_info_mzjzjlb.JZLSH = mzjzjlb.JZLSH AND hz_info_mzjzjlb.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info_mzjzjlb.JZLSH = mzjzjlb.JZLSH AND hz_info_mzjzjlb.mzjzjlb_id = mzjzjlb.mzjzjlb_id AND hz_info_mzjzjlb.YLJGDM = hz_info.YLJGDM WHERE hz_info.YLJGDM = '06...
css
CREATE TABLE table_24226 ( "Place" real, "Athlete" text, "Long jump" real, "Javelin" real, "200 m" real, "Discus" real, "1500 m" real, "Total" real )
Name the max javelin for 200m for 5
SELECT MAX("Javelin") FROM table_24226 WHERE "200 m" = '5'
wikisql
CREATE TABLE table_56852 ( "Team 1" text, "Agg." text, "Team 2" text, "1st leg" text, "2nd leg" text )
Which Team 2 faced Team 1 from Barcelona?
SELECT "Team 2" FROM table_56852 WHERE "Team 1" = 'barcelona'
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 demographic (...
what is the number of patients with admission type elective and basophil lab test?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_type = "ELECTIVE" AND lab.label = "Basophils"
mimicsql_data
CREATE TABLE table_22470 ( "Township" text, "County" text, "Pop. (2010)" real, "Land ( sqmi )" text, "Water (sqmi)" text, "Latitude" text, "Longitude" text, "GEO ID" real, "ANSI code" real )
What is the geo id of the land at 35.999?
SELECT MAX("GEO ID") FROM table_22470 WHERE "Land ( sqmi )" = '35.999'
wikisql
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 average of manager_id over the job_id , and group by attribute job_id by a bar chart, could you rank in asc by the Y-axis?
SELECT JOB_ID, AVG(MANAGER_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 GROUP BY JOB_ID ORDER BY AVG(MANAGER_ID)
nvbench
CREATE TABLE actor ( actor_id number, name text, musical_id number, character text, duration text, age number ) CREATE TABLE musical ( musical_id number, name text, year number, award text, category text, nominee text, result text )
List the name of actors in ascending alphabetical order.
SELECT name FROM actor ORDER BY name
spider
CREATE TABLE table_5450 ( "Rank" real, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
What is the average total with less than 8 bronze, 3 silver, and a Rank smaller than 2?
SELECT AVG("Total") FROM table_5450 WHERE "Bronze" < '8' AND "Silver" = '3' AND "Rank" < '2'
wikisql
CREATE TABLE table_name_30 ( quantity INTEGER, introduced VARCHAR )
What is the total number of quantity when the introductory year was 1984?
SELECT SUM(quantity) FROM table_name_30 WHERE introduced = 1984
sql_create_context
CREATE TABLE table_48634 ( "Source" text, "Dates administered" text, "Democrat: Christine Gregoire" text, "Republican: Dino Rossi" text, "Lead Margin" real )
What was the percentage for Republican: Dino Rossi when Democrat: Christine Gregoire polled at 53.7% and the lead margin was larger than 7?
SELECT "Republican: Dino Rossi" FROM table_48634 WHERE "Lead Margin" > '7' AND "Democrat: Christine Gregoire" = '53.7%'
wikisql
CREATE TABLE table_name_8 ( player VARCHAR, score VARCHAR )
Which player has a score of 68-69-73=210
SELECT player FROM table_name_8 WHERE score = 68 - 69 - 73 = 210
sql_create_context
CREATE TABLE person_info ( CSD text, CSRQ time, GJDM text, GJMC text, JGDM text, JGMC text, MZDM text, MZMC text, RYBH text, XBDM number, XBMC text, XLDM text, XLMC text, XM text, ZYLBDM text, ZYMC text ) CREATE TABLE zyjzjlb ( CYBQDM text, CYBQMC...
2006-04-21到2010-09-27期间,在小儿耳鼻喉科门诊就诊的人数有多少
SELECT COUNT(*) FROM txmzjzjlb WHERE txmzjzjlb.JZKSMC = '小儿耳鼻喉科' AND txmzjzjlb.JZKSRQ BETWEEN '2006-04-21' AND '2010-09-27' UNION SELECT COUNT(*) FROM ftxmzjzjlb WHERE ftxmzjzjlb.JZKSMC = '小儿耳鼻喉科' AND ftxmzjzjlb.JZKSRQ BETWEEN '2006-04-21' AND '2010-09-27'
css
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 countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE departments ( DEPARTMENT_ID decimal...
Show employee_id from each email, display in descending by the names.
SELECT EMAIL, EMPLOYEE_ID FROM employees ORDER BY EMAIL DESC
nvbench
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 inputevents_cv ( row_id number, subject_id number, hadm_id numbe...
how many hours have it been since the last time patient 7112 began to stay in ward 52 on this hospital visit?
SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', transfers.intime)) FROM transfers WHERE transfers.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 7112 AND admissions.dischtime IS NULL)) AND transfers....
mimic_iii
CREATE TABLE program_course ( program_id int, course_id int, workload int, category varchar ) CREATE TABLE offering_instructor ( offering_instructor_id int, offering_id int, instructor_id int ) CREATE TABLE program_requirement ( program_id int, category varchar, min_credit int,...
What courses can I take that will give me 5 credits ?
SELECT DISTINCT name, number FROM course WHERE credits = 5 AND department = 'EECS'
advising
CREATE TABLE table_name_50 ( date VARCHAR, circuit VARCHAR )
Name the date for circuit of interlagos
SELECT date FROM table_name_50 WHERE circuit = "interlagos"
sql_create_context
CREATE TABLE table_41579 ( "Name" text, "Japanese" text, "Date of designation" text, "Date of reclassification" text, "Region" text, "Prefecture" text )
WHich Japanese has a Prefecture of iwate?
SELECT "Japanese" FROM table_41579 WHERE "Prefecture" = 'iwate'
wikisql
CREATE TABLE member ( Member_ID int, Name text, Membership_card text, Age int, Time_of_purchase int, Level_of_membership int, Address text ) CREATE TABLE happy_hour_member ( HH_ID int, Member_ID int, Total_amount real ) CREATE TABLE shop ( Shop_ID int, Address text, ...
Bar graph to show the total number from different address, and could you sort in ascending by the y axis?
SELECT Address, COUNT(*) FROM member GROUP BY Address ORDER BY COUNT(*)
nvbench
CREATE TABLE table_29213 ( "Pick #" real, "CFL Team" text, "Player" text, "Position" text, "College" text )
What college did Jim Bennett attend?
SELECT "College" FROM table_29213 WHERE "Player" = 'Jim Bennett'
wikisql
CREATE TABLE table_name_9 ( surface VARCHAR, opponent VARCHAR )
On what Surface was the match against Ilija Bozoljac played?
SELECT surface FROM table_name_9 WHERE opponent = "ilija bozoljac"
sql_create_context
CREATE TABLE gsi ( course_offering_id int, student_id int ) CREATE TABLE program_requirement ( program_id int, category varchar, min_credit int, additional_req varchar ) CREATE TABLE ta ( campus_job_id int, student_id int, location varchar ) CREATE TABLE offering_instructor ( ...
Can undergrad students take 438 ?
SELECT DISTINCT advisory_requirement, enforced_requirement, name FROM course WHERE department = 'EECS' AND number = 438
advising
CREATE TABLE table_name_35 ( week INTEGER, result VARCHAR )
What is the number week with a result of w 40 62?
SELECT SUM(week) FROM table_name_35 WHERE result = "w 40–62"
sql_create_context
CREATE TABLE table_15887683_16 ( hdtv VARCHAR, television_service VARCHAR )
How many values of HDTV apply when television service is elite shopping tv?
SELECT COUNT(hdtv) FROM table_15887683_16 WHERE television_service = "Elite Shopping TV"
sql_create_context
CREATE TABLE table_25096 ( "Post" real, "Horse name" text, "Trainer" text, "Jockey" text, "Opening Odds" text, "Starting Odds" text, "Finishing Pos." real )
Who was the jockey with opening odds of 4-1?
SELECT "Jockey" FROM table_25096 WHERE "Opening Odds" = '4-1'
wikisql
CREATE TABLE table_52834 ( "Year" real, "Award" text, "Category" text, "Nominee" text, "Result" text )
Which Award is the winner for Outstanding Revival of a Musical given?
SELECT "Award" FROM table_52834 WHERE "Category" = 'outstanding revival of a musical'
wikisql
CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE SuggestedEdits ( Id number, PostId number, CreationDate time, ApprovalDate time, ...
Heinz's query on total users.
SELECT AVG(Users."count") FROM (SELECT COUNT(*) AS "count" FROM Users GROUP BY DATE(CreationDate)) AS users
sede
CREATE TABLE table_9489 ( "Outcome" text, "Date" real, "Tournament" text, "Surface" text, "Partner" text, "Opponents in the final" text, "Score in the final" text )
What is Opponents In The Final, when Partner is 'Ji Nov k'?
SELECT "Opponents in the final" FROM table_9489 WHERE "Partner" = 'jiří novák'
wikisql
CREATE TABLE table_38560 ( "Position" real, "Pilot" text, "Country" text, "Glider" text, "Points" real )
What is the smallest position with less than 7 points piloted by Didier Hauss?
SELECT MIN("Position") FROM table_38560 WHERE "Points" < '7' AND "Pilot" = 'didier hauss'
wikisql
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) CREATE TABLE person_info ( CSD text, CSRQ time, GJDM text, GJMC text, JGDM text, JGMC text, MZDM text, MZMC text, RYBH text, XBDM number, XBMC text, XLDM text, XLMC text, XM text...
门诊给患者王灵慧诊断为混合性焦虑和抑郁障碍,666198这个检测指标的结果定量和单位分别是什么
SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN mzjzjlb_jybgb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = mzjzjlb_jybgb.YLJGDM_MZJZJLB AND mzjzjlb.J...
css
CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE Badges ( Id number, UserId number, Name text, Date time, Class number, TagBased boolean ) CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate tim...
How many comments about Islamic State?.
SELECT Text FROM Comments WHERE LOWER(Text) LIKE '%islamic state%'
sede
CREATE TABLE table_59131 ( "Name" text, "Pos." text, "Height" text, "Weight" text, "Date of Birth" text, "Club" text )
What is the name when weight shows head coach: Aleksandr Kabanov?
SELECT "Name" FROM table_59131 WHERE "Weight" = 'head coach: aleksandr kabanov'
wikisql
CREATE TABLE table_510 ( "Institution" text, "Main Campus Location" text, "Founded" real, "Mascot" text, "School Colors" text )
What is the name of the institution with the mascot of blue devils?
SELECT "Institution" FROM table_510 WHERE "Mascot" = 'Blue Devils'
wikisql
CREATE TABLE table_73252 ( "Conference" text, "Regular Season Winner" text, "Conference Player of the Year" text, "Conference Tournament" text, "Tournament Venue (City)" text, "Tournament Winner" text )
What is the venue and city where the 2000 MWC Men's Basketball Tournament?
SELECT "Tournament Venue (City)" FROM table_73252 WHERE "Conference Tournament" = '2000 MWC Men''s Basketball Tournament'
wikisql
CREATE TABLE table_name_78 ( actor_in_london VARCHAR, _2002 VARCHAR, shipwreck VARCHAR )
Who was the actor in London in 2002 with the shipwreck of Leonty Ibayev?
SELECT actor_in_london, _2002 FROM table_name_78 WHERE shipwreck = "leonty ibayev"
sql_create_context
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time )...
what is the five year survival rate of patients who have been diagnosed with congestive heart failure - combined systolic and diastolic?
SELECT SUM(CASE WHEN patient.hospitaldischargestatus = 'alive' THEN 1 WHEN STRFTIME('%j', patient.hospitaldischargetime) - STRFTIME('%j', t2.diagnosistime) > 5 * 365 THEN 1 ELSE 0 END) * 100 / COUNT(*) FROM (SELECT t1.uniquepid, t1.diagnosistime FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOI...
eicu
CREATE TABLE wdmzjzjlb ( 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...
在患者卫光临的诊疗记录里,从04年6月8日到21年1月17日这期间,为其检测指标224990的医务人员有哪几位,报一下工号及姓名
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 lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, ...
what is maximum age of patients whose primary disease is hyperglycemia and year of death is less than 2131?
SELECT MAX(demographic.age) FROM demographic WHERE demographic.diagnosis = "HYPERGLYCEMIA" AND demographic.dod_year < "2131.0"
mimicsql_data
CREATE TABLE table_name_75 ( points VARCHAR, against VARCHAR, points_diff VARCHAR )
I want the total number of points for against of 753 and points diff more than -114
SELECT COUNT(points) FROM table_name_75 WHERE against = 753 AND points_diff > -114
sql_create_context
CREATE TABLE table_30101 ( "Branding" text, "Callsign" text, "Frequency" text, "Power kW" text, "Coverage" text )
Name the frequency for 103.7 energy fm dipolog*
SELECT "Frequency" FROM table_30101 WHERE "Branding" = '103.7 Energy FM Dipolog*'
wikisql
CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE d_items ( row_id num...
how much dapsone is prescribed to patient 95986 in total on the last hospital visit?
SELECT SUM(prescriptions.dose_val_rx) FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 95986 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime DESC LIMIT 1) AND prescriptions.drug = 'dapsone'
mimic_iii
CREATE TABLE table_76985 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text, "Money ( $ )" real )
What is the Place of the Player with Money greater than 300 and a Score of 71-69-70-70=280?
SELECT "Place" FROM table_76985 WHERE "Money ( $ )" > '300' AND "Score" = '71-69-70-70=280'
wikisql
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) C...
what is the number of patients whose primary disease is abdominal pain and days of hospital stay is greater than 3?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "ABDOMINAL PAIN" AND demographic.days_stay > "3"
mimicsql_data
CREATE TABLE person_info_hz_info ( RYBH text, KH number, KLX number, YLJGDM number ) CREATE TABLE mzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH text, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC...
病人69954049的身高与体重分别达到多少?
SELECT mzjzjlb.SG, mzjzjlb.TZ FROM hz_info JOIN mzjzjlb 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 person_info_hz_info.KH = hz_info.KH AND person_info_hz_info.KLX = hz_info.KLX AND person_info_hz_info.YLJGDM = hz_info.YLJGDM...
css
CREATE TABLE icustays ( row_id number, subject_id number, hadm_id number, icustay_id number, first_careunit text, last_careunit text, first_wardid number, last_wardid number, intime time, outtime time ) CREATE TABLE d_labitems ( row_id number, itemid number, label te...
what is the number of times that gastroenterostomy nec is performed until 2 years ago?
SELECT COUNT(*) FROM procedures_icd WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'gastroenterostomy nec') AND DATETIME(procedures_icd.charttime) <= DATETIME(CURRENT_TIME(), '-2 year')
mimic_iii
CREATE TABLE table_23224961_1 ( season VARCHAR, oberpfalz VARCHAR )
When spvgg vohenstrau is the oberpfalz what is the season?
SELECT season FROM table_23224961_1 WHERE oberpfalz = "SpVgg Vohenstrauß"
sql_create_context
CREATE TABLE table_204_743 ( id number, "pos" text, "no" number, "driver" text, "constructor" text, "laps" number, "time/retired" text, "grid" number, "points" number )
how many drivers did not finish 56 laps ?
SELECT COUNT("driver") FROM table_204_743 WHERE "laps" < 56
squall
CREATE TABLE table_72519 ( "School" text, "Winners" real, "Finalists" real, "Total Finals" real, "Year of last win" text )
In what year was the total finals at 10?
SELECT "Year of last win" FROM table_72519 WHERE "Total Finals" = '10'
wikisql
CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE Tags ( Id number, TagName text, Cou...
Posts by @userId since @startDate.
SELECT t.Name, COUNT(*) FROM Posts AS p JOIN PostTypes AS t ON p.PostTypeId = t.Id WHERE OwnerUserId = @userId AND CreationDate >= @startDate GROUP BY t.Name
sede
CREATE TABLE table_44965 ( "Pollutant" text, "Type" text, "Standard" text, "Averaging Time" text, "Regulatory Citation" text )
what is the averaging time when the regulatory citation is 40 cfr 50.4(b)?
SELECT "Averaging Time" FROM table_44965 WHERE "Regulatory Citation" = '40 cfr 50.4(b)'
wikisql
CREATE TABLE table_67081 ( "Rank" real, "Lane" real, "Name" text, "Nationality" text, "Time" real )
What is the lowest numbered lane of Sue Rolph with a rank under 5?
SELECT MIN("Lane") FROM table_67081 WHERE "Name" = 'sue rolph' AND "Rank" < '5'
wikisql
CREATE TABLE table_15599 ( "Rank" text, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
Which is the highest Gold that has a total smaller than 4 and a silver of 1, and a bronze smaller than 2, and a rank of 13?
SELECT MAX("Gold") FROM table_15599 WHERE "Total" < '4' AND "Silver" = '1' AND "Bronze" < '2' AND "Rank" = '13'
wikisql
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...
tell me the amount of chest tubes cticu ct 1 patient 31854 has had on this month/30?
SELECT SUM(outputevents.value) FROM outputevents WHERE outputevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 31854)) AND outputevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'che...
mimic_iii
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, predicted_graduation_semester int, degree varchar, minor varchar, internship varch...
Which upper level classes do not require 519 as a prerequisite ?
SELECT DISTINCT COURSE_0.department, COURSE_0.name, COURSE_0.number FROM course AS COURSE_0, course AS COURSE_1, course_prerequisite, program_course WHERE NOT COURSE_1.course_id IN (SELECT course_prerequisite.pre_course_id FROM course AS COURSE_0, course_prerequisite WHERE COURSE_0.course_id = course_prerequisite.cours...
advising
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 )
Give me a bar chart to show the names and revenue of the company that earns the highest revenue in each headquarter city, list in descending by the y axis.
SELECT Name, MAX(Revenue) FROM Manufacturers GROUP BY Headquarter ORDER BY MAX(Revenue) DESC
nvbench
CREATE TABLE table_49196 ( "Game" real, "Date" text, "Opponent" text, "Score" text, "Location" text, "Attendance" real, "Record" text, "Points" real )
What is the sum of the game with the boston bruins as the opponent?
SELECT SUM("Game") FROM table_49196 WHERE "Opponent" = 'boston bruins'
wikisql
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...
患者凤高翰在10年5月21日到19年8月3日这段时间内,自付比例低于0.48的药品数量是多少
SELECT COUNT(*) FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.PERSON_NM = '凤高翰' AND t_kc22.STA_DATE BETWEEN '2010-05-21' AND '2019-08-03' AND t_kc22.SELF_PAY_PRO < 0.48
css
CREATE TABLE table_name_91 ( record VARCHAR, team VARCHAR )
Can you tell me the Record that has the Team of minnesota?
SELECT record FROM table_name_91 WHERE team = "minnesota"
sql_create_context
CREATE TABLE table_5441 ( "Driver" text, "Seasons" text, "Entries" real, "3rd places" real, "Percentage" text )
How many entries have 3rd places greater than 19, and alain prost as the driver?
SELECT COUNT("Entries") FROM table_5441 WHERE "3rd places" > '19' AND "Driver" = 'alain prost'
wikisql
CREATE TABLE table_name_17 ( opponent_in_the_final VARCHAR, date VARCHAR )
Who was played against in the final on November 14, 1994?
SELECT opponent_in_the_final FROM table_name_17 WHERE date = "november 14, 1994"
sql_create_context
CREATE TABLE table_name_98 ( player VARCHAR, date VARCHAR )
What player has a date of 12-02-2003?
SELECT player FROM table_name_98 WHERE date = "12-02-2003"
sql_create_context
CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) CREATE TABLE Users ( Id number, Reputation number, CreationDate time, DisplayName text, LastAccessDate time, WebsiteUrl text, Location text, ...
TOP 100 Users based on coimbatore.
SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation FROM Users WHERE LOWER(Location) LIKE '%Coimbatore%' OR UPPER(Location) LIKE '%coimbatore%' OR Location LIKE '%Coimbatore%' AND Reputation >= 1000 ORDER BY Reputation DESC
sede
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) 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...
give me the number of patients whose admission location is clinic referral/premature and discharge location is snf?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_location = "CLINIC REFERRAL/PREMATURE" AND demographic.discharge_location = "SNF"
mimicsql_data
CREATE TABLE table_name_85 ( attendance VARCHAR, opponent VARCHAR )
What was the Attendance of the game against the Los Angeles Raiders?
SELECT attendance FROM table_name_85 WHERE opponent = "los angeles raiders"
sql_create_context
CREATE TABLE table_5821 ( "Placing" real, "Team" text, "Players" text, "Seeding" text, "Playoffs W-L" text, "Matches W-L" text )
Players of judith wiesner and alex antonitsch had what match w-l?
SELECT "Matches W-L" FROM table_5821 WHERE "Players" = 'judith wiesner and alex antonitsch'
wikisql
CREATE TABLE table_29163303_4 ( championship VARCHAR, score VARCHAR )
How many championships were there where the score was 4 6, 7 6 (7 5) , [5 10]?
SELECT COUNT(championship) FROM table_29163303_4 WHERE score = "4–6, 7–6 (7–5) , [5–10]"
sql_create_context
CREATE TABLE table_16384596_4 ( directed_by VARCHAR, broadcast_order VARCHAR )
Who directed the episode for s02 e08?
SELECT directed_by FROM table_16384596_4 WHERE broadcast_order = "S02 E08"
sql_create_context
CREATE TABLE table_33366 ( "Outcome" text, "Date" text, "Tournament" text, "Partner" text, "Opponents in the final" text )
Which date has the tom gullikson butch walts final, and who was the runner-up?
SELECT "Date" FROM table_33366 WHERE "Outcome" = 'runner-up' AND "Opponents in the final" = 'tom gullikson butch walts'
wikisql
CREATE TABLE table_15261_1 ( voltage_range__v_ VARCHAR, clock_multiplier VARCHAR, part_number VARCHAR )
What is the voltage range (v) if the clock multiplier is 3x or 2x mode and part number is a80486dx4wb-100?
SELECT COUNT(voltage_range__v_) FROM table_15261_1 WHERE clock_multiplier = "3X or 2X mode" AND part_number = "A80486DX4WB-100"
sql_create_context
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) CREATE TABLE jybgb ( BBCJBW text, BBDM text, BBMC text, BBZT number, BGDH text, BGJGDM text, BGJGMC text, BGRGH text, BGRQ time, BGRXM text, BGSJ time, CJRQ time, JSBBRQSJ time, ...
患者赵思美所有检验报告单的审核日期时间从01年8月29日至14年11月21日期间内都是哪天吗?
SELECT jybgb.SHSJ FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN mzjzjlb_jybgb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = mzjzjlb_jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND mzjzjl...
css
CREATE TABLE mountain ( Mountain_ID int, Name text, Height real, Prominence real, Range text, Country text ) CREATE TABLE climber ( Climber_ID int, Name text, Country text, Time text, Points real, Mountain_ID int )
What are the countries of mountains with height bigger than 5000, and count them by a bar chart, display by the y-axis in descending.
SELECT Country, COUNT(Country) FROM mountain WHERE Height > 5000 GROUP BY Country ORDER BY COUNT(Country) DESC
nvbench
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 ...
患者周庆生自二零零二年二月十日开始,截止到二零二一年九月二十七日,由哪几位医务人员为其检测指标093591的,查查这些医务人员的工号及姓名
SELECT jyjgzbb.JCRGH, jyjgzbb.JCRXM FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb....
css
CREATE TABLE Products ( product_id INTEGER, product_type_code VARCHAR(10), product_name VARCHAR(80), product_price DECIMAL(19,4) ) CREATE TABLE Department_Stores ( dept_store_id INTEGER, dept_store_chain_id INTEGER, store_name VARCHAR(80), store_address VARCHAR(255), store_phone VAR...
Return a bar chart on how many customers use each payment method?
SELECT payment_method_code, COUNT(*) FROM Customers GROUP BY payment_method_code
nvbench
CREATE TABLE table_name_53 ( group_c VARCHAR, group_b VARCHAR )
What is the group C region with Illinois as group B?
SELECT group_c FROM table_name_53 WHERE group_b = "illinois"
sql_create_context
CREATE TABLE table_34017 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Game site" text, "Attendance" real )
What average week has shea stadium as the game site, and 1979-12-09 as the date?
SELECT AVG("Week") FROM table_34017 WHERE "Game site" = 'shea stadium' AND "Date" = '1979-12-09'
wikisql
CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE Tags ( Id number, TagName text, Count number, ExcerptPostId number, WikiPostId number ) CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, ...
average votes per view for questions.
SELECT MAX(value) FROM (SELECT CAST(COUNT(v.Id) AS FLOAT) / p.ViewCount AS value FROM Votes AS v, Posts AS p WHERE v.VoteTypeId IN (2, 3) AND p.Id = v.PostId AND p.PostTypeId = 1 AND p.ViewCount >= 1 GROUP BY p.ViewCount, p.Id) AS t
sede
CREATE TABLE train ( train_id number, name text, time text, service text ) CREATE TABLE train_station ( train_id number, station_id number ) CREATE TABLE station ( station_id number, name text, annual_entry_exit number, annual_interchanges number, total_passengers number, ...
How many train stations are there?
SELECT COUNT(*) FROM station
spider
CREATE TABLE table_4347 ( "Year" real, "Award" text, "Title of work" text, "Medium" text, "Result" text )
Tell me the title of work for year more than 2009
SELECT "Title of work" FROM table_4347 WHERE "Year" > '2009'
wikisql
CREATE TABLE table_42710 ( "Season" text, "League" text, "Games" real, "Lost" real, "Tied" real, "Points" real, "Winning %" real, "Goals for" real, "Goals against" real, "Standing" text )
What is the total number of losses for teams with less than 5 ties and more than 330 goals for?
SELECT COUNT("Lost") FROM table_42710 WHERE "Tied" < '5' AND "Goals for" > '330'
wikisql
CREATE TABLE table_65464 ( "Model" text, "Years" text, "Type/code" text, "Power@rpm" text, "Torque@rpm" text )
Which Type/code has a Torque@rpm of n m (lb ft) @1900 3500? Question 1
SELECT "Type/code" FROM table_65464 WHERE "Torque@rpm" = 'n·m (lb·ft) @1900–3500'
wikisql
CREATE TABLE table_20855 ( "Year" real, "Date" text, "Driver" text, "Team" text, "Manufacturer" text, "Laps" text, "Miles (km)" text, "Race time" text, "Average speed (mph)" text, "Report" text )
Name the miles for june 7
SELECT "Miles (km)" FROM table_20855 WHERE "Date" = 'June 7'
wikisql
CREATE TABLE College ( cName varchar(20), state varchar(2), enr numeric(5,0) ) 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) )
Show the smallest enrollment of each state using a bar chart, and could you display by the x axis in descending please?
SELECT state, MIN(enr) FROM College GROUP BY state ORDER BY state DESC
nvbench
CREATE TABLE table_name_3 ( finalist VARCHAR, semifinalists VARCHAR )
Which finalist has Semifinalists of andre agassi (1) lleyton hewitt (14)?
SELECT finalist FROM table_name_3 WHERE semifinalists = "andre agassi (1) lleyton hewitt (14)"
sql_create_context
CREATE TABLE table_7709 ( "Draw" real, "Artist" text, "Song" text, "Televote" real, "Place" real )
Artist Justinas Lapatinskas with a draw of greater than 9 got what as the highest televote?
SELECT MAX("Televote") FROM table_7709 WHERE "Artist" = 'justinas lapatinskas' AND "Draw" > '9'
wikisql
CREATE TABLE elimination ( elimination_id text, wrestler_id text, team text, eliminated_by text, elimination_move text, time text ) CREATE TABLE wrestler ( wrestler_id number, name text, reign text, days_held text, location text, event text )
List the names of wrestlers that have not been eliminated.
SELECT name FROM wrestler WHERE NOT wrestler_id IN (SELECT wrestler_id FROM elimination)
spider
CREATE TABLE acceptance ( submission_id number, workshop_id number, result text ) CREATE TABLE submission ( submission_id number, scores number, author text, college text ) CREATE TABLE workshop ( workshop_id number, date text, venue text, name text )
Which college has the most authors with submissions?
SELECT college FROM submission GROUP BY college ORDER BY COUNT(*) DESC LIMIT 1
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 )
What are the names and prices of all products in the store Plot them as bar chart, and show mean price in ascending order please.
SELECT Name, AVG(Price) FROM Products GROUP BY Name ORDER BY AVG(Price)
nvbench
CREATE TABLE table_24287 ( "Series #" real, "Season #" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text )
When 'i feel good' is the title and joe sachs is the writer how many series numbers are there?
SELECT COUNT("Series #") FROM table_24287 WHERE "Written by" = 'Joe Sachs' AND "Title" = 'I Feel Good'
wikisql
CREATE TABLE table_74372 ( "Rank" real, "Rider" text, "Mon 30 May" text, "Tues 31 May" text, "Wed 1 June" text, "Thurs 2 June" text, "Fri 3 June" text )
What is the Fri 3 June time for the rider with a Weds 1 June time of 18' 22.66 123.182mph?
SELECT "Fri 3 June" FROM table_74372 WHERE "Wed 1 June" = '18'' 22.66 123.182mph'
wikisql
CREATE TABLE table_53301 ( "D 50 O" text, "D 49 \u221a" text, "D 48 \u221a" text, "D 47 \u221a" text, "D 46 \u221a" text, "D 45 \u221a" text, "D 44 \u221a" text, "D 43 \u221a" text, "D 42 \u221a" text, "D 41 \u221a" text )
Name the D 43 when it has D 46 of d 26
SELECT "D 43 \u221a" FROM table_53301 WHERE "D 46 \u221a" = 'd 26'
wikisql
CREATE TABLE table_30675 ( "Couple" text, "Style" text, "Music" text, "Trine Dehli Cleve" real, "Tor Fl\u00f8ysvik" real, "Karianne Gulliksen" real, "Christer Tornell" real, "Total" real )
How many couples are there for the song ' i wonder why ' curtis stigers?
SELECT COUNT("Couple") FROM table_30675 WHERE "Music" = ' I Wonder Why "— Curtis Stigers'
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...
what is days of hospital stay and discharge location of subject id 18351?
SELECT demographic.days_stay, demographic.discharge_location FROM demographic WHERE demographic.subject_id = "18351"
mimicsql_data
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...
Show me about the distribution of ACC_Road and the average of Team_ID , and group by attribute ACC_Road in a bar chart, list X-axis in asc order.
SELECT ACC_Road, AVG(Team_ID) FROM basketball_match GROUP BY ACC_Road ORDER BY ACC_Road
nvbench