context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE table_name_62 (
shoots VARCHAR,
player VARCHAR
) | What shows for shoots for craig peacock a? | SELECT shoots FROM table_name_62 WHERE player = "craig peacock a" | sql_create_context |
CREATE TABLE table_32178 (
"Date" text,
"Result" text,
"Score" text,
"Stadium" text,
"City" text,
"Crowd" real
) | What was the date of game with a score of 42-6? | SELECT "Date" FROM table_32178 WHERE "Score" = '42-6' | wikisql |
CREATE TABLE table_name_62 (
social_sec_leeds VARCHAR,
media_officer VARCHAR,
treasurer VARCHAR
) | What kind of Social Sec Leeds has a Media Officer of jason james and a Treasurer of james davidson? | SELECT social_sec_leeds FROM table_name_62 WHERE media_officer = "jason james" AND treasurer = "james davidson" | sql_create_context |
CREATE TABLE table_28803803_1 (
date VARCHAR,
name VARCHAR
) | What are the dates that Falling Angel aired? | SELECT date FROM table_28803803_1 WHERE name = "Falling Angel" | 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... | give me the number of patients whose year of birth is less than 2182 and procedure short title is coronar arteriogr-1 cath? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.dob_year < "2182" AND procedures.short_title = "Coronar arteriogr-1 cath" | mimicsql_data |
CREATE TABLE Course_Authors_and_Tutors (
author_id INTEGER,
author_tutor_ATB VARCHAR(3),
login_name VARCHAR(40),
password VARCHAR(40),
personal_name VARCHAR(80),
middle_name VARCHAR(80),
family_name VARCHAR(80),
gender_mf VARCHAR(1),
address_line_1 VARCHAR(80)
)
CREATE TABLE Courses... | How many completion students in each day? Return a line chart grouping by date of completion, and order by the X-axis in descending please. | SELECT date_of_completion, COUNT(date_of_completion) FROM Student_Course_Enrolment GROUP BY date_of_completion ORDER BY date_of_completion DESC | nvbench |
CREATE TABLE claims (
Effective_Date VARCHAR,
claim_id VARCHAR
)
CREATE TABLE settlements (
claim_id VARCHAR,
settlement_amount INTEGER
) | What is the effective date of the claim that has the largest amount of total settlement? | SELECT t1.Effective_Date FROM claims AS t1 JOIN settlements AS t2 ON t1.claim_id = t2.claim_id GROUP BY t1.claim_id ORDER BY SUM(t2.settlement_amount) DESC LIMIT 1 | sql_create_context |
CREATE TABLE d_icd_procedures (
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 ti... | retrieve the patient ids who are diagnosed with nonrupt cerebral aneurym since 2105. | SELECT admissions.subject_id FROM admissions WHERE admissions.hadm_id IN (SELECT diagnoses_icd.hadm_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 = 'nonrupt cerebral aneurym') AND STRFTIME('%y', diagnoses_icd.charttime) >= ... | mimic_iii |
CREATE TABLE table_13089 (
"Municipality" text,
"Inhabitants" real,
"Mayor" text,
"Party" text,
"Election" real
) | Which inhabitants have 2009 as the election, with cremona as the municipality? | SELECT "Inhabitants" FROM table_13089 WHERE "Election" = '2009' AND "Municipality" = 'cremona' | wikisql |
CREATE TABLE semester (
semester_id int,
semester varchar,
year int
)
CREATE TABLE comment_instructor (
instructor_id int,
student_id int,
score int,
comment_text varchar
)
CREATE TABLE jobs (
job_id int,
job_title varchar,
description varchar,
requirement varchar,
city... | Can you identify the GSIs from last semester for DENTED 605 ? | SELECT DISTINCT student.firstname, student.lastname FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN gsi ON gsi.course_offering_id = course_offering.offering_id INNER JOIN student ON student.student_id = gsi.student_id INNER JOIN semester ON semester.semester_id = course... | advising |
CREATE TABLE table_name_94 (
round VARCHAR,
player VARCHAR
) | What round did Matt Clark play? | SELECT round FROM table_name_94 WHERE player = "matt clark" | sql_create_context |
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... | Is MATH 185 available as a Summer class in 2004 ? | SELECT COUNT(*) > 0 FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND course.department = 'MATH' AND course.number = 185 AND semester.semester = 'Summer' AND semester.semester_id = course_offering.semester AND semester.year = 2004 | advising |
CREATE TABLE Apartment_Facilities (
apt_id INTEGER,
facility_code CHAR(15)
)
CREATE TABLE Apartments (
apt_id INTEGER,
building_id INTEGER,
apt_type_code CHAR(15),
apt_number CHAR(10),
bathroom_count INTEGER,
bedroom_count INTEGER,
room_count CHAR(5)
)
CREATE TABLE Guests (
gue... | Show the facility codes of apartments with more than 4 bedrooms, and count them by a bar chart, display by the Y-axis from high to low. | SELECT facility_code, COUNT(facility_code) FROM Apartment_Facilities AS T1 JOIN Apartments AS T2 ON T1.apt_id = T2.apt_id WHERE T2.bedroom_count > 4 GROUP BY facility_code ORDER BY COUNT(facility_code) DESC | nvbench |
CREATE TABLE table_19808 (
"#" real,
"Episode" text,
"Writer" text,
"Director" text,
"Original air date" text,
"Viewing figure" text
) | Which numerical entry corresponds to 'Episode 9'? | SELECT COUNT("#") FROM table_19808 WHERE "Episode" = 'Episode 9' | wikisql |
CREATE TABLE party_events (
event_id number,
event_name text,
party_id number,
member_in_charge_id number
)
CREATE TABLE party (
party_id number,
minister text,
took_office text,
left_office text,
region_id number,
party_name text
)
CREATE TABLE region (
region_id number,
... | Show the minister who took office after 1961 or before 1959. | SELECT minister FROM party WHERE took_office > 1961 OR took_office < 1959 | spider |
CREATE TABLE table_204_334 (
id number,
"opposition" text,
"matches" number,
"won" number,
"drawn" number,
"lost" number,
"for" number,
"against" number,
"win%" text
) | how many teams did the comets win 2 matches against ? | SELECT COUNT("opposition") FROM table_204_334 WHERE "won" = 2 | squall |
CREATE TABLE table_name_62 (
city___state VARCHAR,
series VARCHAR
) | In what City/State did the ATCC Round 4 series take place? | SELECT city___state FROM table_name_62 WHERE series = "atcc round 4" | sql_create_context |
CREATE TABLE Customer_Address_History (
customer_id INTEGER,
address_id INTEGER,
date_from DATETIME,
date_to DATETIME
)
CREATE TABLE Order_Items (
order_item_id INTEGER,
order_id INTEGER,
product_id INTEGER,
order_quantity VARCHAR(80)
)
CREATE TABLE Contacts (
contact_id INTEGER,
... | Show the product name and total order quantity for each product. Show bar chart. | SELECT T1.product_name, AVG(SUM(T2.order_quantity)) FROM Products AS T1 JOIN Order_Items AS T2 ON T1.product_id = T2.product_id GROUP BY T1.product_name | nvbench |
CREATE TABLE table_60828 (
"Position" real,
"Team" text,
"Played" real,
"Drawn" real,
"Lost" real,
"Goals For" real,
"Goals Against" real,
"Goal Difference" text,
"Points 1" real
) | How much Played has a Position of 7, and a Drawn smaller than 7? | SELECT SUM("Played") FROM table_60828 WHERE "Position" = '7' AND "Drawn" < '7' | wikisql |
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid... | what are the ways to consume guaifenesin? | SELECT DISTINCT prescriptions.route FROM prescriptions WHERE prescriptions.drug = 'guaifenesin' | mimic_iii |
CREATE TABLE table_name_67 (
gran_hamada VARCHAR,
block_a VARCHAR
) | Which Gran Hamada has a Block A of tatsuhito takaiwa? | SELECT gran_hamada FROM table_name_67 WHERE block_a = "tatsuhito takaiwa" | sql_create_context |
CREATE TABLE domain_conference (
cid int,
did int
)
CREATE TABLE cite (
cited int,
citing int
)
CREATE TABLE domain_keyword (
did int,
kid int
)
CREATE TABLE domain_publication (
did int,
pid int
)
CREATE TABLE domain_author (
aid int,
did int
)
CREATE TABLE domain (
did... | return me the number of papers in VLDB conference in ' University of Michigan ' . | SELECT COUNT(DISTINCT (publication.title)) FROM author, conference, organization, publication, writes WHERE conference.name = 'VLDB' AND organization.name = 'University of Michigan' AND organization.oid = author.oid AND publication.cid = conference.cid AND writes.aid = author.aid AND writes.pid = publication.pid | academic |
CREATE TABLE route (
train_id int,
station_id int
)
CREATE TABLE train (
id int,
train_number int,
name text,
origin text,
destination text,
time text,
interval text
)
CREATE TABLE weekly_weather (
station_id int,
day_of_week text,
high_temperature int,
low_temperat... | A bar graph listing the local authorities and how many local authorities provided by all stations, could you display X from high to low order? | SELECT local_authority, COUNT(local_authority) FROM station GROUP BY local_authority ORDER BY local_authority DESC | nvbench |
CREATE TABLE table_61462 (
"Player" text,
"Country" text,
"Year(s) won" text,
"Total" real,
"To par" text,
"Finish" text
) | Where did the player who won in 1991 finish? | SELECT "Finish" FROM table_61462 WHERE "Year(s) won" = '1991' | wikisql |
CREATE TABLE table_name_31 (
weight VARCHAR,
number VARCHAR
) | How much does number 26 weigh? | SELECT weight FROM table_name_31 WHERE number = "26" | sql_create_context |
CREATE TABLE table_41853 (
"Team" text,
"Match" real,
"Points" real,
"Draw" real,
"Lost" real
) | Which team has 10 losses? | SELECT "Team" FROM table_41853 WHERE "Lost" = '10' | wikisql |
CREATE TABLE table_48303 (
"Rank" real,
"Company" text,
"Headquarters" text,
"Industry" text,
"Sales (billion $)" real,
"Profits (billion $)" real,
"Assets (billion $)" real,
"Market Value (billion $)" real
) | What is the highest market value in billions of the company with profits of 20.96 billions and 166.99 billions in assets? | SELECT MAX("Market Value (billion $)") FROM table_48303 WHERE "Profits (billion $)" = '20.96' AND "Assets (billion $)" > '166.99' | wikisql |
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE medication (
medication... | when was the last time patient 027-165214 had the minimum systemicdiastolic on the current intensive care unit visit. | SELECT vitalperiodic.observationtime FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '027-165214') AND patient.unitdischargetime IS NULL)... | eicu |
CREATE TABLE table_25595209_1 (
loa__metres_ VARCHAR,
yacht VARCHAR
) | What is the LOA of Brindabella? | SELECT loa__metres_ FROM table_25595209_1 WHERE yacht = "Brindabella" | sql_create_context |
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,
... | 沈雅懿患者的检验报告单对应的检验结果指标均异常都是哪些?列出对应的检验报告单号都是啥? | SELECT jybgb.BGDH FROM hz_info JOIN mzjzjlb JOIN jybgb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE hz_info.person_info_XM = '沈雅懿' AND NOT jybgb.BGDH IN (SELECT jyjgzbb.BGDH FROM jyjgz... | css |
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_... | what are the top three most common specimen tests performed since 2 years ago? | SELECT t1.spec_type_desc FROM (SELECT microbiologyevents.spec_type_desc, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM microbiologyevents WHERE DATETIME(microbiologyevents.charttime) >= DATETIME(CURRENT_TIME(), '-2 year') GROUP BY microbiologyevents.spec_type_desc) AS t1 WHERE t1.c1 <= 3 | mimic_iii |
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 procedures_icd (
... | had patient 3273 excreted urine out ureteral stent #1 when they came to the hospital last time? | SELECT COUNT(*) > 0 FROM outputevents WHERE outputevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 3273 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime DESC LIMIT 1)) AND outputevents.item... | mimic_iii |
CREATE TABLE table_29292 (
"Season" text,
"Coach" text,
"Conf. Record" text,
"Overall" text,
"Standings" text,
"Postseason" text
) | In what season was the conference record for the Pandas 15-1-1? | SELECT "Season" FROM table_29292 WHERE "Conf. Record" = '15-1-1' | 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,... | 因疾病I35.324住院在乳腺肿瘤这个科室记录有多少平均费用,时间在二零零七年五月十一日至二零一二年六月一日 | SELECT AVG(MED_AMOUT) FROM t_kc21 WHERE MED_ORG_DEPT_NM = '乳腺肿瘤科' AND IN_HOSP_DATE BETWEEN '2007-05-11' AND '2012-06-01' AND IN_DIAG_DIS_CD = 'I35.324' AND CLINIC_TYPE = '住院' | css |
CREATE TABLE table_60842 (
"Constituency number" real,
"Name" text,
"Reserved for ( SC / ST /None)" text,
"District" text,
"Electorates (2011)" real
) | What district has abhayapuri south as the name? | SELECT "District" FROM table_60842 WHERE "Name" = 'abhayapuri south' | wikisql |
CREATE TABLE table_7771 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text
) | What was Tom Kite's to par? | SELECT "To par" FROM table_7771 WHERE "Player" = 'tom kite' | wikisql |
CREATE TABLE table_name_94 (
rank INTEGER,
country VARCHAR,
total VARCHAR
) | Which Rank is the Country of soviet union with a Total smaller than 19? | SELECT MIN(rank) FROM table_name_94 WHERE country = "soviet union" AND total < 19 | sql_create_context |
CREATE TABLE table_25277262_2 (
directed_by VARCHAR,
no_in_season VARCHAR
) | How many people directed episode 3 in the season? | SELECT COUNT(directed_by) FROM table_25277262_2 WHERE no_in_season = 3 | sql_create_context |
CREATE TABLE table_dev_20 (
"id" int,
"anemia" bool,
"gender" string,
"systolic_blood_pressure_sbp" int,
"hemoglobin_a1c_hba1c" float,
"platelets" int,
"dyslipidemia" bool,
"renal_disease" bool,
"creatinine_clearance_cl" float,
"neutropenia" int,
"estimated_glomerular_filtrat... | baseline hgb below the lower limits of normal at the local laboratory; lymphopenia ( < 1000 / l ) , neutropenia ( < 1500 / l ) , or thrombocytopenia ( platelets < 100000 / l ) . | SELECT * FROM table_dev_20 WHERE lymphopenia < 1000 AND neutropenia < 1500 OR thrombocytopenia = 1 OR platelets < 100000 | criteria2sql |
CREATE TABLE table_203_408 (
id number,
"rd." number,
"grand prix" text,
"date" text,
"location" text,
"pole position" text,
"fastest lap" text,
"winning driver" text,
"constructor" text,
"report" text
) | who was the winning driver after nigel mansell ? | SELECT "winning driver" FROM table_203_408 WHERE "rd." > (SELECT "rd." FROM table_203_408 WHERE "winning driver" = 'nigel mansell') ORDER BY "rd." LIMIT 1 | squall |
CREATE TABLE table_name_11 (
type VARCHAR,
model VARCHAR
) | What type of car has the model 6cm? | SELECT type FROM table_name_11 WHERE model = "6cm" | sql_create_context |
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
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... | what was the last ward identification for patient 49036 since 4 years ago? | SELECT transfers.wardid FROM transfers WHERE transfers.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 49036) AND NOT transfers.wardid IS NULL AND DATETIME(transfers.intime) >= DATETIME(CURRENT_TIME(), '-4 year') ORDER BY transfers.intime DESC LIMIT 1 | mimic_iii |
CREATE TABLE table_name_98 (
score VARCHAR,
country VARCHAR
) | What is the player from England's score? | SELECT score FROM table_name_98 WHERE country = "england" | sql_create_context |
CREATE TABLE table_2140071_8 (
episode INTEGER,
premier_date VARCHAR
) | Which Maximum episode premiered March 8, 2008? | SELECT MAX(episode) FROM table_2140071_8 WHERE premier_date = "March 8, 2008" | sql_create_context |
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 procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
... | How many patients are born before 2197 and with procedure icd9 code 309? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.dob_year < "2197" AND procedures.icd9_code = "309" | mimicsql_data |
CREATE TABLE table_name_32 (
acceleration_0_100km_h VARCHAR,
name VARCHAR
) | What is the acceleration 1-100km/h when the name is 1.5 dci? | SELECT acceleration_0_100km_h FROM table_name_32 WHERE name = "1.5 dci" | sql_create_context |
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... | give me the number of patients whose primary disease is transient ischemic attack and days of hospital stay is greater than 4? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "TRANSIENT ISCHEMIC ATTACK" AND demographic.days_stay > "4" | mimicsql_data |
CREATE TABLE table_name_5 (
away VARCHAR,
date VARCHAR
) | Which away game was played on 2008-07-18? | SELECT away FROM table_name_5 WHERE date = "2008-07-18" | sql_create_context |
CREATE TABLE table_17319931_1 (
team VARCHAR,
driver VARCHAR
) | What is the team whose driver Jeff Simmons? | SELECT team FROM table_17319931_1 WHERE driver = "Jeff Simmons" | sql_create_context |
CREATE TABLE table_20986710_1 (
score_in_final VARCHAR,
runner_up VARCHAR
) | What was the final score when tracy austin was runner up? | SELECT score_in_final FROM table_20986710_1 WHERE runner_up = "Tracy Austin" | sql_create_context |
CREATE TABLE table_name_61 (
nba_draft VARCHAR,
player VARCHAR
) | Which NBA Draft had Labradford Smith? | SELECT nba_draft FROM table_name_61 WHERE player = "labradford smith" | sql_create_context |
CREATE TABLE table_24015 (
"Player" text,
"Played" real,
"Legs Won" real,
"Legs Lost" real,
"LWAT" real,
"100+" real,
"140+" real,
"180s" real,
"High Checkout" real,
"3-dart Average" text
) | Which player has a 92.58 3-dart average? | SELECT "Player" FROM table_24015 WHERE "3-dart Average" = '92.58' | wikisql |
CREATE TABLE table_name_95 (
conference_joined VARCHAR,
previous_conference VARCHAR,
mascot VARCHAR
) | Which Conference Joined has a Previous Conference of northwestern, and a Mascot of oilers? | SELECT conference_joined FROM table_name_95 WHERE previous_conference = "northwestern" AND mascot = "oilers" | sql_create_context |
CREATE TABLE schedule (
Cinema_ID int,
Film_ID int,
Date text,
Show_times_per_day int,
Price float
)
CREATE TABLE cinema (
Cinema_ID int,
Name text,
Openning_year int,
Capacity int,
Location text
)
CREATE TABLE film (
Film_ID int,
Rank_in_series int,
Number_in_seaso... | Give me the title and highest price for each film Show bar chart, list from low to high by the Y. | SELECT Title, MAX(T1.Price) FROM schedule AS T1 JOIN film AS T2 ON T1.Film_ID = T2.Film_ID GROUP BY Title ORDER BY MAX(T1.Price) | nvbench |
CREATE TABLE table_17204 (
"Round" real,
"Overall" text,
"Player" text,
"Position" text,
"Nationality" text,
"Club team" text
) | What club team did JArrod Maidens play for? | SELECT "Club team" FROM table_17204 WHERE "Player" = 'Jarrod Maidens' | wikisql |
CREATE TABLE table_15829930_5 (
matches INTEGER,
year VARCHAR
) | Name the least matches for year 2008 | SELECT MIN(matches) FROM table_15829930_5 WHERE year = 2008 | 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... | Show me about the distribution of All_Road and Team_ID in a bar chart, display by the y-axis in ascending. | SELECT All_Road, Team_ID FROM basketball_match ORDER BY Team_ID | nvbench |
CREATE TABLE table_15441 (
"Riding" text,
"Province" text,
"Candidate" text,
"Votes" real,
"Placement" text
) | What is the Placement when the Candidate is Jean-Patrick Berthiaume? | SELECT "Placement" FROM table_15441 WHERE "Candidate" = 'jean-patrick berthiaume' | wikisql |
CREATE TABLE ReviewTasks (
Id number,
ReviewTaskTypeId number,
CreationDate time,
DeletionDate time,
ReviewTaskStateId number,
PostId number,
SuggestedEditId number,
CompletedByReviewTaskId number
)
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Bod... | Questions I have answered where asker has accepted another answer. Lists all questions I have proposed an answer to, and, sadly, the original asker accepted a different answer. | SELECT p.Id AS "post_link", a.Score, a.CreationDate FROM Posts AS a, Posts AS p WHERE a.OwnerUserId = '##UserId##' AND a.PostTypeId = 2 AND p.Id = a.ParentId AND p.AcceptedAnswerId != a.Id ORDER BY a.Score, a.CreationDate | sede |
CREATE TABLE table_777 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Result" text,
"Candidates" text
) | How many winners were there in the race of 1922 | SELECT COUNT("Incumbent") FROM table_777 WHERE "First elected" = '1922' | wikisql |
CREATE TABLE table_15431251_1 (
title VARCHAR,
no_in_season VARCHAR
) | What is the title for episode number 7 in the season? | SELECT COUNT(title) FROM table_15431251_1 WHERE no_in_season = 7 | sql_create_context |
CREATE TABLE table_72981 (
"Outcome" text,
"Edition" real,
"Round" text,
"Opponent Team" text,
"Surface" text,
"Opponent" text,
"Score" text
) | What was the score when the opponent was Dominika Cibulkov ? | SELECT "Score" FROM table_72981 WHERE "Opponent" = 'Dominika Cibulková' | wikisql |
CREATE TABLE table_4876 (
"Place" real,
"Team" text,
"Points" real,
"Played" real,
"Drawn" real,
"Lost" real,
"Goals For" real,
"Goals Against" real
) | How many goals scored against the opposing team occurred with more than 7 losses, less than 27 goals scored for the team and drawn more than 1? | SELECT COUNT("Goals Against") FROM table_4876 WHERE "Lost" > '7' AND "Goals For" < '27' AND "Drawn" > '1' | wikisql |
CREATE TABLE table_8435 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text
) | What is the score for Billy Andrade? | SELECT "Score" FROM table_8435 WHERE "Player" = 'billy andrade' | wikisql |
CREATE TABLE table_70544 (
"Production year" text,
"2001" real,
"2002" real,
"2003" real,
"2004" real,
"2005" real,
"2006" real,
"2007" real,
"2008" real,
"2009" real,
"2010" real,
"2011" real
) | What is the average 2002 value for Sunflower, which had a 2010 value less than 5587 and a 2007 value greater than 546? | SELECT AVG("2002") FROM table_70544 WHERE "2010" < '5587' AND "Production year" = 'sunflower' AND "2007" > '546' | 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... | 在医院3990035中,根据出院诊断疾病名称不同疾病的平均病人年龄是多少,列一下 | SELECT gwyjzb.OUT_DIAG_DIS_NM, AVG(gwyjzb.PERSON_AGE) FROM gwyjzb WHERE gwyjzb.MED_SER_ORG_NO = '3990035' GROUP BY gwyjzb.OUT_DIAG_DIS_NM UNION SELECT fgwyjzb.OUT_DIAG_DIS_NM, AVG(fgwyjzb.PERSON_AGE) FROM fgwyjzb WHERE fgwyjzb.MED_SER_ORG_NO = '3990035' GROUP BY fgwyjzb.OUT_DIAG_DIS_NM | css |
CREATE TABLE table_27700530_15 (
high_points VARCHAR,
date VARCHAR
) | Who had the most points and how many did they have on April 22? | SELECT high_points FROM table_27700530_15 WHERE date = "April 22" | sql_create_context |
CREATE TABLE table_203_777 (
id number,
"years" text,
"building" text,
"city" text,
"height (ctbuh)" text,
"floors" number
) | which building held the record before the current holder ? | SELECT "building" FROM table_203_777 WHERE "years" < present_ref ORDER BY "years" DESC LIMIT 1 | squall |
CREATE TABLE table_name_1 (
attendance INTEGER,
date VARCHAR
) | What is the attendance of the game on July 26? | SELECT SUM(attendance) FROM table_name_1 WHERE date = "july 26" | sql_create_context |
CREATE TABLE table_name_26 (
site VARCHAR,
game VARCHAR
) | Name the site for game of game 2 | SELECT site FROM table_name_26 WHERE game = "game 2" | sql_create_context |
CREATE TABLE table_dev_42 (
"id" int,
"gender" string,
"depression" bool,
"familial_hypercholesterolemia" bool,
"microalbuminuria" int,
"renal_disease" bool,
"diabetic" string,
"estimated_glomerular_filtration_rate_egfr" int,
"serum_creatinine" float,
"fbg" int,
"body_mass_in... | microalbuminuria up to 300 mg / 24 hours is acceptable if serum creatinine is < 1.4 for female , < 1.5 for male and estimated gfr ( egfr ) is > 60 ) | SELECT * FROM table_dev_42 WHERE microalbuminuria <= 300 OR ((gender = 'male' AND serum_creatinine < 1.5) OR (gender = 'female' AND serum_creatinine < 1.4)) AND estimated_glomerular_filtration_rate_egfr > 60 | criteria2sql |
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 (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE d_icd_procedures (
row_id number,
icd9_c... | during the previous year, what were the top three most frequently ordered lab tests for patients during the same month after the diagnosis of accid in resident instit? | 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, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.i... | mimic_iii |
CREATE TABLE table_204_302 (
id number,
"rank" number,
"nation" text,
"gold" number,
"silver" number,
"bronze" number,
"total" number
) | how many total medals did brazil received ? | SELECT "total" FROM table_204_302 WHERE "nation" = 'brazil' | squall |
CREATE TABLE table_name_67 (
play VARCHAR,
author VARCHAR,
base VARCHAR
) | What play has a base of Athens and was written by Aeschylus? | SELECT play FROM table_name_67 WHERE author = "aeschylus" AND base = "athens" | sql_create_context |
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId number,
UserId number,
CreationDate time,
BountyAmount number
)
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationDate time,
CloseReasonTypeId number,
CloseAsOffTopicReasonTypeId num... | Got most down to non-CW answers. | SELECT DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS Rank, Posts.OwnerUserId AS "user_link", Posts.OwnerUserId AS UserId, COUNT(*) AS Count FROM Posts, Votes WHERE Posts.Id = Votes.PostId AND Votes.VoteTypeId = 3 AND Posts.PostTypeId = 2 AND Posts.CommunityOwnedDate IS NULL AND Posts.OwnerUserId > 0 GROUP BY Posts.Owne... | sede |
CREATE TABLE wedding (
church_id number,
male_id number,
female_id number,
year number
)
CREATE TABLE people (
people_id number,
name text,
country text,
is_male text,
age number
)
CREATE TABLE church (
church_id number,
name text,
organized_by text,
open_date numbe... | List all church names in descending order of opening date. | SELECT name FROM church ORDER BY open_date DESC | spider |
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... | 查查D2聚体(肝素/EDTA)数值的平均值以及最值,是针对门诊诊断为强迫性障碍的患者的 | SELECT AVG(jyjgzbb.JCZBJGDL), MIN(jyjgzbb.JCZBJGDL), MAX(jyjgzbb.JCZBJGDL) FROM mzjzjlb JOIN jyjgzbb ON mzjzjlb.YLJGDM = jyjgzbb.jybgb_YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jyjgzbb.jybgb_JZLSH_MZJZJLB WHERE mzjzjlb.JZZDSM = '强迫性障碍' AND jyjgzbb.JCZBMC = 'D2聚体(肝素/EDTA)' | css |
CREATE TABLE table_name_10 (
attendance INTEGER,
week INTEGER
) | What is the average attendance after week 16? | SELECT AVG(attendance) FROM table_name_10 WHERE week > 16 | sql_create_context |
CREATE TABLE injury_accident (
game_id VARCHAR,
injury VARCHAR
)
CREATE TABLE stadium (
name VARCHAR,
id VARCHAR
)
CREATE TABLE game (
season VARCHAR,
stadium_id VARCHAR,
id VARCHAR
) | In which season and which stadium did any player have an injury of 'Foot injury' or 'Knee problem'? | SELECT T1.season, T2.name FROM game AS T1 JOIN stadium AS T2 ON T1.stadium_id = T2.id JOIN injury_accident AS T3 ON T1.id = T3.game_id WHERE T3.injury = 'Foot injury' OR T3.injury = 'Knee problem' | sql_create_context |
CREATE TABLE table_61959 (
"President" text,
"Treasurer" text,
"Secretary" text,
"Social AO" text,
"Academic AO" text,
"Internal CO" text,
"External CO" text
) | What Secretary has an Internal CO of isabel voets? | SELECT "Secretary" FROM table_61959 WHERE "Internal CO" = 'isabel voets' | 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 discharge location is long term care hospital and procedure long title is incision of vessel, lower limb arteries? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.discharge_location = "LONG TERM CARE HOSPITAL" AND procedures.long_title = "Incision of vessel, lower limb arteries" | mimicsql_data |
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id nu... | how much does it cost for the hospital stay of patient 29540? | SELECT SUM(cost.cost) FROM cost WHERE cost.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 29540) | mimic_iii |
CREATE TABLE ref_budget_codes (
budget_type_code text,
budget_type_description text
)
CREATE TABLE accounts (
account_id number,
statement_id number,
account_details text
)
CREATE TABLE ref_document_types (
document_type_code text,
document_type_name text,
document_type_description tex... | Give the ids of documents with expenses that have the budget code 'SF'. | SELECT document_id FROM documents_with_expenses WHERE budget_type_code = 'SF' | spider |
CREATE TABLE Skills_Required_To_Fix (
skill_id VARCHAR
)
CREATE TABLE Skills (
skill_id VARCHAR,
skill_description VARCHAR
) | Which skill is used in fixing the most number of faults? List the skill id and description. | SELECT T1.skill_id, T1.skill_description FROM Skills AS T1 JOIN Skills_Required_To_Fix AS T2 ON T1.skill_id = T2.skill_id GROUP BY T1.skill_id ORDER BY COUNT(*) DESC LIMIT 1 | sql_create_context |
CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId number
)
CREATE TABLE Comments (
Id number,
PostId number,
Score number,
Text text,
CreationDate time,
UserDisplayName text,
UserId number,
ContentLicense text
)
CREATE TABLE Posts ... | Top users under 18 by Reputation. | SELECT Id, DisplayName, Age, Reputation, CreationDate, LastAccessDate, 'http://stackoverflow.com/users/' + CAST(Id AS TEXT) AS Url FROM Users AS b WHERE (b.Age <= 18) ORDER BY b.Reputation, b.Age | sede |
CREATE TABLE PostsWithDeleted (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body text,
OwnerUserId number,
OwnerDisplayName text,
LastEditorUserId number,
LastEditorDispl... | select * from posts limit 10;. | SELECT * FROM Posts WHERE Score > 1000 | sede |
CREATE TABLE paperfield (
fieldid int,
paperid int
)
CREATE TABLE paperdataset (
paperid int,
datasetid int
)
CREATE TABLE field (
fieldid int
)
CREATE TABLE paper (
paperid int,
title varchar,
venueid int,
year int,
numciting int,
numcitedby int,
journalid int
)
CREA... | who wrote the most ACL papers in 2010 | SELECT DISTINCT COUNT(paper.paperid), writes.authorid FROM paper, venue, writes WHERE paper.year = 2010 AND venue.venueid = paper.venueid AND venue.venuename = 'ACL' AND writes.paperid = paper.paperid GROUP BY writes.authorid ORDER BY COUNT(paper.paperid) DESC | scholar |
CREATE TABLE table_25065 (
"District" text,
"Vacator" text,
"Reason for change" text,
"Successor" text,
"Date successor seated" text
) | How many Vacators were listed when the district was North Carolina 3rd? | SELECT COUNT("Vacator") FROM table_25065 WHERE "District" = 'North Carolina 3rd' | wikisql |
CREATE TABLE table_73158 (
"School" text,
"City / Town" text,
"Website" text,
"Size" real,
"Principal" text,
"Grades" text,
"IDOE Profile" text
) | Where is Bloomington High School North? | SELECT "City / Town" FROM table_73158 WHERE "School" = 'Bloomington High School North' | wikisql |
CREATE TABLE city (
city_code varchar,
city_name varchar,
state_code varchar,
country_name varchar,
time_zone_code varchar
)
CREATE TABLE ground_service (
city_code text,
airport_code text,
transport_type text,
ground_fare int
)
CREATE TABLE airport (
airport_code varchar,
... | list the flights from SALT LAKE CITY to ST. PETERSBURG | 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 = 'SALT LAKE CITY' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = ... | atis |
CREATE TABLE table_28140141_1 (
artist VARCHAR,
show VARCHAR
) | How many artists were there for the show thoroughly modern millie? | SELECT COUNT(artist) FROM table_28140141_1 WHERE show = "Thoroughly Modern Millie" | sql_create_context |
CREATE TABLE table_20849830_1 (
result VARCHAR,
record VARCHAR
) | What was the result of the game with the record of 3-1? | SELECT result FROM table_20849830_1 WHERE record = "3-1" | sql_create_context |
CREATE TABLE table_name_28 (
player VARCHAR,
score VARCHAR
) | Which player scored 76-68=144? | SELECT player FROM table_name_28 WHERE score = 76 - 68 = 144 | sql_create_context |
CREATE TABLE gwyjzb (
CLINIC_ID text,
CLINIC_TYPE text,
COMP_ID text,
DATA_ID text,
DIFF_PLACE_FLG number,
FERTILITY_STS number,
FLX_MED_ORG_ID text,
HOSP_LEV number,
HOSP_STS number,
IDENTITY_CARD text,
INPT_AREA_BED text,
INSURED_IDENTITY number,
INSURED_STS text,
... | 自二零零八年十一月二十七日开始,截止到二零一九年二月二十一日,患者奚美丽通过医疗机构4566860做了多少次检查 | SELECT COUNT(*) FROM gwyjzb JOIN t_kc22 ON gwyjzb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gwyjzb.PERSON_NM = '奚美丽' AND t_kc22.STA_DATE BETWEEN '2008-11-27' AND '2019-02-21' AND gwyjzb.MED_SER_ORG_NO = '4566860' AND t_kc22.MED_INV_ITEM_TYPE = '检查费' UNION SELECT COUNT(*) FROM fgwyjzb JOIN t_kc22 ON fgwyjzb.MED_CLINIC_... | css |
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 procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
... | how many unmarried patients have dialys route of drug administration? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.marital_status = "SINGLE" AND prescriptions.route = "DIALYS" | mimicsql_data |
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... | what is minimum age of patients whose primary disease is coronary artery disease\coronary artery bypass graft with mvr; ? maze and admission year is greater than or equal to 2146? | SELECT MIN(demographic.age) FROM demographic WHERE demographic.diagnosis = "CORONARY ARTERY DISEASE\CORONARY ARTERY BYPASS GRAFT WITH MVR; ? MAZE" AND demographic.admityear >= "2146" | mimicsql_data |
CREATE TABLE table_46830 (
"Game" real,
"November" real,
"Opponent" text,
"Score" text,
"Record" text
) | Can you tell me the Record that has the Game of 19? | SELECT "Record" FROM table_46830 WHERE "Game" = '19' | wikisql |
CREATE TABLE table_name_75 (
class VARCHAR,
name VARCHAR
) | What's the class of the HMS Heartsease? | SELECT class FROM table_name_75 WHERE name = "hms heartsease" | sql_create_context |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
... | give me the number of patients whose admission type is elective and procedure icd9 code is 3613? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_type = "ELECTIVE" AND procedures.icd9_code = "3613" | mimicsql_data |
CREATE TABLE table_61774 (
"Year [e ] (Ceremony)" text,
"Film title used in nomination" text,
"Original title" text,
"Director" text,
"Main Language(s)" text,
"Result" text
) | What was the original title for the film used in nomination of street days? | SELECT "Original title" FROM table_61774 WHERE "Film title used in nomination" = 'street days' | wikisql |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.