context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE table_11365528_2 ( website VARCHAR, head_coach VARCHAR )
The head coach, steve radoslavic, is related to which websites?
SELECT website FROM table_11365528_2 WHERE head_coach = "Steve Radoslavic"
sql_create_context
CREATE TABLE table_51994 ( "Region" text, "Voter registration" real, "Voter turnout" real, "BYuT" real, "OU-PSD" real )
What is the lower turnout that has a byut of 50.7 and an ou psd smaller than 36.8?
SELECT MIN("Voter turnout") FROM table_51994 WHERE "BYuT" = '50.7' AND "OU-PSD" < '36.8'
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 ) ...
specify birthdate and death status of patient mary davis
SELECT demographic.dob, demographic.expire_flag FROM demographic WHERE demographic.name = "Mary Davis"
mimicsql_data
CREATE TABLE icustays ( row_id number, subject_id number, hadm_id number, icustay_id number, first_careunit text, last_careunit text, first_wardid number, last_wardid number, intime time, outtime time ) CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, sh...
tell me the name of the medication patient 13473 was first prescribed via iv route?
SELECT prescriptions.drug FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 13473) AND prescriptions.route = 'iv' ORDER BY prescriptions.startdate LIMIT 1
mimic_iii
CREATE TABLE table_name_31 ( college VARCHAR, overall VARCHAR )
Which college had an overall pick of 9?
SELECT college FROM table_name_31 WHERE overall = 9
sql_create_context
CREATE TABLE table_75739 ( "Season" text, "Skip" text, "Third" text, "Second" text, "Lead" text )
What lead has the third David Nedohin?
SELECT "Lead" FROM table_75739 WHERE "Third" = 'david nedohin'
wikisql
CREATE TABLE table_train_57 ( "id" int, "bleeding" int, "in_another_study" bool, "hiv_infection" bool, "hepatitis_c_infection" bool, "receiving_vasopressor" bool, "hypotension" bool, "NOUSE" float )
participation in another study
SELECT * FROM table_train_57 WHERE in_another_study = 1
criteria2sql
CREATE TABLE table_203_809 ( id number, "date" text, "time" text, "opponent#" text, "rank#" text, "site" text, "tv" text, "result" text, "attendance" number )
which game did georgia score the largest amount of points in ?
SELECT "date" FROM table_203_809 ORDER BY "result" DESC LIMIT 1
squall
CREATE TABLE table_27808 ( "Position" real, "Race number" text, "Sail number" text, "Yacht" text, "State/country" text, "Yacht type" text, "LOA (Metres)" text, "Skipper" text, "Elapsed time d:hh:mm:ss" text )
What yacht type is involved where Bob Oatley is the skipper?
SELECT "Yacht type" FROM table_27808 WHERE "Skipper" = 'Bob Oatley'
wikisql
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ...
For patient id 9271, specify the location of the admission with the time
SELECT demographic.admission_location, demographic.admittime FROM demographic WHERE demographic.subject_id = "9271"
mimicsql_data
CREATE TABLE table_63135 ( "Match" real, "Date" text, "Competition or tour" text, "Ground" text, "Opponent" text, "Score1" text, "Scorers" text )
Who are the scorers on 1 August 2008, where the ground was A?
SELECT "Scorers" FROM table_63135 WHERE "Ground" = 'a' AND "Date" = '1 august 2008'
wikisql
CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid number, wardid number, admissionheight number, admissionweight number, dischargeweight number, hospitaladmittime time, ...
is there any nasopharynx microbiology test history of patient 031-16123 until 1 year ago?
SELECT COUNT(*) FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-16123')) AND microlab.culturesite = 'nasopharynx' AND DATETIME(microlab.cultur...
eicu
CREATE TABLE table_77722 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Decision" text, "Attendance" real, "Record" text )
What was the decision of the Kings game when Chicago was the visiting team?
SELECT "Decision" FROM table_77722 WHERE "Visitor" = 'chicago'
wikisql
CREATE TABLE table_1745843_6 ( part_3 VARCHAR, class VARCHAR )
What's the part 3 of the verb in class 5?
SELECT part_3 FROM table_1745843_6 WHERE class = "5"
sql_create_context
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 prescription...
how many patients whose admission location is trsf within this facility and diagnoses long title is abdominal pain, other specified site?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admission_location = "TRSF WITHIN THIS FACILITY" AND diagnoses.long_title = "Abdominal pain, other specified site"
mimicsql_data
CREATE TABLE record ( ID int, Result text, Swimmer_ID int, Event_ID int ) 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 swimme...
Draw a bar chart about the distribution of meter_600 and meter_100 .
SELECT meter_600, meter_100 FROM swimmer
nvbench
CREATE TABLE table_15252 ( "Year" real, "Entrant" text, "Chassis" text, "Engine" text, "Points" real )
Which year averaged less than 9 points?
SELECT AVG("Year") FROM table_15252 WHERE "Points" < '9'
wikisql
CREATE TABLE table_name_60 ( lane INTEGER, heat VARCHAR, mark VARCHAR )
What is the most lanes used in races with more than 1 heat and a winning mark of 7.25?
SELECT MAX(lane) FROM table_name_60 WHERE heat > 1 AND mark = "7.25"
sql_create_context
CREATE TABLE table_18600760_10 ( land___sqmi__ VARCHAR, county VARCHAR )
How big is the land in square miles of Grand Forks county?
SELECT land___sqmi__ FROM table_18600760_10 WHERE county = "Grand Forks"
sql_create_context
CREATE TABLE table_7411 ( "Tournament" 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 )
During the Tournament in which Ji Nov k was absent(A) in 1995, absent(A) in 1997, and made it to the 3rd round (3R) in 2003, how did he do in 2006?
SELECT "2006" FROM table_7411 WHERE "1995" = 'a' AND "1997" = 'a' AND "2003" = '3r'
wikisql
CREATE TABLE Detention ( datetime_detention_start VARCHAR, teacher_id VARCHAR ) CREATE TABLE Teachers ( teacher_id VARCHAR, last_name VARCHAR )
Find the start and end dates of detentions of teachers with last name 'Schultz'.
SELECT T1.datetime_detention_start, datetime_detention_end FROM Detention AS T1 JOIN Teachers AS T2 ON T1.teacher_id = T2.teacher_id WHERE T2.last_name = "Schultz"
sql_create_context
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, ...
give me the number of patients whose lab test name is troponin i?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE lab.label = "Troponin I"
mimicsql_data
CREATE TABLE table_name_64 ( date VARCHAR, runner_s__up VARCHAR )
On what Date was Judy Rankin Runner(s)-up?
SELECT date FROM table_name_64 WHERE runner_s__up = "judy rankin"
sql_create_context
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 ...
has .9% normal saline been administered to patient 25814 on this hospital visit?
SELECT COUNT(*) > 0 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 = 25814 AND admissions.dischtime IS NULL)) AND inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_item...
mimic_iii
CREATE TABLE table_203_607 ( id number, "catalogue number" text, "artist" text, "release title" text, "format" text, "release date" text )
what is the total number of titles coil released on 7 ' vinyl ?
SELECT COUNT("release title") FROM table_203_607 WHERE "format" = '7" vinyl'
squall
CREATE TABLE candidate ( Candidate_ID int, People_ID int, Poll_Source text, Date text, Support_rate real, Consider_rate real, Oppose_rate real, Unsure_rate real ) CREATE TABLE people ( People_ID int, Sex text, Name text, Date_of_Birth text, Height real, Weight re...
Draw a bar chart about the distribution of Name and Height , I want to order by the Y-axis in asc.
SELECT Name, Height FROM people ORDER BY Height
nvbench
CREATE TABLE table_name_6 ( laps INTEGER, driver VARCHAR )
What is the most laps for Ayrton Senna?
SELECT MAX(laps) FROM table_name_6 WHERE driver = "ayrton senna"
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 demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob te...
provide the marital status of subject id 2560.
SELECT demographic.marital_status FROM demographic WHERE demographic.subject_id = "2560"
mimicsql_data
CREATE TABLE Orders ( order_id INTEGER, customer_id INTEGER, date_order_placed DATETIME, order_details VARCHAR(255) ) CREATE TABLE Invoices ( invoice_number INTEGER, order_id INTEGER, invoice_date DATETIME ) CREATE TABLE Invoice_Line_Items ( order_item_id INTEGER, invoice_number IN...
What is the relationship between account id and name for all account? Return a scatter chart.
SELECT account_id, account_name FROM Accounts GROUP BY other_account_details
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 with other phototherapy procedure were hospitalized for more than 4 days?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.days_stay > "4" AND procedures.short_title = "Other phototherapy"
mimicsql_data
CREATE TABLE dataset ( datasetid int, datasetname varchar ) CREATE TABLE journal ( journalid int, journalname varchar ) CREATE TABLE paperdataset ( paperid int, datasetid int ) CREATE TABLE paper ( paperid int, title varchar, venueid int, year int, numciting int, numci...
How many papers does Graham Neubig have in TACL
SELECT DISTINCT COUNT(paper.paperid) FROM author, paper, venue, writes WHERE author.authorname = 'Graham Neubig' AND venue.venueid = paper.venueid AND venue.venuename = 'TACL' AND writes.authorid = author.authorid AND writes.paperid = paper.paperid
scholar
CREATE TABLE table_31441 ( "Series #" real, "Season #" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Viewers (million)" text )
What is the name of the episode written by glen mazzara?
SELECT "Title" FROM table_31441 WHERE "Written by" = 'Glen Mazzara'
wikisql
CREATE TABLE table_16854 ( "Player" text, "No." real, "Nationality" text, "Position" text, "Years for Jazz" text, "School/Club Team" text )
What is the number of school/club teams held by BYU?
SELECT MIN("No.") FROM table_16854 WHERE "School/Club Team" = 'BYU'
wikisql
CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPrivilegedUserGuidance text, MarkdownConcensusDescription text, CreationDate time, CreationModeratorId number, ApprovalDa...
Total votes of users by user-rep.
SELECT (UpVotes + DownVotes) AS "Total Votes" FROM Users WHERE Id = 1340599
sede
CREATE TABLE t_kc21_t_kc22 ( MED_CLINIC_ID text, MED_EXP_DET_ID number ) CREATE TABLE t_kc21 ( CLINIC_ID text, CLINIC_TYPE 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 ...
医疗就诊号码为60434357319就诊期间使用了多少次药品684444每次用药剂量是多些?
SELECT t_kc22.USE_FRE, t_kc22.EACH_DOSAGE FROM t_kc22 JOIN t_kc21_t_kc22 JOIN t_kc21 ON t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID AND t_kc21_t_kc22.MED_CLINIC_ID = t_kc21.MED_CLINIC_ID WHERE t_kc21.MED_CLINIC_ID = '60434357319' AND t_kc22.SOC_SRT_DIRE_CD = '684444'
css
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, ...
provide the number of patients whose ethnicity is hispanic/latino - puerto rican and item id is 50967?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.ethnicity = "HISPANIC/LATINO - PUERTO RICAN" AND lab.itemid = "50967"
mimicsql_data
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...
how many living patients had globulin lab test done?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.expire_flag = "0" AND lab.label = "Globulin"
mimicsql_data
CREATE TABLE table_204_164 ( id number, "branding" text, "callsign" text, "frequency" text, "power (kw)" text, "location" text )
how many stations broadcast with a power of 5kw ?
SELECT COUNT("branding") FROM table_204_164 WHERE "power (kw)" = 5
squall
CREATE TABLE invoice_line_items ( order_item_id number, invoice_number number, product_id number, product_title text, product_quantity text, product_price number, derived_product_cost number, derived_vat_payable number, derived_total_cost number ) CREATE TABLE order_items ( orde...
Show the unique first names, last names, and phone numbers for all customers with any account.
SELECT DISTINCT T1.customer_first_name, T1.customer_last_name, T1.phone_number FROM customers AS T1 JOIN accounts AS T2 ON T1.customer_id = T2.customer_id
spider
CREATE TABLE table_204_317 ( id number, "metropolitan area" text, "country" text, "rank" number, "forstall\n2003 est." number, "official population" number, "year" number )
how many cities are in the united states ?
SELECT COUNT("metropolitan area") FROM table_204_317 WHERE "country" = 'united states'
squall
CREATE TABLE table_68771 ( "Estimate" text, "Name" text, "Nat." text, "Ship type" text, "Where sunk" text, "Date" text )
What is the date that a ship sank in the South Atlantic?
SELECT "Date" FROM table_68771 WHERE "Where sunk" = 'south atlantic'
wikisql
CREATE TABLE table_60527 ( "Year" real, "Round" real, "Pick" real, "Player" text, "NBA Club" text )
What is the highest pick for a year after 2010, and a round smaller than 1?
SELECT MAX("Pick") FROM table_60527 WHERE "Year" > '2010' AND "Round" < '1'
wikisql
CREATE TABLE table_name_31 ( round VARCHAR, event VARCHAR )
What round did the event UFC 86 take place?
SELECT round FROM table_name_31 WHERE event = "ufc 86"
sql_create_context
CREATE TABLE table_203_697 ( id number, "player" text, "career" text, "nickname" text, "team inducted as" text )
who had the nickname robbie ?
SELECT "player" FROM table_203_697 WHERE "nickname" = '"robbie"'
squall
CREATE TABLE table_13947 ( "Athlete" text, "Class" text, "Horse" text, "Event" text, "Result" real )
What horse was shown by with Britta N pel and got less than 71.909?
SELECT "Horse" FROM table_13947 WHERE "Athlete" = 'britta näpel' AND "Result" < '71.909'
wikisql
CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) ) CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,...
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 department_id over the hire_date bin hire_date by time by a bar chart, and I want to order by the y-axis from low to high.
SELECT HIRE_DATE, SUM(DEPARTMENT_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 ORDER BY SUM(DEPARTMENT_ID)
nvbench
CREATE TABLE table_203_378 ( id number, "against" text, "played" number, "won" number, "drawn" number, "lost" number, "win %" text )
what is the number of losses they have against france ?
SELECT "lost" FROM table_203_378 WHERE "against" = 'france'
squall
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 whose death status is 0 and procedure long title is fiber-optic bronchoscopy?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.expire_flag = "0" AND procedures.long_title = "Fiber-optic bronchoscopy"
mimicsql_data
CREATE TABLE table_name_63 ( position VARCHAR, points INTEGER )
What position has less than 6 Points?
SELECT COUNT(position) FROM table_name_63 WHERE points < 6
sql_create_context
CREATE TABLE all_documents ( document_id number, date_stored time, document_type_code text, document_name text, document_description text, other_details text ) CREATE TABLE document_locations ( document_id number, location_code text, date_in_location_from time, date_in_locaton_t...
What are all the role codes, role names, and role descriptions?
SELECT role_code, role_name, role_description FROM roles
spider
CREATE TABLE table_78967 ( "Date" text, "Ship Name" text, "Tonnage" text, "Ship Type" text, "Location" text, "Disposition of Ship" text )
What date was a brig type ship located in SW Approaches?
SELECT "Date" FROM table_78967 WHERE "Ship Type" = 'brig' AND "Location" = 'sw approaches'
wikisql
CREATE TABLE t_kc21 ( CLINIC_ID text, CLINIC_TYPE 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, ...
54152586这名患者在42744321971这个医疗就诊中自费金额最高的项目是啥
SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM t_kc22 JOIN t_kc21_t_kc22 JOIN t_kc21 ON t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID AND t_kc21_t_kc22.MED_CLINIC_ID = t_kc21.MED_CLINIC_ID WHERE t_kc21.MED_CLINIC_ID = '42744321971' GROUP BY t_kc22.SOC_SRT_DIRE_CD ORDER BY SUM(t_kc22.SELF_PAY_AMO) DES...
css
CREATE TABLE table_23354 ( "School" text, "City / Town" text, "Website" text, "Size" real, "Principal" text, "Grades" text, "IDOE Profile" text )
Name the school/s with is size of 604.
SELECT "School" FROM table_23354 WHERE "Size" = '604'
wikisql
CREATE TABLE fgwyjzb ( CLINIC_ID text, CLINIC_TYPE 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, ...
患者陈梦凡在5107523这个医院被开过单价最高的药是什么?列出药品的编码、名称、单价
SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM, t_kc22.UNIVALENT FROM t_kc22 WHERE t_kc22.MED_CLINIC_ID IN (SELECT gwyjzb.MED_CLINIC_ID FROM gwyjzb WHERE gwyjzb.PERSON_NM = '陈梦凡' AND gwyjzb.MED_SER_ORG_NO = '5107523' UNION SELECT fgwyjzb.MED_CLINIC_ID FROM fgwyjzb WHERE fgwyjzb.PERSON_NM = '陈梦凡' AND fgwyjzb.MED_...
css
CREATE TABLE table_18998 ( "Position" real, "Artist" text, "Song title" text, "Highest position" real, "Points" real )
what's the points with artbeingt being dave appell
SELECT "Points" FROM table_18998 WHERE "Artist" = 'Dave Appell'
wikisql
CREATE TABLE table_34461 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Leading scorer" text, "Record" text )
What score has tim duncan (27) as the leading scorer?
SELECT "Score" FROM table_34461 WHERE "Leading scorer" = 'tim duncan (27)'
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 whose admission type is elective and procedure icd9 code is 40?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_type = "ELECTIVE" AND procedures.icd9_code = "40"
mimicsql_data
CREATE TABLE table_name_32 ( fastest_lap VARCHAR, pole_position VARCHAR, winning_driver VARCHAR )
Who had the fastest lap when David Coulthard had pole position and Michael Schumacher as a winning driver.
SELECT fastest_lap FROM table_name_32 WHERE pole_position = "david coulthard" AND winning_driver = "michael schumacher"
sql_create_context
CREATE TABLE table_name_19 ( regular_season VARCHAR, division VARCHAR )
WHICH Regular Season has a Division of 4?
SELECT regular_season FROM table_name_19 WHERE division = 4
sql_create_context
CREATE TABLE table_name_8 ( region VARCHAR, format VARCHAR )
Which region had a release format of CD Maxi?
SELECT region FROM table_name_8 WHERE format = "cd maxi"
sql_create_context
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, ...
what is the number of patients whose diagnoses icd9 code is 412 and lab test fluid is blood?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.icd9_code = "412" AND lab.fluid = "Blood"
mimicsql_data
CREATE TABLE table_41269 ( "Rider" text, "Bike" text, "Laps" real, "Time" text, "Grid" real )
Who was the rider with more than 5 laps on a grid bigger than 29 on a Honda CBR600RR and time at +1:27.385?
SELECT "Rider" FROM table_41269 WHERE "Laps" > '5' AND "Grid" > '29' AND "Bike" = 'honda cbr600rr' AND "Time" = '+1:27.385'
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, a bar chart shows the distribution of name and the sum of code , and group by attribute name.
SELECT T2.Name, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name
nvbench
CREATE TABLE PostsWithDeleted ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId number, OwnerDisplayName text, LastEditorUserId number, LastEditorDispl...
getting all of the R questions.
SELECT YEAR(Posts.CreationDate) AS the_year, Posts.Id FROM Tags LEFT JOIN PostTags ON PostTags.TagId = Tags.Id LEFT JOIN Posts ON Posts.Id = PostTags.PostId LEFT JOIN PostTypes ON PostTypes.Id = Posts.PostTypeId WHERE Tags.TagName IN ('r')
sede
CREATE TABLE table_6422 ( "Game" real, "Date" text, "Opponent" text, "Score" text, "Location" text, "Record" text )
What location did game 64 take place
SELECT "Location" FROM table_6422 WHERE "Game" = '64'
wikisql
CREATE TABLE table_70052 ( "County" text, "Live births 2006" real, "GFR 2006" real, "TFR 2006" real, "Whites as % of Pop." text )
What is the total number of live births in 2006 with 98.40% of the population as Whites and has more than 2 for the TFR?
SELECT SUM("Live births 2006") FROM table_70052 WHERE "Whites as % of Pop." = '98.40%' AND "TFR 2006" > '2'
wikisql
CREATE TABLE table_name_23 ( format VARCHAR, catalog VARCHAR )
What is the Format of the Label with Catalog SBP 234999?
SELECT format FROM table_name_23 WHERE catalog = "sbp 234999"
sql_create_context
CREATE TABLE table_name_82 ( scored INTEGER, points VARCHAR, played VARCHAR )
What is the lowest score of the team with 19 points and less than 18 played?
SELECT MIN(scored) FROM table_name_82 WHERE points = 19 AND played < 18
sql_create_context
CREATE TABLE table_1615980_4 ( no VARCHAR, tournament VARCHAR )
How many tournament wins were at Volvo Masters Andalucia?
SELECT COUNT(no) FROM table_1615980_4 WHERE tournament = "Volvo Masters Andalucia"
sql_create_context
CREATE TABLE table_54950 ( "Class" text, "Wheel arrangement" text, "Fleet number(s)" text, "Manufacturer" text, "Year made" text, "Quantity made" text, "Quantity preserved" text, "Year(s) withdrawn" text )
What is the class of the locomotive with a wheel arrangement of 4-6-0 and a quantity made of 14?
SELECT "Class" FROM table_54950 WHERE "Wheel arrangement" = '4-6-0' AND "Quantity made" = '14'
wikisql
CREATE TABLE table_34837 ( "Locomotive" text, "Pre-conversion" text, "Entered service (T)" text, "Re-entered service (P)" text, "Owner" text )
What date did the T328 that entered service on 18 June 1956 re-enter service?
SELECT "Re-entered service (P)" FROM table_34837 WHERE "Entered service (T)" = '18 june 1956' AND "Pre-conversion" = 't328'
wikisql
CREATE TABLE table_18047346_4 ( airport_name VARCHAR, location VARCHAR )
If the location is Chicago, Illinois, what is the airport name?
SELECT airport_name FROM table_18047346_4 WHERE location = "Chicago, Illinois"
sql_create_context
CREATE TABLE journal ( journalid int, journalname varchar ) CREATE TABLE venue ( venueid int, venuename varchar ) CREATE TABLE paper ( paperid int, title varchar, venueid int, year int, numciting int, numcitedby int, journalid int ) CREATE TABLE paperdataset ( paperid ...
How many papers by Luke Zettlemoyer contain the keyphrases Learning Algorithm ?
SELECT DISTINCT COUNT(DISTINCT writes.paperid) FROM author, keyphrase, paperkeyphrase, writes WHERE author.authorname = 'Luke Zettlemoyer' AND keyphrase.keyphrasename = 'Learning Algorithm' AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND writes.authorid = author.authorid AND writes.paperid = paperkeyphrase.p...
scholar
CREATE TABLE table_8446 ( "Name" text, "Country" text, "Role" text, "Period" text, "Teams" text )
What is the team with the name Boumediene Abderahmane?
SELECT "Teams" FROM table_8446 WHERE "Name" = 'boumediene abderahmane'
wikisql
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREA...
what is the maximum sao2 of patient 025-35599?
SELECT MAX(vitalperiodic.sao2) FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '025-35599')) AND NOT vitalperiodic.sao2 IS NULL
eicu
CREATE TABLE table_name_7 ( roll VARCHAR, name VARCHAR )
What is the total number on roll for Shelly Park school?
SELECT COUNT(roll) FROM table_name_7 WHERE name = "shelly park school"
sql_create_context
CREATE TABLE table_name_36 ( shuttle_run__sec_ VARCHAR, grade VARCHAR )
Tell me the shuttle run with grade c
SELECT shuttle_run__sec_ FROM table_name_36 WHERE grade = "c"
sql_create_context
CREATE TABLE wdmzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH number, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, KH text, KLX number, MJZH text, ML number, MZZYZDZZBM text, MZZYZDZ...
在医院2339646中,查出患者33997628在科室名不包括化疗的就诊科室的门诊就诊记录的流水号有哪些
SELECT wdmzjzjlb.JZLSH FROM hz_info JOIN wdmzjzjlb ON hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX WHERE hz_info.RYBH = '33997628' AND hz_info.YLJGDM = '2339646' AND NOT wdmzjzjlb.JZKSMC LIKE '%化疗%' UNION SELECT bdmzjzjlb.JZLSH FROM hz_info JOIN bdmzjzjlb ON hz_info.YL...
css
CREATE TABLE races ( raceId INTEGER, year INTEGER, round INTEGER, circuitId INTEGER, name TEXT, date TEXT, time TEXT, url TEXT ) CREATE TABLE drivers ( driverId INTEGER, driverRef TEXT, number TEXT, code TEXT, forename TEXT, surname TEXT, dob TEXT, nation...
How many races are held in each year after 2014? Show me a bar chart, rank total number in desc order please.
SELECT year, COUNT(year) FROM races AS T1 JOIN results AS T2 ON T1.raceId = T2.raceId WHERE T1.year > 2014 GROUP BY year ORDER BY COUNT(year) DESC
nvbench
CREATE TABLE table_67802 ( "Year" real, "Entrant" text, "Chassis" text, "Engine" text, "Pts." real )
What is the total number of points for entrants with a Jordan 192 chassis?
SELECT SUM("Pts.") FROM table_67802 WHERE "Chassis" = 'jordan 192'
wikisql
CREATE TABLE publication ( publication_id number, book_id number, publisher text, publication_date text, price number ) CREATE TABLE book ( book_id number, title text, issues number, writer text )
Show different publishers together with the number of publications they have.
SELECT publisher, COUNT(*) FROM publication GROUP BY publisher
spider
CREATE TABLE farm_competition ( Competition_ID int, Year int, Theme text, Host_city_ID int, Hosts text ) CREATE TABLE competition_record ( Competition_ID int, Farm_ID int, Rank int ) CREATE TABLE farm ( Farm_ID int, Year int, Total_Horses real, Working_Horses real, ...
Show the average of population from each status, and rank by the Y in descending.
SELECT Status, AVG(Population) FROM city GROUP BY Status ORDER BY AVG(Population) DESC
nvbench
CREATE TABLE table_203_16 ( id number, "name" text, "took office" text, "left office" text, "party" text, "district residence" text, "notes" text )
how many terms did a republican serve before watkins term ?
SELECT COUNT(*) FROM table_203_16 WHERE "party" = 'republican' AND id < (SELECT id FROM table_203_16 WHERE "name" = 'wes watkins')
squall
CREATE TABLE table_name_51 ( result VARCHAR, awards VARCHAR, category VARCHAR, year VARCHAR )
What was the result in the year greaters than 2008 with an award of Jahat and had a category of Stacy?
SELECT result FROM table_name_51 WHERE category = "stacy" AND year > 2008 AND awards = "jahat"
sql_create_context
CREATE TABLE table_58408 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
Which venue has an Away team score of 17.14 (116)?
SELECT "Venue" FROM table_58408 WHERE "Away team score" = '17.14 (116)'
wikisql
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 swimmer ( ID int, name text, Nationality text, meter_100 real, meter_200 text, meter_300 text, meter_40...
A bar chart shows the distribution of Nationality and the average of ID , and group by attribute Nationality, and could you sort from low to high by the X-axis?
SELECT Nationality, AVG(ID) FROM swimmer GROUP BY Nationality ORDER BY Nationality
nvbench
CREATE TABLE table_24665 ( "Team" text, "Truck(s)" text, "#" real, "Driver(s)" text, "Primary Sponsor(s)" text, "Listed Owner(s)" text, "Crew Chief" text )
Name the trucks for scott neal
SELECT "Truck(s)" FROM table_24665 WHERE "Crew Chief" = 'Scott Neal'
wikisql
CREATE TABLE t_kc21 ( CLINIC_ID text, CLINIC_TYPE 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, ...
哪些医师为病患蒋欣荣在医疗就诊35733517644中开具医疗项目的,提供所有的编号及姓名
SELECT t_kc22.HOSP_DOC_CD, t_kc22.HOSP_DOC_NM FROM t_kc22 JOIN t_kc21_t_kc22 JOIN t_kc21 ON t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID AND t_kc21_t_kc22.MED_CLINIC_ID = t_kc21.MED_CLINIC_ID WHERE t_kc21.MED_CLINIC_ID = '35733517644'
css
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid num...
what was patient 030-3247's first output time of the urine catheter until 04/26/2104?
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 = '030-3247')) AND intakeoutput.cellpath LIKE '%output%'...
eicu
CREATE TABLE table_name_16 ( lost INTEGER, points INTEGER )
What is the highest loss with points less than 7?
SELECT MAX(lost) FROM table_name_16 WHERE points < 7
sql_create_context
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 whose lab test category is chemistry?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE lab."CATEGORY" = "Chemistry"
mimicsql_data
CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CRE...
when was the last time patient 027-140654 got a lab test in this month for chloride?
SELECT lab.labresulttime FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '027-140654')) AND lab.labname = 'chloride' AND DATETIME(lab.labresulttime, 'start o...
eicu
CREATE TABLE table_203_354 ( id number, "party" text, "candidate(s)" text, "votes" number, "percentage" number )
which candidates had the most votes listed ?
SELECT "candidate(s)" FROM table_203_354 ORDER BY "votes" DESC LIMIT 1
squall
CREATE TABLE station_company ( Station_ID int, Company_ID int, Rank_of_the_Year int ) CREATE TABLE company ( Company_ID int, Rank int, Company text, Headquarters text, Main_Industry text, Sales_billion real, Profits_billion real, Assets_billion real, Market_Value real ) ...
How many companies without a gas station in each main industry? Draw a bar chart, and display by the total number in asc.
SELECT Main_Industry, COUNT(Main_Industry) FROM company WHERE NOT Company_ID IN (SELECT Company_ID FROM station_company) GROUP BY Main_Industry ORDER BY COUNT(Main_Industry)
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...
provide the number of patients whose lab test category is hematology?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE lab."CATEGORY" = "Hematology"
mimicsql_data
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid number, ...
count the number of patients who were diagnosed with valvular insufficiency - mitral valve and that did not return to the hospital within the same month during this year.
SELECT (SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'valvular insufficiency - mitral valve' AND DATETIME(diagnosis.diagnosistime, 'start of year') = DATE...
eicu
CREATE TABLE table_name_92 ( points VARCHAR, chassis VARCHAR )
How many points for the simtek s951 chassis?
SELECT COUNT(points) FROM table_name_92 WHERE chassis = "simtek s951"
sql_create_context
CREATE TABLE table_25703_2 ( birth_2012 INTEGER, january_december_2012 VARCHAR )
What were the total number of 2012 births for the January December 2012 Tver Oblast region?
SELECT MIN(birth_2012) FROM table_25703_2 WHERE january_december_2012 = "Tver Oblast"
sql_create_context
CREATE TABLE table_49267 ( "Tie no" text, "Home team" text, "Score" text, "Away team" text, "Date" text )
what is the home team when the away team is frickley colliery?
SELECT "Home team" FROM table_49267 WHERE "Away team" = 'frickley colliery'
wikisql
CREATE TABLE table_8899 ( "Consonant final stem" text, "Example: did-" text, "Vowel final stem" text, "Example: ch'aghara-" text, "Noun example: datv-" text )
What example for did- is shown for a Consonant final stem of - ?
SELECT "Example: did-" FROM table_8899 WHERE "Consonant final stem" = '-ø'
wikisql