context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE demographic ...
provide the number of patients whose lab test name is wbc, other fluid?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE lab.label = "WBC, Other Fluid"
mimicsql_data
CREATE TABLE table_name_68 ( round INTEGER, school_club_team VARCHAR, pick VARCHAR )
Which Round has a School/Club Team of arizona, and a Pick smaller than 298?
SELECT MAX(round) FROM table_name_68 WHERE school_club_team = "arizona" AND pick < 298
sql_create_context
CREATE TABLE table_204_785 ( id number, "rank" number, "nation" text, "gold" number, "silver" number, "bronze" number, "total" number )
which is the only country to not receive a gold medal ?
SELECT "nation" FROM table_204_785 WHERE "gold" = 0
squall
CREATE TABLE table_15844 ( "State/territory" text, "Text/background colour" text, "Format" text, "Current slogan" text, "Current series" text, "Notes" text )
Name the background colour for the Australian Capital Territory
SELECT "Text/background colour" FROM table_15844 WHERE "State/territory" = 'Australian Capital Territory'
wikisql
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 employees ( EMPLOYEE_ID decimal(6,0...
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, draw a scatter chart about the correlation between commission_pct and manager_id .
SELECT COMMISSION_PCT, MANAGER_ID FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40
nvbench
CREATE TABLE table_name_54 ( pennant_number INTEGER, ships_in_class VARCHAR )
What is the highest pennant number with ships in raahe class?
SELECT MAX(pennant_number) FROM table_name_54 WHERE ships_in_class = "raahe"
sql_create_context
CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAddress text ) CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversa...
Downvote percentages for users within a specific rep range.
SELECT Id AS "user_link", Reputation, UpVotes, DownVotes, ROUND(((CAST((DownVotes * 100) AS FLOAT)) / (CAST((UpVotes + DownVotes) AS FLOAT))), 2) AS PercentDownvotes FROM Users WHERE Reputation >= '##MinReputation##' AND Reputation <= '##MaxReputation##' AND (UpVotes + DownVotes > 0) ORDER BY PercentDownvotes DESC
sede
CREATE TABLE people ( People_ID int, Name text, Country text, Is_Male text, Age int ) CREATE TABLE church ( Church_ID int, Name text, Organized_by text, Open_Date int, Continuation_of text ) CREATE TABLE wedding ( Church_ID int, Male_ID int, Female_ID int, Year ...
Show the name and age for all male people who don't have a wedding with a bar chart, and I want to show from low to high by the names.
SELECT Name, Age FROM people WHERE Is_Male = 'T' AND NOT People_ID IN (SELECT Male_ID FROM wedding) ORDER BY Name
nvbench
CREATE TABLE table_15748 ( "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Prod. code" real )
Who wrote the episode with a production code greater than 1.4 direcyed by rick wallace?
SELECT "Written by" FROM table_15748 WHERE "Prod. code" > '1.4' AND "Directed by" = 'rick wallace'
wikisql
CREATE TABLE table_name_26 ( goals INTEGER, result VARCHAR )
How many Goals have a Result of 0 4?
SELECT AVG(goals) FROM table_name_26 WHERE result = "0 – 4"
sql_create_context
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, ...
看看患者水清懿过往的门诊诊断证明
SELECT txmzjzjlb.JZZDBM, txmzjzjlb.JZZDSM FROM person_info JOIN hz_info JOIN txmzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = txmzjzjlb.YLJGDM AND hz_info.KH = txmzjzjlb.KH AND hz_info.KLX = txmzjzjlb.KLX WHERE person_info.XM = '水清懿' UNION SELECT ftxmzjzjlb.JZZDBM, ftxmzjzjlb.JZZDSM FROM person_info JO...
css
CREATE TABLE table_name_32 ( republican_ticket VARCHAR, communist_ticket VARCHAR )
Who's the Republican ticket with a Communist ticket of elizabeth gurley flynn?
SELECT republican_ticket FROM table_name_32 WHERE communist_ticket = "elizabeth gurley flynn"
sql_create_context
CREATE TABLE table_13657883_2 ( gtu_winning_team VARCHAR, gto_winning_team VARCHAR )
What was the gtu winning team when the gto winning team was #48 greenwood racing?
SELECT gtu_winning_team FROM table_13657883_2 WHERE gto_winning_team = "#48 Greenwood Racing"
sql_create_context
CREATE TABLE table_name_89 ( winner VARCHAR, stage VARCHAR, points_classification VARCHAR, intergiro_classification VARCHAR )
Name the winner for adriano baffi and integiro classification of j n svorada for stage of 13
SELECT winner FROM table_name_89 WHERE points_classification = "adriano baffi" AND intergiro_classification = "ján svorada" AND stage = "13"
sql_create_context
CREATE TABLE table_name_15 ( pick INTEGER, player VARCHAR )
What is Mark Joseph Kong's pick?
SELECT AVG(pick) FROM table_name_15 WHERE player = "mark joseph kong"
sql_create_context
CREATE TABLE trip ( id INTEGER, duration INTEGER, start_date TEXT, start_station_name TEXT, start_station_id INTEGER, end_date TEXT, end_station_name TEXT, end_station_id INTEGER, bike_id INTEGER, subscription_type TEXT, zip_code INTEGER ) CREATE TABLE station ( id INTEG...
What are the number of the dates in which the mean sea level pressure was between 303 and 31?, display date in asc order.
SELECT date, COUNT(date) FROM weather WHERE mean_sea_level_pressure_inches BETWEEN 30.3 AND 31 GROUP BY date ORDER BY date
nvbench
CREATE TABLE PostHistoryTypes ( Id number, Name text ) 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 ...
Title starts and end with a slash.
SELECT Id, Title, Score FROM Posts WHERE Title LIKE '/%/'
sede
CREATE TABLE table_31109 ( "Rank 2011" real, "Country" text, "Production in 2011 (1,000 ton)" real, "Share 2011" text, "Rank 2010" real, "Production in 2010 (1,000 ton)" real )
When 75849 is the production in 2010 (1,000 ton) what is the production in 2011 (1,000 ton)?
SELECT "Production in 2011 (1,000 ton)" FROM table_31109 WHERE "Production in 2010 (1,000 ton)" = '75849'
wikisql
CREATE TABLE table_15869204_9 ( high_rebounds VARCHAR, team VARCHAR )
Who scored the most rebounds in the game against Chicago?
SELECT high_rebounds FROM table_15869204_9 WHERE team = "Chicago"
sql_create_context
CREATE TABLE table_1301373_7 ( captain VARCHAR, international_marquee VARCHAR )
Name the captain for emile heskey
SELECT captain FROM table_1301373_7 WHERE international_marquee = "Emile Heskey"
sql_create_context
CREATE TABLE table_name_74 ( malaysia_cup INTEGER, player VARCHAR, fa_cup VARCHAR )
What is Zamri Hassan's lowest Malaysia Cup when there were an FA Cup of 0?
SELECT MIN(malaysia_cup) FROM table_name_74 WHERE player = "zamri hassan" AND fa_cup < 0
sql_create_context
CREATE TABLE table_77767 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
What was the lowest Crowd during the Away Team Score of 10.11 (71)?
SELECT MIN("Crowd") FROM table_77767 WHERE "Away team score" = '10.11 (71)'
wikisql
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...
袁文栋这位参保人在0四年九月二十九日到二一年十月四日期间,单一种药品的最大购买次数有过几次
SELECT COUNT(*) FROM t_kc21 JOIN t_kc22 JOIN t_kc21_t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc21_t_kc22.MED_CLINIC_ID AND t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID WHERE t_kc21.PERSON_NM = '袁文栋' AND t_kc22.STA_DATE BETWEEN '2004-09-29' AND '2021-10-04' GROUP BY t_kc22.SOC_SRT_DIRE_CD ORDER BY COUNT(*) DESC LIMIT ...
css
CREATE TABLE table_24954 ( "Rank" real, "Athlete" text, "Nation" text, "Olympics" text, "Gold" real, "Silver" real, "Bronze" real, "Total(min. 2 medals)" real )
Name the most rank
SELECT MAX("Rank") FROM table_24954
wikisql
CREATE TABLE table_13576 ( "Player" text, "Country" text, "Year(s) won" text, "Total" real, "To par" real )
Who was the player from the United States, with a total larger than 145?
SELECT "Player" FROM table_13576 WHERE "Country" = 'united states' AND "Total" > '145'
wikisql
CREATE TABLE table_50118 ( "Points" real, "Score" text, "Premiers" text, "Runners Up" text, "Details" text )
Which premier team played the 1951 NSWRFL Grand Final?
SELECT "Premiers" FROM table_50118 WHERE "Details" = '1951 nswrfl grand final'
wikisql
CREATE TABLE table_32558 ( "Week" text, "Date" text, "Location" text, "Opponent" text, "Result" text )
Who one in the Tampa Bay Buccaneers?
SELECT "Result" FROM table_32558 WHERE "Opponent" = 'tampa bay buccaneers'
wikisql
CREATE TABLE table_67830 ( "Round" real, "Overall" real, "Player" text, "Position" text, "College" text )
What is the college when the over is larger than 15 in round 7?
SELECT "College" FROM table_67830 WHERE "Overall" > '15' AND "Round" = '7'
wikisql
CREATE TABLE Ref_Budget_Codes ( Budget_Type_Code CHAR(15), Budget_Type_Description VARCHAR(255) ) CREATE TABLE Statements ( Statement_ID INTEGER, Statement_Details VARCHAR(255) ) CREATE TABLE Accounts ( Account_ID INTEGER, Statement_ID INTEGER, Account_Details VARCHAR(255) ) CREATE TABLE ...
Show the number of accounts for different statement details in a bar chart.
SELECT Statement_Details, COUNT(Statement_Details) FROM Accounts AS T1 JOIN Statements AS T2 ON T1.Statement_ID = T2.Statement_ID GROUP BY Statement_Details
nvbench
CREATE TABLE table_name_97 ( winner VARCHAR, finalist VARCHAR )
WHo is the Winner of andre agassi Finalist?
SELECT winner FROM table_name_97 WHERE finalist = "andre agassi"
sql_create_context
CREATE TABLE table_72800 ( "Position" real, "Driver / Passenger" text, "Equipment" text, "Bike No" real, "Points" real )
What are the points for ktm-vmc equipment?
SELECT "Points" FROM table_72800 WHERE "Equipment" = 'KTM-VMC'
wikisql
CREATE TABLE table_name_81 ( score VARCHAR, player VARCHAR )
What is Score, when Player is 'Vijay Singh'?
SELECT score FROM table_name_81 WHERE player = "vijay singh"
sql_create_context
CREATE TABLE table_30235 ( "Round" text, "Clubs remaining" real, "Clubs involved" real, "Winners from previous round" text, "New entries this round" text, "Leagues entering at this round" text )
What was the round that had 32 winners from previous round?
SELECT "Round" FROM table_30235 WHERE "Winners from previous round" = '32'
wikisql
CREATE TABLE table_name_37 ( nation VARCHAR, record VARCHAR )
What is the Nation with a Record that is 7.39?
SELECT nation FROM table_name_37 WHERE record = "7.39"
sql_create_context
CREATE TABLE ReviewTaskResultTypes ( Id number, Name text, Description text ) CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE FlagTypes ( Id ...
Reputation per day average from highest to lowest.
SELECT Id, DisplayName, DATEDIFF(dd, CreationDate, GETDATE()), Reputation FROM Users WHERE Id = 186134
sede
CREATE TABLE Dorm_amenity ( amenid INTEGER, amenity_name VARCHAR(25) ) CREATE TABLE Student ( StuID INTEGER, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3) ) CREATE TABLE Dorm ( dormid INTEGER, dor...
Find the number of male students (with sex M) from each city in a bar chart, could you show in desc by the Y-axis please?
SELECT city_code, COUNT(*) FROM Student WHERE Sex = 'M' GROUP BY city_code ORDER BY COUNT(*) DESC
nvbench
CREATE TABLE Subjects ( subject_id INTEGER, subject_name VARCHAR(120) ) CREATE TABLE Students ( student_id INTEGER, date_of_registration DATETIME, date_of_latest_logon DATETIME, login_name VARCHAR(40), password VARCHAR(10), personal_name VARCHAR(40), middle_name VARCHAR(40), fam...
Find the the date of enrollment of the 'Spanish' course, and count them by a bar chart
SELECT date_of_enrolment, COUNT(date_of_enrolment) FROM Courses AS T1 JOIN Student_Course_Enrolment AS T2 ON T1.course_id = T2.course_id WHERE T1.course_name = "Spanish"
nvbench
CREATE TABLE table_203_512 ( id number, "release date" text, "album" text, "catalog number" text, "chart position" number, "notes" text )
pulse was the first album what was the second ?
SELECT "album" FROM table_203_512 WHERE id = 2
squall
CREATE TABLE status ( station_id INTEGER, bikes_available INTEGER, docks_available INTEGER, time TEXT ) CREATE TABLE trip ( id INTEGER, duration INTEGER, start_date TEXT, start_station_name TEXT, start_station_id INTEGER, end_date TEXT, end_station_name TEXT, end_station...
Show me a bar chart for what are the different ids and names of the stations that have had more than 12 bikes available?, show by the x-axis from low to high.
SELECT name, id FROM station AS T1 JOIN status AS T2 ON T1.id = T2.station_id WHERE T2.bikes_available > 12 ORDER BY name
nvbench
CREATE TABLE table_19786 ( "English gloss" text, "Santee-Sisseton" text, "Yankton-Yanktonai" text, "Northern Lakota" text, "Southern Lakota" text )
Name the yankton yanktonai for wi h a
SELECT "Yankton-Yanktonai" FROM table_19786 WHERE "Southern Lakota" = 'wičháša'
wikisql
CREATE TABLE Staff ( first_name VARCHAR ) CREATE TABLE Lessons ( staff_id VARCHAR )
What is the first name of the staff who did not give any lesson?
SELECT first_name FROM Staff EXCEPT SELECT T2.first_name FROM Lessons AS T1 JOIN Staff AS T2 ON T1.staff_id = T2.staff_id
sql_create_context
CREATE TABLE table_name_66 ( country VARCHAR, value_in_usd VARCHAR, currency VARCHAR )
Which country uses pound sterling with a value higher than 1.33 USD?
SELECT country FROM table_name_66 WHERE value_in_usd > 1.33 AND currency = "pound sterling"
sql_create_context
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, ...
给病人72447719审核检验报告的人员工号及姓名是什么,在医疗就诊00619973238中
SELECT zyjybgb.SHRGH, zyjybgb.SHRXM FROM zyjybgb WHERE zyjybgb.JZLSH = '00619973238' UNION SELECT mzjybgb.SHRGH, mzjybgb.SHRXM FROM mzjybgb WHERE mzjybgb.JZLSH = '00619973238'
css
CREATE TABLE table_name_43 ( ihsaa_class___football___soccer VARCHAR, location VARCHAR )
what is teh ihsaa class/football/soccer when the location is alexandria?
SELECT ihsaa_class___football___soccer FROM table_name_43 WHERE location = "alexandria"
sql_create_context
CREATE TABLE table_name_15 ( country VARCHAR, name VARCHAR )
What country does Glory Alozie play for?
SELECT country FROM table_name_15 WHERE name = "glory alozie"
sql_create_context
CREATE TABLE table_10360823_1 ( player_name VARCHAR, round VARCHAR )
Which player was chosen in round 17?
SELECT player_name FROM table_10360823_1 WHERE round = 17
sql_create_context
CREATE TABLE table_19295 ( "Series #" real, "Title" text, "Story by" text, "Teleplay by" text, "Directed by" text, "Original air date" text )
What is the title of series #1?
SELECT "Title" FROM table_19295 WHERE "Series #" = '1'
wikisql
CREATE TABLE table_name_20 ( opponent VARCHAR, venue VARCHAR )
Who was the opponent at the competition held at Jeonju?
SELECT opponent FROM table_name_20 WHERE venue = "jeonju"
sql_create_context
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...
count the number of patients whose age is less than 89 and item id is 50889?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.age < "89" AND lab.itemid = "50889"
mimicsql_data
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospit...
have diagnosed patient 030-34260 with s/p knee surgery - replacement during their first hospital encounter?
SELECT COUNT(*) > 0 FROM diagnosis WHERE diagnosis.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '030-34260' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.ho...
eicu
CREATE TABLE table_name_5 ( years VARCHAR, jersey_number_s_ INTEGER )
What years did the player with the jersey number bigger than 20 play?
SELECT years FROM table_name_5 WHERE jersey_number_s_ > 20
sql_create_context
CREATE TABLE flight ( aircraft_code_sequence text, airline_code varchar, airline_flight text, arrival_time int, connections int, departure_time int, dual_carrier text, flight_days text, flight_id int, flight_number int, from_airport varchar, meal_code text, stops int,...
an early flight on wednesday morning from BALTIMORE to NEWARK
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 = 'NEWARK' AND date_day.day_number = 23 AND date_day.month_number = 4 AND d...
atis
CREATE TABLE Bookings_Services ( Order_ID INTEGER, Product_ID INTEGER ) CREATE TABLE Customer_Orders ( Order_ID INTEGER, Customer_ID INTEGER, Store_ID INTEGER, Order_Date DATETIME, Planned_Delivery_Date DATETIME, Actual_Delivery_Date DATETIME, Other_Order_Details VARCHAR(255) ) CRE...
Can you draw the trend of the number of actual delivery date over the actual delivery date?, and order X-axis in descending order.
SELECT Actual_Delivery_Date, COUNT(Actual_Delivery_Date) FROM Bookings ORDER BY Actual_Delivery_Date DESC
nvbench
CREATE TABLE requirement ( requirement_id int, requirement varchar, college varchar ) CREATE TABLE ta ( campus_job_id int, student_id int, location varchar ) CREATE TABLE program_requirement ( program_id int, category varchar, min_credit int, additional_req varchar ) CREATE TA...
Which courses for the PreMajor requirement are there in Mechanical Behavior of Materials ?
SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN area ON course.course_id = area.course_id INNER JOIN program_course ON program_course.course_id = course.course_id WHERE (area.area LIKE '%Mechanical Behavior of Materials%' OR course.description LIKE '%Mechanical Behavior of Materials...
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...
团伙成员43929858最常开的药品排序是什么次序
SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM gwyjzb JOIN t_kc22 ON gwyjzb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gwyjzb.PERSON_ID = '43929858' GROUP BY t_kc22.SOC_SRT_DIRE_CD ORDER BY COUNT(*) DESC UNION SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM fgwyjzb JOIN t_kc22 ON fgwyjzb.MED_CLIN...
css
CREATE TABLE program_requirement ( program_id int, category varchar, min_credit int, additional_req varchar ) CREATE TABLE semester ( semester_id int, semester varchar, year int ) CREATE TABLE area ( course_id int, area varchar ) CREATE TABLE offering_instructor ( offering_ins...
Are ULCS classes available next Winter ?
SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester INNER JOIN program_course ON program_course.course_id = course_offering.course_id WHERE program_cour...
advising
CREATE TABLE table_37876 ( "Game" real, "March" real, "Opponent" text, "Score" text, "Record" text, "Points" real )
What is the latest in March when the record of 35 16 6 3?
SELECT MAX("March") FROM table_37876 WHERE "Record" = '35–16–6–3'
wikisql
CREATE TABLE stadium ( ID int, name text, Capacity int, City text, Country text, Opening_year int ) CREATE TABLE event ( ID int, Name text, Stadium_ID int, Year text ) CREATE TABLE record ( ID int, Result text, Swimmer_ID int, Event_ID int ) CREATE TABLE swimme...
Find Nationality and the sum of meter_100 , and group by attribute Nationality, and visualize them by a bar chart, and sort by the X-axis from high to low.
SELECT Nationality, SUM(meter_100) FROM swimmer GROUP BY Nationality ORDER BY Nationality DESC
nvbench
CREATE TABLE table_name_15 ( grid INTEGER, driver VARCHAR, laps VARCHAR )
What is the largest grid with a Driver of ralph firman, and a Lap smaller than 18?
SELECT MAX(grid) FROM table_name_15 WHERE driver = "ralph firman" AND laps < 18
sql_create_context
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id t...
what number of patients admitted in emergency were tested for acetaminophen?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_type = "EMERGENCY" AND lab.label = "Acetaminophen"
mimicsql_data
CREATE TABLE table_73853 ( "Season" real, "Series" text, "Team" text, "Car No." real, "Races" real, "Poles" real, "Wins" real, "FLaps" real, "Points" text, "Position" text )
Name the points for car number 4
SELECT "Points" FROM table_73853 WHERE "Car No." = '4'
wikisql
CREATE TABLE table_name_96 ( centerfold_model VARCHAR, interview_subject VARCHAR )
Who was the Centerfold model in the issue in which the Interview subject was Jos Napole n Duarte?
SELECT centerfold_model FROM table_name_96 WHERE interview_subject = "josé napoleón duarte"
sql_create_context
CREATE TABLE railway_manage ( Railway_ID int, Manager_ID int, From_Year text ) CREATE TABLE railway ( Railway_ID int, Railway text, Builder text, Built text, Wheels text, Location text, ObjectNumber text ) CREATE TABLE train ( Train_ID int, Train_Num text, Name text...
Show the number of the countries that have managers of age above 50 or below 46, list in descending by the bars.
SELECT Country, COUNT(Country) FROM manager WHERE Age > 50 OR Age < 46 GROUP BY Country ORDER BY Country DESC
nvbench
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 prescriptions ( row_id number, subject_id number, h...
what was the name of the first intake of patient 8116 that they had today?
SELECT d_items.label FROM d_items WHERE d_items.itemid IN (SELECT inputevents_cv.itemid FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 8116)) AND DATETIME(inputevents_cv.c...
mimic_iii
CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartr...
how many patients until 2 years ago had a hyperglycemia diagnosis within 2 months after having undergone stress ulcer treatment - ranitidine?
SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, treatment.treatmenttime FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'stress ulcer treatment - ranitidine' AND DATETIME(treatment.treatmenttime) <= DATETIME(CURRENT_TIME(), '-2 y...
eicu
CREATE TABLE table_name_70 ( format VARCHAR, country VARCHAR, catalogue__number VARCHAR )
What is the format of catalog number 886973273913 (gowow012) in the United Kingdom?
SELECT format FROM table_name_70 WHERE country = "united kingdom" AND catalogue__number = "886973273913 (gowow012)"
sql_create_context
CREATE TABLE table_13989 ( "Rank" real, "Athlete" text, "Country" text, "Time" text, "Notes" text )
What is Alan Campbell's Country with Notes of FA?
SELECT "Country" FROM table_13989 WHERE "Notes" = 'fa' AND "Athlete" = 'alan campbell'
wikisql
CREATE TABLE table_9137 ( "Tie no" text, "Home team" text, "Score" text, "Away team" text, "Date" text )
What date did the away team Bristol Rovers play?
SELECT "Date" FROM table_9137 WHERE "Away team" = 'bristol rovers'
wikisql
CREATE TABLE table_57835 ( "Round" real, "Player" text, "Position" text, "Nationality" text, "College/Junior/Club Team (League)" text )
What is the nationality of the player with a round after 4 and plays right wing?
SELECT "Nationality" FROM table_57835 WHERE "Round" > '4' AND "Position" = 'right wing'
wikisql
CREATE TABLE table_14563 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" text, "Record" text )
Which Date has an Attendance of 30,612?
SELECT "Date" FROM table_14563 WHERE "Attendance" = '30,612'
wikisql
CREATE TABLE table_26429658_1 ( written_by VARCHAR, directed_by VARCHAR )
How many episodes were directed by Arlene Sanford?
SELECT COUNT(written_by) FROM table_26429658_1 WHERE directed_by = "Arlene Sanford"
sql_create_context
CREATE TABLE table_name_24 ( year INTEGER, bsu_head_coach VARCHAR )
What is the sum of the years with bus conner as the BSU head coach?
SELECT SUM(year) FROM table_name_24 WHERE bsu_head_coach = "bus conner"
sql_create_context
CREATE TABLE train_station ( Train_ID int, Station_ID int ) CREATE TABLE station ( Station_ID int, Name text, Annual_entry_exit real, Annual_interchanges real, Total_Passengers real, Location text, Main_Services text, Number_of_Platforms int ) CREATE TABLE train ( Train_ID ...
Give me a pie to show total number of number of platforms from different location.
SELECT Location, SUM(Number_of_Platforms) FROM station GROUP BY Location
nvbench
CREATE TABLE table_3066 ( "Round" real, "Date" text, "Country" text, "Circuit" text, "Sprint Winner" text, "Main Winner" text, "Report" text )
Name the date for sprint winner mexico
SELECT "Date" FROM table_3066 WHERE "Sprint Winner" = 'Mexico'
wikisql
CREATE TABLE table_203_755 ( id number, "singing position" number, "song title" text, "informal translation" text, "act" text, "percentage of votes" text, "final position" text )
what is the total number of songs that are listed in the table ?
SELECT COUNT("song title") FROM table_203_755
squall
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) 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 te...
54831539211的检验报告单对应的是什么项目代码和名称
SELECT zyjybgb.JYXMDM, zyjybgb.JYXMMC FROM zyjybgb WHERE zyjybgb.BGDH = '54831539211' UNION SELECT mzjybgb.JYXMDM, mzjybgb.JYXMMC FROM mzjybgb WHERE mzjybgb.BGDH = '54831539211'
css
CREATE TABLE table_name_17 ( company_or_product_name VARCHAR, episode VARCHAR, money_requested__£_ VARCHAR )
Which Company or Product name requested 70,000 on Episode 11?
SELECT company_or_product_name FROM table_name_17 WHERE episode = "episode 11" AND money_requested__£_ = "70,000"
sql_create_context
CREATE TABLE table_name_72 ( withdrawn VARCHAR, gsr_class VARCHAR )
What is withdrawn with a GSR Class of 296?
SELECT withdrawn FROM table_name_72 WHERE gsr_class = "296"
sql_create_context
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...
tell me the icu stay id of the patient with patient id 2560.
SELECT prescriptions.icustay_id FROM prescriptions WHERE prescriptions.subject_id = "2560"
mimicsql_data
CREATE TABLE table_204_986 ( id number, "#" number, "event year" number, "season" text, "flag bearer" text )
who was the first flag bearer ?
SELECT "flag bearer" FROM table_204_986 ORDER BY "event year" LIMIT 1
squall
CREATE TABLE table_21901 ( "Year(s)" real, "Final television commentator" text, "Radio commentator" text, "Spokesperson" text, "Semi-final television commentator" text, "Semi-final second television commentator" text )
What was the latest year that Colin Berry was the spokesperson?
SELECT MAX("Year(s)") FROM table_21901 WHERE "Spokesperson" = 'Colin Berry'
wikisql
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 Posts ( Id number, PostTypeId number, AcceptedAnswer...
Hidden gems: Highest question score per thousand views (minimum 1,000 views).
SELECT Posts.Id AS "post_link", Posts.OwnerUserId AS "user_link", Score, ViewCount, Score * 1000 / ViewCount AS "Score per Thousand Views" FROM Posts WHERE Score > 0 AND ViewCount >= 1000 AND PostTypeId = 1 ORDER BY Score * 1000 / ViewCount DESC LIMIT 1000
sede
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost numbe...
when was the last time patient 021-25705 has been diagnosed with depression since 2 years ago?
SELECT diagnosis.diagnosistime FROM diagnosis WHERE diagnosis.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '021-25705')) AND diagnosis.diagnosisname = 'depression' AND DATET...
eicu
CREATE TABLE table_1547951_3 ( year VARCHAR, outcome VARCHAR, championship VARCHAR )
Name the total number of years where runner-up and championship is us open
SELECT COUNT(year) FROM table_1547951_3 WHERE outcome = "Runner-up" AND championship = "US Open"
sql_create_context
CREATE TABLE jybgb ( BBCJBW text, BBDM text, BBMC text, BBZT number, BGDH text, BGJGDM text, BGJGMC text, BGRGH text, BGRQ time, BGRXM text, BGSJ time, CJRQ time, JSBBRQSJ time, JSBBSJ time, JYBBH text, JYJGMC text, JYJSGH text, JYJSQM text, JY...
患者水光耀在0五年一月九日到一三年八月二日期间,总共到医院看过多少次病
SELECT (SELECT COUNT(*) FROM hz_info JOIN mzjzjlb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX WHERE hz_info.person_info_XM = '水光耀' AND mzjzjlb.JZKSRQ BETWEEN '2005-01-09' AND '2013-08-02') + (SELECT COUNT(*) FROM hz_info JOIN zyjzjlb ON hz_info.YLJGDM = zyjzjlb.YLJGDM AN...
css
CREATE TABLE table_63765 ( "play" text, "author" text, "company" text, "base" text, "country" text )
What is the company from Greece with author Aeschylus?
SELECT "company" FROM table_63765 WHERE "country" = 'greece' AND "author" = 'aeschylus'
wikisql
CREATE TABLE table_16390001_2 ( interview VARCHAR, average VARCHAR )
What are the interview scores for contestants whose average is 9.090?
SELECT interview FROM table_16390001_2 WHERE average = "9.090"
sql_create_context
CREATE TABLE mzjzjlb_jybgb ( YLJGDM_MZJZJLB text, BGDH number, YLJGDM number ) 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, BGRG...
患者35125613493的检验报告单属于哪种类型的检验
SELECT jybgb.JYLX FROM jybgb WHERE jybgb.BGDH = '35125613493'
css
CREATE TABLE table_name_38 ( record_description VARCHAR, date VARCHAR, pilot VARCHAR )
Date of 23 september 1961, and a Pilot of b.v. zemskov had what record description?
SELECT record_description FROM table_name_38 WHERE date = "23 september 1961" AND pilot = "b.v. zemskov"
sql_create_context
CREATE TABLE table_62313 ( "Golden Rivers" text, "Wins" real, "Byes" real, "Losses" real, "Draws" real, "Against" real )
What's the total byes for more than 1 draw?
SELECT COUNT("Byes") FROM table_62313 WHERE "Draws" > '1'
wikisql
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number...
was patient 016-23497 prescribed any medications until 2 years ago?
SELECT COUNT(*) > 0 FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '016-23497')) AND DATETIME(medication.drugstarttime) <= DATETIME(CURRENT_TI...
eicu
CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) ) CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varchar(20), LAST_NAME varchar(25...
For those employees whose salary is in the range of 8000 and 12000 and commission is not null or department number does not equal to 40, give me the comparison about the sum of employee_id over the job_id , and group by attribute job_id, and order by the y axis in descending.
SELECT JOB_ID, SUM(EMPLOYEE_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 GROUP BY JOB_ID ORDER BY SUM(EMPLOYEE_ID) DESC
nvbench
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid number, wa...
when has patient 015-59871 first received a procedure when they came to the hospital last time?
SELECT treatment.treatmenttime FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '015-59871' AND NOT patient.hospitaldischargetime IS NULL ORDER BY...
eicu
CREATE TABLE table_19534874_2 ( indoor INTEGER, inspection VARCHAR )
What are the minimum indoor results that have a 5 for inspection?
SELECT MIN(indoor) FROM table_19534874_2 WHERE inspection = 5
sql_create_context
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, ...
get me the number of patients who are diagnosed with unspecified acute uri and are taking drug via po route.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.short_title = "Acute uri NOS" AND prescriptions.route = "PO"
mimicsql_data
CREATE TABLE table_49229 ( "Class" text, "Part 1" text, "Part 2" text, "Part 3" text, "Part 4" text, "Verb meaning" text )
Which part 2 has a verb that means to leap?
SELECT "Part 2" FROM table_49229 WHERE "Verb meaning" = 'to leap'
wikisql
CREATE TABLE table_11125 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
When did Collingwood play?
SELECT "Date" FROM table_11125 WHERE "Home team" = 'collingwood'
wikisql
CREATE TABLE table_10112 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Game site" text, "Attendance" text )
Which game site has an Opponent of buffalo bills?
SELECT "Game site" FROM table_10112 WHERE "Opponent" = 'buffalo bills'
wikisql
CREATE TABLE table_49233 ( "Tournament" text, "Surface" text, "Week" text, "Winner and score" text, "Finalist" text, "Semifinalists" text )
For the week of August 6, who is the finalist?
SELECT "Finalist" FROM table_49233 WHERE "Week" = 'august 6'
wikisql
CREATE TABLE table_7970 ( "Aircraft" text, "Type" text, "Version" text, "Produced" text, "Quantity" text )
Which type has 140 made?
SELECT "Type" FROM table_7970 WHERE "Quantity" = '140'
wikisql