context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE Catalog_Structure (
catalog_level_name VARCHAR,
catalog_level_number INTEGER
) | Find the name and level of catalog structure with level between 5 and 10. | SELECT catalog_level_name, catalog_level_number FROM Catalog_Structure WHERE catalog_level_number BETWEEN 5 AND 10 | sql_create_context |
CREATE TABLE table_22011138_7 (
pos VARCHAR
) | If the POS is 3, what is the 08 points? | SELECT 08 AS _pts FROM table_22011138_7 WHERE pos = 3 | sql_create_context |
CREATE TABLE table_name_47 (
home_team VARCHAR,
away_team VARCHAR
) | Who is the home team when melbourne is the away team? | SELECT home_team AS score FROM table_name_47 WHERE away_team = "melbourne" | sql_create_context |
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime 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... | does the first catheter tip-iv microbiology test of patient 28484 until 09/2102 have any organisms? | SELECT COUNT(*) > 0 FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 28484) AND microbiologyevents.spec_type_desc = 'catheter tip-iv' AND NOT microbiologyevents.org_name IS NULL AND STRFTIME('%y-%m', microbiologyevents.charttime) <= '21... | mimic_iii |
CREATE TABLE music_festival (
ID int,
Music_Festival text,
Date_of_ceremony text,
Category text,
Volume int,
Result text
)
CREATE TABLE volume (
Volume_ID int,
Volume_Issue text,
Issue_Date text,
Weeks_on_Top real,
Song text,
Artist_ID int
)
CREATE TABLE artist (
Ar... | A bar chart for what are the number of the category of music festivals with result 'Awarded'? | SELECT Category, COUNT(Category) FROM music_festival WHERE Result = "Awarded" GROUP BY Category | nvbench |
CREATE TABLE table_78617 (
"Position" real,
"Club" text,
"Played" real,
"Points" real,
"Wins" real,
"Draws" real,
"Losses" real,
"Goals for" real,
"Goals against" real,
"Goal Difference" real
) | Which Wins have a Goal Difference larger than 12, and a Club of granada cf, and Played larger than 30? | SELECT AVG("Wins") FROM table_78617 WHERE "Goal Difference" > '12' AND "Club" = 'granada cf' AND "Played" > '30' | wikisql |
CREATE TABLE table_name_34 (
laps INTEGER,
time_retired VARCHAR,
grid VARCHAR
) | What is the largest laps for Time/Retired of + 2 laps, and a Grid of 13? | SELECT MAX(laps) FROM table_name_34 WHERE time_retired = "+ 2 laps" AND grid = 13 | 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... | 医疗机构8198670在零二年六月八日到零二年九月二十日内的总金额和统筹总金额分别如何 | SELECT SUM(t_kc24.MED_AMOUT), SUM(t_kc24.OVE_PAY) FROM t_kc24 WHERE t_kc24.t_kc21_MED_SER_ORG_NO = '8198670' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2002-06-08' AND '2002-09-20' | css |
CREATE TABLE injury_accident (
game_id VARCHAR
)
CREATE TABLE game (
id VARCHAR,
score VARCHAR,
date VARCHAR
) | What are the ids, scores, and dates of the games which caused at least two injury accidents? | SELECT T1.id, T1.score, T1.date FROM game AS T1 JOIN injury_accident AS T2 ON T2.game_id = T1.id GROUP BY T1.id HAVING COUNT(*) >= 2 | sql_create_context |
CREATE TABLE table_203_554 (
id number,
"year" number,
"place" text,
"gold" text,
"silver" text,
"bronze" text
) | what are the total number of times the soviet union is listed under the gold column ? | SELECT COUNT(*) FROM table_203_554 WHERE "gold" = 'soviet union' | squall |
CREATE TABLE table_12588 (
"Outcome" text,
"Date" text,
"Category" text,
"Tournament" text,
"Surface" text,
"Opponent" text,
"Score" text
) | What is the Score of the tournament played on Clay Surface against Pablo Martin-Adalia? | SELECT "Score" FROM table_12588 WHERE "Surface" = 'clay' AND "Opponent" = 'pablo martin-adalia' | wikisql |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE prescription... | how many patients whose lab test fluid is pleural? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE lab.fluid = "Pleural" | mimicsql_data |
CREATE TABLE table_37632 (
"Date" text,
"Tournament" text,
"Surface" text,
"Opponent in the final" text,
"Score" text
) | When did Adam Thompson play in the final? | SELECT "Date" FROM table_37632 WHERE "Opponent in the final" = 'adam thompson' | wikisql |
CREATE TABLE table_19963 (
"Year (Ceremony)" real,
"Original title" text,
"English title" text,
"Director" text,
"Result" text
) | Who was the director of Pecado Mortal | SELECT "Director" FROM table_19963 WHERE "Original title" = 'Pecado Mortal' | wikisql |
CREATE TABLE table_name_99 (
points VARCHAR,
position VARCHAR,
loses VARCHAR,
goals_scored VARCHAR
) | How many points are there with more losses than 16, more goals than 44, and a smaller position than 13? | SELECT COUNT(points) FROM table_name_99 WHERE loses > 16 AND goals_scored > 44 AND position < 13 | sql_create_context |
CREATE TABLE table_74963 (
"Outcome" text,
"Date" text,
"Tournament" text,
"Surface" text,
"Opponent" text,
"Score" text
) | Which Tournament has an Outcome of winner on 19 october 2008? | SELECT "Tournament" FROM table_74963 WHERE "Outcome" = 'winner' AND "Date" = '19 october 2008' | wikisql |
CREATE TABLE table_31167 (
"District" real,
"Representative" text,
"Party" text,
"Residence" text,
"First Elected" text,
"Term Limited" real
) | which party is the newark representative from | SELECT "Party" FROM table_31167 WHERE "Residence" = 'Newark' | wikisql |
CREATE TABLE statements (
statement_id number,
statement_details text
)
CREATE TABLE projects (
project_id number,
project_details text
)
CREATE TABLE ref_document_types (
document_type_code text,
document_type_name text,
document_type_description text
)
CREATE TABLE documents (
docum... | Count the number of documents. | SELECT COUNT(*) FROM documents | spider |
CREATE TABLE table_name_56 (
game INTEGER,
opponent VARCHAR
) | Can you tell me the highest Game that has the Opponent of atlanta hawks? | SELECT MAX(game) FROM table_name_56 WHERE opponent = "atlanta hawks" | sql_create_context |
CREATE TABLE table_10887 (
"Season" text,
"Games" real,
"Lost" real,
"Tied" real,
"Points" real,
"Goals for" real,
"Goals against" real,
"Standing" text
) | How many games had a tied less 15 with goals against being fewer than 186? | SELECT COUNT("Games") FROM table_10887 WHERE "Tied" < '15' AND "Goals against" < '186' | wikisql |
CREATE TABLE table_17831 (
"Colt model no." text,
"Diemaco model" text,
"Stock" text,
"Fire control" text,
"Rear sight" text,
"Forward assist" text,
"Barrel length" text,
"Barrel profile" text,
"Barrel twist" text,
"Hand guards" text,
"Bayonet Lug" text,
"Muzzle device" t... | What kind of hand guards are associated with a rear sight of A1 and stock of A2? | SELECT "Hand guards" FROM table_17831 WHERE "Rear sight" = 'A1' AND "Stock" = 'A2' | wikisql |
CREATE TABLE table_name_99 (
field_goals VARCHAR,
extra_points VARCHAR,
touchdowns VARCHAR,
points VARCHAR
) | What is the total number of field goals for a player that had less than 3 touchdowns, had 4 points, and had less than 4 extra points? | SELECT COUNT(field_goals) FROM table_name_99 WHERE touchdowns < 3 AND points = 4 AND extra_points < 4 | sql_create_context |
CREATE TABLE table_name_17 (
band VARCHAR,
album_or_song VARCHAR
) | Which band plays Self Versus Self - Immersion? | SELECT band FROM table_name_17 WHERE album_or_song = "self versus self - immersion" | sql_create_context |
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE ReviewTaskResultTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostFeedback (
Id number,
PostId number,
IsAnonymous boolean,
VoteTypeId number,
CreationDate time
)
CREATE T... | Unique Most Recent Post For Each User. | SELECT OwnerUserId, Score FROM Posts INNER JOIN (SELECT OwnerUserId AS id, MAX(CreationDate) AS maxDate FROM Posts GROUP BY OwnerUserId) AS p ON Posts.OwnerUserId = p.Id AND Posts.CreationDate = p.maxDate LIMIT 20 | sede |
CREATE TABLE flight (
flno number(4,0),
origin varchar2(20),
destination varchar2(20),
distance number(6,0),
departure_date date,
arrival_date date,
price number(7,2),
aid number(9,0)
)
CREATE TABLE employee (
eid number(9,0),
name varchar2(30),
salary number(10,2)
)
CREATE... | How many flights in each destination city? Return a bar chart, and order by the destination from high to low please. | SELECT destination, COUNT(destination) FROM flight GROUP BY destination ORDER BY destination DESC | nvbench |
CREATE TABLE table_32583 (
"Round" real,
"Overall" real,
"Player" text,
"Position" text,
"School/Club Team" text
) | What position does the player from Texas State who was drafted before round 11 with an overall rank lower than 306 play? | SELECT "Position" FROM table_32583 WHERE "Overall" < '306' AND "Round" < '11' AND "School/Club Team" = 'texas state' | wikisql |
CREATE TABLE tweets (
text VARCHAR
) | Return the text of tweets about the topic 'intern'. | SELECT text FROM tweets WHERE text LIKE '%intern%' | sql_create_context |
CREATE TABLE hz_info (
KH text,
KLX number,
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,
JCZBJGDX text... | 住院就诊的患者中谁的检验报告单的编号是94625262145? | SELECT person_info.XM FROM person_info JOIN hz_info JOIN zyjzjlb JOIN jybgb JOIN person_info_hz_info ON person_info.RYBH = person_info_hz_info.RYBH AND hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX AND zyjzjlb.YLJGDM = jybgb.YLJGDM_ZYJZJLB AND zyjzjlb.JZLSH = jybgb.JZLSH_ZYJZ... | css |
CREATE TABLE table_203_457 (
id number,
"tramway" text,
"country" text,
"city" text,
"height of pylons" text,
"span width,\nleaning straight line" text,
"span width,\nhorizontal measurement" text,
"height of cable over ground" text,
"year of inauguration" number,
"notes" text
) | which tramway was built directly before the 3s aeriral tramway ? | SELECT "tramway" FROM table_203_457 WHERE "year of inauguration" = (SELECT "year of inauguration" FROM table_203_457 WHERE "tramway" = '3s aerial tramway') - 1 | squall |
CREATE TABLE t_kc21 (
MED_CLINIC_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
COMP_ID text,
PERSON_ID text,
PERSON_NM text,
IDENTITY_CARD text,
SOC_SRT_CARD text,
PERSON_SEX number,
PERSON_AGE number,
IN_HOSP_DATE time,
OUT_HOSP_DATE time,
DIFF_PLACE_FLG numb... | 44533265221这次医疗就诊,患者个人账户的支出占总医疗费的比例 | SELECT (SELECT PER_ACC_PAY FROM t_kc24 WHERE MED_CLINIC_ID = '44533265221') / (SELECT MED_AMOUT FROM t_kc24 WHERE MED_CLINIC_ID = '44533265221') | css |
CREATE TABLE table_30393 (
"Institution" text,
"Location" text,
"Founded" real,
"Affiliation" text,
"Enrollment" real,
"Team Nickname" text,
"Primary conference" text
) | When sylvania, oh is the location what is the team nickname? | SELECT "Team Nickname" FROM table_30393 WHERE "Location" = 'Sylvania, OH' | wikisql |
CREATE TABLE table_50020 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text
) | What is the to par of the player from the United States with a place of t1 and a 76-68=144 score? | SELECT "To par" FROM table_50020 WHERE "Country" = 'united states' AND "Place" = 't1' AND "Score" = '76-68=144' | wikisql |
CREATE TABLE table_24056 (
"Episode" text,
"Broadcast date" text,
"Run time" text,
"Viewers (in millions)" text,
"Archive" text
) | Name the broadcast date for 7.4 viewers | SELECT "Broadcast date" FROM table_24056 WHERE "Viewers (in millions)" = '7.4' | wikisql |
CREATE TABLE table_70175 (
"Pick #" text,
"Player" text,
"Position" text,
"Nationality" text,
"NHL team" text,
"College/junior/club team" text
) | Which team has a right wing position listed? | SELECT "College/junior/club team" FROM table_70175 WHERE "Position" = 'right wing' | wikisql |
CREATE TABLE table_75509 (
"Year" real,
"Award" text,
"Category" text,
"Nominee" text,
"Result" text
) | what was the nominee of best musical | SELECT "Nominee" FROM table_75509 WHERE "Category" = 'best musical' | wikisql |
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttim... | there is a microbiology test result for patient 96833 since 6 years ago? | SELECT COUNT(*) > 0 FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 96833) AND DATETIME(microbiologyevents.charttime) >= DATETIME(CURRENT_TIME(), '-6 year') | mimic_iii |
CREATE TABLE ReviewTaskStates (
Id number,
Name text,
Description text
)
CREATE TABLE PostNotices (
Id number,
PostId number,
PostNoticeTypeId number,
CreationDate time,
DeletionDate time,
ExpiryDate time,
Body text,
OwnerUserId number,
DeletionUserId number
)
CREATE TA... | Suggested edits which are possibly affected by rollback bug. | SELECT e.PostId AS "post_link" FROM SuggestedEdits AS e INNER JOIN PostHistory AS th ON e.PostId = th.PostId AND e.ApprovalDate = th.CreationDate LEFT OUTER JOIN PostHistory AS h ON e.PostId = h.PostId AND e.ApprovalDate = h.CreationDate AND e.OwnerUserId = h.UserId AND h.PostHistoryTypeId IN (4, 5) WHERE th.PostHistor... | sede |
CREATE TABLE table_48859 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text
) | What is Player, when To Par is +1, and when Score is 72-70-72=214? | SELECT "Player" FROM table_48859 WHERE "To par" = '+1' AND "Score" = '72-70-72=214' | wikisql |
CREATE TABLE table_42054 (
"Position" real,
"Team" text,
"Points" real,
"Played" real,
"Drawn" real,
"Lost" real,
"Against" real,
"Difference" text
) | What is the average against that has a drawn less than 7, points greater than 22, and 19 for the played? | SELECT AVG("Against") FROM table_42054 WHERE "Drawn" < '7' AND "Points" > '22' AND "Played" = '19' | wikisql |
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... | give me the number of patients whose primary disease is st-segment elevation myocardial infarction\cardiac cath and year of birth is less than 2043? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "ST-SEGMENT ELEVATION MYOCARDIAL INFARCTION\CARDIAC CATH" AND demographic.dob_year < "2043" | mimicsql_data |
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE cost (
row_i... | what is the two year survival rate of nb obsrv suspct infect patients? | SELECT SUM(CASE WHEN patients.dod IS NULL THEN 1 WHEN STRFTIME('%j', patients.dod) - STRFTIME('%j', t2.charttime) > 2 * 365 THEN 1 ELSE 0 END) * 100 / COUNT(*) FROM (SELECT t1.subject_id, t1.charttime FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id... | mimic_iii |
CREATE TABLE table_12983929_1 (
total_power VARCHAR,
construction_start VARCHAR,
commercial_operation VARCHAR
) | How many different values of total power are there for the unit whose construction started on 01.03.1977 and whose commercial operation started on 01.02.1984? | SELECT COUNT(total_power) FROM table_12983929_1 WHERE construction_start = "01.03.1977" AND commercial_operation = "01.02.1984" | sql_create_context |
CREATE TABLE table_22559 (
"Date" real,
"Single" text,
"Backed with" text,
"Record label" text,
"Format" text,
"Other details" text
) | What were the 'other details' (number released) for 'is my love will follow me'? | SELECT "Other details" FROM table_22559 WHERE "Single" = 'My Love Will Follow Me' | wikisql |
CREATE TABLE table_24432 (
"Year" text,
"Date" text,
"Driver" text,
"Team" text,
"Manufacturer" text,
"Laps" text,
"Miles (km)" text,
"Race Time" text,
"Average Speed (mph)" text,
"Report" text
) | Name the team for june 16 jeff gordon | SELECT "Team" FROM table_24432 WHERE "Date" = 'June 16' AND "Driver" = 'Jeff Gordon' | wikisql |
CREATE TABLE people (
people_id number,
name text,
height number,
weight number,
home town text
)
CREATE TABLE perpetrator (
perpetrator_id number,
people_id number,
date text,
year number,
location text,
country text,
killed number,
injured number
) | What are the countries that have at least two perpetrators? | SELECT country, COUNT(*) FROM perpetrator GROUP BY country HAVING COUNT(*) >= 2 | spider |
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_type text,
a... | until 2104, patient 7073 has received any procedure? | SELECT COUNT(*) > 0 FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 7073) AND STRFTIME('%y', procedures_icd.charttime) <= '2104' | mimic_iii |
CREATE TABLE table_71174 (
"Date" text,
"Tournament" text,
"Surface" text,
"Partner" text,
"Opponents" text,
"Score" text
) | What was the surface for the May 10, 2009 tournament? | SELECT "Surface" FROM table_71174 WHERE "Date" = 'may 10, 2009' | wikisql |
CREATE TABLE table_34806 (
"Date" text,
"Tournament" text,
"Winning score" text,
"Margin of victory" text,
"Runner-up" text
) | In which tournament was vijay singh a runner-up? | SELECT "Tournament" FROM table_34806 WHERE "Runner-up" = 'vijay singh' | wikisql |
CREATE TABLE table_33580 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | What is the smallest crowd when richmond is away? | SELECT MIN("Crowd") FROM table_33580 WHERE "Away team" = 'richmond' | wikisql |
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... | 哪些医生是编号12012612的团伙成员最常去看病的,依次排序是什么 | SELECT t_kc21.OUT_DIAG_DOC_CD, t_kc21.OUT_DIAG_DOC_NM FROM t_kc21 WHERE t_kc21.PERSON_ID = '12012612' GROUP BY t_kc21.OUT_DIAG_DOC_CD ORDER BY COUNT(*) DESC | css |
CREATE TABLE table_name_66 (
poles VARCHAR,
points VARCHAR
) | What is the total number of poles and 63 points? | SELECT COUNT(poles) FROM table_name_66 WHERE points = "63" | sql_create_context |
CREATE TABLE candidate (
Candidate_ID int,
People_ID int,
Poll_Source text,
Date text,
Support_rate real,
Consider_rate real,
Oppose_rate real,
Unsure_rate real
)
CREATE TABLE people (
People_ID int,
Sex text,
Name text,
Date_of_Birth text,
Height real,
Weight re... | Show me about the distribution of Sex and the sum of Height , and group by attribute Sex in a bar chart. | SELECT Sex, SUM(Height) FROM people GROUP BY Sex | nvbench |
CREATE TABLE table_45268 (
"Team" text,
"Outgoing manager" text,
"Manner of departure" text,
"Date of vacancy" text,
"Replaced by" text,
"Date of appointment" text,
"Position in table" text
) | Who was the manager that was positioned 11th in table and resigned in departure? | SELECT "Replaced by" FROM table_45268 WHERE "Position in table" = '11th' AND "Manner of departure" = 'resigned' | 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... | 医疗机构9550631从零七年二月二十六截止到二零年八月三号这个时间未就业人员就诊花费的医疗费超过了5252.43块的就诊记录数量 | SELECT COUNT(*) FROM gwyjzb WHERE gwyjzb.MED_SER_ORG_NO = '9550631' AND gwyjzb.IN_HOSP_DATE BETWEEN '2007-02-26' AND '2020-08-03' AND gwyjzb.INSURED_STS = '未就业' AND gwyjzb.MED_AMOUT >= 5252.43 UNION SELECT COUNT(*) FROM fgwyjzb WHERE fgwyjzb.MED_SER_ORG_NO = '9550631' AND fgwyjzb.IN_HOSP_DATE BETWEEN '2007-02-26' AND '... | css |
CREATE TABLE table_203_751 (
id number,
"year" number,
"title" text,
"peak chart positions\nus\nair" number,
"peak chart positions\nus\nmain" number,
"peak chart positions\nus\nmod" number,
"album" text
) | how many songs reached the us main charts ? | SELECT COUNT("peak chart positions\nus\nmain") FROM table_203_751 | squall |
CREATE TABLE table_70792 (
"Model" text,
"Specification" text,
"Build date" text,
"Total produced" real,
"Wheel arrangement" text,
"Prime mover" text,
"Power output" text
) | Which wheel arrangement had a Specification of dl-700? | SELECT "Wheel arrangement" FROM table_70792 WHERE "Specification" = 'dl-700' | wikisql |
CREATE TABLE table_name_19 (
lost VARCHAR,
start VARCHAR,
pens VARCHAR,
tries VARCHAR
) | What is the total losses for the player with fewer than 51 pens, 3 tries and 45 starts? | SELECT COUNT(lost) FROM table_name_19 WHERE pens < 51 AND tries = 3 AND start = 45 | 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 diagnoses icd9 code is 34590 and lab test abnormal status is abnormal? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.icd9_code = "34590" AND lab.flag = "abnormal" | mimicsql_data |
CREATE TABLE table_name_7 (
code VARCHAR,
capacity VARCHAR,
name VARCHAR
) | What is the code of 1.5 dci 110, which has a capacity of 1,461cc? | SELECT code FROM table_name_7 WHERE capacity = "1,461cc" AND name = "1.5 dci 110" | sql_create_context |
CREATE TABLE exhibition_record (
exhibition_id number,
date text,
attendance number
)
CREATE TABLE artist (
artist_id number,
name text,
country text,
year_join number,
age number
)
CREATE TABLE exhibition (
exhibition_id number,
year number,
theme text,
artist_id numbe... | Count the number of artists who are older than 46 and joined after 1990. | SELECT COUNT(*) FROM artist WHERE age > 46 AND year_join > 1990 | spider |
CREATE TABLE table_22453 (
"Candidate" text,
"Background" text,
"Original Team" text,
"Age" real,
"Hometown" text,
"Result" text
) | When austin, texas is the hometown what is the lowest age? | SELECT MIN("Age") FROM table_22453 WHERE "Hometown" = 'Austin, Texas' | wikisql |
CREATE TABLE table_name_58 (
d_43_√ VARCHAR,
d_42_√ VARCHAR
) | What is the value of D 43 when the value of D 42 is d 42 ? | SELECT d_43_√ FROM table_name_58 WHERE d_42_√ = "d 42 √" | sql_create_context |
CREATE TABLE course_tags_count (
course_id int,
clear_grading int,
pop_quiz int,
group_projects int,
inspirational int,
long_lectures int,
extra_credit int,
few_tests int,
good_feedback int,
tough_tests int,
heavy_papers int,
cares_for_students int,
heavy_assignments ... | Are there DANCE classes that meet any day other than Friday ? | SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester WHERE course_offering.friday = 'N' AND course.department = 'DANCE' AND semester.semester = 'WN' AND ... | advising |
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... | count the number of patients whose diagnosis short title is dmi neuro nt st uncntrld with a main drug type. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.short_title = "DMI neuro nt st uncntrld" AND prescriptions.drug_type = "MAIN" | mimicsql_data |
CREATE TABLE department (
Department_ID int,
Name text,
Creation text,
Ranking int,
Budget_in_Billions real,
Num_Employees real
)
CREATE TABLE head (
head_ID int,
name text,
born_state text,
age real
)
CREATE TABLE management (
department_ID int,
head_ID int,
tempor... | Show me mean age by born state in a histogram, and could you order from low to high by the bars please? | SELECT born_state, AVG(age) FROM head GROUP BY born_state ORDER BY born_state | nvbench |
CREATE TABLE participates_in (
stuid number,
actid number
)
CREATE TABLE activity (
actid number,
activity_name text
)
CREATE TABLE student (
stuid number,
lname text,
fname text,
age number,
sex text,
major number,
advisor number,
city_code text
)
CREATE TABLE faculty... | What are the rank, first name, and last name of the faculty members? | SELECT rank, fname, lname FROM faculty | spider |
CREATE TABLE teaches (
ID varchar(5),
course_id varchar(8),
sec_id varchar(8),
semester varchar(6),
year numeric(4,0)
)
CREATE TABLE department (
dept_name varchar(20),
building varchar(15),
budget numeric(12,2)
)
CREATE TABLE section (
course_id varchar(8),
sec_id varchar(8),
... | How many departments whose budget is more than the average budget in each building? Show me a bar chart, list by the total number in asc. | SELECT building, COUNT(building) FROM department WHERE budget > (SELECT AVG(budget) FROM department) GROUP BY building ORDER BY COUNT(building) | nvbench |
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefined boolean,
PostNoticeDurationId number
)
CREATE TABLE PostTags (
PostId number,
TagId number
)
CREATE TABLE PostNotices (
Id number,
PostId number,
PostNoticeTypeI... | select top 1 from Posts. | SELECT * FROM Posts WHERE AnswerCount = 0 ORDER BY CreationDate DESC LIMIT 10 | sede |
CREATE TABLE table_77922 (
"Team 1" text,
"Agg." text,
"Team 2" text,
"1st leg" text,
"2nd leg" text
) | What is the 1st leg where Team 1 is C.D. Plaza Amador? | SELECT "1st leg" FROM table_77922 WHERE "Team 1" = 'c.d. plaza amador' | wikisql |
CREATE TABLE t_kc22 (
MED_EXP_DET_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
MED_CLINIC_ID text,
MED_EXP_BILL_ID text,
SOC_SRT_DIRE_CD text,
SOC_SRT_DIRE_NM text,
DIRE_TYPE number,
CHA_ITEM_LEV number,
MED_INV_ITEM_TYPE text,
MED_DIRE_CD text,
MED_DIRE_NM text,... | 在医院0987112中根据入院诊断疾病编码不同疾病的平均病患的年龄是多少岁? | SELECT IN_DIAG_DIS_CD, AVG(PERSON_AGE) FROM t_kc21 WHERE MED_SER_ORG_NO = '0987112' GROUP BY IN_DIAG_DIS_CD | css |
CREATE TABLE table_9208 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Attendance" real
) | What is Opponent, when Week is '5'? | SELECT "Opponent" FROM table_9208 WHERE "Week" = '5' | wikisql |
CREATE TABLE table_1944 (
"Property" text,
"K-band" text,
"Ka-band" text,
"Q-band" text,
"V-band" text,
"W-band" text
) | When 2 is the k-band what is the v-band? | SELECT "V-band" FROM table_1944 WHERE "K-band" = '2' | wikisql |
CREATE TABLE event (
ID int,
Name text,
Stadium_ID int,
Year text
)
CREATE TABLE stadium (
ID int,
name text,
Capacity int,
City text,
Country text,
Opening_year int
)
CREATE TABLE record (
ID int,
Result text,
Swimmer_ID int,
Event_ID int
)
CREATE TABLE swimme... | Return a bar chart about the distribution of meter_400 and meter_100 , and show from low to high by the bar please. | SELECT meter_400, meter_100 FROM swimmer ORDER BY meter_400 | nvbench |
CREATE TABLE Subjects (
subject_id INTEGER,
subject_name VARCHAR(120)
)
CREATE TABLE Students (
student_id INTEGER,
date_of_registration DATETIME,
date_of_latest_logon DATETIME,
login_name VARCHAR(40),
password VARCHAR(10),
personal_name VARCHAR(40),
middle_name VARCHAR(40),
fam... | What are the number of the completion dates of all the tests that have result 'Fail'?, and sort y axis in desc order. | SELECT date_of_completion, COUNT(date_of_completion) FROM Student_Course_Enrolment AS T1 JOIN Student_Tests_Taken AS T2 ON T1.registration_id = T2.registration_id WHERE T2.test_result = "Fail" ORDER BY COUNT(date_of_completion) DESC | nvbench |
CREATE TABLE table_name_72 (
is_3_m1945 VARCHAR,
kv_1s_m1942 VARCHAR
) | What's the IS-3 when the KV-1S is 45? | SELECT is_3_m1945 FROM table_name_72 WHERE kv_1s_m1942 = "45" | sql_create_context |
CREATE TABLE table_48760 (
"Game" real,
"Date" text,
"Opponent" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location/Attendance" text,
"Record" text
) | What is the highest number of points of the game in Conseco fieldhouse 7,134? | SELECT "High points" FROM table_48760 WHERE "Location/Attendance" = 'conseco fieldhouse 7,134' | wikisql |
CREATE TABLE table_name_52 (
played INTEGER,
points VARCHAR,
bp VARCHAR
) | Played that has a Points of 38, and a B.P. larger than 5 has what sum? | SELECT SUM(played) FROM table_name_52 WHERE points = 38 AND bp > 5 | sql_create_context |
CREATE TABLE table_24919 (
"School" text,
"Location" text,
"Team Name" text,
"Colors" text,
"Varsity Teams" real,
"NJCAA Championships" real
) | If the varsity team is 6, what is the location? | SELECT "Location" FROM table_24919 WHERE "Varsity Teams" = '6' | wikisql |
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location t... | how many patients stayed at hospital for more than 4 days? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.days_stay > "4" | mimicsql_data |
CREATE TABLE table_52870 (
"Driver" text,
"Constructor" text,
"Laps" real,
"Time/Retired" text,
"Grid" real
) | How many laps for grid of 9? | SELECT "Laps" FROM table_52870 WHERE "Grid" = '9' | wikisql |
CREATE TABLE record (
ID int,
Result text,
Swimmer_ID int,
Event_ID int
)
CREATE TABLE event (
ID int,
Name text,
Stadium_ID int,
Year text
)
CREATE TABLE stadium (
ID int,
name text,
Capacity int,
City text,
Country text,
Opening_year int
)
CREATE TABLE swimme... | Bar chart x axis meter 600 y axis id | SELECT meter_600, ID FROM swimmer | nvbench |
CREATE TABLE table_41185 (
"Name" text,
"Novelty" text,
"Status" text,
"Authors" text,
"Unit" text,
"Location" text
) | What is the Status with a novelty of gen et sp, and the name is haplocanthosaurus? | SELECT "Status" FROM table_41185 WHERE "Novelty" = 'gen et sp' AND "Name" = 'haplocanthosaurus' | wikisql |
CREATE TABLE table_23916462_3 (
week INTEGER
) | What is the least value for week? | SELECT MIN(week) FROM table_23916462_3 | sql_create_context |
CREATE TABLE table_name_37 (
date VARCHAR,
final_score VARCHAR,
stadium VARCHAR
) | When was the game at Gillette Stadium that ended in a final score of 30-17? | SELECT date FROM table_name_37 WHERE final_score = "30-17" AND stadium = "gillette stadium" | sql_create_context |
CREATE TABLE table_7424 (
"Player" text,
"FG Pct" real,
"3FGM" real,
"3FGA" real,
"3FG Pct" real,
"FT Pct" real,
"Off Reb" real,
"Def Reb" real,
"Total Reb" real,
"Asst" real
) | What is the sum FG Pct of the player with more than 3 asst, a def reb of 30, and a 3FG Pct greater than 36.1? | SELECT SUM("FG Pct") FROM table_7424 WHERE "Asst" > '3' AND "Def Reb" = '30' AND "3FG Pct" > '36.1' | wikisql |
CREATE TABLE table_name_58 (
d_45 VARCHAR,
d_42 VARCHAR
) | I want the D 45 and D 42 of r 22 | SELECT d_45 FROM table_name_58 WHERE d_42 = "r 22" | sql_create_context |
CREATE TABLE table_name_24 (
attendance INTEGER,
season VARCHAR,
games VARCHAR,
w_l_t VARCHAR
) | How much Attendance has Games smaller than 6, and a W-L-T of 3-2-0, and a Season smaller than 1948? | SELECT SUM(attendance) FROM table_name_24 WHERE games < 6 AND w_l_t = "3-2-0" AND season < 1948 | sql_create_context |
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,
TargetRepChange number
)
CREATE TABLE PostFeedback (
Id number,
PostId number,
IsAnonymous boolean,
VoteTypeId number,
CreationD... | Posts using the ambiguous [unit] tag. Posts tagged [unit] but not tagged [unit-testing] or [testing] | SELECT Posts.Id, Posts.Title, Posts.Tags FROM Posts WHERE Posts.Tags LIKE '%<unit>%' AND NOT Posts.Tags LIKE '%<testing>%' AND NOT Posts.Tags LIKE '%<unit-testing>%' | sede |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
... | how many patients whose diagnoses long title is pressure ulcer, hip and drug route is iv bolus? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.long_title = "Pressure ulcer, hip" AND prescriptions.route = "IV BOLUS" | mimicsql_data |
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,... | what is AS | SELECT DISTINCT airline_code FROM airline WHERE airline_code = 'AS' | atis |
CREATE TABLE table_name_80 (
tournament VARCHAR
) | What is the result from 2003 from the US Open? | SELECT 2003 FROM table_name_80 WHERE tournament = "us open" | sql_create_context |
CREATE TABLE table_34230 (
"Player" text,
"Rec." real,
"Yards" real,
"Avg." real,
"Long" real
) | How many yards did Davin Meggett have with more than 9 Rec.? | SELECT SUM("Yards") FROM table_34230 WHERE "Player" = 'davin meggett' AND "Rec." > '9' | wikisql |
CREATE TABLE table_name_10 (
record VARCHAR,
opponent VARCHAR,
date VARCHAR
) | Which Record has an Opponent of twins, and a Date of july 25? | SELECT record FROM table_name_10 WHERE opponent = "twins" AND date = "july 25" | sql_create_context |
CREATE TABLE table_name_52 (
wins INTEGER,
top_25 VARCHAR,
cuts_made VARCHAR
) | What is the smallest number of wins for a top-25 value greater than 5 and more than 38 cuts? | SELECT MIN(wins) FROM table_name_52 WHERE top_25 > 5 AND cuts_made > 38 | sql_create_context |
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,
TargetRepChange number
)
CREATE TABLE TagSynonyms (
Id number,
SourceTagName text,
TargetTagName text,
CreationDate time,
OwnerU... | Top Viewed Game Dev Questions. | SELECT Title, Tags, ViewCount FROM Posts WHERE ViewCount > 1000 ORDER BY ViewCount DESC | sede |
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE treatment (
treatmenti... | let's count the number of times patient 006-133605 has had a volume (ml)-sodium bicarbonate in d5w premix 150 meq/1000 ml intake on the current hospital encounter. | SELECT COUNT(*) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-133605' AND patient.hospitaldischargetime IS NULL)) AND intakeoutput.c... | eicu |
CREATE TABLE table_14507 (
"Rank" real,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) | Gold of 0, and a Silver smaller than 3, and a Rank larger than 9, and a Total of 1 has how many numbers of bronze? | SELECT COUNT("Bronze") FROM table_14507 WHERE "Gold" = '0' AND "Silver" < '3' AND "Rank" > '9' AND "Total" = '1' | wikisql |
CREATE TABLE people (
People_ID int,
Name text,
Country text,
Is_Male text,
Age int
)
CREATE TABLE wedding (
Church_ID int,
Male_ID int,
Female_ID int,
Year int
)
CREATE TABLE church (
Church_ID int,
Name text,
Organized_by text,
Open_Date int,
Continuation_of t... | Show the number of opening years for three churches that opened most recently in a bar chart. Bin the year into the weekday interval. | SELECT Open_Date, COUNT(Open_Date) FROM church ORDER BY Open_Date DESC LIMIT 3 | nvbench |
CREATE TABLE table_27816698_2 (
founded INTEGER,
nickname VARCHAR
) | When was the Titans founded? | SELECT MAX(founded) FROM table_27816698_2 WHERE nickname = "Titans" | 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 is the unabbreviated version of the open wound of scalp? | SELECT d_icd_diagnoses.long_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'open wound of scalp' UNION SELECT d_icd_procedures.long_title FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'open wound of scalp' | mimic_iii |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.