context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
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 diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) C...
find out the icu stay id of patient with patient id 18480.
SELECT prescriptions.icustay_id FROM prescriptions WHERE prescriptions.subject_id = "18480"
mimicsql_data
CREATE TABLE table_name_97 ( number_of_electorates__2009_ VARCHAR, name VARCHAR )
what is the total number of electorates (2009) when the name is govindpura?
SELECT COUNT(number_of_electorates__2009_) FROM table_name_97 WHERE name = "govindpura"
sql_create_context
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 cost ( costid num...
what was the name of the drug that patient 009-7776 was prescribed with within the same day after being diagnosed with hypoglycemia on the current hospital visit?
SELECT t2.drugname FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '009-7776' AND patient.hospitaldis...
eicu
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 maximum age of patients whose death status is 0 and primary disease is femoral artery thrombosis?
SELECT MAX(demographic.age) FROM demographic WHERE demographic.expire_flag = "0" AND demographic.diagnosis = "FEMORAL ARTERY THROMBOSIS"
mimicsql_data
CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE TagSynonyms ( Id number, SourceTagName text, TargetTagName text, CreationDate time, OwnerUserId number, AutoRenameCount number, LastAutoRename time, Score number, ApprovedByUserId number, ApprovalDate time ) C...
Self-answered questions that would have been deleted.
SELECT COUNT(DISTINCT q.Id) AS Questions FROM Posts AS q JOIN Posts AS a ON q.Id = a.ParentId WHERE q.PostTypeId = 1 AND a.PostTypeId = 2 AND q.ClosedDate IS NULL AND DATEPART(yyyy, q.CreationDate) = 2012 AND a.OwnerUserId = q.OwnerUserId AND q.Score >= 0 AND DATEDIFF(DD, q.CreationDate, creationDate) > 1
sede
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
how many patients have diagnosis icd9 code 49392?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE diagnoses.icd9_code = "49392"
mimicsql_data
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 (...
count the number of patients whose ethnicity is black/african american and admission year is less than 2178?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "BLACK/AFRICAN AMERICAN" AND demographic.admityear < "2178"
mimicsql_data
CREATE TABLE table_38067 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" real )
How many weeks have an attendance greater than 21,231, with l 38-10 as the result?
SELECT COUNT("Week") FROM table_38067 WHERE "Attendance" > '21,231' AND "Result" = 'l 38-10'
wikisql
CREATE TABLE table_61464 ( "Draw" real, "Artist" text, "Song" text, "Lyrics (l) / Music (m)" text, "Results" text )
What are the Lyrics (l) / Music (m) when the draw was 5?
SELECT "Lyrics (l) / Music (m)" FROM table_61464 WHERE "Draw" = '5'
wikisql
CREATE TABLE table_9618 ( "Rank" real, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
What is the highest rank that has 5 silvers, less than 5 golds, and less than 7 total medals?
SELECT MAX("Rank") FROM table_9618 WHERE "Silver" = '5' AND "Gold" < '5' AND "Total" < '7'
wikisql
CREATE TABLE table_name_84 ( Id VARCHAR )
What is the 2009 result when 2011 is 1R and 2007 is A?
SELECT 2009 FROM table_name_84 WHERE 2011 = "1r" AND 2007 = "a"
sql_create_context
CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type text, admission_location text, discharge_location te...
what was the name of the medicine patient 61591 was prescribed during the same hospital encounter after having received a cont inv mec ven 96+ hrs procedure since 33 months ago?
SELECT t2.drug FROM (SELECT admissions.subject_id, procedures_icd.charttime, admissions.hadm_id FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE admissions.subject_id = 61591 AND procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_proce...
mimic_iii
CREATE TABLE t_kc22 ( MED_EXP_DET_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, MED_CLINIC_ID text, MED_EXP_BILL_ID text, SOC_SRT_DIRE_CD text, SOC_SRT_DIRE_NM text, DIRE_TYPE number, CHA_ITEM_LEV number, MED_INV_ITEM_TYPE text, MED_DIRE_CD text, MED_DIRE_NM text,...
在89843781622的那次医疗就诊中,一共被开出了哪些超限价自付金额高于2412.64元的药品,都给列出清单来
SELECT SOC_SRT_DIRE_CD, SOC_SRT_DIRE_NM FROM t_kc22 WHERE MED_CLINIC_ID = '89843781622' AND OVE_SELF_AMO > 2412.64
css
CREATE TABLE news_report ( journalist_ID int, Event_ID int, Work_Type text ) CREATE TABLE event ( Event_ID int, Date text, Venue text, Name text, Event_Attendance int ) CREATE TABLE journalist ( journalist_ID int, Name text, Nationality text, Age text, Years_working...
Compare the total number of journalist with different nationality using a bar chart, I want to order by the names in ascending.
SELECT Nationality, COUNT(Nationality) FROM journalist GROUP BY Nationality ORDER BY Nationality
nvbench
CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_ID decimal(4,0) ) CREATE TABLE locations ( LOCATION_ID decimal(4,0),...
For those employees who do not work in departments with managers that have ids between 100 and 200, give me the comparison about the amount of hire_date over the hire_date bin hire_date by time by a bar chart, and could you rank in descending by the total number?
SELECT HIRE_DATE, COUNT(HIRE_DATE) FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY COUNT(HIRE_DATE) DESC
nvbench
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 scatter chart about the correlation between Team_ID and School_ID .
SELECT Team_ID, School_ID FROM basketball_match
nvbench
CREATE TABLE table_name_69 ( ihsaa_class VARCHAR, enrollment VARCHAR )
What is the IHSAA class with 395 in enrollment?
SELECT ihsaa_class FROM table_name_69 WHERE enrollment = 395
sql_create_context
CREATE TABLE person_info ( RYBH text, XBDM number, XBMC text, XM text, CSRQ time, CSD text, MZDM text, MZMC text, GJDM text, GJMC text, JGDM text, JGMC text, XLDM text, XLMC text, ZYLBDM text, ZYMC text ) CREATE TABLE zyjzjlb ( YLJGDM text, JZLSH ...
找出和检验指标记录63731957945相同的检测指标结果定量单位、检测指标名称并且检测指标结果定量大于等于其的检验指标记录一共都有哪些?
SELECT * FROM jyjgzbb WHERE JCZBMC = (SELECT JCZBMC FROM jyjgzbb WHERE JYZBLSH = '63731957945') AND JCZBJGDW = (SELECT JCZBJGDW FROM jyjgzbb WHERE JYZBLSH = '63731957945') AND JCZBJGDL >= (SELECT JCZBJGDL FROM jyjgzbb WHERE JYZBLSH = '63731957945')
css
CREATE TABLE table_name_25 ( rank VARCHAR, s_wicket VARCHAR )
What Rank has a 65 s Wicket?
SELECT rank FROM table_name_25 WHERE s_wicket = "65"
sql_create_context
CREATE TABLE area ( course_id int, area varchar ) CREATE TABLE course_prerequisite ( pre_course_id int, course_id int ) CREATE TABLE semester ( semester_id int, semester varchar, year int ) CREATE TABLE ta ( campus_job_id int, student_id int, location varchar ) CREATE TABLE p...
Which class is the easiest one to fulfill the Other requirement ?
SELECT DISTINCT course.department, course.name, course.number, program_course.workload, program_course.workload FROM course, program_course WHERE program_course.category LIKE '%Other%' AND program_course.course_id = course.course_id AND program_course.workload = (SELECT MIN(PROGRAM_COURSEalias1.workload) FROM program_c...
advising
CREATE TABLE table_2101431_1 ( viewers__in_millions_ VARCHAR, run_time VARCHAR )
How many millions viewers watched the episode that ran 23:25?
SELECT viewers__in_millions_ FROM table_2101431_1 WHERE run_time = "23:25"
sql_create_context
CREATE TABLE table_23286112_7 ( score VARCHAR, date VARCHAR )
What is the score for the date of December 7?
SELECT score FROM table_23286112_7 WHERE date = "December 7"
sql_create_context
CREATE TABLE flight_leg ( flight_id int, leg_number int, leg_flight int ) CREATE TABLE date_day ( month_number int, day_number int, year int, day_name varchar ) CREATE TABLE food_service ( meal_code text, meal_number int, compartment text, meal_description varchar ) CREATE...
i'd like a flight on UA from DALLAS to SAN FRANCISCO that leaves after 815
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN FRANCISCO' AND flight.departure_time > 815 AND flight.to_airport = AIRPORT_SERVICE_1...
atis
CREATE TABLE Products ( product_id INTEGER, product_name VARCHAR(80), product_details VARCHAR(255) ) CREATE TABLE Order_Items ( order_item_id INTEGER, product_id INTEGER, order_id INTEGER, order_item_status VARCHAR(10), order_item_details VARCHAR(255) ) CREATE TABLE Invoices ( invo...
List the name and count of each product in all orders with a bar chart.
SELECT T3.product_name, SUM(COUNT(*)) FROM Orders AS T1 JOIN Order_Items AS T2 JOIN Products AS T3 ON T1.order_id = T2.order_id AND T2.product_id = T3.product_id GROUP BY T3.product_name
nvbench
CREATE TABLE table_62012 ( "Outcome" text, "Edition" real, "Round" text, "Opponent Team" text, "Surface" text, "Opponent" text, "Score" text )
What is Score, when Opponent Team is Belgium, and when Opponent is Kirsten Flipkens?
SELECT "Score" FROM table_62012 WHERE "Opponent Team" = 'belgium' AND "Opponent" = 'kirsten flipkens'
wikisql
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, ...
how many patients admitted for more than 2 days had a lab test for urine
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.days_stay > "2" AND lab.fluid = "Urine"
mimicsql_data
CREATE TABLE time_zone ( time_zone_code text, time_zone_name text, hours_from_gmt int ) CREATE TABLE code_description ( code varchar, description text ) CREATE TABLE fare ( fare_id int, from_airport varchar, to_airport varchar, fare_basis_code text, fare_airline text, restr...
show me flights from PHILADELPHIA to BALTIMORE
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'PHILADELPHIA' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'B...
atis
CREATE TABLE table_name_11 ( venue VARCHAR, goal__number VARCHAR )
What was the venue where goal #2 occured?
SELECT venue FROM table_name_11 WHERE goal__number = 2
sql_create_context
CREATE TABLE area ( course_id int, area varchar ) CREATE TABLE student_record ( student_id int, course_id int, semester int, grade varchar, how varchar, transfer_source varchar, earn_credit varchar, repeat_term varchar, test_id varchar ) CREATE TABLE gsi ( course_offeri...
Could you tell me if there are any 500 -level courses for this Fall or Winter term ?
SELECT DISTINCT course.department, course.name, course.number, semester.semester FROM course, course_offering, semester WHERE ((semester.semester = 'FA' AND semester.year = 2016) OR (semester.semester = 'WN' AND semester.year = 2017)) AND course.course_id = course_offering.course_id AND course.department = 'department0...
advising
CREATE TABLE table_28037 ( "Player" text, "Position" text, "Starter" text, "Touchdowns" real, "Extra points" real, "Field goals" real, "Points" real )
What is the most points recorded for a right halfback?
SELECT MAX("Points") FROM table_28037 WHERE "Position" = 'Right halfback'
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 demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, ...
count the number of patients whose diagnoses icd9 code is v1000 and lab test fluid is ascites?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.icd9_code = "V1000" AND lab.fluid = "Ascites"
mimicsql_data
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREAT...
when did patient 031-4423 receive a microbiology test first time?
SELECT microlab.culturetakentime FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-4423')) ORDER BY microlab.culturetakentime LIMIT 1
eicu
CREATE TABLE table_9276 ( "Wicket" text, "Runs" text, "Batting partners" text, "Batting team" text, "Fielding team" text, "Venue" text, "Date" text )
What was the wicket ranking for the match that had a fielding team of Sri Lanka?
SELECT "Wicket" FROM table_9276 WHERE "Fielding team" = 'sri lanka'
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, return a bar chart about the distribution of headquarter and the average of revenue , and group by attribute headquarter, and I want to list from low to high by the Headquarter.
SELECT Headquarter, AVG(Revenue) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter ORDER BY Headquarter
nvbench
CREATE TABLE table_name_39 ( blank_ends INTEGER, nation VARCHAR, ends_lost VARCHAR )
What is the sum of Blank Ends for Denmark when less than 42 is the ends lost?
SELECT SUM(blank_ends) FROM table_name_39 WHERE nation = "denmark" AND ends_lost < 42
sql_create_context
CREATE TABLE table_name_42 ( school VARCHAR, player VARCHAR )
Which School did Player Tyrone Johnson attend?
SELECT school FROM table_name_42 WHERE player = "tyrone johnson"
sql_create_context
CREATE TABLE table_name_23 ( attendance VARCHAR, date VARCHAR )
What is the attendance on 24 December 1898?
SELECT attendance FROM table_name_23 WHERE date = "24 december 1898"
sql_create_context
CREATE TABLE table_name_58 ( country VARCHAR, player VARCHAR )
What is S.K. Ho's Country?
SELECT country FROM table_name_58 WHERE player = "s.k. ho"
sql_create_context
CREATE TABLE table_62755 ( "Team" text, "Country" text, "Home" text, "Skip" text, "Third" text, "Second" text, "Lead" text )
Where in Sweden is the home of the Swedish team?
SELECT "Home" FROM table_62755 WHERE "Country" = 'sweden'
wikisql
CREATE TABLE table_32122 ( "Driver" text, "Constructor" text, "Laps" real, "Time/Retired" text, "Grid" real )
Which Driver that has a Grid less than 9 and a Time/Retired of 2:06:26.358?
SELECT "Driver" FROM table_32122 WHERE "Grid" < '9' AND "Time/Retired" = '2:06:26.358'
wikisql
CREATE TABLE table_72080 ( "Country ( exonym )" text, "Capital ( exonym )" text, "Country ( endonym )" text, "Capital ( endonym )" text, "Official or native language(s) (alphabet/script)" text )
What is the English name of the country whose official native language is Dutch Papiamento?
SELECT "Country ( exonym )" FROM table_72080 WHERE "Official or native language(s) (alphabet/script)" = 'Dutch Papiamento'
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...
在00年10月14日到2011年2月11日期间为病患谢芳蕙执行检测指标607066的医务人员的工号还有姓名是什么?
SELECT jyjgzbb.JCRGH, jyjgzbb.JCRXM FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jy...
css
CREATE TABLE table_77497 ( "Date" text, "Tournament" text, "Winning score" text, "To par" text, "Margin of victory" text, "Runner-up" text )
Who was the runner-up in the tournament that has a margin of victory of 2 strokes, and a To par of 16?
SELECT "Runner-up" FROM table_77497 WHERE "Margin of victory" = '2 strokes' AND "To par" = '−16'
wikisql
CREATE TABLE table_name_13 ( participants INTEGER, rank VARCHAR, silver VARCHAR )
What is listed as the highest Participants that also have a Rank of 5, and Silver that's smaller than 0?
SELECT MAX(participants) FROM table_name_13 WHERE rank = 5 AND silver < 0
sql_create_context
CREATE TABLE table_18222 ( "District" text, "Incumbent" text, "Party" text, "Elected" real, "Status" text, "Opponent" text )
What is Larry Combest's district?
SELECT "District" FROM table_18222 WHERE "Incumbent" = 'Larry Combest'
wikisql
CREATE TABLE table_name_24 ( enrollment INTEGER, _number___county VARCHAR )
What's the enrollment at 41 Johnson?
SELECT AVG(enrollment) FROM table_name_24 WHERE _number___county = "41 johnson"
sql_create_context
CREATE TABLE mzb ( 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...
在2005年8月29日到2007年4月15日之间名叫施博雅参保人员门诊手术费要多少钱?
SELECT SUM(t_kc22.AMOUNT) FROM t_kc22 JOIN mzb ON mzb.MED_ORG_DEPT_CD = t_kc22.MED_CLINIC_ID WHERE mzb.PERSON_SEX = '施博雅' AND t_kc22.STA_DATE BETWEEN '2005-08-29' AND '2007-04-15' AND t_kc22.MED_INV_ITEM_TYPE = '手术费'
css
CREATE TABLE table_11260 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
What was the away score when North Melbourne was played?
SELECT "Away team score" FROM table_11260 WHERE "Home team" = 'north melbourne'
wikisql
CREATE TABLE table_name_59 ( _percentage_hydropower INTEGER, _percentage_coal VARCHAR, _percentage_nuclear_power VARCHAR )
what is the highest % hydropower when % coal is 4.9 and % nuclear power is more than 0?
SELECT MAX(_percentage_hydropower) FROM table_name_59 WHERE _percentage_coal = 4.9 AND _percentage_nuclear_power > 0
sql_create_context
CREATE TABLE table_name_56 ( death VARCHAR, spouse VARCHAR )
When did the duchess, who was married to philippe, die?
SELECT death FROM table_name_56 WHERE spouse = "philippe"
sql_create_context
CREATE TABLE people ( People_ID int, Name text, Height real, Weight real, Date_of_Birth text ) CREATE TABLE entrepreneur ( Entrepreneur_ID int, People_ID int, Company text, Money_Requested real, Investor text )
Return a pie on what are the investors of entrepreneurs and the corresponding number of entrepreneurs invested by each investor?
SELECT Investor, COUNT(*) FROM entrepreneur GROUP BY Investor
nvbench
CREATE TABLE table_1507806_1 ( year INTEGER, runner_up VARCHAR )
WHAT YEAR DID MIKE BRADY GET RUNNER-UP?
SELECT MIN(year) FROM table_1507806_1 WHERE runner_up = "Mike Brady"
sql_create_context
CREATE TABLE table_16710 ( "Rnd" real, "Race" text, "Date" text, "Location" text, "Pole Position" text, "Fastest Lap" text, "Race Winner" text, "Constructor" text, "Report" text )
what's the constructor with location being hockenheimring
SELECT "Constructor" FROM table_16710 WHERE "Location" = 'Hockenheimring'
wikisql
CREATE TABLE table_2140071_13 ( season INTEGER )
What is the minimum number of seasons?
SELECT MIN(season) FROM table_2140071_13
sql_create_context
CREATE TABLE table_name_29 ( to_par VARCHAR, player VARCHAR )
What is Fuzzy Zoeller's To par?
SELECT to_par FROM table_name_29 WHERE player = "fuzzy zoeller"
sql_create_context
CREATE TABLE table_204_463 ( id number, "year" number, "division" number, "league" text, "regular season" text, "playoffs" text, "open cup" text )
what playoff result occurred the most ?
SELECT "playoffs" FROM table_204_463 GROUP BY "playoffs" ORDER BY COUNT(*) DESC LIMIT 1
squall
CREATE TABLE table_14868 ( "Year" real, "Men's singles" text, "Women's singles" text, "Men's doubles" text, "Women's doubles" text, "Mixed doubles" text )
What is the average year with Nathan Robertson Gail Emms in mixed doubles?
SELECT AVG("Year") FROM table_14868 WHERE "Mixed doubles" = 'nathan robertson gail emms'
wikisql
CREATE TABLE table_46001 ( "Game" real, "Date" text, "Team" text, "Score" text, "Record" text, "Streak" text )
What is the date of game 66?
SELECT "Date" FROM table_46001 WHERE "Game" = '66'
wikisql
CREATE TABLE table_203_757 ( id number, "year" number, "award ceremony" text, "category" text, "film/show" text, "result" text )
which film/show only had two award ceremonies ?
SELECT "film/show" FROM table_203_757 GROUP BY "film/show" HAVING COUNT("award ceremony") = 2
squall
CREATE TABLE table_204_223 ( id number, "party" text, "previous council" number, "staying councillors" number, "seats up for election" number, "election result" number, "new council" number )
what is the average number of previou council ?
SELECT AVG("previous council") FROM table_204_223
squall
CREATE TABLE user_profiles ( name VARCHAR, email VARCHAR, followers VARCHAR )
Find the name and email of the user followed by the least number of people.
SELECT name, email FROM user_profiles ORDER BY followers LIMIT 1
sql_create_context
CREATE TABLE table_79961 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" text, "Record" text )
What was the record at the game attended by 10,389?
SELECT "Record" FROM table_79961 WHERE "Attendance" = '10,389'
wikisql
CREATE TABLE table_22824302_3 ( steals VARCHAR, games_played VARCHAR )
How many interceptions for the team who played 31 games?
SELECT steals FROM table_22824302_3 WHERE games_played = 31
sql_create_context
CREATE TABLE table_64120 ( "Date of release" text, "Title" text, "Billboard peak" text, "RIAA cert." text, "Label" text )
Where did god & guns peak on the Billboard?
SELECT "Billboard peak" FROM table_64120 WHERE "Title" = 'god & guns'
wikisql
CREATE TABLE table_name_89 ( rank VARCHAR, year VARCHAR )
What was the rank in 1955?
SELECT rank FROM table_name_89 WHERE year = "1955"
sql_create_context
CREATE TABLE table_40743 ( "Television service" text, "Country" text, "Language" text, "Content" text, "HDTV" text, "Package/Option" text )
What is the content of the television service ewtn in the United Kingdom?
SELECT "Content" FROM table_40743 WHERE "Country" = 'united kingdom' AND "Television service" = 'ewtn'
wikisql
CREATE TABLE program ( program_id int, name varchar, college varchar, introduction 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, admi...
In the afternoon of Winter 2001 is 595 offered ?
SELECT COUNT(*) > 0 FROM course, course_offering, semester WHERE course_offering.start_time >= '12:00:00' AND course.course_id = course_offering.course_id AND course.department = 'EECS' AND course.number = 595 AND semester.semester = 'Winter' AND semester.semester_id = course_offering.semester AND semester.year = 2001
advising
CREATE TABLE table_23670057_7 ( no VARCHAR, player VARCHAR )
What is every number when the player is Aigars Vitols?
SELECT no FROM table_23670057_7 WHERE player = "Aigars Vitols"
sql_create_context
CREATE TABLE table_25028 ( "Date" text, "Builder" text, "Type" text, "Operator" text, "Number" text, "Withdrawn" text, "Status" text )
List the builder from 1930.
SELECT "Builder" FROM table_25028 WHERE "Date" = '1930'
wikisql
CREATE TABLE mzb ( 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...
从02年11月3日到13年11月20日,病患俞雅韶总共检查的次数是多少?
SELECT COUNT(*) FROM qtb JOIN t_kc22 ON qtb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE qtb.PERSON_NM = '俞雅韶' AND t_kc22.STA_DATE BETWEEN '2002-11-03' AND '2013-11-20' AND t_kc22.MED_INV_ITEM_TYPE = '检查费' UNION SELECT COUNT(*) FROM gyb JOIN t_kc22 ON gyb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gyb.PERSON_NM = '俞雅韶' A...
css
CREATE TABLE table_13168 ( "Opposing Teams" text, "Against" real, "Date" text, "Venue" text, "Status" text )
On which date was the opponent ireland and the status Five Nations?
SELECT "Date" FROM table_13168 WHERE "Status" = 'five nations' AND "Opposing Teams" = 'ireland'
wikisql
CREATE TABLE table_name_89 ( record VARCHAR, boxscore VARCHAR, loss VARCHAR )
Which record has a Boxscore of w2, and a Loss of kline (2 3)?
SELECT record FROM table_name_89 WHERE boxscore = "w2" AND loss = "kline (2–3)"
sql_create_context
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 )
A bar chart for showing the number of the names of editors that are on the committee of journals with sales bigger than 3000, sort Name in asc order.
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 ORDER BY Name
nvbench
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, ...
since 02/2104 had patient 16472 been prescribed albumin 25% (12.5g / 50ml), tacrolimus or sodium bicarbonate?
SELECT COUNT(*) > 0 FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 16472) AND prescriptions.drug IN ('albumin 25% (12.5g / 50ml)', 'tacrolimus', 'sodium bicarbonate') AND STRFTIME('%y-%m', prescriptions.startdate) >= '2104-02'
mimic_iii
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...
从2010年9月11日直到19年6月8日医疗机构1793987的入院诊断疾病结果与出院诊断疾病结果有多少次不一样?
SELECT COUNT(*) FROM gwyjzb WHERE gwyjzb.MED_SER_ORG_NO = '1793987' AND gwyjzb.IN_HOSP_DATE BETWEEN '2010-09-11' AND '2019-06-08' AND gwyjzb.IN_DIAG_DIS_CD <> gwyjzb.OUT_DIAG_DIS_CD UNION SELECT COUNT(*) FROM fgwyjzb WHERE fgwyjzb.MED_SER_ORG_NO = '1793987' AND fgwyjzb.IN_HOSP_DATE BETWEEN '2010-09-11' AND '2019-06-08'...
css
CREATE TABLE table_32001 ( "Rank" real, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
How many Silver medals did nation who is ranked greater than 1 and has 4 Gold medals have?
SELECT SUM("Silver") FROM table_32001 WHERE "Rank" > '1' AND "Gold" = '4'
wikisql
CREATE TABLE table_204_525 ( id number, "rank" number, "player" text, "county" text, "tally" text, "total" number, "opposition" text )
how many players have a total above 10 ?
SELECT COUNT(DISTINCT "player") FROM table_204_525 WHERE "total" > 10
squall
CREATE TABLE table_name_71 ( version VARCHAR, year VARCHAR )
Tell me the version for 1940-45
SELECT version FROM table_name_71 WHERE year = "1940-45"
sql_create_context
CREATE TABLE Activity ( Id VARCHAR )
How many activities do we have?
SELECT COUNT(*) FROM Activity
sql_create_context
CREATE TABLE table_12921 ( "Tournament" text, "2007" text, "2008" text, "2009" text, "2010" text, "2011" text, "2012" text )
What is the 2011 entry for the row with a 2007 entry of 558?
SELECT "2011" FROM table_12921 WHERE "2007" = '558'
wikisql
CREATE TABLE table_name_82 ( away_team VARCHAR, venue VARCHAR )
Which Away team has a Venue of mcg?
SELECT away_team FROM table_name_82 WHERE venue = "mcg"
sql_create_context
CREATE TABLE table_name_68 ( record VARCHAR, game VARCHAR )
What was the record of Game 43?
SELECT record FROM table_name_68 WHERE game = 43
sql_create_context
CREATE TABLE table_70330 ( "Tournament" text, "2008" text, "2010" text, "2011" text, "2012" text, "2013" text )
Name the 2012 for 2011 being 1r
SELECT "2012" FROM table_70330 WHERE "2011" = '1r'
wikisql
CREATE TABLE table_1115992_1 ( sept_1943 INTEGER, late_1943 VARCHAR )
What is the least september 1943 when late 1943 is 78000
SELECT MIN(sept_1943) FROM table_1115992_1 WHERE late_1943 = 78000
sql_create_context
CREATE TABLE table_17467447_1 ( directed_by VARCHAR, production_code VARCHAR )
If the product code is 2t6267, who was the director?
SELECT directed_by FROM table_17467447_1 WHERE production_code = "2T6267"
sql_create_context
CREATE TABLE table_name_16 ( game VARCHAR, score VARCHAR, january VARCHAR )
How many games have a Score of 3 0, and a January larger than 12?
SELECT COUNT(game) FROM table_name_16 WHERE score = "3–0" AND january > 12
sql_create_context
CREATE TABLE ReviewTaskResultTypes ( Id number, Name text, Description text ) CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPrivilegedUserGuidance text, MarkdownConce...
select id from posts where ViewCount>100000.
SELECT Id, Title FROM Posts WHERE ViewCount > 100000
sede
CREATE TABLE table_20338 ( "School" text, "Location" text, "Control" text, "Type" text, "Enrollment" real, "Founded" real )
Name the location when control is private and founded is 1870
SELECT "Location" FROM table_20338 WHERE "Control" = 'Private' AND "Founded" = '1870'
wikisql
CREATE TABLE airports ( apid number, name text, city text, country text, x number, y number, elevation number, iata text, icao text ) CREATE TABLE routes ( rid number, dst_apid number, dst_ap text, src_apid number, src_ap text, alid number, airline text, ...
How many airports' names have the word Interanation in them?
SELECT COUNT(*) FROM airports WHERE name LIKE '%International%'
spider
CREATE TABLE table_name_81 ( venue VARCHAR, winner VARCHAR )
What venue was the game played in when the winner was the atlanta hawks (11)?
SELECT venue FROM table_name_81 WHERE winner = "atlanta hawks (11)"
sql_create_context
CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) ) CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_ID decimal(4,0) ) CREATE TABLE employees ( EMPLOYE...
For those employees who did not have any job in the past, visualize a bar chart about the distribution of hire_date and the amount of hire_date bin hire_date by weekday, sort by the how many hire date in ascending please.
SELECT HIRE_DATE, COUNT(HIRE_DATE) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) ORDER BY COUNT(HIRE_DATE)
nvbench
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 demographic ( subject_id text, hadm_id t...
report the number of patients who died on or before 2183 and had atrial fibrillation/thoracoscopic maze procedure bilateral/sda primary disease.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "ATRIAL FIBRILLATION\THORACOSCOPIC MAZE PROCEDURE BILATERAL/SDA" AND demographic.dod_year <= "2183.0"
mimicsql_data
CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE ReviewRejectionReasons ( Id number, Na...
Number of questions for a moon tag.
SELECT COUNT(*) FROM Posts WHERE Id IN (SELECT DISTINCT (PostId) FROM PostTags WHERE TagId IN (SELECT Id FROM Tags WHERE TagName LIKE '%moon%'))
sede
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 year of death is less than or equal to 2148 and procedure long title is arteriography of cerebral arteries?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.dod_year <= "2148.0" AND procedures.long_title = "Arteriography of cerebral arteries"
mimicsql_data
CREATE TABLE table_11411026_2 ( written_by VARCHAR, us_viewers__millions_ VARCHAR )
Who wrote an episode watched by 19.01 million US viewers?
SELECT written_by FROM table_11411026_2 WHERE us_viewers__millions_ = "19.01"
sql_create_context
CREATE TABLE table_name_36 ( record VARCHAR, home VARCHAR )
What is the Record when Buffalo is at Home?
SELECT record FROM table_name_36 WHERE home = "buffalo"
sql_create_context
CREATE TABLE table_name_43 ( game INTEGER, record VARCHAR, points VARCHAR )
Which Game has a Record of 8 2 0, and Points larger than 16?
SELECT SUM(game) FROM table_name_43 WHERE record = "8–2–0" AND points > 16
sql_create_context
CREATE TABLE table_15819 ( "District" text, "Counties Represented" text, "Party" text, "First Elected" real, "Committee" text )
What counties represented have a democratic committee, and a committee of ways and means?
SELECT "Counties Represented" FROM table_15819 WHERE "Party" = 'democratic' AND "Committee" = 'ways and means'
wikisql
CREATE TABLE table_2840500_4 ( position VARCHAR, player VARCHAR )
How many draft pick positions did Matt Bradley have?
SELECT COUNT(position) FROM table_2840500_4 WHERE player = "Matt Bradley"
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 lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text,...
provide the number of patients whose ethnicity is black/african american and diagnoses is below knee amputation status.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.ethnicity = "BLACK/AFRICAN AMERICAN" AND diagnoses.long_title = "Below knee amputation status"
mimicsql_data