context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE region (
Region_id int,
Region_code text,
Region_name text
)
CREATE TABLE affected_region (
Region_id int,
Storm_ID int,
Number_city_affected real
)
CREATE TABLE storm (
Storm_ID int,
Name text,
Dates_active text,
Max_speed int,
Damage_millions_USD real,
Nu... | Draw a bar chart for how many storms occured in each region?, and show bars from low to high order. | SELECT Region_name, COUNT(*) FROM region AS T1 JOIN affected_region AS T2 ON T1.Region_id = T2.Region_id GROUP BY T1.Region_id ORDER BY Region_name | nvbench |
CREATE TABLE table_name_31 (
district VARCHAR,
college_or_campus_name VARCHAR
) | What District has a College or Campus Name of anna university college of engineering kanchipuram? | SELECT district FROM table_name_31 WHERE college_or_campus_name = "anna university college of engineering kanchipuram" | sql_create_context |
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostFeedback (
Id number,
PostId number,
IsAnonymous boolean,
VoteTypeId number,
CreationDate time
)
CREATE TABLE ReviewTaskStates (
Id number,
Name text,
Description text
)
CREATE TABLE S... | Do Higher bounties lead to faster answers?. | WITH FirstAnswers AS (SELECT p.Id AS PostID, MIN(a.CreationDate) AS FirstAnswerDate FROM Posts AS p LEFT JOIN Posts AS a ON a.ParentId = p.Id WHERE p.PostTypeId = 1 GROUP BY p.Id) SELECT BountyAmount /* count(*) BountyCount, */, AVG(CAST((JULIANDAY(FirstAnswerDate) - JULIANDAY(v.CreationDate)) AS INT)) AS AvgMinutesToA... | sede |
CREATE TABLE table_name_30 (
score VARCHAR,
february VARCHAR,
game VARCHAR
) | What was the score after february 4 in the game 61? | SELECT score FROM table_name_30 WHERE february > 4 AND game = 61 | sql_create_context |
CREATE TABLE table_name_72 (
away_team VARCHAR,
venue VARCHAR
) | What team was the away team at Arden Street Oval? | SELECT away_team FROM table_name_72 WHERE venue = "arden street oval" | sql_create_context |
CREATE TABLE table_1721 (
"Player" text,
"League" real,
"Scottish Cup" real,
"League Cup" real,
"Challenge Cup" real,
"Total" real
) | Name the total number of league cup for mark roberts | SELECT COUNT("League Cup") FROM table_1721 WHERE "Player" = 'Mark Roberts' | wikisql |
CREATE TABLE table_70895 (
"Year" text,
"Category" text,
"Genre" text,
"Recording" text,
"Result" text
) | Name the recording for 2012 | SELECT "Recording" FROM table_70895 WHERE "Year" = '2012' | wikisql |
CREATE TABLE ref_document_types (
document_type_code text,
document_type_description text
)
CREATE TABLE addresses (
address_id number,
address_details text
)
CREATE TABLE ref_shipping_agents (
shipping_agent_code text,
shipping_agent_name text,
shipping_agent_description text
)
CREATE TA... | How many employees do we have? | SELECT COUNT(*) FROM employees | spider |
CREATE TABLE table_name_9 (
year VARCHAR,
open_cup VARCHAR
) | How many years did Real Colorado Foxes make it to the Open Cup 1st Round? | SELECT COUNT(year) FROM table_name_9 WHERE open_cup = "1st round" | sql_create_context |
CREATE TABLE body_builder (
Body_Builder_ID int,
People_ID int,
Snatch real,
Clean_Jerk real,
Total real
)
CREATE TABLE people (
People_ID int,
Name text,
Height real,
Weight real,
Birth_Date text,
Birth_Place text
) | A scatter chart shows the correlation between Body_Builder_ID and Clean_Jerk . | SELECT Body_Builder_ID, Clean_Jerk FROM body_builder | nvbench |
CREATE TABLE table_name_79 (
set_3 VARCHAR,
date VARCHAR,
set_1 VARCHAR
) | What is the Set 3 on 30 may, and a Set 1 is 20 25? | SELECT set_3 FROM table_name_79 WHERE date = "30 may" AND set_1 = "20–25" | sql_create_context |
CREATE TABLE Supplier_Addresses (
supplier_id INTEGER,
address_id INTEGER,
date_from DATETIME,
date_to DATETIME
)
CREATE TABLE Department_Store_Chain (
dept_store_chain_id INTEGER,
dept_store_chain_name VARCHAR(80)
)
CREATE TABLE Staff_Department_Assignments (
staff_id INTEGER,
departm... | Give the maximum product price for each product type in a bar chart, sort by the y axis from low to high. | SELECT product_type_code, MAX(product_price) FROM Products GROUP BY product_type_code ORDER BY MAX(product_price) | nvbench |
CREATE TABLE player_college (
player_id text,
college_id text,
year number
)
CREATE TABLE hall_of_fame (
player_id text,
yearid number,
votedby text,
ballots number,
needed number,
votes number,
inducted text,
category text,
needed_note text
)
CREATE TABLE team (
ye... | How many times in total did the team Boston Red Stockings participate in postseason games? | SELECT COUNT(*) FROM (SELECT * FROM postseason AS T1 JOIN team AS T2 ON T1.team_id_winner = T2.team_id_br WHERE T2.name = 'Boston Red Stockings' UNION SELECT * FROM postseason AS T1 JOIN team AS T2 ON T1.team_id_loser = T2.team_id_br WHERE T2.name = 'Boston Red Stockings') | spider |
CREATE TABLE table_39780 (
"Res." text,
"Record" text,
"Opponent" text,
"Method" text,
"Event" text,
"Round" real,
"Time" text,
"Location" text
) | Which method led to a record of 9-4? | SELECT "Method" FROM table_39780 WHERE "Record" = '9-4' | wikisql |
CREATE TABLE Teachers (
teacher_id INTEGER,
address_id INTEGER,
first_name VARCHAR(80),
middle_name VARCHAR(80),
last_name VARCHAR(80),
gender VARCHAR(1),
cell_mobile_number VARCHAR(40),
email_address VARCHAR(40),
other_details VARCHAR(255)
)
CREATE TABLE Students (
student_id I... | Return a bar chart about the distribution of date_address_to and the amount of date_address_to bin date_address_to by weekday. | SELECT date_address_to, COUNT(date_address_to) FROM Student_Addresses ORDER BY monthly_rental DESC | nvbench |
CREATE TABLE course_offering (
offering_id int,
course_id int,
semester int,
section_number int,
start_time time,
end_time time,
monday varchar,
tuesday varchar,
wednesday varchar,
thursday varchar,
friday varchar,
saturday varchar,
sunday varchar,
has_final_proje... | Would taking EECS 695 be easier or would taking EECS 499 be easier ? | SELECT DISTINCT course.number FROM course INNER JOIN program_course ON program_course.course_id = course.course_id WHERE (course.number = 695 OR course.number = 499) AND program_course.workload = (SELECT MIN(PROGRAM_COURSEalias1.workload) FROM program_course AS PROGRAM_COURSEalias1 INNER JOIN course AS COURSEalias1 ON ... | advising |
CREATE TABLE table_58030 (
"Year" real,
"Tournament" text,
"Venue" text,
"Result" text,
"Extra" text
) | In which year was the Tournament of european indoor championships played where the Extra was 800 m and the Result was 2nd? | SELECT "Year" FROM table_58030 WHERE "Extra" = '800 m' AND "Tournament" = 'european indoor championships' AND "Result" = '2nd' | wikisql |
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationDate time,
CloseReasonTypeId number,
CloseAsOffTopicReasonTypeId number,
DuplicateOfQuestionId number,
BelongsOnBaseHostAddress text
)
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId n... | What are the vote types?. | SELECT * FROM VoteTypes | sede |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
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 t... | how many patients have stayed in the hospital for more than 3 days with a drug name phenylephrine? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.days_stay > "3" AND prescriptions.drug = "PHENYLEPHrine" | mimicsql_data |
CREATE TABLE table_name_79 (
player VARCHAR,
position VARCHAR,
year_born VARCHAR
) | What player is a center born in 1977? | SELECT player FROM table_name_79 WHERE position = "center" AND year_born = 1977 | sql_create_context |
CREATE TABLE zyjzjlb (
CYBQDM text,
CYBQMC text,
CYCWH text,
CYKSDM text,
CYKSMC text,
CYSJ time,
CYZTDM number,
HZXM text,
JZKSDM text,
JZKSMC text,
JZLSH text,
KH text,
KLX number,
MZBMLX number,
MZJZLSH text,
MZZDBM text,
MZZDMC text,
MZZYZDZZBM... | 列出在08年4月2日到10年8月17日内患者云文石全部检验结果指标记录中的仪器名称以及编号都是什么啊? | SELECT jyjgzbb.YQBH, jyjgzbb.YQMC FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb 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 AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BG... | css |
CREATE TABLE table_24153 (
"Outcome" text,
"Year" real,
"Championship" text,
"Surface" text,
"Partner" text,
"Opponents in the final" text,
"Score in the final" text
) | What was the court surface on year 1971? | SELECT "Surface" FROM table_24153 WHERE "Year" = '1971' | wikisql |
CREATE TABLE table_12264 (
"Draft" real,
"Round" text,
"Pick" real,
"Player" text,
"Nationality" text
) | What is the pick for round 8 with a USA nationality in the 2000 draft? | SELECT "Pick" FROM table_12264 WHERE "Round" = '8' AND "Nationality" = 'usa' AND "Draft" = '2000' | wikisql |
CREATE TABLE table_test_25 (
"id" int,
"ejection_fraction_ef" int,
"respiratory_tract_infection" bool,
"left_ventricular_ejection_fraction_lvef" int,
"intra_aortic_balloon_pump_iabp" bool,
"systolic_blood_pressure_sbp" int,
"central_diabetes_insipidus" bool,
"hyponatremia" bool,
"hea... | body weight < 50 kg | SELECT * FROM table_test_25 WHERE body_weight < 50 | criteria2sql |
CREATE TABLE PostHistory (
Id number,
PostHistoryTypeId number,
PostId number,
RevisionGUID other,
CreationDate time,
UserId number,
UserDisplayName text,
Comment text,
Text text,
ContentLicense text
)
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal bool... | Mining for evidence of Jon Skeet 'bias'.. | WITH rankScores AS (SELECT p.ParentId, p.Id, p.OwnerUserId, parent.AcceptedAnswerId, RANK() OVER (PARTITION BY p.ParentId ORDER BY p.Score DESC) AS Rank FROM Posts AS p INNER JOIN Posts AS parent ON p.ParentId = parent.Id WHERE p.PostTypeId = 2 LIMIT 10000) SELECT SUM(CASE WHEN Rank = 1 AND NOT AcceptedAnswerId IS NULL... | sede |
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 Votes (
Id number,
PostId number,
VoteTypeId nu... | Total Posts by Programming Languages Per Month - 2015. | SELECT COUNT(*) AS PostCount, T.TagName, YEAR(P.CreationDate) FROM Posts AS P INNER JOIN PostTags AS PT ON (P.Id = PT.PostId) INNER JOIN Tags AS T ON (PT.TagId = T.Id) WHERE YEAR(P.CreationDate) > 2014 AND P.CreationDate < '2015-12-01' AND NOT TagName LIKE '%rails%' GROUP BY YEAR(P.CreationDate), T.TagName HAVING COUNT... | sede |
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
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,
... | 编号为60629196677的这次门诊就诊中,中医诊断的名称和编码分别是啥 | SELECT zzmzjzjlb.MZZYZDZZBM, zzmzjzjlb.MZZYZDZZMC FROM zzmzjzjlb WHERE zzmzjzjlb.JZLSH = '60629196677' UNION SELECT fzzmzjzjlb.MZZYZDZZBM, fzzmzjzjlb.MZZYZDZZMC FROM fzzmzjzjlb WHERE fzzmzjzjlb.JZLSH = '60629196677' | css |
CREATE TABLE table_24540893_6 (
position VARCHAR,
school VARCHAR
) | What position does the player from kent state play? | SELECT position FROM table_24540893_6 WHERE school = "Kent State" | sql_create_context |
CREATE TABLE table_17911 (
"Year" real,
"Delaware" text,
"Maryland" text,
"New Jersey" text,
"New York" text,
"Pennsylvania" text,
"Washington, D.C." text
) | After the year 2008.0, who played for Maryland the same year M.O.T. LL Middletown played in Delaware? | SELECT "Maryland" FROM table_17911 WHERE "Delaware" = 'M.O.T. LL Middletown' AND "Year" > '2008.0' | wikisql |
CREATE TABLE table_67344 (
"Driver" text,
"Team" text,
"Laps" real,
"Time/Retired" text,
"Grid" real,
"Points" real
) | What is the highest points total scored by Dan Clarke in a grid higher than 10? | SELECT MAX("Points") FROM table_67344 WHERE "Driver" = 'dan clarke' AND "Grid" > '10' | wikisql |
CREATE TABLE city (
City_ID int,
County_ID int,
Name text,
White real,
Black real,
Amerindian real,
Asian real,
Multiracial real,
Hispanic real
)
CREATE TABLE county_public_safety (
County_ID int,
Name text,
Population int,
Police_officers int,
Residents_per_offi... | What is the number of cities in each country? Return a bar chart, I want to sort from high to low by the y-axis please. | SELECT T2.Name, COUNT(T2.Name) FROM city AS T1 JOIN county_public_safety AS T2 ON T1.County_ID = T2.County_ID GROUP BY T2.Name ORDER BY COUNT(T2.Name) DESC | nvbench |
CREATE TABLE t_kc21 (
CLINIC_ID text,
CLINIC_TYPE text,
COMP_ID text,
DATA_ID text,
DIFF_PLACE_FLG number,
FERTILITY_STS number,
FLX_MED_ORG_ID text,
HOSP_LEV number,
HOSP_STS number,
IDENTITY_CARD text,
INPT_AREA_BED text,
INSURED_IDENTITY number,
INSURED_STS text,
... | 参保人27789150整数金额住院次数是多少? | SELECT COUNT(*) FROM t_kc21 WHERE t_kc21.PERSON_ID = '27789150' AND t_kc21.CLINIC_TYPE = '住院' AND MOD(t_kc21.MED_AMOUT, 1) = 0 | css |
CREATE TABLE table_28209 (
"Celebrity" text,
"Known for" text,
"Age" real,
"Professional" text,
"Series" real,
"Place" text,
"Dances" real,
"Highest score" real,
"Lowest score" real,
"Aggregate" real,
"Average" text
) | What was the aggregate for the celebrity who was known for being a singer and had 7 dances? | SELECT "Aggregate" FROM table_28209 WHERE "Dances" = '7' AND "Known for" = 'Singer' | wikisql |
CREATE TABLE table_22171978_1 (
athletic_nickname VARCHAR,
location VARCHAR
) | For the location of quezon city , metro manila what is the athletic nickname? | SELECT athletic_nickname FROM table_22171978_1 WHERE location = "Quezon City , Metro Manila" | sql_create_context |
CREATE TABLE table_1696 (
"Year" real,
"Total" text,
"Less than a year" real,
"One year" real,
"Two years" real,
"Three years" real,
"Four years" real,
"5\u20139 years" real,
"10\u201314 years" real,
"15\u201319 years" real,
"20\u201324 years" real,
"25 and more" real,
... | If unknown is larger than 1.0, what is the maximum two year amount? | SELECT MAX("Two years") FROM table_1696 WHERE "Unknown" > '1.0' | wikisql |
CREATE TABLE table_name_8 (
gold VARCHAR,
bronze VARCHAR,
total VARCHAR
) | How many golds were there in a game that has 17 bronze and a total of 31? | SELECT gold FROM table_name_8 WHERE bronze = "17" AND total = "31" | sql_create_context |
CREATE TABLE table_name_20 (
city VARCHAR
) | What place is listed in the 2002-2003 season for the City of Aveiro? | SELECT 2002 AS _2003_season FROM table_name_20 WHERE city = "aveiro" | sql_create_context |
CREATE TABLE table_40572 (
"Name" text,
"Rank" real,
"Out of" real,
"Source" text,
"Year" text
) | Which Name had a Rank of 18 Out of a number smaller than 149? | SELECT "Name" FROM table_40572 WHERE "Out of" < '149' AND "Rank" = '18' | wikisql |
CREATE TABLE table_20411 (
"No." real,
"Date" text,
"Tournament" text,
"Winning score" text,
"To par" text,
"Margin of victory" text,
"Runner(s)-up" text
) | Name the total number when date is 30 may 2010 | SELECT COUNT("No.") FROM table_20411 WHERE "Date" = '30 May 2010' | wikisql |
CREATE TABLE t_kc21_t_kc24 (
MED_CLINIC_ID text,
MED_SAFE_PAY_ID number
)
CREATE TABLE t_kc21 (
CLINIC_ID text,
CLINIC_TYPE text,
COMP_ID text,
DATA_ID text,
DIFF_PLACE_FLG number,
FERTILITY_STS number,
FLX_MED_ORG_ID text,
HOSP_LEV number,
HOSP_STS number,
IDENTITY_CARD... | 31337680的患者自02.3.31起,到04.3.1止,看病时一共做了多少次的检查 | SELECT COUNT(*) FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.PERSON_ID = '31337680' AND t_kc22.STA_DATE BETWEEN '2002-03-31' AND '2004-03-01' AND t_kc22.MED_INV_ITEM_TYPE = '检查费' | css |
CREATE TABLE table_61211 (
"Date" text,
"Series" text,
"Circuit" text,
"City / State" text,
"Winner" text,
"Team" text
) | Which team won at winton motor raceway? | SELECT "Team" FROM table_61211 WHERE "Circuit" = 'winton motor raceway' | wikisql |
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate tim... | how many times patient 32160 had visited the hospital? | SELECT COUNT(DISTINCT admissions.hadm_id) FROM admissions WHERE admissions.subject_id = 32160 | mimic_iii |
CREATE TABLE table_50858 (
"Internet Plan" text,
"Downstream" text,
"Upstream" text,
"Bandwidth Included" text,
"Price" text
) | What is Upstream, when Price is '14 EUR'? | SELECT "Upstream" FROM table_50858 WHERE "Price" = '14 eur' | wikisql |
CREATE TABLE Person (
name varchar(20),
age INTEGER,
city TEXT,
gender TEXT,
job TEXT
)
CREATE TABLE PersonFriend (
name varchar(20),
friend varchar(20),
year INTEGER
) | Count the job title of all people using a pie chart. | SELECT job, COUNT(job) FROM Person GROUP BY job | nvbench |
CREATE TABLE table_26842217_16 (
broadcast VARCHAR,
home_team VARCHAR
) | On what network was the Kentucky game broadcast? | SELECT broadcast FROM table_26842217_16 WHERE home_team = "Kentucky" | sql_create_context |
CREATE TABLE table_name_12 (
bubbles VARCHAR,
attribute VARCHAR
) | Name the bubbles for onscroll | SELECT bubbles FROM table_name_12 WHERE attribute = "onscroll" | sql_create_context |
CREATE TABLE table_2603017_2 (
bb___blind_bear VARCHAR,
ba___running_bear VARCHAR
) | what is bb - blind bear where ba - running bear is mf - mountain falcon? | SELECT bb___blind_bear FROM table_2603017_2 WHERE ba___running_bear = "MF - Mountain Falcon" | sql_create_context |
CREATE TABLE table_204_794 (
id number,
"iec\nworld plugs\nType" text,
"standard" text,
"power\nrating" text,
"earthed" text,
"polarised" text,
"fused" text,
"insulated\npins" text,
"europlug\ncompatible" text
) | how many are europlug compatible -lrb- yes -rrb- ? | SELECT COUNT(*) FROM table_204_794 WHERE "europlug\ncompatible" = 'yes' | squall |
CREATE TABLE table_name_23 (
investment_earnings VARCHAR,
total_revenue VARCHAR
) | What were the investment earnings in a year when total revenue was $21,779,618? | SELECT investment_earnings FROM table_name_23 WHERE total_revenue = "21,779,618" | 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... | Return a bar chart about the distribution of Team_Name and School_ID , list by the Y in desc. | SELECT Team_Name, School_ID FROM basketball_match ORDER BY School_ID DESC | nvbench |
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
)
... | what is admission time and diagnoses short title of subject name paul edwards? | SELECT demographic.admittime, diagnoses.short_title FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.name = "Paul Edwards" | mimicsql_data |
CREATE TABLE table_7558 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
) | What is the Score of the game with a Record of 12 12? | SELECT "Score" FROM table_7558 WHERE "Record" = '12–12' | wikisql |
CREATE TABLE table_4277 (
"Season" real,
"Date" text,
"Location" text,
"Discipline" text,
"Position" real,
"FIS points" real
) | Name the date for s. valentino alla muta , italia | SELECT "Date" FROM table_4277 WHERE "Location" = 'S. Valentino Alla Muta , Italia' | wikisql |
CREATE TABLE table_name_8 (
player VARCHAR,
school_club_team VARCHAR
) | Who is the player who went to Stanford? | SELECT player FROM table_name_8 WHERE school_club_team = "stanford" | sql_create_context |
CREATE TABLE table_42010 (
"Member State" text,
"Population in millions" real,
"Population % of EU" text,
"Area km 2" real,
"Area % of EU" text,
"Pop. density People/km 2" real
) | What is the lowest area km2 of the member state of the Czech Republic and has a population in millions lesss than 10.3? | SELECT MIN("Area km 2") FROM table_42010 WHERE "Member State" = 'czech republic' AND "Population in millions" < '10.3' | wikisql |
CREATE TABLE icustays (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
first_careunit text,
last_careunit text,
first_wardid number,
last_wardid number,
intime time,
outtime time
)
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
s... | tell me the cost for the asbestosis diagnosis? | SELECT DISTINCT cost.cost FROM cost WHERE cost.event_type = 'diagnoses_icd' AND cost.event_id IN (SELECT diagnoses_icd.row_id FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'asbestosis')) | mimic_iii |
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... | 有哪些定价上限金额高于377.96块用在医疗就诊83290845570的治疗过程中? | SELECT SOC_SRT_DIRE_CD, SOC_SRT_DIRE_NM FROM t_kc22 WHERE MED_CLINIC_ID = '83290845570' AND UP_LIMIT_AMO > 377.96 | css |
CREATE TABLE Investors (
investor_id INTEGER,
Investor_details VARCHAR(255)
)
CREATE TABLE Lots (
lot_id INTEGER,
investor_id INTEGER,
lot_details VARCHAR(255)
)
CREATE TABLE Purchases (
purchase_transaction_id INTEGER,
purchase_details VARCHAR(255)
)
CREATE TABLE Transactions_Lots (
... | Show the number of the dates of transactions if the share count is bigger than 100 or the amount is bigger than 1000, could you list from high to low by the Y? | SELECT date_of_transaction, COUNT(date_of_transaction) FROM Transactions WHERE share_count > 100 OR amount_of_transaction > 1000 ORDER BY COUNT(date_of_transaction) DESC | nvbench |
CREATE TABLE table_33578 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | What was the away team at the match where the crowd was larger than 30,000? | SELECT "Away team" FROM table_33578 WHERE "Crowd" > '30,000' | wikisql |
CREATE TABLE table_39396 (
"Call sign" text,
"Frequency MHz" real,
"City of license" text,
"ERP W" real,
"Class" text,
"FCC info" text
) | What frequency has call sign w228bg? | SELECT "Frequency MHz" FROM table_39396 WHERE "Call sign" = 'w228bg' | wikisql |
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... | 从05年6月26日开始到09年10月18日病患陶秀英常常去哪个医院就诊? | SELECT MED_SER_ORG_NO FROM t_kc21 WHERE PERSON_NM = '陶秀英' AND IN_HOSP_DATE BETWEEN '2005-06-26' AND '2009-10-18' GROUP BY MED_SER_ORG_NO ORDER BY COUNT(*) DESC LIMIT 1 | css |
CREATE TABLE requirement (
requirement_id int,
requirement varchar,
college varchar
)
CREATE TABLE ta (
campus_job_id int,
student_id int,
location varchar
)
CREATE TABLE program_requirement (
program_id int,
category varchar,
min_credit int,
additional_req varchar
)
CREATE TA... | I 'm looking for courses worth 9 credits , which are they ? | SELECT DISTINCT name, number FROM course WHERE credits = 9 AND department = 'EECS' | advising |
CREATE TABLE table_65578 (
"Game" real,
"Date" text,
"Opponent" text,
"Score" text,
"Location/Attendance" text,
"Series" text
) | What is the lowest game when the score is 102-104? | SELECT MIN("Game") FROM table_65578 WHERE "Score" = '102-104' | wikisql |
CREATE TABLE table_name_8 (
year INTEGER,
venue VARCHAR,
event VARCHAR,
result VARCHAR
) | What is earliest year that had a 50km event with a 2nd place result played in London, United Kingdom? | SELECT MIN(year) FROM table_name_8 WHERE event = "50km" AND result = "2nd" AND venue = "london, united kingdom" | sql_create_context |
CREATE TABLE table_name_32 (
location VARCHAR,
res VARCHAR,
method VARCHAR
) | Where was the match held when the result was win, and tko as the method? | SELECT location FROM table_name_32 WHERE res = "win" AND method = "tko" | sql_create_context |
CREATE TABLE table_66028 (
"Rank" text,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) | What is the hioghest amount of silver medals for a nation ranked higher than 19 and less than 2 gold medals? | SELECT MAX("Silver") FROM table_66028 WHERE "Rank" = '19' AND "Gold" < '2' | wikisql |
CREATE TABLE table_name_30 (
circuit VARCHAR,
round INTEGER
) | Which circuit had a round larger than 5? | SELECT circuit FROM table_name_30 WHERE round > 5 | sql_create_context |
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE inputevents_cv (
row_id numb... | in the case of patients who received a contrast aortogram until 1 year ago, what were the three most frequent lab tests that followed within 2 months? | SELECT d_labitems.label FROM d_labitems WHERE d_labitems.itemid IN (SELECT t3.itemid FROM (SELECT t2.itemid, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, procedures_icd.charttime FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_i... | mimic_iii |
CREATE TABLE table_1520559_1 (
venue VARCHAR,
champion VARCHAR
) | At what venues did Lorena Ochoa win the championship? | SELECT venue FROM table_1520559_1 WHERE champion = "Lorena Ochoa" | sql_create_context |
CREATE TABLE table_52949 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | What did the team score when playing at home in victoria park? | SELECT "Home team score" FROM table_52949 WHERE "Venue" = 'victoria park' | wikisql |
CREATE TABLE table_69682 (
"Rank" real,
"Lane" real,
"Name" text,
"Nationality" text,
"Time" text
) | Name the least lane for lenny krayzelburg | SELECT MIN("Lane") FROM table_69682 WHERE "Name" = 'lenny krayzelburg' | wikisql |
CREATE TABLE t_kc21_t_kc22 (
MED_CLINIC_ID text,
MED_EXP_DET_ID number
)
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,
C... | 37631577362这个医疗就诊是哪天出院 | SELECT t_kc21.OUT_HOSP_DATE FROM t_kc21 WHERE t_kc21.MED_CLINIC_ID = '37631577362' | css |
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,
... | 显示出1623012这家医院就诊的患者任阳舒的出院科室名字没有中医的住院就诊记录 | SELECT * FROM person_info JOIN hz_info JOIN zyjzjlb JOIN hz_info_zyjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = hz_info_zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX AND hz_info_zyjzjlb.JZLSH = zyjzjlb.JZLSH AND hz_info_zyjzjlb.YLJGDM = hz_info_zyjzjlb.YLJGDM AND hz_info_zyjz... | css |
CREATE TABLE table_48085 (
"Res." text,
"Record" text,
"Opponent" text,
"Method" text,
"Event" text,
"Round" real,
"Time" text,
"Location" text
) | Which Time has a Round larger than 2, and an Opponent of jesse brock? | SELECT "Time" FROM table_48085 WHERE "Round" > '2' AND "Opponent" = 'jesse brock' | wikisql |
CREATE TABLE table_name_27 (
club_province VARCHAR,
caps VARCHAR,
position VARCHAR
) | What club/province does the prop player with over 45 caps play for? | SELECT club_province FROM table_name_27 WHERE caps > 45 AND position = "prop" | sql_create_context |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id... | how many patients whose gender is f and diagnoses short title is adv eff benzodiaz tranq? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.gender = "F" AND diagnoses.short_title = "Adv eff benzodiaz tranq" | mimicsql_data |
CREATE TABLE table_68289 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text
) | Which place has horton smith as the player? | SELECT "Place" FROM table_68289 WHERE "Player" = 'horton smith' | wikisql |
CREATE TABLE table_204_109 (
id number,
"district" text,
"incumbent" text,
"party" text,
"first\nelected" text,
"result" text,
"candidates" text
) | who was the next incumbent after john randolph ? | SELECT "incumbent" FROM table_204_109 WHERE id = (SELECT id FROM table_204_109 WHERE "incumbent" = 'john randolph') + 1 | squall |
CREATE TABLE editor (
Age VARCHAR
) | Please show the most common age of editors. | SELECT Age FROM editor GROUP BY Age ORDER BY COUNT(*) DESC LIMIT 1 | sql_create_context |
CREATE TABLE t_kc21 (
CLINIC_ID text,
CLINIC_TYPE text,
COMP_ID text,
DATA_ID text,
DIFF_PLACE_FLG number,
FERTILITY_STS number,
FLX_MED_ORG_ID text,
HOSP_LEV number,
HOSP_STS number,
IDENTITY_CARD text,
INPT_AREA_BED text,
INSURED_IDENTITY number,
INSURED_STS text,
... | 自2000年8月9日起,到2005年9月8日,医院3415980涉及的医疗费总额少于7321.4元的科室有多少 | SELECT COUNT(*) FROM (SELECT t_kc21.MED_ORG_DEPT_CD 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.MED_SER_ORG_NO = '3415980' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2000-08-09' AND '2005-09-08' GROUP B... | css |
CREATE TABLE table_7903 (
"Round" real,
"Pick" real,
"Player" text,
"Nationality" text,
"College" text
) | Who was the highest drafted player that attended college at Virginia? | SELECT MAX("Pick") FROM table_7903 WHERE "College" = 'virginia' | wikisql |
CREATE TABLE flight_leg (
flight_id int,
leg_number int,
leg_flight int
)
CREATE TABLE date_day (
month_number int,
day_number int,
year int,
day_name varchar
)
CREATE TABLE airport_service (
city_code varchar,
airport_code varchar,
miles_distant int,
direction varchar,
... | find a flight on DL from PHILADELPHIA to SAN FRANCISCO | 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 = 'SAN FRANCISCO' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = ... | atis |
CREATE TABLE table_name_18 (
total VARCHAR,
silver VARCHAR,
rank VARCHAR
) | How many medals were won total for the country that won 1 silver and was ranked 2 or lower? | SELECT COUNT(total) FROM table_name_18 WHERE silver = 1 AND rank < 2 | sql_create_context |
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
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 pat... | what are the four most commonly prescribed medications for patients that are also prescribed with propofol at the same time, until 2 years ago? | SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, prescriptions.startdate FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE prescriptions.drug = 'propofol' AND DATETIME(prescriptions.startdate) <= DATETIME(CURRE... | mimic_iii |
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
)
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
) | For those records from the products and each product's manufacturer, find name and code , and group by attribute founder, and visualize them by a bar chart, and show Y in descending order. | SELECT T1.Name, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder, T1.Name ORDER BY T1.Code DESC | nvbench |
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE intakeoutput (
intakeoutputid ... | what was the yearly maximum intake of misc. that patient 022-44805 had received? | SELECT MAX(intakeoutput.cellvaluenumeric) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '022-44805')) AND intakeoutput.celllabel = 'misc.... | eicu |
CREATE TABLE table_name_98 (
points INTEGER,
year VARCHAR,
chassis VARCHAR
) | What was the total amount of points in 1978 with a Chassis of arrows fa1? | SELECT SUM(points) FROM table_name_98 WHERE year = 1978 AND chassis = "arrows fa1" | sql_create_context |
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
)
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
) | For those records from the products and each product's manufacturer, show me about the distribution of headquarter and the amount of headquarter , and group by attribute headquarter in a bar chart, and I want to display x axis in descending order please. | SELECT Headquarter, COUNT(Headquarter) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter ORDER BY Headquarter DESC | nvbench |
CREATE TABLE table_13613 (
"Model number" text,
"sSpec number" text,
"Frequency" text,
"Turbo" text,
"GPU frequency" text,
"Cores" text,
"L2 cache" text,
"L3 cache" text,
"I/O bus" text,
"Mult." text,
"Memory" text,
"Voltage" text,
"Socket" text,
"Release date" te... | What is the voltage when there are 2 cores, turbo is 5/8 and the release date is September 2010? | SELECT "Voltage" FROM table_13613 WHERE "Cores" = '2' AND "Release date" = 'september 2010' AND "Turbo" = '5/8' | wikisql |
CREATE TABLE t_kc22 (
AMOUNT number,
CHA_ITEM_LEV number,
DATA_ID text,
DIRE_TYPE number,
DOSE_FORM text,
DOSE_UNIT text,
EACH_DOSAGE text,
EXP_OCC_DATE time,
FLX_MED_ORG_ID text,
FXBZ number,
HOSP_DOC_CD text,
HOSP_DOC_NM text,
MED_CLINIC_ID text,
MED_DIRE_CD tex... | 病患82459876开出的所有药品的编号、名称、数量、单价、金额列出在2000年5月9日到2017年10月31日期间的详细情况? | SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM, t_kc22.QTY, t_kc22.UNIVALENT, t_kc22.AMOUNT FROM gwyjzb JOIN t_kc22 ON gwyjzb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gwyjzb.PERSON_ID = '82459876' AND gwyjzb.IN_HOSP_DATE BETWEEN '2000-05-09' AND '2017-10-31' UNION SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_... | css |
CREATE TABLE table_23992 (
"Round" real,
"Pick #" real,
"Player" text,
"Position" text,
"Height" text,
"Weight" text,
"College" text,
"Status" text
) | state the status of pick # 32 | SELECT "Status" FROM table_23992 WHERE "Pick #" = '32' | wikisql |
CREATE TABLE table_13342 (
"Township" text,
"County" text,
"Pop. (2010)" real,
"Land ( sqmi )" real,
"Water (sqmi)" real,
"Latitude" real,
"Longitude" real,
"GEO ID" real,
"ANSI code" real
) | what is the average water sqmi with a population (2010) more than 47 in the Brenna Township with Longitude less than -97.171507 | SELECT AVG("Water (sqmi)") FROM table_13342 WHERE "Pop. (2010)" > '47' AND "Township" = 'brenna' AND "Longitude" < '-97.171507' | wikisql |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
... | how many patients whose admission type is elective and lab test name is lymphocytes, percent? | 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.label = "Lymphocytes, Percent" | mimicsql_data |
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
eventtype text,
careunit te... | what are the top four common diagnoses of patients of age 30s until 3 years ago? | SELECT d_icd_diagnoses.short_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.icd9_code IN (SELECT t1.icd9_code FROM (SELECT diagnoses_icd.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM diagnoses_icd WHERE diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.age BETWEEN... | mimic_iii |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id... | which patients have ou route of drug administration? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE prescriptions.route = "OU" | mimicsql_data |
CREATE TABLE table_train_176 (
"id" int,
"systolic_blood_pressure_sbp" int,
"hemoglobin_a1c_hba1c" float,
"estimated_glomerular_filtration_rate_egfr" int,
"blood_glucose" int,
"hypoglycemia" bool,
"total_cholesterol" int,
"low_density_lipoprotein_ldl_cholesterol" int,
"triglyceride_t... | have an egfr level > 30 l / min | SELECT * FROM table_train_176 WHERE estimated_glomerular_filtration_rate_egfr > 30 | criteria2sql |
CREATE TABLE table_41651 (
"Year" text,
"Starts" real,
"Cuts Made" real,
"Wins" real,
"Top 10" real,
"Top 25" real,
"Earnings (\u20ac)" real,
"Money list rank" text
) | What is the average number of starts when 11 cuts were made and the top 10 ranking is larger than 4? | SELECT AVG("Starts") FROM table_41651 WHERE "Cuts Made" = '11' AND "Top 10" > '4' | wikisql |
CREATE TABLE t_kc21 (
CLINIC_ID text,
CLINIC_TYPE text,
COMP_ID text,
DATA_ID text,
DIFF_PLACE_FLG number,
FERTILITY_STS number,
FLX_MED_ORG_ID text,
HOSP_LEV number,
HOSP_STS number,
IDENTITY_CARD text,
INPT_AREA_BED text,
INSURED_IDENTITY number,
INSURED_STS text,
... | 在医院0510522中就诊的患者97104929看的哪个药品的单价最高其编码和名字以及单价具体是多少? | SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM, t_kc22.UNIVALENT FROM t_kc22 WHERE t_kc21_t_kc22.MED_CLINIC_ID IN (SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_ID = '97104929' AND t_kc21.MED_SER_ORG_NO = '0510522') ORDER BY t_kc22.UNIVALENT DESC LIMIT 1 | css |
CREATE TABLE table_name_7 (
attendance VARCHAR,
week VARCHAR
) | What was the Attendance in Week 1? | SELECT attendance FROM table_name_7 WHERE week = 1 | sql_create_context |
CREATE TABLE table_47294 (
"Year" real,
"Date" text,
"Winner" text,
"Result" text,
"Loser" text,
"Location" text
) | Who was the loser when the New York Giants were the winners on November 14? | SELECT "Loser" FROM table_47294 WHERE "Winner" = 'new york giants' AND "Date" = 'november 14' | wikisql |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.