context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE table_52593 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Decision" text,
"Attendance" real,
"Record" text
) | What was the score when Montreal was home? | SELECT "Score" FROM table_52593 WHERE "Home" = 'montreal' | wikisql |
CREATE TABLE table_40026 (
"Goal" real,
"Date" text,
"Venue" text,
"Score" text,
"Result" text,
"Competition" text
) | What is the score when there are less than 2 goals? | SELECT "Score" FROM table_40026 WHERE "Goal" < '2' | wikisql |
CREATE TABLE movie (
movie_id number,
title text,
year number,
director text,
budget_million number,
gross_worldwide number
)
CREATE TABLE culture_company (
company_name text,
type text,
incorporated_in text,
group_equity_shareholding number,
book_club_id text,
movie_id ... | What are the publishers who have published a book in both 1989 and 1990? | SELECT publisher FROM book_club WHERE year = 1989 INTERSECT SELECT publisher FROM book_club WHERE year = 1990 | spider |
CREATE TABLE table_name_46 (
co_driver VARCHAR,
year VARCHAR,
race VARCHAR
) | Who was the co-driver in 1970 for the race of Targa Florio? | SELECT co_driver FROM table_name_46 WHERE year = 1970 AND race = "targa florio" | sql_create_context |
CREATE TABLE TagSynonyms (
Id number,
SourceTagName text,
TargetTagName text,
CreationDate time,
OwnerUserId number,
AutoRenameCount number,
LastAutoRename time,
Score number,
ApprovedByUserId number,
ApprovalDate time
)
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
... | Is there any way to search closed questions with reasons of primarily opinion-based or too broad. http://meta.stackexchange.com/questions/285499/is-there-any-way-to-search-closed-questions-with-reasons-of-primarily-opinion-b | SELECT * FROM Posts AS p INNER JOIN PostHistory AS ph ON ph.PostId = p.Id WHERE ph.PostHistoryTypeId = 10 AND NOT p.ClosedDate IS NULL AND p.PostTypeId = 1 | sede |
CREATE TABLE table_75202 (
"Rank" real,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) | What is the highest rank of Austria, which had less than 0 silvers? | SELECT MIN("Rank") FROM table_75202 WHERE "Nation" = 'austria' AND "Silver" < '0' | wikisql |
CREATE TABLE mzjybgb (
BBCJBW text,
BBDM text,
BBMC text,
BBZT number,
BGDH number,
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,
... | 列出在2007-12-26到2017-05-25期间,患者华歌韵所有检验结果指标记录的检测人为尤弘业的检验指标流水号是多少? | SELECT jyjgzbb.JYZBLSH FROM person_info JOIN hz_info JOIN mzjzjlb JOIN zyjybgb JOIN jyjgzbb 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 = zyjybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = zyjybgb.JZLSH_MZJZJLB AND zyjybgb.Y... | css |
CREATE TABLE table_75333 (
"Game" text,
"Date" text,
"Home Team" text,
"Result" text,
"Road Team" text
) | On what date was game 2 played? | SELECT "Date" FROM table_75333 WHERE "Game" = 'game 2' | wikisql |
CREATE TABLE table_203_208 (
id number,
"team" text,
"location" text,
"venue" text,
"capacity" number,
"position in 1993-94" number
) | how many teams are located in minsk ? | SELECT COUNT("team") FROM table_203_208 WHERE "location" = 'minsk' | squall |
CREATE TABLE table_name_8 (
traffic_direction VARCHAR,
street VARCHAR,
west VARCHAR,
_number_of_lanes VARCHAR
) | What is the traffic direction of 64th street with 2nd avenue to the west and 1 lane? | SELECT traffic_direction FROM table_name_8 WHERE west = "2nd avenue" AND _number_of_lanes = "1" AND street = "64th street" | sql_create_context |
CREATE TABLE Comments (
Id number,
PostId number,
Score number,
Text text,
CreationDate time,
UserDisplayName text,
UserId number,
ContentLicense text
)
CREATE TABLE PostNotices (
Id number,
PostId number,
PostNoticeTypeId number,
CreationDate time,
DeletionDate time... | High on favorites, but low on votes. Find out which questions were favorited more than twice their score | SELECT Id AS "post_link", FavoriteCount, Score FROM Posts WHERE Score > 10 AND FavoriteCount > 10 ORDER BY FavoriteCount DESC | sede |
CREATE TABLE table_name_76 (
outcome VARCHAR,
date VARCHAR
) | What's the Outcome for the Date of July 16, 2011? | SELECT outcome FROM table_name_76 WHERE date = "july 16, 2011" | sql_create_context |
CREATE TABLE table_45530 (
"Rank" real,
"City" text,
"Province" text,
"Date of Official Foundation of Municipality" real,
"2006" real,
"1996" real,
"1986" real,
"1976" real,
"1966" real,
"1956" real
) | What is the 2006 sum with a rank 1 and more than 6758845 in 1996? | SELECT SUM("2006") FROM table_45530 WHERE "Rank" = '1' AND "1996" > '6758845' | wikisql |
CREATE TABLE papers (
paperid number,
title text
)
CREATE TABLE authorship (
authid number,
instid number,
paperid number,
authorder number
)
CREATE TABLE inst (
instid number,
name text,
country text
)
CREATE TABLE authors (
authid number,
lname text,
fname text
) | Retrieve all the first and last names of authors in the alphabetical order of last names. | SELECT fname, lname FROM authors ORDER BY lname | spider |
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefined boolean,
PostNoticeDurationId number
)
C... | my posts edited by someone else. | SELECT Id, Title FROM Posts WHERE OwnerUserId = 499 AND LastEditorUserId != 499 | sede |
CREATE TABLE table_name_83 (
score VARCHAR,
attendance VARCHAR
) | What was the score when the attendance was 18,545? | SELECT score FROM table_name_83 WHERE attendance = "18,545" | 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, draw a bar chart about the distribution of headquarter and the sum of code , and group by attribute headquarter, order in ascending by the X-axis. | SELECT T2.Headquarter, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Headquarter ORDER BY T2.Headquarter | nvbench |
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,
spec_type_desc text,
org_name text
)
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
sh... | is there any microbiology test result of patient 12927 during their current hospital encounter? | SELECT COUNT(*) > 0 FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 12927 AND admissions.dischtime IS NULL) | mimic_iii |
CREATE TABLE furniture (
Furniture_ID int,
Name text,
Num_of_Component int,
Market_Rate real
)
CREATE TABLE manufacturer (
Manufacturer_ID int,
Open_Year real,
Name text,
Num_of_Factories int,
Num_of_Shops int
)
CREATE TABLE furniture_manufacte (
Manufacturer_ID int,
Furnit... | Find the component amounts and names of all furnitures that have more than 10 components, and could you order by the y axis from low to high? | SELECT Name, Num_of_Component FROM furniture WHERE Num_of_Component > 10 ORDER BY Num_of_Component | nvbench |
CREATE TABLE table_name_50 (
date VARCHAR,
venue VARCHAR
) | On what date was the venue VFL Park? | SELECT date FROM table_name_50 WHERE venue = "vfl park" | sql_create_context |
CREATE TABLE t_kc24 (
MED_SAFE_PAY_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
MED_CLINIC_ID text,
REF_SLT_FLG number,
CLINIC_SLT_DATE time,
COMP_ID text,
PERSON_ID text,
FLX_MED_ORG_ID text,
INSU_TYPE text,
MED_AMOUT number,
PER_ACC_PAY number,
OVE_PAY numb... | 列出名称不包含心理的科室开出的所有医疗费用明细项目在医疗就诊30612359533中有哪些? | SELECT * FROM t_kc22 WHERE MED_CLINIC_ID = '30612359533' AND NOT MED_ORG_DEPT_NM LIKE '%心理%' | css |
CREATE TABLE table_25695027_1 (
years_built VARCHAR,
cylinder_size VARCHAR,
firebox VARCHAR
) | This engine with a cylinder size of 20 x 26 and a firebox of radial-stay was built when? | SELECT years_built FROM table_25695027_1 WHERE cylinder_size = "20 ½” x 26”" AND firebox = "Radial-stay" | sql_create_context |
CREATE TABLE table_name_88 (
english VARCHAR,
character VARCHAR
) | What is the English character for Lin Ming Kuan ( )? | SELECT english FROM table_name_88 WHERE character = "lin ming kuan (林明寬)" | sql_create_context |
CREATE TABLE table_name_99 (
winning_team VARCHAR,
usa_captain VARCHAR
) | When the USA's captain was Beth Daniel, who was the winning team? | SELECT winning_team FROM table_name_99 WHERE usa_captain = "beth daniel" | sql_create_context |
CREATE TABLE table_name_64 (
season VARCHAR,
school_club_team VARCHAR
) | What season did the player who came from Cebu play in? | SELECT season FROM table_name_64 WHERE school_club_team = "cebu" | 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... | 统计一下医疗记录中患者年龄低于28岁的平均医疗费总额都是多少? | SELECT AVG(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_PERSON_AGE < 28) | css |
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime time,
v... | how much does the cost of von willebrand factor antigen are? | SELECT DISTINCT cost.cost FROM cost WHERE cost.event_type = 'labevents' AND cost.event_id IN (SELECT labevents.row_id FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'von willebrand factor antigen')) | mimic_iii |
CREATE TABLE table_13922 (
"Class" text,
"Railway number(s)" text,
"Quantity" real,
"Year(s) of manufacture" text,
"Type" text
) | Which Railway number(s) has a Year(s) of manufacture of 1899 1907? | SELECT "Railway number(s)" FROM table_13922 WHERE "Year(s) of manufacture" = '1899–1907' | wikisql |
CREATE TABLE races (
raceid number,
year number,
round number,
circuitid number,
name text,
date text,
time text,
url text
)
CREATE TABLE driverstandings (
driverstandingsid number,
raceid number,
driverid number,
points number,
position number,
positiontext text... | What is the id and first name of all the drivers who participated in the Australian Grand Prix and the Chinese Grand Prix? | SELECT T2.driverid, T3.forename FROM races AS T1 JOIN results AS T2 ON T1.raceid = T2.raceid JOIN drivers AS T3 ON T2.driverid = T3.driverid WHERE T1.name = "Australian Grand Prix" INTERSECT SELECT T2.driverid, T3.forename FROM races AS T1 JOIN results AS T2 ON T1.raceid = T2.raceid JOIN drivers AS T3 ON T2.driverid = ... | spider |
CREATE TABLE table_51424 (
"Date" text,
"Venue" text,
"Score" text,
"Result" text,
"Competition" text
) | What is the score of the match on July 22, 2008? | SELECT "Score" FROM table_51424 WHERE "Date" = 'july 22, 2008' | wikisql |
CREATE TABLE customers (
customer_id number,
customer_details text
)
CREATE TABLE claims (
claim_id number,
policy_id number,
date_claim_made time,
date_claim_settled time,
amount_claimed number,
amount_settled number
)
CREATE TABLE payments (
payment_id number,
settlement_id n... | Which customers do not have any policies? Find the details of these customers. | SELECT customer_details FROM customers EXCEPT SELECT T1.customer_details FROM customers AS T1 JOIN customer_policies AS T2 ON T1.customer_id = T2.customer_id | spider |
CREATE TABLE table_name_97 (
years_competed VARCHAR,
nickname VARCHAR
) | Tell me the years competed for panthers | SELECT years_competed FROM table_name_97 WHERE nickname = "panthers" | sql_create_context |
CREATE TABLE table_name_57 (
country VARCHAR,
to_par VARCHAR
) | What country has a +3 to par? | SELECT country FROM table_name_57 WHERE to_par = "+3" | sql_create_context |
CREATE TABLE table_204_693 (
id number,
"place" text,
"total" number,
"men" number,
"women" number,
"children" number,
"elderly" number,
"serbs" number,
"jews" number,
"romani" number,
"rusyns" number,
"hungarians" number,
"russians" number
) | what was the average number of victims for all places ? | SELECT AVG("total") FROM table_204_693 | squall |
CREATE TABLE table_name_99 (
format VARCHAR,
catalog VARCHAR
) | What is the Format o Catalog F4 87199? | SELECT format FROM table_name_99 WHERE catalog = "f4 87199" | sql_create_context |
CREATE TABLE table_6110 (
"Stage" text,
"Winner" text,
"General classification" text,
"Points Classification" text,
"Mountains Classification" text,
"Team Classification" text
) | What is the team classification with a winner of Beat Zberg, and a points classification of Jos Mar a Jim nez. | SELECT "Team Classification" FROM table_6110 WHERE "Points Classification" = 'josé maría jiménez' AND "Winner" = 'beat zberg' | wikisql |
CREATE TABLE table_name_10 (
rebounds VARCHAR,
team VARCHAR,
games VARCHAR
) | How many Rebounds did Maccabi Tel Aviv Team get after Game 6? | SELECT COUNT(rebounds) FROM table_name_10 WHERE team = "maccabi tel aviv" AND games > 6 | sql_create_context |
CREATE TABLE table_57353 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | Who was the home team at Princes Park? | SELECT "Home team score" FROM table_57353 WHERE "Venue" = 'princes park' | wikisql |
CREATE TABLE table_76972 (
"Result" text,
"Race" text,
"Distance" text,
"Weight" real,
"Winner or 2nd" text,
"Pos'n" text
) | What was the name of the winner or 2nd when the result was , and weight was 6.7? | SELECT "Winner or 2nd" FROM table_76972 WHERE "Result" = '–' AND "Weight" = '6.7' | wikisql |
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,
ZYLBDM text,
ZYMC text
)
CREATE TABLE jybgb (
BBCJBW text,
BBDM tex... | 就诊的病患33852265号其检验报告单上对应的检查结果指标均不正常的单号是多少? | SELECT jybgb.BGDH FROM hz_info JOIN mzjzjlb JOIN jybgb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE hz_info.RYBH = '33852265' AND NOT jybgb.BGDH IN (SELECT jyjgzbb.BGDH FROM jyjgzbb WH... | css |
CREATE TABLE table_name_9 (
country VARCHAR,
place VARCHAR,
score VARCHAR
) | Which country has t6 as a place and 75-70=145 as the score? | SELECT country FROM table_name_9 WHERE place = "t6" AND score = 75 - 70 = 145 | sql_create_context |
CREATE TABLE dual_carrier (
main_airline varchar,
low_flight_number int,
high_flight_number int,
dual_airline varchar,
service_name text
)
CREATE TABLE airline (
airline_code varchar,
airline_name text,
note text
)
CREATE TABLE airport (
airport_code varchar,
airport_name text,... | show me all flights from ATLANTA to DENVER which leave after 1700 o'clock pm the day after tomorrow | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE ((date_day.day_number = 20 AND date_day.month_number = 1 AND date_day.year = 1991 AND days.day_name = date_day.day_name AND flight.departure_time... | atis |
CREATE TABLE election (
Election_ID int,
Representative_ID int,
Date text,
Votes real,
Vote_Percent real,
Seats real,
Place real
)
CREATE TABLE representative (
Representative_ID int,
Name text,
State text,
Party text,
Lifespan text
) | Plot how many party by grouped by party as a bar graph, could you rank by the total number from low to high? | SELECT Party, COUNT(Party) FROM representative GROUP BY Party ORDER BY COUNT(Party) | nvbench |
CREATE TABLE table_11959669_6 (
record VARCHAR,
high_assists VARCHAR
) | What is the record where high assists is pierce (6)? | SELECT record FROM table_11959669_6 WHERE high_assists = "Pierce (6)" | sql_create_context |
CREATE TABLE table_27708484_3 (
matches_played VARCHAR,
average_goals_scored_per_match VARCHAR
) | how many matches were played that average goals scored 1.25? | SELECT COUNT(matches_played) FROM table_27708484_3 WHERE average_goals_scored_per_match = "1.25" | sql_create_context |
CREATE TABLE table_name_59 (
developer VARCHAR,
platform VARCHAR
) | Which developer has xbox 360 as the platform? | SELECT developer FROM table_name_59 WHERE platform = "xbox 360" | sql_create_context |
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Percent text,
ACC_Home text,
ACC_Road text,
All_Games text,
All_Games_Percent int,
All_Home text,
All_Road text,
All_Neutral text
)
CREATE TABLE university (
Scho... | Give me the comparison about ACC_Percent over the All_Neutral , and could you rank All_Neutral in ascending order? | SELECT All_Neutral, ACC_Percent FROM basketball_match ORDER BY All_Neutral | nvbench |
CREATE TABLE table_name_57 (
stage VARCHAR,
points_classification VARCHAR,
general_classification VARCHAR
) | Which stage had a Points Classification of Francesco Moser and a general classification of Bernard Hinault? | SELECT stage FROM table_name_57 WHERE points_classification = "francesco moser" AND general_classification = "bernard hinault" | sql_create_context |
CREATE TABLE table_61254 (
"Team" text,
"Played" real,
"Draw" real,
"Lost" real,
"Goals Scored" real,
"Goals Conceded" real,
"Points" text
) | Name the average Played with a Points of 0*? | SELECT AVG("Played") FROM table_61254 WHERE "Points" = '0*' | wikisql |
CREATE TABLE allergy_type (
allergy text,
allergytype text
)
CREATE TABLE has_allergy (
stuid number,
allergy text
)
CREATE TABLE student (
stuid number,
lname text,
fname text,
age number,
sex text,
major number,
advisor number,
city_code text
) | What are the distinct first names and cities of the students who have allergy either to milk or to cat? | SELECT DISTINCT T1.fname, T1.city_code FROM student AS T1 JOIN has_allergy AS T2 ON T1.stuid = T2.stuid WHERE T2.allergy = "Milk" OR T2.allergy = "Cat" | spider |
CREATE TABLE PostLinks (
Id number,
CreationDate time,
PostId number,
RelatedPostId number,
LinkTypeId number
)
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE SuggestedEdits (
Id number,
PostId number,
CreationDate time,
ApprovalDa... | Number of Comments Per Question. | SELECT Posts.Id, Posts.PostTypeId, Posts.Score, Posts.ViewCount, Posts.OwnerUserId, Posts.OwnerDisplayName, Users.Reputation, Posts.CommentCount FROM Posts LEFT JOIN Users ON Users.Id = Posts.OwnerUserId | sede |
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
eventtype text,
careunit text,
wardid number,
intime time,
... | when has patient 58730 first had the minimum value of hemoglobin during their last hospital visit? | SELECT labevents.charttime FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 58730 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime DESC LIMIT 1) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = ... | mimic_iii |
CREATE TABLE table_45435 (
"Date" text,
"H/A/N" text,
"Opponent" text,
"Score" text,
"Record" text
) | What is Record, when H/A/N is n? | SELECT "Record" FROM table_45435 WHERE "H/A/N" = 'n' | wikisql |
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... | Give me the comparison about meter_100 over the meter_300 by a bar chart. | SELECT meter_300, meter_100 FROM swimmer | nvbench |
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 minimum age of patients who were admitted in emergency in or after the year 2175. | SELECT MIN(demographic.age) FROM demographic WHERE demographic.admission_type = "EMERGENCY" AND demographic.admityear >= "2175" | mimicsql_data |
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TAB... | what were the three most frequently prescribed drugs that were prescribed to the intracranial injury - with subarachnoid hemorrhage male patients 40s in the same month after they had been diagnosed with intracranial injury - with subarachnoid hemorrhage until 1 year ago? | SELECT t3.drugname FROM (SELECT t2.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'intracranial injury - with subarachnoid hemorrhage... | eicu |
CREATE TABLE table_203_865 (
id number,
"place" number,
"athlete" text,
"nation" text,
"best mark" text,
"throw 1" number,
"throw 2" number,
"throw 3" number,
"throw 4" number,
"throw 5" number,
"throw 6" number
) | what was the last recorded throw for valerie young ? | SELECT "throw 6" FROM table_203_865 WHERE "athlete" = 'valerie young' | squall |
CREATE TABLE table_18474 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Result" text,
"Candidates" text
) | What was the result when Leo E. Allen was elected? | SELECT "Result" FROM table_18474 WHERE "Incumbent" = 'Leo E. Allen' | wikisql |
CREATE TABLE medicine (
id VARCHAR,
trade_name VARCHAR
)
CREATE TABLE medicine_enzyme_interaction (
medicine_id VARCHAR
) | What is the id and trade name of the medicines can interact with at least 3 enzymes? | SELECT T1.id, T1.trade_name FROM medicine AS T1 JOIN medicine_enzyme_interaction AS T2 ON T2.medicine_id = T1.id GROUP BY T1.id HAVING COUNT(*) >= 3 | sql_create_context |
CREATE TABLE table_name_65 (
res VARCHAR,
method VARCHAR,
opponent VARCHAR
) | What was the resolution for the fight against tom bolger by submission (guillotine choke)? | SELECT res FROM table_name_65 WHERE method = "submission (guillotine choke)" AND opponent = "tom bolger" | sql_create_context |
CREATE TABLE table_41323 (
"Draw" real,
"Song" text,
"Performer" text,
"Points" real,
"Rank" text
) | Which Points have a Performer of se n monaghan and a Draw smaller than 7? | SELECT MIN("Points") FROM table_41323 WHERE "Performer" = 'seán monaghan' AND "Draw" < '7' | wikisql |
CREATE TABLE customers (
customer_name VARCHAR,
customer_phone VARCHAR,
payment_method_code VARCHAR,
customer_number VARCHAR
) | Show the name, phone, and payment method code for all customers in descending order of customer number. | SELECT customer_name, customer_phone, payment_method_code FROM customers ORDER BY customer_number DESC | sql_create_context |
CREATE TABLE table_204_113 (
id number,
"rank" number,
"area" text,
"state/\nprovince" text,
"csa/cma\n2009 population" number,
"projected\n2025 population" number,
"projected increase\n2009-2025" number
) | what population center has the larger projected increase : detroit or cleveland ? | SELECT "area" FROM table_204_113 WHERE "area" IN ('detroit', 'cleveland') ORDER BY "projected increase\n2009-2025" DESC LIMIT 1 | squall |
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, draw a bar chart about the distribution of name and revenue , and group by attribute name, and display x axis in descending order. | SELECT T1.Name, T2.Revenue FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name, T1.Name ORDER BY T1.Name DESC | nvbench |
CREATE TABLE class_of_service (
booking_class varchar,
rank int,
class_description text
)
CREATE TABLE flight_leg (
flight_id int,
leg_number int,
leg_flight int
)
CREATE TABLE month (
month_number int,
month_name text
)
CREATE TABLE ground_service (
city_code text,
airport_co... | i'd like to see all flights from BALTIMORE to PHILADELPHIA | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'BALTIMORE' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'PHIL... | atis |
CREATE TABLE table_name_16 (
rank VARCHAR,
date VARCHAR
) | Which Rank that is on september 9, 2004? | SELECT rank FROM table_name_16 WHERE date = "september 9, 2004" | sql_create_context |
CREATE TABLE table_name_87 (
nationality VARCHAR,
name VARCHAR
) | Roslinda Samsu has what nationality? | SELECT nationality FROM table_name_87 WHERE name = "roslinda samsu" | sql_create_context |
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate time,
drug text,
dose... | what are the four most frequent drugs prescribed during the same hospital visit to the male patients of age 20s after having been diagnosed with long-term use anticoagul since 3 years ago? | SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime, admissions.hadm_id 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_... | mimic_iii |
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 days of hospital stay is greater than 43 and item id is 51276? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.days_stay > "43" AND lab.itemid = "51276" | mimicsql_data |
CREATE TABLE table_name_90 (
other VARCHAR,
control VARCHAR,
labour VARCHAR,
green VARCHAR,
independent VARCHAR
) | Which Other has a Green of 0, and an Independent of 1, and a Labour smaller than 45, and a Control of labour lose to no overall control? | SELECT other FROM table_name_90 WHERE green = 0 AND independent = 1 AND labour < 45 AND control = "labour lose to no overall control" | sql_create_context |
CREATE TABLE table_name_31 (
home_team VARCHAR
) | What was the score for the Essendon home team? | SELECT home_team AS score FROM table_name_31 WHERE home_team = "essendon" | sql_create_context |
CREATE TABLE table_name_34 (
tournament VARCHAR,
winning_score VARCHAR
) | What was the tournament that resulted in a winning score of 4 (71-72-72-69=284)? | SELECT tournament FROM table_name_34 WHERE winning_score = –4(71 - 72 - 72 - 69 = 284) | sql_create_context |
CREATE TABLE t_kc24 (
ACCOUNT_DASH_DATE time,
ACCOUNT_DASH_FLG number,
CASH_PAY number,
CIVIL_SUBSIDY number,
CKC102 number,
CLINIC_ID text,
CLINIC_SLT_DATE time,
COMP_ID text,
COM_ACC_PAY number,
COM_PAY number,
DATA_ID text,
ENT_ACC_PAY number,
ENT_PAY number,
F... | 二零一五年十月二十六日到二零一八年七月九日,9987120医院的科室小儿胃肠外科涉及到多少医疗费用 | SELECT SUM(t_kc24.MED_AMOUT) FROM t_kc24 WHERE t_kc21_t_kc24.MED_CLINIC_ID IN (SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '9987120' AND t_kc21.MED_ORG_DEPT_NM = '小儿胃肠外科') AND t_kc24.CLINIC_SLT_DATE BETWEEN '2015-10-26' AND '2018-07-09' | css |
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
... | what is patient 15754's yearly minimum level of total protein, urine? | SELECT MIN(labevents.valuenum) FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 15754) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'total protein, urine') GROUP BY STRFTIME('%y', labevents.charttime) | mimic_iii |
CREATE TABLE table_65622 (
"Circuit" text,
"Date" text,
"Pole Position" text,
"Fastest Lap" text,
"Winning driver" text,
"Winning team" text
) | Who had the fastest lap when adam christodoulou was the winning driver and had the pole position? | SELECT "Fastest Lap" FROM table_65622 WHERE "Winning driver" = 'adam christodoulou' AND "Pole Position" = 'adam christodoulou' | wikisql |
CREATE TABLE person_info (
RYBH text,
XBDM number,
XBMC text,
XM text,
CSRQ time,
CSD text,
MZDM text,
MZMC text,
GJDM text,
GJMC text,
JGDM text,
JGMC text,
XLDM text,
XLMC text,
ZYLBDM text,
ZYMC text
)
CREATE TABLE jybgb (
YLJGDM text,
YLJGDM_M... | 从2011年6月6到2021年10月25日,7702859这个医疗机构的新生儿门诊的就诊记录有多少 | SELECT COUNT(*) FROM mzjzjlb WHERE YLJGDM = '7702859' AND JZKSRQ BETWEEN '2011-06-06' AND '2021-10-25' AND ZSEBZ > 0 | css |
CREATE TABLE customers (
customer_id number,
customer_name text,
customer_details text
)
CREATE TABLE shipment_items (
shipment_id number,
order_item_id number
)
CREATE TABLE shipments (
shipment_id number,
order_id number,
invoice_number number,
shipment_tracking_number text,
... | Which customer made the most orders? Find the customer name. | SELECT T1.customer_name FROM customers AS T1 JOIN orders AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id ORDER BY COUNT(*) DESC LIMIT 1 | spider |
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... | Count the number of patients less than 59 years who had a sodium whole blood lab test. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.age < "59" AND lab.label = "Sodium, Whole Blood" | mimicsql_data |
CREATE TABLE table_15234 (
"Name" text,
"Years" text,
"A-League" text,
"Finals" text,
"Total" text
) | Which player has an A-League of 150 (4)? | SELECT "Name" FROM table_15234 WHERE "A-League" = '150 (4)' | 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
)
... | count the number of patients whose admission type is urgent and diagnoses long title is other chronic pain? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admission_type = "URGENT" AND diagnoses.long_title = "Other chronic pain" | mimicsql_data |
CREATE TABLE table_name_42 (
year VARCHAR,
points VARCHAR,
wins VARCHAR,
team VARCHAR
) | What is the year that there were 0 wins, team AJS, and under 12 points? | SELECT COUNT(year) FROM table_name_42 WHERE wins = 0 AND team = "ajs" AND points < 12 | sql_create_context |
CREATE TABLE table_name_4 (
crowd VARCHAR,
home_team VARCHAR
) | How many games is collingwood the home side? | SELECT COUNT(crowd) FROM table_name_4 WHERE home_team = "collingwood" | sql_create_context |
CREATE TABLE CLASS (
class_code VARCHAR,
crs_code VARCHAR
)
CREATE TABLE student (
stu_gpa INTEGER,
stu_num VARCHAR
)
CREATE TABLE enroll (
stu_num VARCHAR,
class_code VARCHAR
) | What is the average gpa of the students enrolled in the course with code ACCT-211? | SELECT AVG(T2.stu_gpa) FROM enroll AS T1 JOIN student AS T2 ON T1.stu_num = T2.stu_num JOIN CLASS AS T3 ON T1.class_code = T3.class_code WHERE T3.crs_code = 'ACCT-211' | sql_create_context |
CREATE TABLE table_40455 (
"Election" real,
"First member" text,
"First party" text,
"Second member" text,
"Second party" text,
"Third member" text,
"Third party" text
) | Who is the second member for the Second Party Liberal, and the Third Party Conservative, after the 1841 election? | SELECT "Second member" FROM table_40455 WHERE "Second party" = 'liberal' AND "Third party" = 'conservative' AND "Election" > '1841' | wikisql |
CREATE TABLE grants (
grant_id number,
organisation_id number,
grant_amount number,
grant_start_date time,
grant_end_date time,
other_details text
)
CREATE TABLE staff_roles (
role_code text,
role_description text
)
CREATE TABLE document_types (
document_type_code text,
documen... | What is the description for the results whose project detail is 'sint'? | SELECT T1.outcome_description FROM research_outcomes AS T1 JOIN project_outcomes AS T2 ON T1.outcome_code = T2.outcome_code JOIN projects AS T3 ON T2.project_id = T3.project_id WHERE T3.project_details = 'sint' | spider |
CREATE TABLE table_14391 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Record" text
) | What is the record of the game where the visitor team is the Edmonton Oilers? | SELECT "Record" FROM table_14391 WHERE "Visitor" = 'edmonton oilers' | wikisql |
CREATE TABLE table_name_11 (
game INTEGER,
january VARCHAR,
record VARCHAR
) | What is the sum of the games before January 19 with a 27-6-6 record? | SELECT SUM(game) FROM table_name_11 WHERE january < 19 AND record = "27-6-6" | sql_create_context |
CREATE TABLE table_9862 (
"Date" text,
"Name" text,
"Nationality" text,
"Tonnage (GRT)" real,
"Fate" text
) | Which Tonnage (GRT) has a Nationality of united kingdom, and a Name of king gruffydd? | SELECT MIN("Tonnage (GRT)") FROM table_9862 WHERE "Nationality" = 'united kingdom' AND "Name" = 'king gruffydd' | wikisql |
CREATE TABLE table_21269143_1 (
result VARCHAR,
round VARCHAR
) | Name the result for round 13 | SELECT result FROM table_21269143_1 WHERE round = "13" | sql_create_context |
CREATE TABLE table_38953 (
"Position" real,
"Team" text,
"Points" real,
"Played" real,
"Drawn" real,
"Lost" real,
"Against" real,
"Difference" text
) | Which average Points have a Position of 7, and a Lost smaller than 4? | SELECT AVG("Points") FROM table_38953 WHERE "Position" = '7' AND "Lost" < '4' | wikisql |
CREATE TABLE table_12561 (
"Player" text,
"Pos." text,
"Nationality" text,
"Previous team" text,
"Years of NBA experience [a ]" text
) | What Player has 10 Years of NBA experience? | SELECT "Player" FROM table_12561 WHERE "Years of NBA experience [a ]" = '10' | wikisql |
CREATE TABLE table_name_6 (
opponent VARCHAR,
result VARCHAR
) | What is the name of the Opponent when the Result was w48-0? | SELECT opponent FROM table_name_6 WHERE result = "w48-0" | sql_create_context |
CREATE TABLE table_32208 (
"Player" text,
"Nationality" text,
"Position" text,
"From" text,
"School/Country" text
) | Which player is from 2012 and North Carolina? | SELECT "Player" FROM table_32208 WHERE "From" = '2012' AND "School/Country" = 'north carolina' | wikisql |
CREATE TABLE table_3237 (
"Character" text,
"English version" text,
"Cinderella" text,
"Cinderella II: Dreams Come True" text,
"Cinderella III: A Twist in Time" text
) | Who also voiced Cinderella in Cinderella III: A Twist in Time besides Nobuko Terashima? | SELECT "Cinderella III: A Twist in Time" FROM table_3237 WHERE "Cinderella" = 'Nobuko Terashima' | wikisql |
CREATE TABLE table_75832 (
"Episode #" real,
"Title" text,
"Air Date" text,
"Rating" real,
"Share" real,
"18\u201349" real,
"Viewers" real,
"Rank" text
) | What is the average Episode # with a share of 9, and #35 is rank and less than 8.21 viewers? | SELECT AVG("Episode #") FROM table_75832 WHERE "Share" = '9' AND "Rank" = '#35' AND "Viewers" < '8.21' | wikisql |
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... | Number of users by number of digits of reputation. | SELECT CONCAT(POWER(10, rep_digits - 1) + 1, '-', POWER(10, rep_digits)) AS rep_bracket, count, CAST((count * 100.0) / (SELECT COUNT(*) FROM Users) AS FLOAT(4, 2)) AS percentage FROM (SELECT CEIL(LOG10(Reputation)) AS rep_digits, COUNT(*) AS count FROM Users GROUP BY CEIL(LOG10(Reputation))) AS x ORDER BY rep_digits | sede |
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 ... | what is the name of procedure patient 3267 has been given two or more times since 177 months ago? | SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT t1.icd9_code FROM (SELECT procedures_icd.icd9_code, COUNT(procedures_icd.charttime) AS c1 FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 326... | mimic_iii |
CREATE TABLE table_35124 (
"Rank" real,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) | What is the total number of bronze medals the U.S. Virgin Islands, which has less than 0 golds, has? | SELECT COUNT("Bronze") FROM table_35124 WHERE "Nation" = 'u.s. virgin islands' AND "Gold" < '0' | wikisql |
CREATE TABLE table_31950 (
"Year" real,
"Director" text,
"Project" text,
"Category" text,
"Result" text
) | What year was Bulworth nominated? | SELECT "Year" FROM table_31950 WHERE "Project" = 'bulworth' | wikisql |
CREATE TABLE table_name_6 (
fa_cup_goals INTEGER,
total_goals VARCHAR,
name VARCHAR
) | What is the lowest FA cup goals that have total goals less than 4, with Terry poole as the name? | SELECT MIN(fa_cup_goals) FROM table_name_6 WHERE total_goals < 4 AND name = "terry poole" | sql_create_context |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.