context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE table_55009 ( "Date" text, "Ship" text, "Type" text, "Nationality" text, "Tonnage GRT" real )
Which nationality has a Ship of minteh?
SELECT "Nationality" FROM table_55009 WHERE "Ship" = 'minteh'
wikisql
CREATE TABLE table_74060 ( "Team" text, "Outgoing manager" text, "Manner of departure" text, "Date of vacancy" text, "Replaced by" text, "Date of appointment" text )
Who replaced the outgoing manager H sn zkara?
SELECT "Replaced by" FROM table_74060 WHERE "Outgoing manager" = 'Hüsnü Özkara'
wikisql
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, a...
among patients who were prescribed haldol after they had been diagnosed with third spacing show me the three year survival rate.
SELECT SUM(CASE WHEN patient.hospitaldischargestatus = 'alive' THEN 1 WHEN STRFTIME('%j', patient.hospitaldischargetime) - STRFTIME('%j', t4.diagnosistime) > 3 * 365 THEN 1 ELSE 0 END) * 100 / COUNT(*) FROM (SELECT t2.uniquepid, t2.diagnosistime FROM (SELECT t1.uniquepid, t1.diagnosistime FROM (SELECT patient.uniquepid...
eicu
CREATE TABLE table_name_61 ( batting_team VARCHAR, season VARCHAR )
Who was the batting team in the 2006 season?
SELECT batting_team FROM table_name_61 WHERE season = "2006"
sql_create_context
CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, sp...
what was the last time that the arterial bp mean of patient 26817 was, on the last icu visit, greater than 58.0?
SELECT chartevents.charttime FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 26817) AND NOT icustays.outtime IS NULL ORDER BY icustays.intime DESC LIMIT 1) AND chartevents.itemid...
mimic_iii
CREATE TABLE table_name_11 ( imperial VARCHAR, ratio VARCHAR )
What are the imperial size for the unit that has a ratio of 1/20?
SELECT imperial FROM table_name_11 WHERE ratio = "1/20"
sql_create_context
CREATE TABLE table_train_41 ( "id" int, "pulmonary_embolization" bool, "hiv_infection" bool, "neutrophil_count" int, "renal_disease" bool, "liver_disease" bool, "serum_creatinine" float, "myocardial_infarction" bool, "NOUSE" float )
acute myocardial infarction or pulmonary embolization
SELECT * FROM table_train_41 WHERE myocardial_infarction = 1 OR pulmonary_embolization = 1
criteria2sql
CREATE TABLE table_39094 ( "Club" text, "Played" text, "Drawn" text, "Lost" text, "Points for" text, "Points against" text, "Tries for" text, "Tries against" text, "Try bonus" text, "Losing bonus" text, "Points" text )
When the tries against is 90 how many points are there?
SELECT "Points" FROM table_39094 WHERE "Tries against" = '90'
wikisql
CREATE TABLE table_name_52 ( event VARCHAR, res VARCHAR, opponent VARCHAR )
Which event resulted in loss with an Opponent of maurice smith?
SELECT event FROM table_name_52 WHERE res = "loss" AND opponent = "maurice smith"
sql_create_context
CREATE TABLE chip_model ( model_name text, launch_year number, ram_mib number, rom_mib number, slots text, wifi text, bluetooth text ) CREATE TABLE screen_mode ( graphics_mode number, char_cells text, pixels text, hardware_colours number, used_kb number, map text, ...
List the hardware model name and company name for the phone whose screen mode type is 'Graphics.
SELECT T2.hardware_model_name, T2.company_name FROM screen_mode AS T1 JOIN phone AS T2 ON T1.graphics_mode = T2.screen_mode WHERE T1.type = "Graphics"
spider
CREATE TABLE table_79423 ( "Date" text, "Internet Explorer" text, "Firefox" text, "Safari" text, "Opera" text )
What percentage of browsers were using Internet Explorer in April 2009?
SELECT "Internet Explorer" FROM table_79423 WHERE "Date" = 'april 2009'
wikisql
CREATE TABLE jyjgzbb ( BGDH text, BGRQ time, CKZFWDX text, CKZFWSX number, CKZFWXX number, JCFF text, JCRGH text, JCRXM text, JCXMMC text, JCZBDM text, JCZBJGDL number, JCZBJGDW text, JCZBJGDX text, JCZBMC text, JLDW text, JYRQ time, JYZBLSH text, ...
列举出病患苏兰娜在06年7月30日到19年10月4日内被开出的所有检验报告单的名称以及科室编号是什么?
SELECT jybgb.KSBM, jybgb.KSMC FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE person_info.XM = '苏...
css
CREATE TABLE head ( head_ID int, name text, born_state text, age real ) CREATE TABLE department ( Department_ID int, Name text, Creation text, Ranking int, Budget_in_Billions real, Num_Employees real ) CREATE TABLE management ( department_ID int, head_ID int, tempor...
Show me mean age by born state in a histogram, show Y-axis in descending order.
SELECT born_state, AVG(age) FROM head GROUP BY born_state ORDER BY AVG(age) DESC
nvbench
CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varchar(20), LAST_NAME varchar(25), EMAIL varchar(25), PHONE_NUMBER varchar(20), HIRE_DATE date, JOB_ID varchar(10), SALARY decimal(8,2), COMMISSION_PCT decimal(2,2), MANAGER_ID decimal(6,0), DEPARTMENT_ID decimal(...
For those employees who do not work in departments with managers that have ids between 100 and 200, find hire_date and the sum of department_id bin hire_date by weekday, and visualize them by a bar chart, and show y axis in ascending order.
SELECT HIRE_DATE, SUM(DEPARTMENT_ID) FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY SUM(DEPARTMENT_ID)
nvbench
CREATE TABLE table_55349 ( "Candidate" text, "Money Raised, 2Q" text, "Loans Received, 2Q" text, "Money Spent, 2Q" text, "Total Receipts" text, "Cash On Hand" text )
How much money was raised in the 2Q when the total receipts were $63,075,927?
SELECT "Money Raised, 2Q" FROM table_55349 WHERE "Total Receipts" = '$63,075,927'
wikisql
CREATE TABLE Customer_Contact_Channels ( customer_id INTEGER, channel_code VARCHAR(15), active_from_date DATETIME, active_to_date DATETIME, contact_number VARCHAR(50) ) CREATE TABLE Addresses ( address_id INTEGER, address_content VARCHAR(80), city VARCHAR(50), zip_postcode VARCHAR(2...
Return a bar chart showing how many customers whose contact channel code is email for each weekday.
SELECT active_from_date, COUNT(active_from_date) FROM Customers AS t1 JOIN Customer_Contact_Channels AS t2 ON t1.customer_id = t2.customer_id WHERE t2.channel_code = 'Email'
nvbench
CREATE TABLE table_name_2 ( total VARCHAR, gold VARCHAR, nation VARCHAR )
What is the medal total when there is 2 gold medals, and Brazil (BRA) is the nation?
SELECT total FROM table_name_2 WHERE gold = 2 AND nation = "brazil (bra)"
sql_create_context
CREATE TABLE table_name_27 ( year INTEGER, playoffs VARCHAR )
Which year had playoffs of champion?
SELECT AVG(year) FROM table_name_27 WHERE playoffs = "champion"
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 demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, ...
how many patients whose diagnoses long title is ulcer of other part of foot and drug type is base?
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.long_title = "Ulcer of other part of foot" AND prescriptions.drug_type = "BASE"
mimicsql_data
CREATE TABLE Comments ( Id number, PostId number, Score number, Text text, CreationDate time, UserDisplayName text, UserId number, ContentLicense text ) CREATE TABLE PostFeedback ( Id number, PostId number, IsAnonymous boolean, VoteTypeId number, CreationDate time ) ...
Question per Day on StackExchange.
SELECT Date AS "dates", ROUND((SUM(pd.Questions) * 1.00 / COUNT(pd.Date)), 2) AS "questions_per_day" FROM (SELECT SUM(CASE WHEN p.PostTypeId = 1 THEN 1 ELSE 0 END) AS "questions", DATE(p.CreationDate) AS "date" FROM Posts AS p GROUP BY DATE(p.CreationDate)) AS pd GROUP BY Date ORDER BY Date DESC
sede
CREATE TABLE table_67219 ( "Date" text, "Opponent" text, "City" text, "Result" text, "Score" text )
What was the date of the game against Northwestern?
SELECT "Date" FROM table_67219 WHERE "Opponent" = 'northwestern'
wikisql
CREATE TABLE table_name_97 ( team__number1 VARCHAR, team__number2 VARCHAR )
What is the team #1 that has unics kazan for team #2?
SELECT team__number1 FROM table_name_97 WHERE team__number2 = "unics kazan"
sql_create_context
CREATE TABLE stadium ( ID int, name text, Capacity int, City text, Country text, Opening_year int ) CREATE TABLE record ( ID int, Result text, Swimmer_ID int, Event_ID int ) CREATE TABLE event ( ID int, Name text, Stadium_ID int, Year text ) CREATE TABLE swimme...
Visualize a bar chart about the distribution of Nationality and the amount of Nationality , and group by attribute Nationality.
SELECT Nationality, COUNT(Nationality) FROM swimmer GROUP BY Nationality
nvbench
CREATE TABLE table_7468 ( "Year" real, "Entrant" text, "Chassis" text, "Engine" text, "Points" real )
How many points total are there later than 2003?
SELECT SUM("Points") FROM table_7468 WHERE "Year" > '2003'
wikisql
CREATE TABLE table_17058 ( "Player" text, "Position" text, "School" text, "Hometown" text, "MLB Draft" text )
How many positions did the player from Spring High School play?
SELECT COUNT("Position") FROM table_17058 WHERE "School" = 'Spring High School'
wikisql
CREATE TABLE table_8667 ( "Province" text, "Capital" text, "Population at 2010 Census" real, "Area (km\u00b2)" real, "Density (2010)" real, "Geographical unit" text, "Number of Cities (kota)" real, "Number of Regencies (kabupaten)" real, "Number of Districts (kecamatan)" real, "V...
What is the average number of regencies (kabupaten) with more than 331 villages and a 2010 population census of 12,982,204?
SELECT AVG("Number of Regencies (kabupaten)") FROM table_8667 WHERE "Villages" > '331' AND "Population at 2010 Census" = '12,982,204'
wikisql
CREATE TABLE table_10611 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
What was the date of the game at Lake Oval?
SELECT "Date" FROM table_10611 WHERE "Venue" = 'lake oval'
wikisql
CREATE TABLE plays_games ( stuid number, gameid number, hours_played number ) CREATE TABLE sportsinfo ( stuid number, sportname text, hoursperweek number, gamesplayed number, onscholarship text ) CREATE TABLE video_games ( gameid number, gname text, gtype text ) CREATE TAB...
Show all male student ids who don't play football.
SELECT stuid FROM student WHERE sex = 'M' EXCEPT SELECT stuid FROM sportsinfo WHERE sportname = "Football"
spider
CREATE TABLE table_17965 ( "Ensemble" text, "Gold Medals" real, "Silver Medals" real, "Bronze Medals" real, "Total Medals" real )
How many numbers were listed under Silver Medals for Portsmouth HS?
SELECT COUNT("Silver Medals") FROM table_17965 WHERE "Ensemble" = 'Portsmouth HS'
wikisql
CREATE TABLE Ref_Calendar ( Calendar_Date DATETIME, Day_Number INTEGER ) CREATE TABLE Employees ( Employee_ID INTEGER, Role_Code CHAR(15), Employee_Name VARCHAR(255), Gender_MFU CHAR(1), Date_of_Birth DATETIME, Other_Details VARCHAR(255) ) CREATE TABLE Documents_to_be_Destroyed ( D...
What are the id of each employee and the number of document destruction authorised by that employee. Visualize by scatter chart.
SELECT Destruction_Authorised_by_Employee_ID, COUNT(*) FROM Documents_to_be_Destroyed GROUP BY Destruction_Authorised_by_Employee_ID
nvbench
CREATE TABLE table_42158 ( "Season" real, "Series" text, "Team" text, "Races" real, "Wins" real, "Points" text, "Position" text )
In what Season were then less than 3 Races with less than 1 Win?
SELECT AVG("Season") FROM table_42158 WHERE "Races" < '3' AND "Wins" < '1'
wikisql
CREATE TABLE table_name_97 ( years VARCHAR, decile VARCHAR, area VARCHAR )
Which years have a Decile smaller than 2, and an Area of mohaka?
SELECT years FROM table_name_97 WHERE decile < 2 AND area = "mohaka"
sql_create_context
CREATE TABLE FlagTypes ( Id number, Name text, Description text ) CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, ExpiryDate time, Body text, OwnerUserId number, DeletionUserId number ) CREATE TABLE Rev...
Search posts by multiple comment text ('OR' operator) and UserId.
SELECT Id AS "comment_link", Score, Text FROM Comments WHERE (UPPER(Text) LIKE UPPER('%##CommentText##%') OR UPPER(Text) LIKE UPPER('%##CommentText2##%')) AND UserId = '##UserId##' ORDER BY Score DESC
sede
CREATE TABLE table_name_44 ( sport VARCHAR, country VARCHAR, year VARCHAR )
Name the sport for puerto rico and year of 2000
SELECT sport FROM table_name_44 WHERE country = "puerto rico" AND year = 2000
sql_create_context
CREATE TABLE table_name_43 ( main_span_feet VARCHAR, main_span_metres VARCHAR, rank VARCHAR, year_opened VARCHAR, country VARCHAR )
What is the main span feet from opening year of 1936 in the United States with a rank greater than 47 and 421 main span metres?
SELECT main_span_feet FROM table_name_43 WHERE year_opened = 1936 AND country = "united states" AND rank > 47 AND main_span_metres = "421"
sql_create_context
CREATE TABLE table_204_269 ( id number, "week" number, "room" text, "winning couple" text, "2nd couple" text, "3rd couple" text, "chumps" text )
in week 3 the winning couple in guest bedroom 2 was kyal and kara but the chumps were
SELECT "chumps" FROM table_204_269 WHERE "week" = 3 AND "room" = 'guest bedroom 2'
squall
CREATE TABLE table_name_10 ( pens VARCHAR, conv VARCHAR )
I want to know the pens with conv of 6
SELECT pens FROM table_name_10 WHERE conv = "6"
sql_create_context
CREATE TABLE SuggestedEdits ( Id number, PostId number, CreationDate time, ApprovalDate time, RejectionDate time, OwnerUserId number, Comment text, Text text, Title text, Tags text, RevisionGUID other ) CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal...
Lowest question-score to comment-score ratios.
SELECT Comments.Id AS "comment_link", Posts.Score AS "post_score", Comments.Score AS "comment_score", Comments.Score / Posts.Score AS "score_ratio" FROM Comments JOIN Posts ON Comments.PostId = Posts.Id WHERE Posts.Score != 0 AND Posts.PostTypeId = 1 ORDER BY 'score_ratio' LIMIT 100
sede
CREATE TABLE table_203_627 ( id number, "no." number, "constituency" text, "created" number, "seats" number, "change" number )
which constituency is listed on top ?
SELECT "constituency" FROM table_203_627 WHERE id = 1
squall
CREATE TABLE table_20167 ( "Year / Theme" text, "Award name" text, "Team name" text, "Team number" real, "City, State/Country" text )
Name the award name for black ocean current
SELECT "Award name" FROM table_20167 WHERE "Team name" = 'BLACK OCEAN CURRENT'
wikisql
CREATE TABLE table_57448 ( "Name" text, "Bodyweight" real, "Snatch" real, "Clean & jerk" real, "Total (kg)" text )
what is the highest clean & jerk when total (kg) is 200.0 and snatch is more than 87.5?
SELECT MAX("Clean & jerk") FROM table_57448 WHERE "Total (kg)" = '200.0' AND "Snatch" > '87.5'
wikisql
CREATE TABLE table_name_46 ( total INTEGER, bronze VARCHAR, nation VARCHAR )
What is the least total number of medals when the bronze medals is 1, and Czech Republic (CZE) is the nation?
SELECT MIN(total) FROM table_name_46 WHERE bronze = 1 AND nation = "czech republic (cze)"
sql_create_context
CREATE TABLE table_11960407_5 ( date VARCHAR, game VARCHAR )
What is the date of Game 50?
SELECT date FROM table_11960407_5 WHERE game = 50
sql_create_context
CREATE TABLE table_name_68 ( lane INTEGER, time VARCHAR, rank VARCHAR )
What is the highest Lane number of a person with a time of 55.94 with a Rank that's bigger than 8?
SELECT MAX(lane) FROM table_name_68 WHERE time > 55.94 AND rank > 8
sql_create_context
CREATE TABLE salary ( year INTEGER, team_id TEXT, league_id TEXT, player_id TEXT, salary INTEGER ) CREATE TABLE pitching_postseason ( player_id TEXT, year INTEGER, round TEXT, team_id TEXT, league_id TEXT, w INTEGER, l INTEGER, g INTEGER, gs INTEGER, cg INTEG...
Show me a line chart for how many players enter hall of fame each year?
SELECT yearid, COUNT(*) FROM hall_of_fame GROUP BY yearid
nvbench
CREATE TABLE table_27680 ( "22/06/2008" text, "Indonesia Super Series 2008" text, "S.Series" text, "7800.00" text, "Runner-Up" text )
Which series occurred when the 7800 was 5040.00?
SELECT "Indonesia Super Series 2008" FROM table_27680 WHERE "7800.00" = '5040.00'
wikisql
CREATE TABLE table_name_98 ( netflix VARCHAR, series_ep VARCHAR )
What is the Netflix episode that has a series episode of 6-02?
SELECT netflix FROM table_name_98 WHERE series_ep = "6-02"
sql_create_context
CREATE TABLE table_50528 ( "Year" text, "Winner" text, "Runner-up" text, "Score" text, "Venue" text )
what is the venue on 21 june 1987?
SELECT "Venue" FROM table_50528 WHERE "Year" = '21 june 1987'
wikisql
CREATE TABLE Documents_with_Expenses ( Document_ID INTEGER, Budget_Type_Code CHAR(15), Document_Details VARCHAR(255) ) CREATE TABLE Statements ( Statement_ID INTEGER, Statement_Details VARCHAR(255) ) CREATE TABLE Accounts ( Account_ID INTEGER, Statement_ID INTEGER, Account_Details VARC...
List document type codes and the number of documents in each code Visualize by bar chart, rank in descending by the y-axis please.
SELECT Document_Type_Code, COUNT(*) FROM Documents GROUP BY Document_Type_Code ORDER BY COUNT(*) DESC
nvbench
CREATE TABLE student ( stuid number, lname text, fname text, age number, sex text, major number, advisor number, city_code text ) CREATE TABLE visits_restaurant ( stuid number, resid number, time time, spent number ) CREATE TABLE restaurant_type ( restypeid number, ...
At which restaurant did the students spend the least amount of time? List restaurant and the time students spent on in total.
SELECT restaurant.resname, SUM(visits_restaurant.spent) FROM visits_restaurant JOIN restaurant ON visits_restaurant.resid = restaurant.resid GROUP BY restaurant.resid ORDER BY SUM(visits_restaurant.spent) LIMIT 1
spider
CREATE TABLE table_name_85 ( report VARCHAR, date VARCHAR )
What Report is on June 3, 2000?
SELECT report FROM table_name_85 WHERE date = "june 3, 2000"
sql_create_context
CREATE TABLE table_23689 ( "Club" text, "Played" text, "Won" text, "Drawn" text, "Lost" text, "Points for" text, "Points against" text, "Points difference" text, "Bonus Points" text, "Points" text )
how many won 83 points for?
SELECT "Won" FROM table_23689 WHERE "Points for" = '83'
wikisql
CREATE TABLE Sales ( sales_transaction_id INTEGER, sales_details VARCHAR(255) ) CREATE TABLE Purchases ( purchase_transaction_id INTEGER, purchase_details VARCHAR(255) ) CREATE TABLE Investors ( investor_id INTEGER, Investor_details VARCHAR(255) ) CREATE TABLE Lots ( lot_id INTEGER, i...
Show all dates of transactions whose type code is 'SALE', and count them by a line chart
SELECT date_of_transaction, COUNT(date_of_transaction) FROM Transactions WHERE transaction_type_code = "SALE"
nvbench
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic (...
count the number of patients whose admission type is elective and lab test fluid is other body fluid?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_type = "ELECTIVE" AND lab.fluid = "Other Body Fluid"
mimicsql_data
CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefin...
Where to see how long I have been a member of SO?. http://meta.stackoverflow.com/questions/334109/where-to-see-how-long-i-have-been-a-member-of-so
SELECT Id AS "user_link", CreationDate FROM Users WHERE Id = '##userid##'
sede
CREATE TABLE gyb ( 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...
列出病人53441764医疗记录中的入院诊断疾病编码和名称,主要针对医疗费总额不低于4790.44元的
SELECT qtb.OUT_DIAG_DIS_CD, qtb.OUT_DIAG_DIS_NM FROM qtb WHERE qtb.PERSON_ID = '53441764' AND qtb.MED_CLINIC_ID IN (SELECT t_kc24.MED_CLINIC_ID FROM t_kc24 WHERE t_kc24.MED_AMOUT >= 4790.44) UNION SELECT gyb.OUT_DIAG_DIS_CD, gyb.OUT_DIAG_DIS_NM FROM gyb WHERE gyb.PERSON_ID = '53441764' AND gyb.MED_CLINIC_ID IN (SELECT ...
css
CREATE TABLE table_58220 ( "Driver" text, "Constructor" text, "Laps" real, "Time/Retired" text, "Grid" real )
What is the grid 13 time score?
SELECT "Time/Retired" FROM table_58220 WHERE "Grid" = '13'
wikisql
CREATE TABLE table_203_699 ( id number, "name" text, "parentage" text, "size" text, "flower colour" text, "flower type" text )
is leonard messel or royalty larger in size ?
SELECT "name" FROM table_203_699 WHERE "name" IN ('leonard messel', 'royalty') ORDER BY "size" DESC LIMIT 1
squall
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, ...
what were the number of patients who received an cortisol test this year?
SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE patient.patientunitstayid IN (SELECT lab.patientunitstayid FROM lab WHERE lab.labname = 'cortisol' AND DATETIME(lab.labresulttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year'))
eicu
CREATE TABLE table_31100 ( "Stage" real, "Winner" text, "General Classification" text, "Mountains Classification" text, "Sprint Classification" text, "Young Rider Classification" text, "Team Classification" text, "Aggressive Rider" text )
Who is the sprint classification where Francisco Ventoso wins?
SELECT "Sprint Classification" FROM table_31100 WHERE "Winner" = 'Francisco Ventoso'
wikisql
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id t...
give me the number of married patients admitted in hospital before 2119.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.marital_status = "MARRIED" AND demographic.admityear < "2119"
mimicsql_data
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) CREATE TABLE jybgb ( BBCJBW text, BBDM text, BBMC text, BBZT number, BGDH text, BGJGDM text, BGJGMC text, BGRGH text, BGRQ time, BGRXM text, BGSJ time, CJRQ time, JSBBRQSJ time, ...
患者77448008在2009年8月4日到2021年6月15日内都做了什么检查把检验报告单号列出来
SELECT jybgb.BGDH FROM hz_info JOIN txmzjzjlb JOIN jybgb ON hz_info.YLJGDM = txmzjzjlb.YLJGDM AND hz_info.KH = txmzjzjlb.KH AND hz_info.KLX = txmzjzjlb.KLX AND txmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND txmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE hz_info.RYBH = '77448008' AND jybgb.BGRQ BETWEEN '2009-08-04' AND '2021-...
css
CREATE TABLE table_name_50 ( kind_of_the_song VARCHAR, number VARCHAR, name_of_the_song VARCHAR )
What type of song is larger than 8 and named ?
SELECT kind_of_the_song FROM table_name_50 WHERE number > 8 AND name_of_the_song = "實情"
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 name and revenue , and group by attribute headquarter, display by the bars in asc.
SELECT T1.Name, T2.Revenue FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter, T1.Name ORDER BY T1.Name
nvbench
CREATE TABLE table_69215 ( "Rank (CSA)" text, "State(s)" text, "2007 Estimate" text, "2000 Population" text, "Percent Change (1990\u20132000)" text )
What is the rank of a result with a population of 99,962 in 2000?
SELECT "Rank (CSA)" FROM table_69215 WHERE "2000 Population" = '99,962'
wikisql
CREATE TABLE table_24223834_3 ( overall VARCHAR, title VARCHAR )
How may overall episodes had the title 'this is what they want'?
SELECT COUNT(overall) FROM table_24223834_3 WHERE title = "This is What They Want"
sql_create_context
CREATE TABLE table_7962 ( "Tie no" text, "Home team" text, "Score" text, "Away team" text, "Date" text )
Which Date has a Tie no of 11?
SELECT "Date" FROM table_7962 WHERE "Tie no" = '11'
wikisql
CREATE TABLE table_38475 ( "School Year" text, "Class A" text, "Class AA" text, "Class AAA" text, "Class AAAA" text, "Class AAAAA" text )
What is the Class AA in the 2010-11 school year with a class AAA of Giddings?
SELECT "Class AA" FROM table_38475 WHERE "Class AAA" = 'giddings' AND "School Year" = '2010-11'
wikisql
CREATE TABLE table_10490 ( "Retail name" text, "Chipset based on" text, "Digital/analog signal" text, "AVIVO" text, "Available interface" text )
What is the Retail name with a Digital/analog signal with analog, and a Chipset based on with radeon 9600?
SELECT "Retail name" FROM table_10490 WHERE "Digital/analog signal" = 'analog' AND "Chipset based on" = 'radeon 9600'
wikisql
CREATE TABLE cinema ( Cinema_ID int, Name text, Openning_year int, Capacity int, Location text ) CREATE TABLE film ( Film_ID int, Rank_in_series int, Number_in_season int, Title text, Directed_by text, Original_air_date text, Production_code text ) CREATE TABLE schedule...
Give me the title and highest price for each film in a bar chart, and display x-axis in asc order.
SELECT Title, MAX(T1.Price) FROM schedule AS T1 JOIN film AS T2 ON T1.Film_ID = T2.Film_ID GROUP BY Title ORDER BY Title
nvbench
CREATE TABLE table_24143253_2 ( cause_of_death VARCHAR, name VARCHAR )
How did Stella Farentino die?
SELECT cause_of_death FROM table_24143253_2 WHERE name = "Stella Farentino"
sql_create_context
CREATE TABLE table_name_72 ( to_par VARCHAR, country VARCHAR, score VARCHAR )
What is the to par for the United States with a 67-71-73=211 score?
SELECT to_par FROM table_name_72 WHERE country = "united states" AND score = 67 - 71 - 73 = 211
sql_create_context
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, ...
count the number of medications patient 006-147098 has been prescribed in their last hospital visit.
SELECT COUNT(*) FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-147098' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hos...
eicu
CREATE TABLE table_14722 ( "Game" real, "Date" text, "Location" text, "Time" text, "Attendance" real )
What was the average attendance on October 12?
SELECT AVG("Attendance") FROM table_14722 WHERE "Date" = 'october 12'
wikisql
CREATE TABLE table_name_61 ( season VARCHAR, super_g VARCHAR, overall VARCHAR )
How many seasons had a Super G of 2 and overall of 3?
SELECT COUNT(season) FROM table_name_61 WHERE super_g = "2" AND overall = 3
sql_create_context
CREATE TABLE table_13968 ( "Season" real, "Series" text, "Team" text, "Races" real, "Wins" real, "Poles" real, "F/Laps" real, "Podiums" real, "Points" real, "Position" text )
What is the lowest number of f/laps with more than 4 podiums and more than 14 races?
SELECT MIN("F/Laps") FROM table_13968 WHERE "Podiums" > '4' AND "Races" > '14'
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...
give me the number of patients whose admission year is less than 2173 and lab test name is calculated bicarbonate, whole blood?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admityear < "2173" AND lab.label = "Calculated Bicarbonate, Whole Blood"
mimicsql_data
CREATE TABLE t_kc22 ( MED_EXP_DET_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, MED_CLINIC_ID text, MED_EXP_BILL_ID text, SOC_SRT_DIRE_CD text, SOC_SRT_DIRE_NM text, DIRE_TYPE number, CHA_ITEM_LEV number, MED_INV_ITEM_TYPE text, MED_DIRE_CD text, MED_DIRE_NM text,...
陶迎秋这个病患的医疗记录里一共被开出了多少次均价小于2684.97元的药物?看病时的编号是多少?
SELECT MED_CLINIC_ID FROM t_kc21 WHERE PERSON_NM = '陶迎秋' AND NOT MED_CLINIC_ID IN (SELECT MED_CLINIC_ID FROM t_kc22 WHERE AMOUNT >= 2684.97)
css
CREATE TABLE table_181240_1 ( modern_german__standard_wording_ VARCHAR, english___bcp__ VARCHAR )
What is the english (bcp) phrase 'for thine is the kingdom, the power' in modern german with standard wording?
SELECT modern_german__standard_wording_ FROM table_181240_1 WHERE english___bcp__ = "For thine is the kingdom, the power"
sql_create_context
CREATE TABLE host ( Host_ID int, Name text, Nationality text, Age text ) CREATE TABLE party ( Party_ID int, Party_Theme text, Location text, First_year text, Last_year text, Number_of_hosts int ) CREATE TABLE party_host ( Party_ID int, Host_ID int, Is_Main_in_Charge...
Return a histogram on how many hosts does each nationality have? List the nationality and the count.
SELECT Nationality, COUNT(*) FROM host GROUP BY Nationality
nvbench
CREATE TABLE table_name_58 ( away_team VARCHAR, attendance VARCHAR )
What is the away team of the game with an attendance of 117?
SELECT away_team FROM table_name_58 WHERE attendance = 117
sql_create_context
CREATE TABLE table_63539 ( "Draw" real, "Language" text, "Artist" text, "Song" text, "Place" real, "Points" real )
What was the lowest draw for Beathoven when the place was smaller than 16?
SELECT MIN("Draw") FROM table_63539 WHERE "Artist" = 'beathoven' AND "Place" < '16'
wikisql
CREATE TABLE table_16114 ( "Season" text, "Series" text, "Team" text, "Races" real, "Wins" real, "Poles" real, "F/Laps" real, "Podiums" real, "Points" real, "Position" text )
What is the number of podiums for season 2010 for campionato italiano superstars.
SELECT COUNT("Podiums") FROM table_16114 WHERE "Season" = '2010' AND "Series" = 'Campionato Italiano Superstars'
wikisql
CREATE TABLE table_34351 ( "Date" text, "Site" text, "Sport" text, "Winning team" text, "Series" text )
Which Series are on september 15, 2007?
SELECT "Series" FROM table_34351 WHERE "Date" = 'september 15, 2007'
wikisql
CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varchar(20), LAST_NAME varchar(25), EMAIL varchar(25), PHONE_NUMBER varchar(20), HIRE_DATE date, JOB_ID varchar(10), SALARY decimal(8,2), COMMISSION_PCT decimal(2,2), MANAGER_ID decimal(6,0), DEPARTMENT_ID decimal(...
Visualize a bar chart for simply displaying the email address of the employee and the corresponding employee id, and could you display by the X-axis in asc?
SELECT EMAIL, EMPLOYEE_ID FROM employees ORDER BY EMAIL
nvbench
CREATE TABLE table_name_99 ( race VARCHAR, tyre VARCHAR, winning_driver VARCHAR )
What is the race that had a tyre of p and Juan Manuel Fangio as the winning driver?
SELECT race FROM table_name_99 WHERE tyre = "p" AND winning_driver = "juan manuel fangio"
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 demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, ...
what is the number of patients whose days of hospital stay is greater than 27 and drug route is both eyes?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.days_stay > "27" AND prescriptions.route = "BOTH EYES"
mimicsql_data
CREATE TABLE county ( county_id number, county_name text, population number, zip_code text ) CREATE TABLE election ( election_id number, counties_represented text, district number, delegate text, party number, first_elected number, committee text ) CREATE TABLE party ( ...
Show the zip code of the county with name 'Howard'.
SELECT zip_code FROM county WHERE county_name = "Howard"
spider
CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text ) CREATE...
cliffer some closed questions that need cliffering 2. http://meta.stackexchange.com/questions/78048/enable-automatic-deletion-of-old-unanswered-zero-score-questions-after-a-year/92006#92006
SELECT q.Id AS "post_link", q.Score AS qScore, a.Score AS aScore, q.ViewCount AS Views, q.CreationDate AS qDate FROM Posts AS q INNER JOIN Posts AS a ON a.ParentId = q.Id WHERE q.PostTypeId = 1 AND a.PostTypeId = 2 AND q.Score < 1 AND a.Score = 1 AND q.AcceptedAnswerId IS NULL AND DATEDIFF(DAY, q.ClosedDate, GETDATE())...
sede
CREATE TABLE table_27058 ( "No. in series" real, "No. in season" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production code" real )
When 15 is the number in season what is the highest number in series?
SELECT MAX("No. in series") FROM table_27058 WHERE "No. in season" = '15'
wikisql
CREATE TABLE gwyjzb ( 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, ...
因疾病I35.324住院在乳腺肿瘤这个科室记录有多少平均费用,时间在二零零七年五月十一日至二零一二年六月一日
SELECT AVG(gwyjzb.MED_AMOUT) FROM gwyjzb WHERE gwyjzb.MED_ORG_DEPT_NM = '乳腺肿瘤科' AND gwyjzb.IN_HOSP_DATE BETWEEN '2007-05-11' AND '2012-06-01' AND gwyjzb.IN_DIAG_DIS_CD = 'I35.324' AND gwyjzb.CLINIC_TYPE = '住院' UNION SELECT AVG(fgwyjzb.MED_AMOUT) FROM fgwyjzb WHERE fgwyjzb.MED_ORG_DEPT_NM = '乳腺肿瘤科' AND fgwyjzb.IN_HOSP_D...
css
CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost numb...
how many *nf* rasburicase prescriptions have been written?
SELECT COUNT(*) FROM prescriptions WHERE prescriptions.drug = '*nf* rasburicase'
mimic_iii
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 text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) C...
how many patients have a government insurance policy?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.insurance = "Government"
mimicsql_data
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...
A pie chart shows the proportion of All_Neutral and team id.
SELECT All_Neutral, Team_ID FROM basketball_match
nvbench
CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code tex...
the heartrate of patient 005-11182 last measured on the first icu visit is greater than it was first measured on the first icu visit?
SELECT (SELECT vitalperiodic.heartrate FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '005-11182') AND NOT patient.unitdischargetime IS ...
eicu
CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time, drug text, dose_val_rx text, dose_unit_rx text, route text ) CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, ...
count the number of people who were diagnosed with lung contusion-open and didn't come back to the hospital within 2 months.
SELECT (SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'lung contu...
mimic_iii
CREATE TABLE table_43883 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text )
What is Country, when Player is 'Jack Nicklaus'?
SELECT "Country" FROM table_43883 WHERE "Player" = 'jack nicklaus'
wikisql
CREATE TABLE table_11206787_5 ( capacity INTEGER, team VARCHAR )
What is the minimum capacity where airdrie united is?
SELECT MIN(capacity) FROM table_11206787_5 WHERE team = "Airdrie United"
sql_create_context
CREATE TABLE VoteTypes ( Id number, Name text ) CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, Crea...
swt tagged questions without answers and comments.
SELECT Id, Body FROM Posts WHERE CommentCount = 0 AND AnswerCount = 0 AND Tags LIKE '%eclipse%'
sede
CREATE TABLE jybgb ( BBCJBW text, BBDM text, BBMC text, BBZT number, BGDH text, BGJGDM text, BGJGMC text, BGRGH text, BGRQ time, BGRXM text, BGSJ time, CJRQ time, JSBBRQSJ time, JSBBSJ time, JYBBH text, JYJGMC text, JYJSGH text, JYJSQM text, JY...
在编号为9381500的医院中,孙丹红患者在科室名有产字的科室的就诊记录的流水号有哪些
SELECT mzjzjlb.JZLSH FROM hz_info JOIN mzjzjlb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX WHERE hz_info.person_info_XM = '孙丹红' AND hz_info.YLJGDM = '9381500' AND mzjzjlb.JZKSMC LIKE '%产%'
css