context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE table_name_25 ( date VARCHAR, record VARCHAR )
On what date was the Blue Jays record 60-56?
SELECT date FROM table_name_25 WHERE record = "60-56"
sql_create_context
CREATE TABLE table_10912 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Leading scorer" text, "Attendance" real, "Record" text )
Who was the leading scorer of the game where the Knicks were the home team and the Warriors were the visiting team?
SELECT "Leading scorer" FROM table_10912 WHERE "Home" = 'knicks' AND "Visitor" = 'warriors'
wikisql
CREATE TABLE staff ( staff_id number, tourist_attraction_id number, name text, other_details text ) CREATE TABLE tourist_attraction_features ( tourist_attraction_id number, feature_id number ) CREATE TABLE visits ( visit_id number, tourist_attraction_id number, tourist_id number, ...
Tell me the price ranges for all the hotels.
SELECT price_range FROM hotels
spider
CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type text, admission_location text, discharge_location text, insurance text, language text, marital_status text, ethnicity text, age number ) CREATE ...
when was the first time that patient 5828 was tested for neutrophils during this month?
SELECT labevents.charttime FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'neutrophils') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 5828) AND DATETIME(labevents.charttime, 'start of month') = DATETIME(CUR...
mimic_iii
CREATE TABLE table_name_89 ( website VARCHAR, language VARCHAR, frequency VARCHAR )
Which english website has a daily frequency ?
SELECT website FROM table_name_89 WHERE language = "english" AND frequency = "daily"
sql_create_context
CREATE TABLE Drama_Workshop_Groups ( Workshop_Group_ID INTEGER, Address_ID INTEGER, Currency_Code CHAR(15), Marketing_Region_Code CHAR(15), Store_Name VARCHAR(255), Store_Phone VARCHAR(255), Store_Email_Address VARCHAR(255), Other_Details VARCHAR(255) ) CREATE TABLE Clients ( Client...
What are the order dates of orders with price higher than 1000, and count them by a line chart
SELECT Order_Date, COUNT(Order_Date) FROM Customer_Orders AS T1 JOIN Order_Items AS T2 ON T1.Order_ID = T2.Order_ID JOIN Products AS T3 ON T2.Product_ID = T3.Product_ID WHERE T3.Product_Price > 1000
nvbench
CREATE TABLE table_8836 ( "Model Number" text, "Frequency" text, "L2-Cache" text, "Front Side Bus" text, "Multiplier" text, "Voltage" text, "Socket" text )
Which Multiplier has a Front Side Bus of 200 mhz, and a Frequency of 1200 mhz?
SELECT "Multiplier" FROM table_8836 WHERE "Front Side Bus" = '200 mhz' AND "Frequency" = '1200 mhz'
wikisql
CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL ) CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER )
Bar chart of minimal price from each name, and order by the y-axis from high to low.
SELECT Name, MIN(Price) FROM Products GROUP BY Name ORDER BY MIN(Price) DESC
nvbench
CREATE TABLE country ( Name VARCHAR, Languages VARCHAR )
List the names of countries whose language is not 'German'.
SELECT Name FROM country WHERE Languages <> "German"
sql_create_context
CREATE TABLE table_18050 ( "#" real, "Player" text, "Country" text, "Points" real, "Events" real, "Reset Points" real )
What is the country for # 8
SELECT "Country" FROM table_18050 WHERE "#" = '8'
wikisql
CREATE TABLE table_42097 ( "Outcome" text, "Date" real, "Championship" text, "Surface" text, "Opponent in the final" text, "Score in the final" text )
What is the Championship with Vitas Gerulaitis as Opponent in the final in a match on Clay Surface?
SELECT "Championship" FROM table_42097 WHERE "Surface" = 'clay' AND "Opponent in the final" = 'vitas gerulaitis'
wikisql
CREATE TABLE table_26707 ( "Major version" text, "Minor version" text, "WebKit version" text, "Operating System" text, "Release date" text, "Features" text )
List all OS's with a webkit version of 525.29.1.
SELECT "Operating System" FROM table_26707 WHERE "WebKit version" = '525.29.1'
wikisql
CREATE TABLE table_name_54 ( method VARCHAR, venue VARCHAR )
The match that was held at Club Med Sandpiper has what method?
SELECT method FROM table_name_54 WHERE venue = "club med sandpiper"
sql_create_context
CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, ExpiryDate time, Body text, OwnerUserId number, DeletionUserId number ) CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE PostTags ( PostId num...
Average Scores for Closed Questions.
SELECT TIME_TO_STR(CreationDate, '%Y') * 12 + TIME_TO_STR(CreationDate, '%m'), AVG(Score) FROM Posts GROUP BY TIME_TO_STR(CreationDate, '%Y') * 12 + TIME_TO_STR(CreationDate, '%m') HAVING TIME_TO_STR(CreationDate, '%Y') * 12 + TIME_TO_STR(CreationDate, '%m') > 24105 ORDER BY TIME_TO_STR(CreationDate, '%Y') * 12 + TIME_...
sede
CREATE TABLE table_25277 ( "Constituency" text, "Winner" text, "Party" text, "Margin" real, "Runner-up a" text, "Party a" text )
Name the party a for sriperumbudur
SELECT "Party a" FROM table_25277 WHERE "Constituency" = 'Sriperumbudur'
wikisql
CREATE TABLE table_train_137 ( "id" int, "hbv" bool, "systolic_blood_pressure_sbp" int, "hemoglobin_a1c_hba1c" float, "substance_dependence" bool, "hcv" bool, "schizophrenia" bool, "neutrophil_count" int, "renal_disease" bool, "creatinine_clearance_cl" float, "platelet_count"...
liver serum transaminases ( ast and / or alt ) > 5 times the upper limit of normal; total and / or direct bilirubin > 1.5 mg / dl, hemoglobin < 9 mg / dl; pt and ptt > 2 times the upper limit of normal; creatinine clearance < 30 ml / min; positive serology for hbv or hcv; absolute neutrophil count < 1500 cells / mm3 an...
SELECT * FROM table_train_137 WHERE bilirubin > 1.5 OR hemoglobin_a1c_hba1c < 9 OR creatinine_clearance_cl < 30 OR (hbv = 1 OR hcv = 1) OR (neutrophil_count < 1500 AND platelet_count < 100000)
criteria2sql
CREATE TABLE table_14598_5 ( s_hindu VARCHAR, buddhist VARCHAR )
What is the data point for s hindu where the buddhist data point is 73.0%?
SELECT COUNT(s_hindu) FROM table_14598_5 WHERE buddhist = "73.0%"
sql_create_context
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) ...
how many patients whose marital status is single and drug route is iv bolus?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.marital_status = "SINGLE" AND prescriptions.route = "IV BOLUS"
mimicsql_data
CREATE TABLE table_72654 ( "No. in series" real, "No. in season" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production code" real, "Viewers (millions)" text )
What are all the numbers in the series with an episode title of 'the beach'?
SELECT "No. in series" FROM table_72654 WHERE "Title" = 'The Beach'
wikisql
CREATE TABLE table_43730 ( "Internet Plan" text, "Downstream" text, "Upstream" text, "Bandwidth Included" text, "Price" text )
What is the price of the internet provider that has an upstream rate of 256 kbit and a downstream rate of 512 kbit?
SELECT "Price" FROM table_43730 WHERE "Upstream" = '256 kbit' AND "Downstream" = '512 kbit'
wikisql
CREATE TABLE table_16520 ( "Team" text, "Stadium" text, "Capacity" real, "Highest" real, "Lowest" real, "Average" real )
What team plays at Palmerston Park?
SELECT "Team" FROM table_16520 WHERE "Stadium" = 'Palmerston Park'
wikisql
CREATE TABLE table_18660 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Result" text, "Candidates" text )
What is the name of the candidate where the incumbent is named James P. Buchanan?
SELECT "Candidates" FROM table_18660 WHERE "Incumbent" = 'James P. Buchanan'
wikisql
CREATE TABLE Acceptance ( Submission_ID int, Workshop_ID int, Result text ) CREATE TABLE workshop ( Workshop_ID int, Date text, Venue text, Name text ) CREATE TABLE submission ( Submission_ID int, Scores real, Author text, College text )
Give me a histogram for how many workshops did each author submit to? Return the author name and the number of workshops, and could you rank by the X-axis in desc?
SELECT Author, COUNT(DISTINCT T1.Workshop_ID) FROM Acceptance AS T1 JOIN submission AS T2 ON T1.Submission_ID = T2.Submission_ID ORDER BY Author DESC
nvbench
CREATE TABLE ship ( ship_id number, name text, type text, built_year number, class text, flag text ) CREATE TABLE captain ( captain_id number, name text, ship_id number, age text, class text, rank text )
What are the ranks of captains that have no captain that are in the Third-rate ship of the line class?
SELECT rank FROM captain EXCEPT SELECT rank FROM captain WHERE class = 'Third-rate ship of the line'
spider
CREATE TABLE Courses ( course_id INTEGER, author_id INTEGER, subject_id INTEGER, course_name VARCHAR(120), course_description VARCHAR(255) ) CREATE TABLE Students ( student_id INTEGER, date_of_registration DATETIME, date_of_latest_logon DATETIME, login_name VARCHAR(40), password...
List the number of completion students in each month and bin date of completion by month interval with a bar chart.
SELECT date_of_completion, COUNT(date_of_completion) FROM Student_Course_Enrolment
nvbench
CREATE TABLE catalog_contents_additional_attributes ( catalog_entry_id number, catalog_level_number number, attribute_id number, attribute_value text ) CREATE TABLE catalog_structure ( catalog_level_number number, catalog_id number, catalog_level_name text ) CREATE TABLE attribute_definiti...
What are the names of catalog entries with level number 8?
SELECT t1.catalog_entry_name FROM catalog_contents AS t1 JOIN catalog_contents_additional_attributes AS t2 ON t1.catalog_entry_id = t2.catalog_entry_id WHERE t2.catalog_level_number = "8"
spider
CREATE TABLE table_204_62 ( id number, "year" number, "winner" text, "second" text, "third" text, "starters" number )
how many horses started the breeders cup juvenile in 2013 ?
SELECT "starters" FROM table_204_62 WHERE "year" = 2013
squall
CREATE TABLE table_name_8 ( position VARCHAR, year VARCHAR, event VARCHAR, competition VARCHAR )
Which Position has an Event of 10,000 m, and a Competition of world championships, and a Year larger than 1993?
SELECT position FROM table_name_8 WHERE event = "10,000 m" AND competition = "world championships" AND year > 1993
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,...
How many male patients use a main drug type?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.gender = "M" AND prescriptions.drug_type = "MAIN"
mimicsql_data
CREATE TABLE t_kc24 ( MED_SAFE_PAY_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, MED_CLINIC_ID text, REF_SLT_FLG number, CLINIC_SLT_DATE time, COMP_ID text, PERSON_ID text, FLX_MED_ORG_ID text, INSU_TYPE text, MED_AMOUT number, PER_ACC_PAY number, OVE_PAY numb...
参保人7099180210元以内小金额结算次数有多少,时间是在17年9月28日到18年2月5日内
SELECT COUNT(*) FROM t_kc24 WHERE PERSON_ID = '70991802' AND CLINIC_SLT_DATE BETWEEN '2017-09-28' AND '2018-02-05' AND MED_AMOUT <= 10
css
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) ...
what is the number of patients whose days of hospital stay is greater than 16 and lab test name is globulin?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.days_stay > "16" AND lab.label = "Globulin"
mimicsql_data
CREATE TABLE table_10821 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
What is the score of the away team when the home team is Footscray?
SELECT "Away team score" FROM table_10821 WHERE "Home team" = 'footscray'
wikisql
CREATE TABLE table_204_358 ( id number, "species" text, "common name" text, "ncbi accession #" text, "ncbi name" text, "length" text, "sequence identity" text, "sequence similarity" text, "years since divergence from human (mya)" number )
which species has the most years since divergence from human ?
SELECT "species" FROM table_204_358 ORDER BY "years since divergence from human (mya)" DESC LIMIT 1
squall
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...
A bar chart about what are the different affiliations, and what is the total enrollment of schools founded after 1850 for each enrollment type?, list by the bars in desc.
SELECT Affiliation, SUM(Enrollment) FROM university WHERE Founded > 1850 GROUP BY Affiliation ORDER BY Affiliation DESC
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 lab ( subject_id text, hadm_id text, ...
what is maximum days of hospital stay of patients whose ethnicity is black/cape verdean?
SELECT MAX(demographic.days_stay) FROM demographic WHERE demographic.ethnicity = "BLACK/CAPE VERDEAN"
mimicsql_data
CREATE TABLE table_3843 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text )
Which team played on November 15?
SELECT "Team" FROM table_3843 WHERE "Date" = 'November 15'
wikisql
CREATE TABLE table_12193259_1 ( mens_singles VARCHAR, season VARCHAR )
Name the mens singles for 1944/1945
SELECT mens_singles FROM table_12193259_1 WHERE season = "1944/1945"
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 prescriptions ( subject_id text, hadm_id...
Find the average age of patients who are married and have a primary disease of chest pain.
SELECT AVG(demographic.age) FROM demographic WHERE demographic.marital_status = "MARRIED" AND demographic.diagnosis = "CHEST PAIN"
mimicsql_data
CREATE TABLE table_name_57 ( president VARCHAR, year VARCHAR )
Who was the president in 1999?
SELECT president FROM table_name_57 WHERE year = 1999
sql_create_context
CREATE TABLE college ( Leader_Name VARCHAR, College_Location VARCHAR )
Show the leader names and locations of colleges.
SELECT Leader_Name, College_Location FROM college
sql_create_context
CREATE TABLE table_203_581 ( id number, "club" text, "chinese" text, "city" text, "home stadium" text, "capacity" number, "average attendance" number )
which club had the highest average attendance ?
SELECT "club" FROM table_203_581 ORDER BY "average attendance" DESC LIMIT 1
squall
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemics...
when was the first time since 03/27/2103 that patient 017-88691 had an intake?
SELECT intakeoutput.intakeoutputtime FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '017-88691')) AND intakeoutput.cellpath LIKE '%intake%...
eicu
CREATE TABLE table_name_93 ( court_surface VARCHAR, began INTEGER )
What was the surface played on for the match than began before 1897?
SELECT court_surface FROM table_name_93 WHERE began < 1897
sql_create_context
CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, char...
patient 28484 visited an emergency room until 3 years ago?
SELECT COUNT(*) > 0 FROM admissions WHERE admissions.subject_id = 28484 AND admissions.admission_location = 'emergency room admit' AND DATETIME(admissions.admittime) <= DATETIME(CURRENT_TIME(), '-3 year')
mimic_iii
CREATE TABLE table_2581397_5 ( date VARCHAR, race VARCHAR )
What date was the Doncaster race?
SELECT date FROM table_2581397_5 WHERE race = "Doncaster"
sql_create_context
CREATE TABLE table_54447 ( "Team" text, "Played" real, "Draw" real, "Lost" real, "Goals For" real, "Goals Against" real, "Goal Difference" real, "Points" real )
Name the average goal difference for draw of 7 and played more than 18
SELECT AVG("Goal Difference") FROM table_54447 WHERE "Draw" = '7' AND "Played" > '18'
wikisql
CREATE TABLE guests ( guest_id number, gender_code text, guest_first_name text, guest_last_name text, date_of_birth time ) CREATE TABLE view_unit_status ( apt_id number, apt_booking_id number, status_date time, available_yn others ) CREATE TABLE apartment_facilities ( apt_id nu...
Which apartment type code is the most common among apartments with more than one bathroom?
SELECT apt_type_code FROM apartments WHERE bathroom_count > 1 GROUP BY apt_type_code ORDER BY COUNT(*) DESC LIMIT 1
spider
CREATE TABLE table_27902171_5 ( high_assists VARCHAR, location_attendance VARCHAR )
How many people are high assists when location attendance is Seattle Center Coliseum 14,180?
SELECT COUNT(high_assists) FROM table_27902171_5 WHERE location_attendance = "Seattle Center Coliseum 14,180"
sql_create_context
CREATE TABLE person_info_hz_info ( RYBH text, KH number, KLX number, YLJGDM number ) 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 t...
38758660的患者之前会有哪些不良反应
SELECT * FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb 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 mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb....
css
CREATE TABLE table_20035 ( "Position" real, "Team" text, "Points" real, "Played" real, "Won" real, "Drawn" real, "Lost" real, "For" real, "Against" real, "Difference" real )
If the difference is 11 how much is for?
SELECT MAX("For") FROM table_20035 WHERE "Difference" = '11'
wikisql
CREATE TABLE table_64048 ( "Title" text, "Author" text, "First Issue" text, "Last Issue" text, "Completed?" text )
What is the last issue entry of Time and Again?
SELECT "Last Issue" FROM table_64048 WHERE "Title" = 'time and again'
wikisql
CREATE TABLE table_name_24 ( podiums INTEGER, finishes VARCHAR, starts VARCHAR )
What is the average number of podiums for drivers with under 12 finishes and under 1 start?
SELECT AVG(podiums) FROM table_name_24 WHERE finishes < 12 AND starts < 1
sql_create_context
CREATE TABLE table_21711 ( "Class" text, "Part 1" text, "Part 2" text, "Part 3" text, "Part 4" text, "Verb meaning" text )
What is the class of the word who's second participle is laug?
SELECT "Class" FROM table_21711 WHERE "Part 2" = 'laug'
wikisql
CREATE TABLE swimmer ( ID int, name text, Nationality text, meter_100 real, meter_200 text, meter_300 text, meter_400 text, meter_500 text, meter_600 text, meter_700 text, Time text ) CREATE TABLE record ( ID int, Result text, Swimmer_ID int, Event_ID int ) ...
Show me a bar chart for how many stadiums does each country have?
SELECT Country, COUNT(*) FROM stadium GROUP BY Country
nvbench
CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_ID decimal(4,0) ) CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE regions ( REGION_ID decimal(5,0), ...
For those employees who was hired before 2002-06-21, show me about the distribution of hire_date and the sum of salary bin hire_date by weekday in a bar chart, could you order by the sum salary in asc?
SELECT HIRE_DATE, SUM(SALARY) FROM employees WHERE HIRE_DATE < '2002-06-21' ORDER BY SUM(SALARY)
nvbench
CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, Dupli...
Most popular bad questions about Python with body _R-year by year. All non-CW questions with at least 1000 views ordered by votes ascending so that the least popular of the questions is on top
SELECT question.Id AS "post_link", question.Title, question.Score, question.Body, question.AnswerCount AS "Answer Count", question.ViewCount, t.TagName FROM Posts AS question JOIN PostTypes AS ty ON ty.Id = question.PostTypeId JOIN PostTags AS questiont ON question.Id = questiont.PostId JOIN Tags AS t ON t.Id = questio...
sede
CREATE TABLE table_name_38 ( december INTEGER, record VARCHAR, game VARCHAR )
Which December has a Record of 21 8 4, and a Game larger than 33?
SELECT AVG(december) FROM table_name_38 WHERE record = "21–8–4" AND game > 33
sql_create_context
CREATE TABLE Subjects ( subject_id INTEGER, subject_name VARCHAR(120) ) CREATE TABLE Course_Authors_and_Tutors ( author_id INTEGER, author_tutor_ATB VARCHAR(3), login_name VARCHAR(40), password VARCHAR(40), personal_name VARCHAR(80), middle_name VARCHAR(80), family_name VARCHAR(80),...
Display a bar chart for what is the name of each course and the corresponding number of student enrollment?, and could you display in asc by the x-axis?
SELECT course_name, COUNT(*) FROM Courses AS T1 JOIN Student_Course_Enrolment AS T2 ON T1.course_id = T2.course_id GROUP BY T1.course_name ORDER BY course_name
nvbench
CREATE TABLE table_name_90 ( gzip VARCHAR, lha_lzh VARCHAR, stuffit VARCHAR, bzip2 VARCHAR )
What is the gzip value associated with a stuffit of no, bzip2 of no, and LHA.LZH of no?
SELECT gzip FROM table_name_90 WHERE stuffit = "no" AND bzip2 = "no" AND lha_lzh = "no"
sql_create_context
CREATE TABLE table_7951 ( "Date" text, "Tournament" text, "Surface" text, "Partnering" text, "Opponents in the final" text, "Score" text )
What is Score, when Partnering is 'Alexander Waske', and when Opponents In The Final is 'Rafael Nadal Bartolom Salv -Vidal'?
SELECT "Score" FROM table_7951 WHERE "Partnering" = 'alexander waske' AND "Opponents in the final" = 'rafael nadal bartolomé salvá-vidal'
wikisql
CREATE TABLE table_name_7 ( date VARCHAR, attendance VARCHAR )
Name the date for postponed attendance
SELECT date FROM table_name_7 WHERE attendance = "postponed"
sql_create_context
CREATE TABLE table_name_34 ( rank INTEGER, athlete VARCHAR )
what is the highest rank for tim maeyens?
SELECT MAX(rank) FROM table_name_34 WHERE athlete = "tim maeyens"
sql_create_context
CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL ) CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER )
For those records from the products and each product's manufacturer, return a bar chart about the distribution of founder and the average of code , and group by attribute founder, rank x axis in ascending order.
SELECT T2.Founder, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Founder ORDER BY T2.Founder
nvbench
CREATE TABLE table_66173 ( "play" text, "author" text, "company" text, "base" text, "country" text )
What is the Country of the Play Electra?
SELECT "country" FROM table_66173 WHERE "play" = 'electra'
wikisql
CREATE TABLE hz_info ( KH text, KLX number, YLJGDM text, RYBH text ) CREATE TABLE jyjgzbb ( JYZBLSH text, YLJGDM text, BGDH text, BGRQ time, JYRQ time, JCRGH text, JCRXM text, SHRGH text, SHRXM text, JCXMMC text, JCZBDM text, JCFF text, JCZBMC text, ...
在46372324753这次门诊就诊中,就诊的科室叫什么?编码呢
SELECT JZKSBM, JZKSMC FROM mzjzjlb WHERE JZLSH = '46372324753'
css
CREATE TABLE table_name_60 ( agg VARCHAR, team_2 VARCHAR )
What was the aggregate for the match with a team 2 of Kenya?
SELECT agg FROM table_name_60 WHERE team_2 = "kenya"
sql_create_context
CREATE TABLE Comments ( Id number, PostId number, Score number, Text text, CreationDate time, UserDisplayName text, UserId number, ContentLicense text ) CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDat...
TOP Scala users in London.
WITH USER_BY_TAG AS (SELECT ROW_NUMBER() OVER (ORDER BY COUNT(*) DESC) AS Rank, u.Id, u.DisplayName, u.WebsiteUrl AS "user_link", COUNT(*) AS UpVotes, u.age FROM Tags AS t INNER JOIN PostTags AS pt ON pt.TagId = t.Id INNER JOIN Posts AS p ON p.ParentId = pt.PostId INNER JOIN Votes AS v ON v.PostId = p.Id AND VoteTypeId...
sede
CREATE TABLE table_80061 ( "Year" text, "English title" text, "Original title" text, "Country" text, "Director" text )
Who is the Director of the Original title of The Crying Game?
SELECT "Director" FROM table_80061 WHERE "Original title" = 'the crying game'
wikisql
CREATE TABLE table_28814 ( "Western" text, "Central" text, "Eastern" text, "Old Galician (13th\u201315th c.)" text, "Portuguese" text, "Spanish" text, "Latin" text, "English" text )
What is the central word for 'robbers'?
SELECT "Central" FROM table_28814 WHERE "English" = 'robbers'
wikisql
CREATE TABLE Reservations ( Code INTEGER, Room TEXT, CheckIn TEXT, CheckOut TEXT, Rate REAL, LastName TEXT, FirstName TEXT, Adults INTEGER, Kids INTEGER ) CREATE TABLE Rooms ( RoomId TEXT, roomName TEXT, beds INTEGER, bedType TEXT, maxOccupancy INTEGER, baseP...
Draw a bar chart for what is the average base price of rooms, for each bed type?, I want to show bedType from high to low order.
SELECT bedType, AVG(basePrice) FROM Rooms GROUP BY bedType ORDER BY bedType DESC
nvbench
CREATE TABLE ReviewTasks ( Id number, ReviewTaskTypeId number, CreationDate time, DeletionDate time, ReviewTaskStateId number, PostId number, SuggestedEditId number, CompletedByReviewTaskId number ) CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Bod...
Questions without at least one of the required Meta Stack Overflow tags. in chronological order of creation date
SELECT Id AS "post_link", Tags, CreationDate FROM Posts WHERE NOT Tags LIKE '%><%' AND PostTypeId = 1 AND NOT Tags LIKE '%<support>%' AND NOT Tags LIKE '%<bug>%' AND NOT Tags LIKE '%<feature-request>%' AND NOT Tags LIKE '%<discussion>%' ORDER BY CreationDate
sede
CREATE TABLE table_8043 ( "Name" text, "Death" text, "Assumed Office" text, "Left Office" text, "Years in office" text, "Monarch" text )
On what date did ke eaumoku p pa iahiahi leave office?
SELECT "Left Office" FROM table_8043 WHERE "Name" = 'ke ʻ eaumoku pāpa ʻ iahiahi'
wikisql
CREATE TABLE table_16994 ( "Marginal Ordinary Income Tax Rate" text, "Single" text, "Married Filing Jointly or Qualified Widow(er)" text, "Married Filing Separately" text, "Head of Household" text )
What is the range of married filing jointly or qualified widower in which married filing separately is $33,951 $68,525?
SELECT "Married Filing Jointly or Qualified Widow(er)" FROM table_16994 WHERE "Married Filing Separately" = '$33,951–$68,525'
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 diagnoses short title and diagnoses long title of diagnoses icd9 code 1918?
SELECT diagnoses.short_title, diagnoses.long_title FROM diagnoses WHERE diagnoses.icd9_code = "1918"
mimicsql_data
CREATE TABLE table_1301 ( "Date" text, "Cover model" text, "Centerfold model" text, "Interview subject" text, "20 Questions" text, "Pictorials" text )
Name the 20 questions when centerfold model is cherie witter
SELECT "20 Questions" FROM table_1301 WHERE "Centerfold model" = 'Cherie Witter'
wikisql
CREATE TABLE table_27734769_8 ( date VARCHAR, high_points VARCHAR )
What is the date the high points was lamarcus aldridge (36)?
SELECT date FROM table_27734769_8 WHERE high_points = "LaMarcus Aldridge (36)"
sql_create_context
CREATE TABLE table_name_57 ( opponent VARCHAR, game_site VARCHAR )
Game site of candlestick park had what opponent?
SELECT opponent FROM table_name_57 WHERE game_site = "candlestick park"
sql_create_context
CREATE TABLE table_32233 ( "Date" text, "Venue" text, "Score" text, "Result" text, "Competition" text )
Which competition was played on 8 June 2005?
SELECT "Competition" FROM table_32233 WHERE "Date" = '8 june 2005'
wikisql
CREATE TABLE table_12584 ( "Standard order" real, "English translation" text, "Transcription (based on Pinyin)" text, "Traditional Chinese" text, "Simplified Chinese" text )
What is the simplified Chinese with a standard order over 4, and the transcription of Bei Hui Feng?
SELECT "Simplified Chinese" FROM table_12584 WHERE "Standard order" > '4' AND "Transcription (based on Pinyin)" = 'bei hui feng'
wikisql
CREATE TABLE table_name_80 ( champion VARCHAR, runner_up VARCHAR )
Who was the champion in the match where C.A. Palmer was the runner-up?
SELECT champion FROM table_name_80 WHERE runner_up = "c.a. palmer"
sql_create_context
CREATE TABLE table_name_23 ( pick INTEGER, school VARCHAR )
What is the pick number for tulane university?
SELECT SUM(pick) FROM table_name_23 WHERE school = "tulane university"
sql_create_context
CREATE TABLE table_28765 ( "Cons." text, "Democratic Coalition" text, "Alliance" text, "Together We Can Do More" text, "Independent Regional Force" text, "Independents" text )
where together we can do more is gloria mujica ( ph ) what are all the cons.
SELECT "Cons." FROM table_28765 WHERE "Together We Can Do More" = 'Gloria Mujica ( PH )'
wikisql
CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL ) CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER )
For those records from the products and each product's manufacturer, return a scatter chart about the correlation between manufacturer and code , and group by attribute founder.
SELECT T1.Manufacturer, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder
nvbench
CREATE TABLE table_204_994 ( id number, "date" text, "time" text, "opponent#" text, "rank#" text, "site" text, "tv" text, "result" text, "attendance" number )
how many wins did they have before the november 19th game ?
SELECT COUNT(*) FROM table_204_994 WHERE "result" = 'w' AND id < (SELECT id FROM table_204_994 WHERE "date" = 'november 19')
squall
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE procedures ( ...
count the number of patients whose marital status is single and ethnicity is white?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.marital_status = "SINGLE" AND demographic.ethnicity = "WHITE"
mimicsql_data
CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, chartt...
what is the monthly maximum urea nitrogen value for patient 18726 in 2103?
SELECT MAX(labevents.valuenum) FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 18726) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'urea nitrogen') AND STRFTIME('%y', labevents.charttime) = '2103' GROUP BY S...
mimic_iii
CREATE TABLE table_name_51 ( date VARCHAR, time VARCHAR, set_1 VARCHAR, score VARCHAR )
What is the Date when the Set 1 is 25 21, and the Score is 3 0, and the Time is 11:00?
SELECT date FROM table_name_51 WHERE set_1 = "25–21" AND score = "3–0" AND time = "11:00"
sql_create_context
CREATE TABLE table_name_72 ( county VARCHAR, school VARCHAR )
What county is Whiteland Community School in?
SELECT county FROM table_name_72 WHERE school = "whiteland community"
sql_create_context
CREATE TABLE table_58858 ( "Player" text, "Country" text, "Year(s) won" text, "Total" real, "To par" real )
Who is the player that won in the year 1978?
SELECT "Player" FROM table_58858 WHERE "Year(s) won" = '1978'
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 the number of patients with lab test item id 50967 who died in or before the year 2165?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dod_year <= "2165.0" AND lab.itemid = "50967"
mimicsql_data
CREATE TABLE table_name_60 ( first_contact_with_hitler VARCHAR, age_at_death VARCHAR )
When did the woman who died at 31 first contact Hitlers?
SELECT first_contact_with_hitler FROM table_name_60 WHERE age_at_death = "31"
sql_create_context
CREATE TABLE VoteTypes ( Id number, Name text ) CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE Tags ( Id number, TagName text, Count num...
user tag age is not null.
SELECT COUNT(Users.Id) FROM Users INNER JOIN Posts ON Posts.OwnerUserId = Users.Id INNER JOIN PostTags ON PostTags.PostId = Posts.Id OR PostTags.PostId = Posts.ParentId WHERE NOT Users.age IS NULL
sede
CREATE TABLE table_train_6 ( "id" int, "bleeding" int, "systolic_blood_pressure_sbp" int, "mean_arterial_pressure_map" int, "active_infection" bool, "hypotension" bool, "age" float, "NOUSE" float )
refractory hypotension definition sbp < 90 or map < 65
SELECT * FROM table_train_6 WHERE hypotension = 1 OR (systolic_blood_pressure_sbp < 90 OR mean_arterial_pressure_map < 65)
criteria2sql
CREATE TABLE table_name_32 ( notes VARCHAR, date VARCHAR )
What do the notes say for 1989 May 7?
SELECT notes FROM table_name_32 WHERE date = "1989 may 7"
sql_create_context
CREATE TABLE table_1373542_1 ( asset_acquired VARCHAR, date_announced VARCHAR )
It was announced on July 2, 2006 that what asset was acquired?
SELECT asset_acquired FROM table_1373542_1 WHERE date_announced = "July 2, 2006"
sql_create_context
CREATE TABLE table_20866024_3 ( model_designation VARCHAR, gvw__kg_ton_ VARCHAR, axle_ratio VARCHAR )
What's the model designation of the model with GVW of 2828/2.78 kg/ton and axle ratio of 9/47?
SELECT model_designation FROM table_20866024_3 WHERE gvw__kg_ton_ = "2828/2.78" AND axle_ratio = "9/47"
sql_create_context
CREATE TABLE table_43504 ( "Tournament" text, "1978" text, "1979" text, "1980" text, "1982" text, "1983" text, "1984" text, "1985" text, "1986" text, "1987" text, "1988" text, "1989" text, "1990" text, "1991" text, "1992" text, "Career SR" text )
What is 1984, when 1979 is '1R'?
SELECT "1984" FROM table_43504 WHERE "1979" = '1r'
wikisql
CREATE TABLE farm_competition ( competition_id number, year number, theme text, host_city_id number, hosts text ) CREATE TABLE city ( city_id number, official_name text, status text, area_km_2 number, population number, census_ranking text ) CREATE TABLE farm ( farm_id ...
Which statuses correspond to both cities that have a population over 1500 and cities that have a population lower than 500?
SELECT status FROM city WHERE population > 1500 INTERSECT SELECT status FROM city WHERE population < 500
spider
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,...
give me the number of patients whose ethnicity is asian and year of birth is less than 2107?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "ASIAN" AND demographic.dob_year < "2107"
mimicsql_data
CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE labevents ( row_id number, subject_id number, ...
what time has patient 10211 first had an intake on the first intensive care unit visit?
SELECT inputevents_cv.charttime 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 = 10211) AND NOT icustays.outtime IS NULL ORDER BY icustays.intime LIMIT 1) ORDER BY inputeven...
mimic_iii