context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE services ( service_id number, service_type_code text ) CREATE TABLE participants_in_events ( event_id number, participant_id number ) CREATE TABLE events ( event_id number, service_id number, event_details text ) CREATE TABLE participants ( participant_id number, part...
What is the id of the event with the most participants?
SELECT event_id FROM participants_in_events GROUP BY event_id ORDER BY COUNT(*) DESC LIMIT 1
spider
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 ...
find the number of patients born before 1821 who belong to black/african american ethnic background.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "BLACK/AFRICAN AMERICAN" AND demographic.dob_year < "1821"
mimicsql_data
CREATE TABLE table_name_42 ( mintage INTEGER, animal VARCHAR, year VARCHAR )
How many Red Breasted Nuthatch coins created before 2007 were minted, on average?
SELECT AVG(mintage) FROM table_name_42 WHERE animal = "red breasted nuthatch" AND year < 2007
sql_create_context
CREATE TABLE table_76489 ( "Rank" real, "Club" text, "Winners" real, "Runners-up" real, "Third" real )
Which Winners is the highest one that has a Rank larger than 7, and a Third smaller than 1?
SELECT MAX("Winners") FROM table_76489 WHERE "Rank" > '7' AND "Third" < '1'
wikisql
CREATE TABLE table_71162 ( "Year" real, "Men's singles" text, "Women's singles" text, "Women's doubles" text, "Mixed doubles" text )
Who participated in the Mixed Doubles when Tracey Hallam participated in the Women's Singles?
SELECT "Mixed doubles" FROM table_71162 WHERE "Women's singles" = 'tracey hallam'
wikisql
CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAddress text ) CREATE TABLE Badges ( Id number, UserId number, Name text, ...
2D Histogram of question score vs. highest voted answer score.
SELECT sel.Idx, COUNT(*) AS "occurence" FROM (SELECT (q.Score - '##S1##') * @NS + (a.Score - '##S1##') AS "idx" FROM Posts AS q INNER JOIN (SELECT DISTINCT a.ParentId, MAX(a.Score) AS "score" FROM Posts AS a WHERE a.PostTypeId = 2 AND a.Score >= '##S1##' AND a.Score < '##S2##' GROUP BY a.ParentId) AS a ON q.Id = a.Pare...
sede
CREATE TABLE status ( station_id number, bikes_available number, docks_available number, time text ) CREATE TABLE station ( id number, name text, lat number, long number, dock_count number, city text, installation_date text ) CREATE TABLE trip ( id number, duration ...
In zip code 94107, on which day neither Fog nor Rain was not observed?
SELECT date FROM weather WHERE zip_code = 94107 AND events <> "Fog" AND events <> "Rain"
spider
CREATE TABLE table_name_67 ( points INTEGER, played INTEGER )
What was the average points for someone who has played more than 10?
SELECT AVG(points) FROM table_name_67 WHERE played > 10
sql_create_context
CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId number, OwnerDisplayName text, LastEditorUserId number, LastEditorDisplayName text...
High-Scoring Questions with Authors (Tutorial).
SELECT p.PostId, p.TagId, t.Id, t.TagName FROM PostTags AS p JOIN Tags AS t ON p.TagId = t.Id
sede
CREATE TABLE table_7823 ( "Place" text, "Player" text, "Country" text, "Score" real, "To par" text )
What was T3 player Lee Janzen's score?
SELECT MIN("Score") FROM table_7823 WHERE "Place" = 't3' AND "Player" = 'lee janzen'
wikisql
CREATE TABLE customers ( customer_id number, customer_address_id number, customer_status_code text, date_became_customer time, date_of_birth time, first_name text, last_name text, amount_outstanding number, email_address text, phone_number text, cell_mobile_phone_number text ...
For each customer status code, how many customers are classified that way?
SELECT customer_status_code, COUNT(*) FROM customers GROUP BY customer_status_code
spider
CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number ) CREATE TABLE Tags ( Id number, TagName text, Count number, ExcerptPostId number, WikiPostId number ) CREATE TABLE PostsWit...
Top 50 Sri Lankan Developers who are on Stackoverflow.
SELECT ROW_NUMBER() OVER (ORDER BY Users.Reputation DESC) AS "#", Users.Id AS "user_link", Users.Location, Users.Reputation, Users.UpVotes, Users.DownVotes, (SELECT COUNT(*) FROM Posts AS PQ WHERE PostTypeId = 1 AND PQ.OwnerUserId = Users.Id) AS "questions", (SELECT COUNT(*) FROM Posts AS PA WHERE PostTypeId = 2 AND PA...
sede
CREATE TABLE VoteTypes ( Id number, Name text ) CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE Tags ( Id number, TagName text, Count number, ExcerptPostId number, WikiPostId number ) CREATE TABLE PostsWithDeleted ( Id number, PostTypeId number, Acce...
Number of posts over time for a tag.
SELECT 'year/month', COUNT(1) FROM (SELECT CONCAT(YEAR(CreationDate), '/', RIGHT(CONCAT('00', MONTH(CreationDate)), 2)) AS "Year/Month" FROM Posts WHERE 'tags' LIKE '%g1ant%') AS a GROUP BY 'year/month' ORDER BY 'year/month'
sede
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 allergy ( allergy...
how many patients received the neurosurgery consultation after the antibacterials in the same month?
SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, treatment.treatmenttime FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'antibacterials') AS t1 JOIN (SELECT patient.uniquepid, treatment.treatmenttime FROM treatment JOIN patient O...
eicu
CREATE TABLE table_69612 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Record" text )
What is the score of the game with a record of 12 8 3?
SELECT "Score" FROM table_69612 WHERE "Record" = '12–8–3'
wikisql
CREATE TABLE Comments ( Id number, PostId number, Score number, Text text, CreationDate time, UserDisplayName text, UserId number, ContentLicense text ) CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, ...
What percentage of closed questions are reopened.
SELECT (SELECT COUNT(*) FROM PostHistory WHERE PostHistoryTypeId = 10) AS closed, (SELECT COUNT(*) FROM PostHistory WHERE PostHistoryTypeId = 11) AS reopened
sede
CREATE TABLE table_6203 ( "Tournament" text, "1992" text, "1993" text, "1994" text, "1995" text, "1996" text, "1997" text, "1998" text, "1999" text, "2000" text, "2001" text, "2002" text, "2003" text, "2004" text, "2005" text, "2006" text, "Career SR" ...
Name the tournament for 2006 of a, 1996 of 1r and 2004 of 1r
SELECT "Tournament" FROM table_6203 WHERE "2006" = 'a' AND "1996" = '1r' AND "2004" = '1r'
wikisql
CREATE TABLE table_name_21 ( first_elected INTEGER, result VARCHAR, district VARCHAR )
What's the highest First Elected with a Result of Re-elected and DIstrict of California 5?
SELECT MAX(first_elected) FROM table_name_21 WHERE result = "re-elected" AND district = "california 5"
sql_create_context
CREATE TABLE table_14670 ( "Team" text, "Manager" text, "Captain" text, "Kit manufacturer" text, "Shirt sponsor" text )
Who is the shirt sponsor for the manufacturer Nike?
SELECT "Shirt sponsor" FROM table_14670 WHERE "Kit manufacturer" = 'nike'
wikisql
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...
医院1868481的医疗记录中,出院诊断为X20.040的最少医疗费总额是多少?最多的总额又是多少
SELECT MIN(t_kc24.MED_AMOUT), MAX(t_kc24.MED_AMOUT) FROM t_kc24 WHERE t_kc24.MED_CLINIC_ID IN (SELECT t_kc24.MED_CLINIC_ID FROM t_kc24 WHERE t_kc24.t_kc21_MED_SER_ORG_NO = '1868481' AND t_kc24.t_kc21_OUT_DIAG_DIS_CD = 'X20.040')
css
CREATE TABLE Circulation_History ( document_id INTEGER, draft_number INTEGER, copy_number INTEGER, employee_id INTEGER ) CREATE TABLE Documents_Mailed ( document_id INTEGER, mailed_to_address_id INTEGER, mailing_date DATETIME ) CREATE TABLE Documents ( document_id INTEGER, document...
Bar chart of the frequency from each receipt date, and bin the date in weekday interval, and then show y axis in asc order.
SELECT receipt_date, COUNT(receipt_date) FROM Documents ORDER BY COUNT(receipt_date)
nvbench
CREATE TABLE table_26982362_2 ( original_airdate VARCHAR, production_code VARCHAR )
The episode with production code 693-002, has how many original airdates?
SELECT COUNT(original_airdate) FROM table_26982362_2 WHERE production_code = "693-002"
sql_create_context
CREATE TABLE table_19526 ( "Stage" real, "Winner" text, "General classification" text, "Points classification" text, "Mountains classification" text, "Young rider classification" text )
Who was awarded the young ride classification leader when the winner was Marzio Bruseghin?
SELECT "Young rider classification" FROM table_19526 WHERE "Winner" = 'Marzio Bruseghin'
wikisql
CREATE TABLE university ( School_ID int, School text, Location text, Founded real, Affiliation text, Enrollment real, Nickname text, Primary_conference text ) CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Per...
Show me about the distribution of Team_Name and Team_ID in a bar chart.
SELECT Team_Name, Team_ID FROM basketball_match
nvbench
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...
有多少人得过F33.464这个疾病
SELECT COUNT(qtb.PERSON_ID) FROM qtb WHERE qtb.IN_DIAG_DIS_CD = 'F33.464' UNION SELECT COUNT(gyb.PERSON_ID) FROM gyb WHERE gyb.IN_DIAG_DIS_CD = 'F33.464' UNION SELECT COUNT(zyb.PERSON_ID) FROM zyb WHERE zyb.IN_DIAG_DIS_CD = 'F33.464' UNION SELECT COUNT(mzb.PERSON_ID) FROM mzb WHERE mzb.IN_DIAG_DIS_CD = 'F33.464'
css
CREATE TABLE zyjzjlb ( CYBQDM text, CYBQMC text, CYCWH text, CYKSDM text, CYKSMC text, CYSJ time, CYZTDM number, HZXM text, JZKSDM text, JZKSMC text, JZLSH text, KH text, KLX number, MZBMLX number, MZJZLSH text, MZZDBM text, MZZDMC text, MZZYZDZZBM...
查一下患者81795336之前有哪些门诊诊疗记录
SELECT zzmzjzjlb.JZZDBM, zzmzjzjlb.JZZDSM FROM hz_info JOIN zzmzjzjlb ON hz_info.YLJGDM = zzmzjzjlb.YLJGDM AND hz_info.KH = zzmzjzjlb.KH AND hz_info.KLX = zzmzjzjlb.KLX WHERE hz_info.RYBH = '81795336' UNION SELECT fzzmzjzjlb.JZZDBM, fzzmzjzjlb.JZZDSM FROM hz_info JOIN fzzmzjzjlb ON hz_info.YLJGDM = fzzmzjzjlb.YLJGDM AN...
css
CREATE TABLE department ( dept_name VARCHAR, dept_code VARCHAR ) CREATE TABLE student ( stu_gpa INTEGER, dept_code VARCHAR )
What is the name and the average gpa of department whose students have the highest average gpa?
SELECT T2.dept_name, AVG(T1.stu_gpa) FROM student AS T1 JOIN department AS T2 ON T1.dept_code = T2.dept_code GROUP BY T1.dept_code ORDER BY AVG(T1.stu_gpa) DESC LIMIT 1
sql_create_context
CREATE TABLE student ( student_id int, lastname varchar, firstname varchar, program_id int, declare_major varchar, total_credit int, total_gpa float, entered_as varchar, admit_term int, predicted_graduation_semester int, degree varchar, minor varchar, internship varch...
For the MDE program requirement , who teaches courses that fulfill it ?
SELECT DISTINCT instructor.name FROM instructor INNER JOIN offering_instructor ON offering_instructor.instructor_id = instructor.instructor_id INNER JOIN course_offering ON offering_instructor.offering_id = course_offering.offering_id INNER JOIN program_course ON program_course.course_id = course_offering.course_id INN...
advising
CREATE TABLE table_name_94 ( _ppp__ VARCHAR, d__billions_of_us$_ VARCHAR, expenditures_on_r INTEGER, country_region VARCHAR, year VARCHAR )
What is the lowest expenditures on R&D for Poland after 2011?
SELECT MIN(expenditures_on_r) & d__billions_of_us$_, _ppp__ FROM table_name_94 WHERE country_region = "poland" AND year > 2011
sql_create_context
CREATE TABLE MediaType ( MediaTypeId integer, Name varchar(120) ) CREATE TABLE Artist ( ArtistId integer, Name varchar(120) ) CREATE TABLE Customer ( CustomerId integer, FirstName varchar(40), LastName varchar(20), Company varchar(80), Address varchar(70), City varchar(40), ...
Find all invoice dates corresponding to customers with first name Astrid and last name Gruber, and count them by a bar chart, I want to show by the total number from low to high please.
SELECT InvoiceDate, COUNT(InvoiceDate) FROM Customer AS T1 JOIN Invoice AS T2 ON T1.CustomerId = T2.CustomerId WHERE T1.FirstName = "Astrid" AND LastName = "Gruber" ORDER BY COUNT(InvoiceDate)
nvbench
CREATE TABLE table_73307 ( "Region" text, "Population" text, "Country" text, "Language" text, "N" real, "Total%" text, "R1b1c (R-V88)" text, "R1b1a2 (R-M269)" text, "R1b1c* (R-V88*)" text, "R1b1c4 (R-V69)" text )
What is the largest n value for 55.6% r1b1c4 (r-v69)?
SELECT MAX("N") FROM table_73307 WHERE "R1b1c4 (R-V69)" = '55.6%'
wikisql
CREATE TABLE Orders ( order_id INTEGER, customer_id INTEGER, date_order_placed DATETIME, order_details VARCHAR(255) ) CREATE TABLE Order_Items ( order_item_id INTEGER, order_id INTEGER, product_id INTEGER, product_quantity VARCHAR(50), other_order_item_details VARCHAR(255) ) CREATE...
Show the transaction types and the total amount of transactions, could you sort in ascending by the Y-axis?
SELECT transaction_type, SUM(transaction_amount) FROM Financial_Transactions GROUP BY transaction_type ORDER BY SUM(transaction_amount)
nvbench
CREATE TABLE table_1341423_9 ( incumbent VARCHAR, district VARCHAR )
Who's the incumbent of Florida 12 district?
SELECT incumbent FROM table_1341423_9 WHERE district = "Florida 12"
sql_create_context
CREATE TABLE table_41857 ( "Rank" real, "Location" text, "Total Passengers" real, "Annual change" text, "Capacity in use" text )
what is the highest amount of passengers when there is a rank of 1?
SELECT MAX("Total Passengers") FROM table_41857 WHERE "Rank" = '1'
wikisql
CREATE TABLE table_name_61 ( surface VARCHAR, tournament VARCHAR )
What Surface has a Tournament of pune, india?
SELECT surface FROM table_name_61 WHERE tournament = "pune, india"
sql_create_context
CREATE TABLE CLASS ( class_room VARCHAR )
Find the number of classes offered for all class rooms that held at least 2 classes.
SELECT COUNT(*), class_room FROM CLASS GROUP BY class_room HAVING COUNT(*) >= 2
sql_create_context
CREATE TABLE Has_amenity ( dormid INTEGER, amenid INTEGER ) CREATE TABLE Dorm_amenity ( amenid INTEGER, amenity_name VARCHAR(25) ) CREATE TABLE Lives_in ( stuid INTEGER, dormid INTEGER, room_number INTEGER ) CREATE TABLE Student ( StuID INTEGER, LName VARCHAR(12), Fname VARCHA...
A bar chart for finding the number of the first name of students who are living in the Smith Hall, and show by the Fname in asc please.
SELECT Fname, COUNT(Fname) FROM Student AS T1 JOIN Lives_in AS T2 ON T1.stuid = T2.stuid JOIN Dorm AS T3 ON T3.dormid = T2.dormid WHERE T3.dorm_name = 'Smith Hall' GROUP BY Fname ORDER BY Fname
nvbench
CREATE TABLE table_name_82 ( artist VARCHAR, format VARCHAR, single VARCHAR )
What artist had a single called Alien Rock b/w Combat, The Remix on 12 inch Vinyl format?
SELECT artist FROM table_name_82 WHERE format = "12 inch vinyl" AND single = "alien rock b/w combat, the remix"
sql_create_context
CREATE TABLE table_name_71 ( willingshain VARCHAR, kirchheim VARCHAR )
What Willingshain is Kirchheim 1,126?
SELECT willingshain FROM table_name_71 WHERE kirchheim = "1,126"
sql_create_context
CREATE TABLE table_19839391_3 ( wins VARCHAR, winning__percentage VARCHAR )
How many wins had a win percentage of 0.667
SELECT wins FROM table_19839391_3 WHERE winning__percentage = "0.667"
sql_create_context
CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text ) CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate tim...
The total number of questions asked so far vs. time?. http://meta.stackexchange.com/questions/248396/how-can-i-get-stats-for-the-total-number-of-questions-asked-so-far-vs-time
SELECT DATEADD(d, days, @lowest) AS "date", SUM(qcnt) OVER (ORDER BY days) AS Questions, SUM(acnt) OVER (ORDER BY days) AS Answers FROM (SELECT DATEDIFF(m, @lowest, creationdate) AS days, SUM(CASE WHEN PostTypeId = 1 THEN 1 ELSE 0 END) AS qcnt, SUM(CASE WHEN PostTypeId = 2 THEN 1 ELSE 0 END) AS acnt FROM Posts WHERE Cr...
sede
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, From text, Arrival text, Railway_ID int ) CREATE TABLE railway_manage ( R...
Show the working years of managers in descending order of their level, and count them by a bar chart
SELECT Working_year_starts, COUNT(Working_year_starts) FROM manager ORDER BY Level DESC
nvbench
CREATE TABLE table_28538368_2 ( mountains_classification VARCHAR, winner VARCHAR, general_classification VARCHAR, points_classification VARCHAR )
When Alberto Contador Kanstantsin Sivtsov was the general classification and Alessandro Petacchi was the points classification at the same time while Mark Cavendish is the winner, who was the mountain classification?
SELECT mountains_classification FROM table_28538368_2 WHERE general_classification = "Alberto Contador Kanstantsin Sivtsov" AND points_classification = "Alessandro Petacchi" AND winner = "Mark Cavendish"
sql_create_context
CREATE TABLE table_name_65 ( ole_miss VARCHAR, arkansas VARCHAR )
Who was the Ole Miss player associated with Chuck Dicus?
SELECT ole_miss FROM table_name_65 WHERE arkansas = "chuck dicus"
sql_create_context
CREATE TABLE table_24353141_1 ( original_tokyo___seoul_tour_cast VARCHAR, original_1st_us_tour_cast VARCHAR )
While the original 1st us tour cast included nicci claspell, who was in the original tokyo/seoul tour cast?
SELECT original_tokyo___seoul_tour_cast FROM table_24353141_1 WHERE original_1st_us_tour_cast = "Nicci Claspell"
sql_create_context
CREATE TABLE table_14077 ( "School" text, "Location" text, "Mascot" text, "Enrollment" real, "IHSAA Class" text, "# / County" text )
What is the IHSAA Class for a school in Munster with an enrollment of 1,206?
SELECT "IHSAA Class" FROM table_14077 WHERE "Enrollment" > '1,206' AND "Location" = 'munster'
wikisql
CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate n...
what is the average cost of a hospital bill that includes a drug called metoclopramide hcl since 2 years ago?
SELECT AVG(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.patientunitstayid IN (SELECT medication.patientunitstayid FROM medication WHERE medication.drugname = 'metoclopramide hcl')) AND DATETIME(cost.charge...
eicu
CREATE TABLE table_name_28 ( hand VARCHAR )
What would be the 4 credits result of a straight?
SELECT 4 AS _credits FROM table_name_28 WHERE hand = "straight"
sql_create_context
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, h...
whats the last height of patient 005-80291 until 10/2105?
SELECT patient.admissionheight FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '005-80291') AND NOT patient.admissionheight IS NULL AND STRFTIME('%y-%m', patient.unitadmittime) <= '2105-10' ORDER BY patient.unitadmittime DESC LIMIT...
eicu
CREATE TABLE table_name_58 ( surface VARCHAR, score VARCHAR )
What was the surface of the score of 7 5, 3 6, 7 6?
SELECT surface FROM table_name_58 WHERE score = "7–5, 3–6, 7–6"
sql_create_context
CREATE TABLE table_19239 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Ground" text, "Crowd" real, "Date" text, "Report" text )
Name the home team for manuka oval
SELECT "Home team" FROM table_19239 WHERE "Ground" = 'Manuka Oval'
wikisql
CREATE TABLE table_name_93 ( home VARCHAR, round VARCHAR, competition VARCHAR, season VARCHAR )
What is the home team of the UEFA cup in the 2000-2001 season with a second round?
SELECT home FROM table_name_93 WHERE competition = "uefa cup" AND season = "2000-2001" AND round = "second round"
sql_create_context
CREATE TABLE Catalog_Contents_Additional_Attributes ( catalog_entry_id INTEGER, catalog_level_number INTEGER, attribute_id INTEGER, attribute_value VARCHAR(255) ) CREATE TABLE Catalog_Contents ( catalog_entry_id INTEGER, catalog_level_number INTEGER, parent_entry_id INTEGER, previous_en...
What are the number of the names of catalog entries with level number 8?, and order names in ascending order.
SELECT catalog_entry_name, COUNT(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" GROUP BY catalog_entry_name ORDER BY catalog_entry_name
nvbench
CREATE TABLE table_203_37 ( id number, "#" number, "title" text, "producer(s)" text, "performer(s)" text, "length" text )
what song on prophets vs. profits has no producer ?
SELECT "title" FROM table_203_37 WHERE "producer(s)" IS NULL
squall
CREATE TABLE weather ( date TEXT, max_temperature_f INTEGER, mean_temperature_f INTEGER, min_temperature_f INTEGER, max_dew_point_f INTEGER, mean_dew_point_f INTEGER, min_dew_point_f INTEGER, max_humidity INTEGER, mean_humidity INTEGER, min_humidity INTEGER, max_sea_level_pre...
What are the dates that have an average sea level pressure between 30.3 and 31, and count them by a bar chart
SELECT date, COUNT(date) FROM weather WHERE mean_sea_level_pressure_inches BETWEEN 30.3 AND 31
nvbench
CREATE TABLE table_62946 ( "Rank" real, "Rowers" text, "Country" text, "Time" text, "Notes" text )
What are the notes for 6:31.16?
SELECT "Notes" FROM table_62946 WHERE "Time" = '6:31.16'
wikisql
CREATE TABLE table_name_65 ( tries_for VARCHAR, points_for VARCHAR )
If the points were 0, what were the tries for?
SELECT tries_for FROM table_name_65 WHERE points_for = "0"
sql_create_context
CREATE TABLE table_name_22 ( city VARCHAR, result VARCHAR )
What city has a Result of brisbane broncos def. halifax blue sox?
SELECT city FROM table_name_22 WHERE result = "brisbane broncos def. halifax blue sox"
sql_create_context
CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE patients ( row_id number,...
what procedure did patient 57023 receive that last time this year?
SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT procedures_icd.icd9_code FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 57023) AND DATETIME(procedures_icd.charttime, 'start of year') = DAT...
mimic_iii
CREATE TABLE Customer_Orders ( order_id INTEGER, customer_id INTEGER, order_status_code VARCHAR(15), shipping_method_code VARCHAR(15), order_placed_datetime DATETIME, order_delivered_datetime DATETIME, order_shipping_charges VARCHAR(255) ) CREATE TABLE Mailshot_Customers ( mailshot_id I...
Show all distinct product categories along with the number of mailshots in each category in a bar chart, and list Y-axis from low to high order.
SELECT product_category, COUNT(*) FROM Mailshot_Campaigns GROUP BY product_category ORDER BY COUNT(*)
nvbench
CREATE TABLE table_35397 ( "Region" text, "Employment ( salaries & wages)" text, "Self employed" text, "Investment income" text, "Working tax credit" text, "State pensions" text, "Occupational pensions" text, "Disability benefits" text, "Other social security benefits" text, "Oth...
Occupational pensions of 7%, and a Working tax credit of 2%, and a Other social security benefits of 6% has what investment income?
SELECT "Investment income" FROM table_35397 WHERE "Occupational pensions" = '7%' AND "Working tax credit" = '2%' AND "Other social security benefits" = '6%'
wikisql
CREATE TABLE table_name_5 ( name VARCHAR )
What is the 4.45 for Yelena Isinbayeva?
SELECT 445 FROM table_name_5 WHERE name = "yelena isinbayeva"
sql_create_context
CREATE TABLE train ( id int, train_number int, name text, origin text, destination text, time text, interval text ) CREATE TABLE route ( train_id int, station_id int ) CREATE TABLE station ( id int, network_name text, services text, local_authority text ) CREATE TA...
Group by services attribute in station table and compute the total number of services with a bar chart, display x-axis from high to low order please.
SELECT services, COUNT(services) FROM station GROUP BY services ORDER BY services DESC
nvbench
CREATE TABLE table_203_116 ( id number, "no." number, "player" text, "birth date" text, "weight" number, "height" number, "position" text, "current club" text )
which players played the same position as ardo kreek ?
SELECT "player" FROM table_203_116 WHERE "player" <> 'ardo kreek' AND "position" = (SELECT "position" FROM table_203_116 WHERE "player" = 'ardo kreek')
squall
CREATE TABLE table_31926 ( "Player" text, "Nationality" text, "Position" text, "Years in Toronto" text, "School/Club Team" text )
What is Michael Stewart's school or club team?
SELECT "School/Club Team" FROM table_31926 WHERE "Player" = 'michael stewart'
wikisql
CREATE TABLE table_16864968_7 ( score VARCHAR, opponent VARCHAR )
What was the final score when the Maple Leafs played the Columbus Blue Jackets?
SELECT score FROM table_16864968_7 WHERE opponent = "Columbus Blue Jackets"
sql_create_context
CREATE TABLE table_56428 ( "Episode #" text, "Title" text, "Directed by" text, "Written by" text, "Original airdate" text )
Who is the author of Episode 38 (16)?
SELECT "Written by" FROM table_56428 WHERE "Episode #" = '38 (16)'
wikisql
CREATE TABLE table_test_2 ( "id" int, "loss_of_consciousness" bool, "gender" string, "bleeding" int, "systolic_blood_pressure_sbp" int, "stroke" bool, "renal_disease" bool, "hemorrhagic_diathesis" bool, "transient_ischemic_attack" bool, "creatinine_clearance_cl" float, "demen...
having a health coverage
SELECT * FROM table_test_2 WHERE health_coverage = 1
criteria2sql
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...
在21年2月24到21年6月19日的这几个月,共有多少异地病患在医院6947584看过病
SELECT COUNT(*) FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '6947584' AND t_kc21.IN_HOSP_DATE BETWEEN '2021-02-24' AND '2021-06-19' AND t_kc21.REMOTE_SETTLE_FLG = '异地1' OR t_kc21.REMOTE_SETTLE_FLG = '异地2'
css
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, JCZBJGDX text, JCZBJGDL number, JCZBJGDW text, SBBM text, YQBH text...
65100285762的住院看病的出院状态代码是多少?
SELECT CYZTDM FROM zyjzjlb WHERE JZLSH = '65100285762'
css
CREATE TABLE table_51554 ( "Race" text, "Candidate" text, "Party" text, "Notes" text, "Votes" real )
How many votes were cast when the notes reported lost to incumbent vic gilliam?
SELECT "Votes" FROM table_51554 WHERE "Notes" = 'lost to incumbent vic gilliam'
wikisql
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) ...
how many patients on government insurance had atrial cardioversion?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.insurance = "Government" AND procedures.short_title = "Atrial cardioversion"
mimicsql_data
CREATE TABLE table_21290 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text )
Name the record for april 1
SELECT "Record" FROM table_21290 WHERE "Date" = 'April 1'
wikisql
CREATE TABLE table_23569 ( "Pick #" real, "CFL Team" text, "Player" text, "Position" text, "College" text )
What CFL team did Darcy Brown play for?
SELECT "CFL Team" FROM table_23569 WHERE "Player" = 'Darcy Brown'
wikisql
CREATE TABLE table_24050 ( "Displacement" text, "Bore" text, "Stroke" text, "Cylinders" text, "Valves" real, "Power" text, "Torque" text, "Applications" text )
If torque is n m (lb ft) @1600 2400 rpm and applications is 2000 w90x sprinter, what is the power?
SELECT "Power" FROM table_24050 WHERE "Torque" = 'N·m (lb·ft) @1600–2400 rpm' AND "Applications" = '2000 W90x Sprinter'
wikisql
CREATE TABLE table_name_1 ( Double VARCHAR, non_suited_match VARCHAR, house_edge VARCHAR )
With a House Edge of 3.63% and a Non-Suited Match of 4:1, what is the Double Non-Suited Match?
SELECT Double AS non_suited_match FROM table_name_1 WHERE non_suited_match = "4:1" AND house_edge = "3.63%"
sql_create_context
CREATE TABLE authors ( authid number, lname text, fname text ) CREATE TABLE inst ( instid number, name text, country text ) CREATE TABLE papers ( paperid number, title text ) CREATE TABLE authorship ( authid number, instid number, paperid number, authorder number )
Which institution does 'Katsuhiro Ueno' belong to?
SELECT DISTINCT t3.name FROM authors AS t1 JOIN authorship AS t2 ON t1.authid = t2.authid JOIN inst AS t3 ON t2.instid = t3.instid WHERE t1.fname = "Katsuhiro" AND t1.lname = "Ueno"
spider
CREATE TABLE table_20860 ( "Series #" real, "Season #" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text )
What season was the episode titled 'Harlequin' in?
SELECT MAX("Season #") FROM table_20860 WHERE "Title" = 'Harlequin'
wikisql
CREATE TABLE table_27948565_1 ( motogp_winner VARCHAR, date VARCHAR )
Name the motogp winner for 6 may
SELECT motogp_winner FROM table_27948565_1 WHERE date = "6 May"
sql_create_context
CREATE TABLE table_name_43 ( years_for_jazz VARCHAR, position VARCHAR, school_club_team VARCHAR )
At Position of guard, from the School/Club Team Notre Dame, how many Years for Jazz did that person play?
SELECT years_for_jazz FROM table_name_43 WHERE position = "guard" AND school_club_team = "notre dame"
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...
参保人编号为84583960年门诊医疗费一共要多少钱?
SELECT SUM(mzb.MED_CLINIC_ID) FROM mzb WHERE mzb.PERSON_NM = '84583960'
css
CREATE TABLE table_name_84 ( league_goals INTEGER, total_apps VARCHAR, position VARCHAR, fa_cup_goals VARCHAR, fa_cup_apps VARCHAR )
Who has the lowest league total goals with 0 FA cup goals and no FA cup appearances, plays the DF position and has appeared in total of 3 times?
SELECT MIN(league_goals) FROM table_name_84 WHERE fa_cup_goals = "0" AND fa_cup_apps = "0" AND position = "df" AND total_apps = "3"
sql_create_context
CREATE TABLE table_36156 ( "Nation" text, "Skip" text, "Third" text, "Second" text, "Lead" text, "Alternate" text )
What is the alternate of the nation with Erkki Lill as the skip?
SELECT "Alternate" FROM table_36156 WHERE "Skip" = 'erkki lill'
wikisql
CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE Badges ( Id number, UserId number, Name text, Date time, Class number, TagBased boolean ) CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswer...
see questions that has or had bounties this month.
SELECT P.Id AS "post_link", V.BountyAmount, V.CreationDate AS "bounty_start", P.Score, P.ViewCount, P.Title, P.Tags, P.Body, P.AnswerCount FROM Posts AS P INNER JOIN Votes AS V ON P.Id = V.PostId WHERE TIME_TO_STR(V.CreationDate, '%-M') = TIME_TO_STR(CURRENT_TIMESTAMP(), '%-M') AND TIME_TO_STR(V.CreationDate, '%Y') = T...
sede
CREATE TABLE table_1901751_1 ( original_west_end_performer VARCHAR, character VARCHAR )
Who is the original west end performer for the character Neville Craven?
SELECT original_west_end_performer FROM table_1901751_1 WHERE character = "Neville Craven"
sql_create_context
CREATE TABLE table_name_89 ( Id VARCHAR )
What is the 2006 when the 2013 is 1r, and the 2012 is 1r?
SELECT 2006 FROM table_name_89 WHERE 2013 = "1r" AND 2012 = "1r"
sql_create_context
CREATE TABLE table_12032893_1 ( _number VARCHAR, high_school VARCHAR )
Crockett High School had which number(#)?
SELECT _number FROM table_12032893_1 WHERE high_school = "Crockett"
sql_create_context
CREATE TABLE table_24762 ( "Event" real, "Round" real, "Circuit" text, "Date" text, "Pole Position" text, "Fastest Lap" text, "Winning driver" text, "Winning team" text )
How many times did Tim Macrow and Joey Foster both got the fastest lap and pole position respectively?
SELECT COUNT("Event") FROM table_24762 WHERE "Fastest Lap" = 'Tim Macrow' AND "Pole Position" = 'Joey Foster'
wikisql
CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_ID decimal(4,0) ) CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) ) CREATE TABLE locations ( LOCATIO...
For those employees who was hired before 2002-06-21, give me the comparison about the sum of department_id over the hire_date bin hire_date by time, and could you display by the sum department id in ascending?
SELECT HIRE_DATE, SUM(DEPARTMENT_ID) FROM employees WHERE HIRE_DATE < '2002-06-21' ORDER BY SUM(DEPARTMENT_ID)
nvbench
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 of the age 80 and above had the primary disease as hypoxia?
SELECT AVG(demographic.age) FROM demographic WHERE demographic.diagnosis = "HYPOXIA" AND demographic.age >= "80"
mimicsql_data
CREATE TABLE customer_addresses ( customer_id number, address_id number, date_from time, date_to time ) CREATE TABLE departments ( department_id number, dept_store_id number, department_name text ) CREATE TABLE department_store_chain ( dept_store_chain_id number, dept_store_chain_n...
Return the name, phone number and email address for the customer with the most orders.
SELECT T1.customer_name, T1.customer_phone, T1.customer_email FROM customers AS T1 JOIN customer_orders AS T2 ON T1.customer_id = T2.customer_id GROUP BY T2.customer_id ORDER BY COUNT(*) DESC LIMIT 1
spider
CREATE TABLE table_name_33 ( elector VARCHAR, place_of_birth VARCHAR )
What Elector has the Place of birth of San Severino?
SELECT elector FROM table_name_33 WHERE place_of_birth = "san severino"
sql_create_context
CREATE TABLE table_26842217_12 ( result VARCHAR, broadcast VARCHAR )
What was the result in the game broadcast on the SEC Network?
SELECT result FROM table_26842217_12 WHERE broadcast = "SEC Network"
sql_create_context
CREATE TABLE t_kc22 ( AMOUNT number, CHA_ITEM_LEV number, DATA_ID text, DIRE_TYPE number, DOSE_FORM text, DOSE_UNIT text, EACH_DOSAGE text, EXP_OCC_DATE time, FLX_MED_ORG_ID text, FXBZ number, HOSP_DOC_CD text, HOSP_DOC_NM text, MED_CLINIC_ID text, MED_DIRE_CD tex...
在15-05-05到15-05-20内,参保人76645693小金额结算次数,10元以内为小金额有多少
SELECT COUNT(*) FROM t_kc24 WHERE t_kc24.PERSON_ID = '76645693' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2015-05-05' AND '2015-05-20' AND t_kc24.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 lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text,...
give me the number of patients whose diagnoses short title is adv eff antineoplastic and drug route is pr?
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 = "Adv eff antineoplastic" AND prescriptions.route = "PR"
mimicsql_data
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) CREATE TABLE person_info ( CSD text, CSRQ time, GJDM text, GJMC text, JGDM text, JGMC text, MZDM text, MZMC text, RYBH text, XBDM number, XBMC text, XLDM text, XLMC text, XM text...
韩嘉容这个患者在之前有过哪些门诊诊断记录
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_76 ( home_team VARCHAR, venue VARCHAR )
What was the home teams score when the VFL played Princes Park?
SELECT home_team AS score FROM table_name_76 WHERE venue = "princes park"
sql_create_context
CREATE TABLE table_name_48 ( ergative VARCHAR, nominative VARCHAR )
Mis-i is the nominative of what ergative?
SELECT ergative FROM table_name_48 WHERE nominative = "mis-i"
sql_create_context
CREATE TABLE table_37770 ( "Year" real, "Division" real, "League" text, "Reg. Season" text, "Playoffs" text )
Which Division that has a Reg Season of 1st, western, and Playoffs of champions, and a Year smaller than 2013?
SELECT AVG("Division") FROM table_37770 WHERE "Reg. Season" = '1st, western' AND "Playoffs" = 'champions' AND "Year" < '2013'
wikisql
CREATE TABLE management ( department_ID int, head_ID int, temporary_acting text ) CREATE TABLE department ( Department_ID int, Name text, Creation text, Ranking int, Budget_in_Billions real, Num_Employees real ) CREATE TABLE head ( head_ID int, name text, born_state tex...
I want to see trend of the number of creation by creation
SELECT Creation, COUNT(Creation) FROM department GROUP BY Creation
nvbench