context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
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
)
CREATE TABLE gas_station (
Station_ID int,
Open_Year int,
Location text,
Manager_N... | What is the market value of every comapny in the banking industry? Return a pie chart. | SELECT Company, Market_Value FROM company WHERE Main_Industry = 'Banking' | nvbench |
CREATE TABLE airports (
apid integer,
name text,
city text,
country text,
x real,
y real,
elevation bigint,
iata character varchar(3),
icao character varchar(4)
)
CREATE TABLE airlines (
alid integer,
name text,
iata varchar(2),
icao varchar(3),
callsign text,
... | What is the altitude (or elevation) of the airports in the city of New York? Show me a bar chart, order in ascending by the elevation. | SELECT name, elevation FROM airports WHERE city = 'New York' ORDER BY elevation | nvbench |
CREATE TABLE table_42282 (
"Tournament" text,
"1998" text,
"1999" text,
"2000" text,
"2001" text,
"2002" text,
"2003" text,
"2004" text,
"2005" text,
"2006" text,
"2007" text,
"2008" text,
"2009" text,
"2010" text,
"2011" text,
"2012" text
) | What was 2002, when 2008 was, 'career statistics'? | SELECT "2002" FROM table_42282 WHERE "2008" = 'career statistics' | wikisql |
CREATE TABLE field (
fieldid int
)
CREATE TABLE paper (
paperid int,
title varchar,
venueid int,
year int,
numciting int,
numcitedby int,
journalid int
)
CREATE TABLE dataset (
datasetid int,
datasetname varchar
)
CREATE TABLE keyphrase (
keyphraseid int,
keyphrasename... | papers with more than 5 citations | SELECT DISTINCT cite.citingpaperid FROM cite, paper WHERE paper.paperid = cite.citedpaperid GROUP BY cite.citingpaperid HAVING COUNT(DISTINCT cite.citedpaperid) > 5 | scholar |
CREATE TABLE table_206217_2 (
epoch__utc_ VARCHAR,
periselene__km_ VARCHAR
) | What is every entry for epoch if periselene is 5,454.925? | SELECT epoch__utc_ FROM table_206217_2 WHERE periselene__km_ = "5,454.925" | sql_create_context |
CREATE TABLE table_10727 (
"Player" text,
"Position" text,
"School" text,
"Hometown" text,
"College" text
) | What's the hometown of thomas tyner? | SELECT "Hometown" FROM table_10727 WHERE "Player" = 'thomas tyner' | wikisql |
CREATE TABLE ref_service_types (
service_type_code text,
parent_service_type_code text,
service_type_description text
)
CREATE TABLE invoices (
invoice_id number,
order_id number,
payment_method_code text,
product_id number,
order_quantity text,
other_item_details text,
order_it... | Find the product names whose average product price is below 1000000. | SELECT product_name FROM products GROUP BY product_name HAVING AVG(product_price) < 1000000 | spider |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob te... | how many patients whose age is less than 27 and drug name is meropenem? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.age < "27" AND prescriptions.drug = "Meropenem" | mimicsql_data |
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
CREATE TABLE zyjzjlb (
CYBQDM text,
CYBQMC text,
CYCWH text,
CYKSDM text,
CYKSMC text,
CYSJ time,
CYZTDM number,
HZXM text,
JZKSDM text,
JZKSMC text,
JZLSH text,
KH text,
KLX number,... | 报一下身高和体重,患者18593737的 | SELECT mzjzjlb.SG, mzjzjlb.TZ FROM hz_info JOIN mzjzjlb JOIN hz_info_mzjzjlb ON hz_info.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND hz_info_mzjzjlb.JZLSH = mzjzjlb.JZLSH AND hz_info_mzjzjlb.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info_mzjzjlb.JZLSH = mzjzjlb.JZLSH AND hz... | css |
CREATE TABLE table_13817 (
"School" text,
"Mascot" text,
"School Corp." text,
"Size" real,
"IHSAA Class (Football)" text,
"Year Joined" text,
"Other Conferences" text
) | What IHSAA football class do the Generals play in? | SELECT "IHSAA Class (Football)" FROM table_13817 WHERE "Mascot" = 'generals' | wikisql |
CREATE TABLE table_22931 (
"Currency Bracket:" text,
"Dollars Taxed in Bracket:" text,
"Rate:" text,
"Taxes From Bracket:" text,
"After Tax Income:" text,
"Percentage of Income Kept:" text
) | Name the taxes from brqacket for percentage of income kept being 73% | SELECT "Taxes From Bracket:" FROM table_22931 WHERE "Percentage of Income Kept:" = '73%' | wikisql |
CREATE TABLE table_60137 (
"Club" text,
"Nickname" text,
"Location" text,
"GFL Premierships" text,
"Years in GFL" text
) | Which club is located in Thomson, Victoria? | SELECT "Club" FROM table_60137 WHERE "Location" = 'thomson, victoria' | 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, find name and the sum of price , and group by attribute name, and visualize them by a bar chart, I want to order by the total number of price in descending. | SELECT T2.Name, T1.Price FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name ORDER BY T1.Price DESC | nvbench |
CREATE TABLE table_22435 (
"Rank" real,
"Title" text,
"Release Date" text,
"Franchise" text,
"Developer(s)" text,
"Platform" text,
"Units sold (in Millions)" text
) | How many titles were released on 21 October 1992? | SELECT COUNT("Rank") FROM table_22435 WHERE "Release Date" = '21 October 1992' | wikisql |
CREATE TABLE student (
ID varchar(5),
name varchar(20),
dept_name varchar(20),
tot_cred numeric(3,0)
)
CREATE TABLE advisor (
s_ID varchar(5),
i_ID varchar(5)
)
CREATE TABLE classroom (
building varchar(15),
room_number varchar(7),
capacity numeric(4,0)
)
CREATE TABLE section (
... | How many departments whose budget is more than the average budget in each building? Show me a bar chart, and display y axis from high to low order. | SELECT building, COUNT(building) FROM department WHERE budget > (SELECT AVG(budget) FROM department) GROUP BY building ORDER BY COUNT(building) DESC | nvbench |
CREATE TABLE table_name_30 (
yards INTEGER,
avg VARCHAR,
long VARCHAR
) | what is the least yards when the average is 7 and the long is less than 7? | SELECT MIN(yards) FROM table_name_30 WHERE avg = 7 AND long < 7 | sql_create_context |
CREATE TABLE table_49440 (
"Date" text,
"Round" text,
"Opponent" text,
"Venue" text,
"Result" text,
"Attendance" real,
"Scorers" text
) | What is the result the R3 round? | SELECT "Result" FROM table_49440 WHERE "Round" = 'r3' | wikisql |
CREATE TABLE procedures (
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,
... | how many female patients are admitted before the year 2105? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.gender = "F" AND demographic.admityear < "2105" | mimicsql_data |
CREATE TABLE table_name_79 (
finish VARCHAR,
win__percentage VARCHAR
) | What was the final rank of the Brewers when they achieved a win percentage of .585? | SELECT finish FROM table_name_79 WHERE win__percentage = ".585" | sql_create_context |
CREATE TABLE table_44367 (
"Class" text,
"Part 1" text,
"Part 2" text,
"Part 3" text,
"Part 4" text,
"Verb meaning" text
) | what is the verb meaning when the part 1 is lopen? | SELECT "Verb meaning" FROM table_44367 WHERE "Part 1" = 'lopen' | wikisql |
CREATE TABLE table_24138 (
"Rank" real,
"Commodity" text,
"Value (Int $1000)" real,
"Production (MT)" real,
"Quantity world rank" text,
"Value world rank" text
) | When the value world rank is 7, what is the rank? | SELECT "Rank" FROM table_24138 WHERE "Value world rank" = '7' | wikisql |
CREATE TABLE people (
People_ID int,
Name text,
Height real,
Weight real,
Birth_Date text,
Birth_Place text
)
CREATE TABLE body_builder (
Body_Builder_ID int,
People_ID int,
Snatch real,
Clean_Jerk real,
Total real
) | Show me about the correlation between Snatch and Total in a scatter chart. | SELECT Snatch, Total FROM body_builder | nvbench |
CREATE TABLE table_name_97 (
goals_against VARCHAR,
played INTEGER
) | How many Goals against have Played more than 34? | SELECT COUNT(goals_against) FROM table_name_97 WHERE played > 34 | sql_create_context |
CREATE TABLE table_44389 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Ground" text,
"Crowd" real,
"Date" text,
"Time" text
) | Who was the home team at 8:00 pm when the score was 11.18 (84)? | SELECT "Home team" FROM table_44389 WHERE "Time" = '8:00 pm' AND "Home team score" = '11.18 (84)' | wikisql |
CREATE TABLE table_name_62 (
date VARCHAR,
opponent_in_the_final VARCHAR
) | On what date was the opponent in the final Gwinyai Tongoona? | SELECT date FROM table_name_62 WHERE opponent_in_the_final = "gwinyai tongoona" | sql_create_context |
CREATE TABLE table_24988 (
"Year" real,
"Date" text,
"Driver" text,
"Team" text,
"Manufacturer" text,
"Laps" text,
"Miles (km)" text,
"Race Time" text,
"Average Speed (mph)" text,
"Report" text
) | In how many different years did the race happen on February 27? | SELECT COUNT("Year") FROM table_24988 WHERE "Date" = 'February 27' | wikisql |
CREATE TABLE table_name_9 (
name VARCHAR,
moving_from VARCHAR
) | Name the name that has moving of 1. fc n rnberg. | SELECT name FROM table_name_9 WHERE moving_from = "1. fc nürnberg" | sql_create_context |
CREATE TABLE table_25800134_12 (
series__number VARCHAR,
airdate VARCHAR
) | What episode number of the series aired on February 26, 1968? | SELECT series__number FROM table_25800134_12 WHERE airdate = "February 26, 1968" | sql_create_context |
CREATE TABLE table_61953 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To Par" text,
"Money ( $ )" real
) | Which Player has a Money ($) of 137, and a Score of 73-70-73-74=290? | SELECT "Player" FROM table_61953 WHERE "Money ( $ )" = '137' AND "Score" = '73-70-73-74=290' | wikisql |
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
systemicsystolic number,
systemicdiastolic number,
systemicmean number,
observationtime time
)
CREATE TABLE diagnosis (
diagn... | what are the three most common diagnoses since 2102 in which patients are diagnosed in the same month after being diagnosed with headache? | SELECT t3.diagnosisname FROM (SELECT t2.diagnosisname, 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 = 'headache' AND STRFTIME('%y', diagnosis.d... | eicu |
CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId number
)
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostsWithDeleted (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,... | Average Reputation Of SO Users where reputation > 15. | SELECT AVG(Reputation) AS AVG_REP, COUNT(Id) AS "total_users" FROM Users WHERE LOWER(Location) LIKE '%manchester, united kingdom' AND Reputation > 15 | sede |
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE icustays (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
first_careunit text,
last_careunit text,
first_wardid number,
... | what was the top five most commonly prescribed medication that patients were prescribed during the same hospital encounter after having received a int insert dual-cham dev procedure? | SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, procedures_icd.charttime, admissions.hadm_id FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FR... | mimic_iii |
CREATE TABLE table_11602313_4 (
frequency VARCHAR,
part_number_s_ VARCHAR
) | What is the frequency of the model with part number lf80537gf0411m? | SELECT frequency FROM table_11602313_4 WHERE part_number_s_ = "LF80537GF0411M" | sql_create_context |
CREATE TABLE table_2686 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
) | Name the high rebounds for new york | SELECT "High rebounds" FROM table_2686 WHERE "Team" = 'New York' | wikisql |
CREATE TABLE table_29221 (
"Pick #" real,
"CFL Team" text,
"Player" text,
"Position" text,
"College" text
) | where cfl team is edmonton (2) what are all the position | SELECT "Position" FROM table_29221 WHERE "CFL Team" = 'Edmonton (2)' | wikisql |
CREATE TABLE flight (
aircraft_code_sequence text,
airline_code varchar,
airline_flight text,
arrival_time int,
connections int,
departure_time int,
dual_carrier text,
flight_days text,
flight_id int,
flight_number int,
from_airport varchar,
meal_code text,
stops int,... | show me the last flight available in the evening from BOSTON to WASHINGTON on 7 21 | 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 (((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'WASHINGTON' AND date_day.day_number = 21 AND date_day.month_number = 7 ... | atis |
CREATE TABLE airline (
airline_code varchar,
airline_name text,
note text
)
CREATE TABLE flight (
aircraft_code_sequence text,
airline_code varchar,
airline_flight text,
arrival_time int,
connections int,
departure_time int,
dual_carrier text,
flight_days text,
flight_id... | are there any flights from DENVER to ATLANTA to PITTSBURGH | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, airport_service AS AIRPORT_SERVICE_2, city AS CITY_0, city AS CITY_1, city AS CITY_2, flight, flight_stop WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'PITTSBURGH' AND CITY_2... | atis |
CREATE TABLE VoteTypes (
Id number,
Name text
)
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE TagSynonyms (
Id number,
SourceTagName text,
TargetTagName text,
CreationDate time,
OwnerUserId number,
AutoRenameCount number,
LastAutoRename time,
Score number... | Getting number of upvotes and downvotes for each tag for a user, along with ratio. number of upvotes and downvotes i have for each tag, questions and answers combined | SELECT a.TagName AS "Tagname", a.upvotes AS "Upvotes", b.downvotes AS "Downvotes" FROM (SELECT TagName, COUNT(*) AS upvotes FROM Tags JOIN PostTags ON PostTags.TagId = Tags.Id JOIN Posts ON Posts.ParentId = PostTags.PostId OR Posts.Id = PostTags.PostId JOIN Votes ON Votes.PostId = Posts.Id AND Votes.VoteTypeId = 2 WHER... | sede |
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE prescriptions (
... | how many patients in this year have undergone aortocor bypas-2 cor art within 2 months following the first hypothermia? | SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, procedures_icd.charttime FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'hypothermia... | mimic_iii |
CREATE TABLE table_66859 (
"Year" real,
"Date" text,
"Title" text,
"Format(s)" text,
"Award description(s)" text,
"Result(s)" text
) | What are the results of Format single on March 21? | SELECT "Result(s)" FROM table_66859 WHERE "Format(s)" = 'single' AND "Date" = 'march 21' | wikisql |
CREATE TABLE mzjzjlb (
HXPLC number,
HZXM text,
JLSJ time,
JZJSSJ time,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
JZLSH text,
JZZDBM text,
JZZDSM text,
JZZTDM number,
JZZTMC text,
KH text,
KLX number,
MJZH text,
ML number,
MZZYZDZZBM text,
MZZYZDZZMC ... | 查一下患者郑和平72353954303医疗就诊的检验报告单 | SELECT * FROM jybgb WHERE jybgb.JZLSH = '72353954303' | css |
CREATE TABLE table_21638 (
"Position" real,
"Team" text,
"Played" real,
"Won" real,
"Drawn" real,
"Lost" real,
"Goals For" real,
"Goals Against" real,
"Goal Average 1" text,
"Points 2" real
) | How many teams finished with a 2nd points total of 31? | SELECT COUNT("Position") FROM table_21638 WHERE "Points 2" = '31' | wikisql |
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
... | how many of the current patients are 50s? | SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE patient.hospitaldischargetime IS NULL AND patient.age BETWEEN 50 AND 59 | eicu |
CREATE TABLE table_25029 (
"Date" text,
"Builder" text,
"Type" text,
"Operator" text,
"Number" text,
"Withdrawn" text,
"Status" text
) | List the number of builders where the withdrawn is 1951 and number is 42. | SELECT COUNT("Builder") FROM table_25029 WHERE "Withdrawn" = '1951' AND "Number" = '42' | wikisql |
CREATE TABLE table_204_806 (
id number,
"name" text,
"date" text,
"condition" text,
"ownership\n/ access" text,
"notes" text
) | what is the only chateau built in 1455 ? | SELECT "name" FROM table_204_806 WHERE "date" = 1455 | squall |
CREATE TABLE table_9546 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Attendance" text
) | What week was the bye week? | SELECT AVG("Week") FROM table_9546 WHERE "Opponent" = 'bye' | wikisql |
CREATE TABLE t_kc22 (
AMOUNT number,
CHA_ITEM_LEV number,
DATA_ID text,
DIRE_TYPE number,
DOSE_FORM text,
DOSE_UNIT text,
EACH_DOSAGE text,
EXP_OCC_DATE time,
FLX_MED_ORG_ID text,
FXBZ number,
HOSP_DOC_CD text,
HOSP_DOC_NM text,
MED_DIRE_CD text,
MED_DIRE_NM text,... | 从二零零八年五月六日到二零一五年十二月二十八日这段时间参保人蒋岚翠在门诊的西药费用了多少钱? | SELECT SUM(t_kc22.AMOUNT) FROM t_kc21 JOIN t_kc22 JOIN t_kc21_t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc21_t_kc22.MED_CLINIC_ID AND t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID WHERE t_kc21.PERSON_NM = '蒋岚翠' AND t_kc21.CLINIC_TYPE = '门诊' AND t_kc22.STA_DATE BETWEEN '2008-05-06' AND '2015-12-28' AND t_kc22.MED_INV_IT... | css |
CREATE TABLE table_name_67 (
rider VARCHAR,
time VARCHAR,
manufacturer VARCHAR,
grid VARCHAR,
laps VARCHAR
) | What is Rider, when Grid is less than 16, when Laps is 21, when Manufacturer is Honda, and when Time is +10.583? | SELECT rider FROM table_name_67 WHERE grid < 16 AND laps = 21 AND manufacturer = "honda" AND time = "+10.583" | sql_create_context |
CREATE TABLE table_name_25 (
away_team VARCHAR,
venue VARCHAR
) | Who was the away team at mcg? | SELECT away_team FROM table_name_25 WHERE venue = "mcg" | sql_create_context |
CREATE TABLE table_203_507 (
id number,
"#" text,
"player" text,
"\u03c3 points" number,
"qual." number,
"final" number
) | the most points were scored by which player ? | SELECT "player" FROM table_203_507 ORDER BY "\u03c3 points" DESC LIMIT 1 | squall |
CREATE TABLE table_66680 (
"Date(s) Released" text,
"Polling institute" text,
"Nationalist" text,
"Labour" text,
"Democratic Alternative" text,
"Undecided/ No answer" text,
"Lead" text
) | What is the value of the Democratic Alternative for the poll released by Malta Today? | SELECT "Democratic Alternative" FROM table_66680 WHERE "Polling institute" = 'malta today' | wikisql |
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 diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
C... | tell me the type and time of admission for patient ida cook. | SELECT demographic.admission_type, demographic.admittime FROM demographic WHERE demographic.name = "Ida Cook" | mimicsql_data |
CREATE TABLE table_38531 (
"Game" text,
"Date" text,
"Referee" text,
"Umpire" text,
"Head Linesman" text,
"Line Judge" text,
"Field Judge" text,
"Back Judge" text
) | Who is the head linesman of the game on 1 February 2009? | SELECT "Head Linesman" FROM table_38531 WHERE "Date" = '1 february 2009' | wikisql |
CREATE TABLE table_77279 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Ground" text,
"Crowd" real,
"Date" text,
"Local Time" text,
"AEDT Time" text
) | Name the Away team which has a Ground of waverley park, and a Home team of hawthorn? | SELECT "Away team" FROM table_77279 WHERE "Ground" = 'waverley park' AND "Home team" = 'hawthorn' | wikisql |
CREATE TABLE procedures (
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 year of death is less than or equal to 2174 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.dod_year <= "2174.0" AND lab.fluid = "Other Body Fluid" | mimicsql_data |
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_DIRE_CD text,
MED_DIRE_NM text,... | 整理出患者年龄在3岁以下的医疗记录的平均医疗费总额 | SELECT AVG(t_kc24.MED_AMOUT) FROM t_kc24 WHERE t_kc24.MED_CLINIC_ID IN (SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_AGE <= 3) | css |
CREATE TABLE table_name_73 (
status VARCHAR,
notes VARCHAR
) | What is the Status of the dinosaur, whose notes are, 'n coelurosauria'? | SELECT status FROM table_name_73 WHERE notes = "n coelurosauria" | sql_create_context |
CREATE TABLE table_23224961_1 (
schwaben VARCHAR,
oberbayern_a VARCHAR
) | When wacker burghausen is the oberbayern a what is the schwaben? | SELECT schwaben FROM table_23224961_1 WHERE oberbayern_a = "Wacker Burghausen" | sql_create_context |
CREATE TABLE table_35273 (
"7:00" text,
"7:30" text,
"8:00" text,
"8:30" text,
"9:00" text,
"9:30" text,
"10:00" text,
"10:30" text
) | What is the 9:30 program airing on the station that airs The Red Green Show at 8:30? | SELECT "9:30" FROM table_35273 WHERE "8:30" = 'the red green show' | wikisql |
CREATE TABLE table_68997 (
"Pos." text,
"Player" text,
"Team" text,
"Height" text,
"Weight" real
) | What does DeShawn Stevenson weigh? | SELECT SUM("Weight") FROM table_68997 WHERE "Player" = 'deshawn stevenson' | wikisql |
CREATE TABLE Bookings (
Booking_ID INTEGER,
Customer_ID INTEGER,
Workshop_Group_ID VARCHAR(100),
Status_Code CHAR(15),
Store_ID INTEGER,
Order_Date DATETIME,
Planned_Delivery_Date DATETIME,
Actual_Delivery_Date DATETIME,
Other_Order_Details VARCHAR(255)
)
CREATE TABLE Ref_Service_Ty... | What are the descriptions of the service types with product price above 100, and count them by a bar chart, and I want to order in desc by the names. | SELECT Service_Type_Description, COUNT(Service_Type_Description) FROM Ref_Service_Types AS T1 JOIN Services AS T2 ON T1.Service_Type_Code = T2.Service_Type_Code WHERE T2.Product_Price > 100 GROUP BY Service_Type_Description ORDER BY Service_Type_Description DESC | nvbench |
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... | 以前患者34588710是去哪里看病的 | SELECT mzjzjlb.YLJGDM 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.RYBH = '34588710' UNION SELECT wdmzjzjlb.YLJGDM FROM hz_info JOIN wdmzjzjlb ON hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmz... | css |
CREATE TABLE table_42933 (
"Position" real,
"Team" text,
"Points" real,
"Played" real,
"Drawn" real,
"Lost" real,
"Against" real,
"Difference" text
) | What lost has a position greater than 2, a drawn greater than 0, with an against greater than 15? | SELECT "Lost" FROM table_42933 WHERE "Position" > '2' AND "Drawn" > '0' AND "Against" > '15' | wikisql |
CREATE TABLE table_name_43 (
weight VARCHAR,
name VARCHAR
) | What is Tatyana Gubina's Weight? | SELECT weight FROM table_name_43 WHERE name = "tatyana gubina" | 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 admission type is elective and diagnoses long title is personal history of surgery to other organs? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admission_type = "ELECTIVE" AND diagnoses.long_title = "Personal history of surgery to other organs" | mimicsql_data |
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugst... | for patients who received physical restraints in this year, what are the top three most frequent diagnoses that followed afterwards within 2 months? | SELECT t3.diagnosisname FROM (SELECT t2.diagnosisname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, treatment.treatmenttime FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'physical restraints' AND DATETIME(treatm... | eicu |
CREATE TABLE climber (
climber_id number,
name text,
country text,
time text,
points number,
mountain_id number
)
CREATE TABLE mountain (
mountain_id number,
name text,
height number,
prominence number,
range text,
country text
) | Show the range that has the most number of mountains. | SELECT range FROM mountain GROUP BY range ORDER BY COUNT(*) DESC LIMIT 1 | spider |
CREATE TABLE table_name_27 (
ties VARCHAR,
name VARCHAR,
lost VARCHAR
) | Tell me the total number of ties for name of totals and lost more than 30 | SELECT COUNT(ties) FROM table_name_27 WHERE name = "totals" AND lost > 30 | sql_create_context |
CREATE TABLE table_24000 (
"Game" real,
"Date" text,
"Opponent" text,
"Result" text,
"Cardinals points" real,
"Opponents" real,
"Record" text
) | Name the number opponent for loss result | SELECT COUNT("Opponent") FROM table_24000 WHERE "Result" = 'Loss' | wikisql |
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE d_items (
... | count the number of patients who had been given a rigid proctosigmoidoscpy procedure this year. | SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT procedures_icd.hadm_id FROM procedures_icd WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'rigid proctosigmoidoscpy') AND DATETIME(procedures_i... | mimic_iii |
CREATE TABLE table_37199 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Record" text
) | What was the Score on March 1? | SELECT "Score" FROM table_37199 WHERE "Date" = 'march 1' | wikisql |
CREATE TABLE table_name_51 (
time_retired VARCHAR,
laps VARCHAR,
grid VARCHAR
) | What's the Time/Retired of 80 laps with a Grid larger than 2? | SELECT time_retired FROM table_name_51 WHERE laps = 80 AND grid > 2 | sql_create_context |
CREATE TABLE table_53753 (
"Total fat" text,
"Saturated fat" text,
"Monounsaturated fat" text,
"Polyunsaturated fat" text,
"Smoke point" text
) | Name the total fat which has a polyunsaturated fat of 11g and monounsaturated fat of 45g | SELECT "Total fat" FROM table_53753 WHERE "Polyunsaturated fat" = '11g' AND "Monounsaturated fat" = '45g' | wikisql |
CREATE TABLE table_23308178_8 (
opponent VARCHAR,
date VARCHAR
) | How many games did they play on february 5? | SELECT opponent FROM table_23308178_8 WHERE date = "February 5" | 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... | Among patients diagnosed with rheumatic heart failure, calculate the total number of those born before the year 2168. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.dob_year < "2168" AND diagnoses.short_title = "Rheumatic heart failure" | mimicsql_data |
CREATE TABLE table_12581 (
"Version" text,
"Fairing" text,
"CCBs" real,
"SRBs" text,
"Upper stage" text,
"Payload to LEO" text,
"Payload to GTO" text,
"Launches to date" real
) | What is the total Launches to date with a Version of 541, and CCBs smaller than 1? | SELECT COUNT("Launches to date") FROM table_12581 WHERE "Version" = '541' AND "CCBs" < '1' | wikisql |
CREATE TABLE table_name_95 (
venue VARCHAR,
date VARCHAR
) | In what venue was the event held on 14 February 2009? | SELECT venue FROM table_name_95 WHERE date = "14 february 2009" | sql_create_context |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TA... | what are the five most commonly prescribed medication for patients who have been diagnosed with encephalopathy - metabolic previously during the same month, in the last year? | 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 = 'encephalopathy - metabolic' AND DATETIME(diagnosis... | eicu |
CREATE TABLE table_23814 (
"Country" text,
"Contestant" text,
"Age" real,
"Height (cm)" real,
"Height (ft)" text,
"Hometown" text
) | How tall is the contestant from Aruba? | SELECT "Height (ft)" FROM table_23814 WHERE "Country" = 'Aruba' | wikisql |
CREATE TABLE table_63154 (
"Rank" real,
"Rowers" text,
"Country" text,
"Time" text,
"Notes" text
) | What are the notes for the rower in ranks over 2 and having a time of 7:00:46? | SELECT "Notes" FROM table_63154 WHERE "Rank" > '2' AND "Time" = '7:00:46' | wikisql |
CREATE TABLE table_54272 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | What's the home team for the western oval venue? | SELECT "Home team" FROM table_54272 WHERE "Venue" = 'western oval' | wikisql |
CREATE TABLE table_15744 (
"Year" real,
"Denomination" text,
"Alloy" text,
"Reverse" text,
"Diameter" text,
"Weight" text,
"Obverse" text,
"Mintage" real,
"Series" text
) | How much did the Modern Pentathlon III Series coin weigh? | SELECT "Weight" FROM table_15744 WHERE "Series" = 'iii series' AND "Reverse" = 'modern pentathlon' | wikisql |
CREATE TABLE table_name_86 (
points INTEGER,
opponent VARCHAR
) | Which Points have an Opponent of @ pittsburgh penguins? | SELECT MAX(points) FROM table_name_86 WHERE opponent = "@ pittsburgh penguins" | 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
) | What is the number of names for each product in the store?, and order Y in desc order. | SELECT Name, COUNT(Name) FROM Products GROUP BY Name ORDER BY COUNT(Name) DESC | nvbench |
CREATE TABLE table_5208 (
"Position" text,
"Game 1" text,
"Game 2" text,
"Game 3" text,
"Exhibition*" text
) | Which Game 2 has an Exhibition of michael o'connor? | SELECT "Game 2" FROM table_5208 WHERE "Exhibition*" = 'michael o''connor' | wikisql |
CREATE TABLE table_41939 (
"Tournament" text,
"Wins" real,
"Top-5" real,
"Top-10" real,
"Top-25" real,
"Events" real,
"Cuts made" real
) | What is the Top-25 with a Top-10 of 8, and an Events of 45? | SELECT AVG("Top-25") FROM table_41939 WHERE "Top-10" = '8' AND "Events" = '45' | wikisql |
CREATE TABLE table_name_8 (
pennant VARCHAR,
builder VARCHAR
) | What is the pennant with Denny, Dumbarton as the builder? | SELECT pennant FROM table_name_8 WHERE builder = "denny, dumbarton" | sql_create_context |
CREATE TABLE table_2160215_1 (
character VARCHAR,
original_japanese VARCHAR
) | Makio Inoue dubbed on which character? | SELECT character FROM table_2160215_1 WHERE original_japanese = "Makio Inoue" | 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... | 7734587号医院的42244科室在04年2月19号到21年8月21号期间不是其负责的所有医疗就诊记录哪些? | (SELECT * FROM t_kc21 WHERE MED_SER_ORG_NO = '7734587' AND IN_HOSP_DATE BETWEEN '2004-02-19' AND '2021-08-21') EXCEPT (SELECT * FROM t_kc21 WHERE MED_SER_ORG_NO = '7734587' AND IN_HOSP_DATE BETWEEN '2004-02-19' AND '2021-08-21' AND MED_ORG_DEPT_CD = '42244') | css |
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... | 周兴业这位病人在04.2.7到17.11.24的就诊结算日期内,一共有多少医疗就诊记录编号,把这些编号都列出来 | SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 JOIN t_kc24 JOIN t_kc21_t_kc24 ON t_kc21.MED_CLINIC_ID = t_kc21_t_kc24.MED_CLINIC_ID AND t_kc21_t_kc24.MED_SAFE_PAY_ID = t_kc24.MED_SAFE_PAY_ID WHERE t_kc21.PERSON_NM = '周兴业' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2004-02-07' AND '2017-11-24' | css |
CREATE TABLE table_73107 (
"C_{low}" text,
"C_{high}" text,
"I_{low}" real,
"I_{high}" real,
"Category" text
) | What's the C_{low} value when C_{high} is 12.0? | SELECT "C_{low}" FROM table_73107 WHERE "C_{high}" = '12.0' | wikisql |
CREATE TABLE table_name_9 (
attendance VARCHAR,
opponent VARCHAR
) | What was the attendance for the game against the Houston Oilers? | SELECT attendance FROM table_name_9 WHERE opponent = "houston oilers" | sql_create_context |
CREATE TABLE table_49141 (
"E. coli" text,
"Yeast (S. cerevisiae)" text,
"Human" text,
"Type" text,
"Substrates" text
) | Which E. coli has a human value of HNEIL1? | SELECT "E. coli" FROM table_49141 WHERE "Human" = 'hneil1' | wikisql |
CREATE TABLE table_41487 (
"Position" real,
"Team" text,
"Points" real,
"Played" real,
"Drawn" real,
"Lost" real,
"Against" real,
"Difference" text
) | What is the average Lost when the difference is - 3, and a Played is less than 10? | SELECT AVG("Lost") FROM table_41487 WHERE "Difference" = '- 3' AND "Played" < '10' | wikisql |
CREATE TABLE table_name_33 (
date VARCHAR,
set_4 VARCHAR
) | What date has a set 4 of 25-19? | SELECT date FROM table_name_33 WHERE set_4 = "25-19" | sql_create_context |
CREATE TABLE table_23043 (
"No." real,
"Country" text,
"Local title" text,
"Format" text,
"Start Date" text,
"End Date" text,
"Episodes" real,
"Premiere/Air Dates" text
) | What was the minimum number of episodes in any of the series? | SELECT MIN("Episodes") FROM table_23043 | wikisql |
CREATE TABLE table_1342233_11 (
candidates VARCHAR,
district VARCHAR
) | What candidate is associated with the Georgia 4 district? | SELECT candidates FROM table_1342233_11 WHERE district = "Georgia 4" | 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... | what is the number of patients whose marital status is single and procedure short title is transplant cadaver donor? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.marital_status = "SINGLE" AND procedures.short_title = "Transplant cadaver donor" | mimicsql_data |
CREATE TABLE authors (
authid number,
lname text,
fname text
)
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
) | Find the titles of all the papers written by 'Aaron Turon'. | SELECT t3.title FROM authors AS t1 JOIN authorship AS t2 ON t1.authid = t2.authid JOIN papers AS t3 ON t2.paperid = t3.paperid WHERE t1.fname = "Aaron" AND t1.lname = "Turon" | spider |
CREATE TABLE table_56809 (
"Race Name" text,
"Circuit" text,
"Date" text,
"Winning driver" text,
"Constructor" text,
"Report" text
) | Tell me the race name where stirling moss won on 16 april | SELECT "Race Name" FROM table_56809 WHERE "Winning driver" = 'stirling moss' AND "Date" = '16 april' | wikisql |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.