context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE table_50148 (
"Tie no" text,
"Home team" text,
"Score" text,
"Away team" text,
"Date" text
) | For Tie #2, who was the home team? | SELECT "Home team" FROM table_50148 WHERE "Tie no" = '2' | wikisql |
CREATE TABLE table_name_32 (
Id VARCHAR
) | What shows for 1988 when 1994 shows 10 6? | SELECT 1988 FROM table_name_32 WHERE 1994 = "10–6" | sql_create_context |
CREATE TABLE table_1506950_4 (
player VARCHAR,
finish VARCHAR
) | What players finished 2nd? | SELECT player FROM table_1506950_4 WHERE finish = "2nd" | sql_create_context |
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_type text,
admission_location text,
d... | what is the one year survival rate of patients prescribed with insulin after diagnosed with hx of alcoholism? | SELECT SUM(CASE WHEN patients.dod IS NULL THEN 1 WHEN STRFTIME('%j', patients.dod) - STRFTIME('%j', t4.charttime) > 1 * 365 THEN 1 ELSE 0 END) * 100 / COUNT(*) FROM (SELECT t2.subject_id, t2.charttime FROM (SELECT t1.subject_id, t1.charttime FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd... | mimic_iii |
CREATE TABLE certificate (
eid number(9,0),
aid number(9,0)
)
CREATE TABLE aircraft (
aid number(9,0),
name varchar2(30),
distance number(6,0)
)
CREATE TABLE employee (
eid number(9,0),
name varchar2(30),
salary number(10,2)
)
CREATE TABLE flight (
flno number(4,0),
origin var... | Return a bar chart on what are the names and distances for all airplanes?, and I want to sort names from low to high order. | SELECT name, distance FROM aircraft ORDER BY name | nvbench |
CREATE TABLE fgwyjzb (
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,
... | 在病院1313131看病的病患34943476在入院确诊疾病名称中包含有癫痫的医疗就诊记录编号都有啥? | SELECT gwyjzb.MED_CLINIC_ID FROM gwyjzb WHERE gwyjzb.PERSON_ID = '34943476' AND gwyjzb.MED_SER_ORG_NO = '1313131' AND gwyjzb.IN_DIAG_DIS_NM LIKE '%癫痫%' UNION SELECT fgwyjzb.MED_CLINIC_ID FROM fgwyjzb WHERE fgwyjzb.PERSON_ID = '34943476' AND fgwyjzb.MED_SER_ORG_NO = '1313131' AND fgwyjzb.IN_DIAG_DIS_NM LIKE '%癫痫%' | css |
CREATE TABLE table_36412 (
"Country" text,
"Launches" real,
"Successes" real,
"Failures" real,
"Partial failures" real
) | Failures larger than 0, and a Successes of 1 has what lowest partial failures? | SELECT MIN("Partial failures") FROM table_36412 WHERE "Failures" > '0' AND "Successes" = '1' | wikisql |
CREATE TABLE course (
course_id int,
name varchar,
department varchar,
number varchar,
credits varchar,
advisory_requirement varchar,
enforced_requirement varchar,
description varchar,
num_semesters int,
num_enrolled int,
has_discussion varchar,
has_lab varchar,
has_p... | Which 300 -level classes are there for Fall or Winter terms ? | SELECT DISTINCT course.department, course.name, course.number, semester.semester FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND course.department = 'EECS' AND course.number BETWEEN 300 AND 300 + 100 AND semester.semester IN ('FA', 'WN') AND semester.semester_id = course_of... | advising |
CREATE TABLE table_53743 (
"Abbreviation" text,
"Voivodeship" text,
"Capital" text,
"Area km\u00b2 (1998)" text,
"Population (1980)" text,
"No. of cities" real,
"No. of communes" real
) | Namem the number of cities that contains Voivodeship of elbl g voivodeship | SELECT "No. of cities" FROM table_53743 WHERE "Voivodeship" = 'elbląg voivodeship' | wikisql |
CREATE TABLE bank (
branch_ID int,
bname varchar(20),
no_of_customers int,
city varchar(10),
state varchar(20)
)
CREATE TABLE customer (
cust_ID varchar(3),
cust_name varchar(20),
acc_type char(1),
acc_bal int,
no_of_loans int,
credit_score int,
branch_ID int,
state ... | Find the total amount of loans offered by each bank branch, and sort in desc by the total number. | SELECT bname, SUM(amount) FROM bank AS T1 JOIN loan AS T2 ON T1.branch_ID = T2.branch_ID GROUP BY T1.bname ORDER BY SUM(amount) DESC | nvbench |
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,
... | what is minimum days of hospital stay of patients whose ethnicity is black/african american? | SELECT MIN(demographic.days_stay) FROM demographic WHERE demographic.ethnicity = "BLACK/AFRICAN AMERICAN" | mimicsql_data |
CREATE TABLE table_59191 (
"Location" text,
"Year" real,
"Champion" text,
"Runner-up" text,
"Score" text
) | Who was the runner-up, when the champion was Bj rn Borg after 1978? | SELECT "Runner-up" FROM table_59191 WHERE "Champion" = 'björn borg' AND "Year" > '1978' | wikisql |
CREATE TABLE table_name_40 (
record VARCHAR,
opponent VARCHAR,
december VARCHAR,
points VARCHAR
) | What record has a december less than 6, points less than 38, and pittsburgh penguins as the opponent? | SELECT record FROM table_name_40 WHERE december < 6 AND points < 38 AND opponent = "pittsburgh penguins" | sql_create_context |
CREATE TABLE university (
School_ID int,
School text,
Location text,
Founded real,
Affiliation text,
Enrollment real,
Nickname text,
Primary_conference text
)
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Per... | Give me a bar chart for total number of team id of each acc road, order by the X-axis in ascending. | SELECT ACC_Road, SUM(Team_ID) FROM basketball_match GROUP BY ACC_Road ORDER BY ACC_Road | nvbench |
CREATE TABLE table_34399 (
"Week" text,
"Division" text,
"Position" text,
"Player" text,
"School" text
) | What is the position of player Tiffany Garofano (2)? | SELECT "Position" FROM table_34399 WHERE "Player" = 'tiffany garofano (2)' | 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... | count the number of patients whose discharge location is dead/expired? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.discharge_location = "DEAD/EXPIRED" | mimicsql_data |
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,
... | how many patients died in or before year 2148 had the primary disease overdose? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "OVERDOSE" AND demographic.dod_year <= "2148.0" | mimicsql_data |
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 discharged to home health care and with procedure sm bowel exteriorization? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.discharge_location = "HOME HEALTH CARE" AND procedures.short_title = "Sm bowel exteriorization" | mimicsql_data |
CREATE TABLE table_32972 (
"Year" real,
"Sportsperson" text,
"Nation of birth" text,
"Team" text,
"Competition , federation , or league" text,
"Sport" text
) | Who playes the sport of athletics? | SELECT "Sportsperson" FROM table_32972 WHERE "Sport" = 'athletics' | wikisql |
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 demographic (
subject_id text,
hadm_id t... | count the number of patients whose year of death is less than or equal to 2138 and procedure long title is other diagnostic procedures on nasal sinuses? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.dod_year <= "2138.0" AND procedures.long_title = "Other diagnostic procedures on nasal sinuses" | mimicsql_data |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE d... | what's the total dose of volume (ml) epinephrine that patient 011-52460 had received until 02/14/2103? | SELECT SUM(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 = '011-52460')) AND intakeoutput.celllabel = 'volum... | eicu |
CREATE TABLE table_58306 (
"Driver" text,
"Constructor" text,
"Laps" real,
"Time/Retired" text,
"Grid" real
) | What is the highest number of laps for grid 17? | SELECT MAX("Laps") FROM table_58306 WHERE "Grid" = '17' | wikisql |
CREATE TABLE table_name_41 (
time_retired VARCHAR,
grid VARCHAR
) | Tell me the time/retired for grid 4 | SELECT time_retired FROM table_name_41 WHERE grid = 4 | sql_create_context |
CREATE TABLE ReviewTasks (
Id number,
ReviewTaskTypeId number,
CreationDate time,
DeletionDate time,
ReviewTaskStateId number,
PostId number,
SuggestedEditId number,
CompletedByReviewTaskId number
)
CREATE TABLE Tags (
Id number,
TagName text,
Count number,
ExcerptPostId... | First Posts by Users Created Recently. | WITH UserFirstPost AS (SELECT OwnerUserId, MIN(Posts.Id) AS PostId FROM Posts JOIN Users ON Users.Id = Posts.OwnerUserId WHERE Users.CreationDate > '2012-01-01' GROUP BY OwnerUserId LIMIT 50) SELECT * FROM UserFirstPost LIMIT 10 | sede |
CREATE TABLE table_204_649 (
id number,
"rank" number,
"name" text,
"image" number,
"height\nft (m)" text,
"floors" number,
"year" number,
"notes" text
) | how many buildings have less than 20 floors ? | SELECT COUNT("name") FROM table_204_649 WHERE "floors" < 20 | squall |
CREATE TABLE table_name_76 (
percent_of_slovenes_1991 VARCHAR,
village__slovenian_ VARCHAR
) | What was Rut's Slovenes percentage in 1991? | SELECT percent_of_slovenes_1991 FROM table_name_76 WHERE village__slovenian_ = "rut" | sql_create_context |
CREATE TABLE table_name_83 (
bore_x_stroke VARCHAR,
year VARCHAR
) | Name the Bore x stroke of 1929-32 | SELECT bore_x_stroke FROM table_name_83 WHERE year = "1929-32" | sql_create_context |
CREATE TABLE table_204_269 (
id number,
"week" number,
"room" text,
"winning couple" text,
"2nd couple" text,
"3rd couple" text,
"chumps" text
) | who were the chumps in the kitchen ? | SELECT "chumps" FROM table_204_269 WHERE "room" = 'kitchen' | squall |
CREATE TABLE AssignedTo (
Scientist int,
Project char(4)
)
CREATE TABLE Scientists (
SSN int,
Name Char(30)
)
CREATE TABLE Projects (
Code Char(4),
Name Char(50),
Hours int
) | Find the number of scientists involved for the projects that require more than 300 hours Show bar chart, and display by the total number in asc. | SELECT Name, COUNT(*) FROM Projects AS T1 JOIN AssignedTo AS T2 ON T1.Code = T2.Project WHERE T1.Hours > 300 GROUP BY T1.Name ORDER BY COUNT(*) | nvbench |
CREATE TABLE table_203_192 (
id number,
"year" number,
"competition" text,
"venue" text,
"position" text,
"notes" text
) | the number of times david oliver placed 1st in 100m hurdles between the years 2006-2013 . | SELECT COUNT(*) FROM table_203_192 WHERE "position" = 1 AND "notes" = '110 m hurdles' | squall |
CREATE TABLE table_56259 (
"Driver" text,
"Constructor" text,
"Laps" real,
"Time/Retired" text,
"Grid" real
) | What is the grid for Jack Brabham with more than 65 laps? | SELECT SUM("Grid") FROM table_56259 WHERE "Driver" = 'jack brabham' AND "Laps" > '65' | wikisql |
CREATE TABLE table_42470 (
"Year" real,
"Team" text,
"Player" text,
"Position" text,
"School" text
) | Which player was from Western Washington University, played midfield, and was from years after 2009? | SELECT "Player" FROM table_42470 WHERE "School" = 'western washington university' AND "Position" = 'midfield' AND "Year" > '2009' | wikisql |
CREATE TABLE table_44442 (
"Driver" text,
"Team" text,
"Laps" text,
"Time/Retired" text,
"Grid" text,
"Laps Led" text,
"Points" text
) | How many points have 75 laps? | SELECT "Points" FROM table_44442 WHERE "Laps" = '75' | wikisql |
CREATE TABLE table_name_8 (
built VARCHAR,
wheels VARCHAR,
status VARCHAR
) | What is found in the Built column of the locomotive with 0-4-0 wheels that is still in service? | SELECT built FROM table_name_8 WHERE wheels = "0-4-0" AND status = "in service" | sql_create_context |
CREATE TABLE table_79618 (
"Player" text,
"Played" real,
"Legs Won" real,
"Legs Lost" real,
"100+" real,
"140+" real,
"180s" real,
"High Checkout" real,
"3-dart Average" real
) | What is the number of high checkout when legs Lost is 17, 140+ is 15, and played is larger than 4? | SELECT SUM("High Checkout") FROM table_79618 WHERE "Legs Lost" = '17' AND "140+" = '15' AND "Played" > '4' | wikisql |
CREATE TABLE table_20668268_1 (
name VARCHAR,
starting_price VARCHAR,
jockey VARCHAR
) | What was the name that had a starting price of 11/1 and a jockey named Garrett Cotter? | SELECT name FROM table_20668268_1 WHERE starting_price = "11/1" AND jockey = "Garrett Cotter" | sql_create_context |
CREATE TABLE table_name_60 (
publisher VARCHAR,
year_of_release VARCHAR,
original_platforms VARCHAR
) | Which publisher has release year of 2000 and an original dreamcast platform? | SELECT publisher FROM table_name_60 WHERE year_of_release = "2000" AND original_platforms = "dreamcast" | sql_create_context |
CREATE TABLE table_7317 (
"Outcome" text,
"Date" real,
"Tournament" text,
"Surface" text,
"Partner" text,
"Opponent in the final" text,
"Score in the final" text
) | What Opponent in the final had a Partner of Gast n Etlis? | SELECT "Opponent in the final" FROM table_7317 WHERE "Partner" = 'gastón etlis' | wikisql |
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid number,
wardid number,
admissionheight number,
admissionweight number,
dischargeweight number,
hospitaladmittime time,
... | indicate the daily minimum amount of respiration for patient 033-4763 in 11/last year. | SELECT MIN(vitalperiodic.respiration) FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '033-4763')) AND NOT vitalperiodic.respiration IS N... | eicu |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE patient (
uniquepid text,
... | when did patient 010-3286 first get his heartrate measured on 11/18/this year? | 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 = '010-3286')) AND NOT vitalperiodic.heartrate IS NULL... | eicu |
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost numbe... | the last year what were the top three most common procedures that patients received during the same hospital encounter after getting a immunosuppressive therapy - tacrolimus? | SELECT t3.treatmentname FROM (SELECT t2.treatmentname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, treatment.treatmenttime, patient.patienthealthsystemstayid FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'immun... | eicu |
CREATE TABLE table_name_50 (
place VARCHAR,
country VARCHAR,
player VARCHAR
) | Which place is Andy Bean from the United States? | SELECT place FROM table_name_50 WHERE country = "united states" AND player = "andy bean" | sql_create_context |
CREATE TABLE t_kc24 (
ACCOUNT_DASH_DATE time,
ACCOUNT_DASH_FLG number,
CASH_PAY number,
CIVIL_SUBSIDY number,
CKC102 number,
CLINIC_ID text,
CLINIC_SLT_DATE time,
COMP_ID text,
COM_ACC_PAY number,
COM_PAY number,
DATA_ID text,
ENT_ACC_PAY number,
ENT_PAY number,
F... | 能告诉我病人97231052所有医疗记录中医疗费总额不低于9587.83元的入院诊断疾病名称是什么吗?疾病编码呢 | SELECT gwyjzb.OUT_DIAG_DIS_CD, gwyjzb.OUT_DIAG_DIS_NM FROM gwyjzb WHERE gwyjzb.PERSON_ID = '97231052' AND gwyjzb.MED_CLINIC_ID IN (SELECT t_kc24.MED_CLINIC_ID FROM t_kc24 WHERE t_kc24.MED_AMOUT >= 9587.83) UNION SELECT fgwyjzb.OUT_DIAG_DIS_CD, fgwyjzb.OUT_DIAG_DIS_NM FROM fgwyjzb WHERE fgwyjzb.PERSON_ID = '97231052' AN... | css |
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
)
... | give me the number of patients whose death status is 0 and diagnoses icd9 code is 78052? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.expire_flag = "0" AND diagnoses.icd9_code = "78052" | mimicsql_data |
CREATE TABLE table_202_232 (
id number,
"institution" text,
"location" text,
"established" number,
"gained university status" number,
"vice-chancellor" text,
"total number of students" number,
"research funding (\u00a3,000)" number
) | how many of the institutions are located in london ? | SELECT COUNT("institution") FROM table_202_232 WHERE "location" = 'london' | squall |
CREATE TABLE procedures_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 TABL... | did patient 739 have a normal arterial bp [systolic] on 12/16/this year? | SELECT COUNT(*) > 0 FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 739)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'arterial bp [systol... | mimic_iii |
CREATE TABLE table_39431 (
"Category" text,
"Type" text,
"Attribute" text,
"Bubbles" text,
"Cancelable" text
) | Name the attribute for mutation and domcharacterdatamodified | SELECT "Attribute" FROM table_39431 WHERE "Category" = 'mutation' AND "Type" = 'domcharacterdatamodified' | wikisql |
CREATE TABLE nomination (
Artwork_ID VARCHAR,
Festival_ID VARCHAR
)
CREATE TABLE festival_detail (
Festival_ID VARCHAR,
Year VARCHAR
)
CREATE TABLE artwork (
Type VARCHAR,
Artwork_ID VARCHAR
) | Show distinct types of artworks that are nominated in festivals in 2007. | SELECT DISTINCT T2.Type FROM nomination AS T1 JOIN artwork AS T2 ON T1.Artwork_ID = T2.Artwork_ID JOIN festival_detail AS T3 ON T1.Festival_ID = T3.Festival_ID WHERE T3.Year = 2007 | sql_create_context |
CREATE TABLE table_name_67 (
team VARCHAR,
pick VARCHAR
) | What Team has a Pick of 40? | SELECT team FROM table_name_67 WHERE pick = 40 | sql_create_context |
CREATE TABLE table_name_35 (
report VARCHAR,
date VARCHAR,
away_team VARCHAR
) | Name the Report of 7 february with an Away team of new zealand breakers? | SELECT report FROM table_name_35 WHERE date = "7 february" AND away_team = "new zealand breakers" | sql_create_context |
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,... | 从00年10月1日到10年9月21日这个患者喻萍雅检查了多少次? | SELECT COUNT(*) FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.PERSON_NM = '喻萍雅' AND t_kc22.STA_DATE BETWEEN '2000-10-01' AND '2010-09-21' AND t_kc22.MED_INV_ITEM_TYPE = '检查费' | css |
CREATE TABLE table_6981 (
"Rank" real,
"Celebrity" text,
"Professional Partner" text,
"Season" real,
"Average" real
) | What is the highest average of celebrity Natalia Lesz, who is ranked greater than 4? | SELECT MAX("Average") FROM table_6981 WHERE "Rank" > '4' AND "Celebrity" = 'natalia lesz' | wikisql |
CREATE TABLE host (
host_id number,
name text,
nationality text,
age text
)
CREATE TABLE party_host (
party_id number,
host_id number,
is_main_in_charge others
)
CREATE TABLE party (
party_id number,
party_theme text,
location text,
first_year text,
last_year text,
... | Count the number of parties. | SELECT COUNT(*) FROM party | spider |
CREATE TABLE table_1342233_6 (
result VARCHAR,
incumbent VARCHAR
) | what's the result with incumbent being jack z. anderson | SELECT result FROM table_1342233_6 WHERE incumbent = "Jack Z. Anderson" | sql_create_context |
CREATE TABLE table_21790 (
"Rank" real,
"Country" text,
"Miss United Continent" real,
"Virreina" real,
"1st RU" real,
"2nd RU" real,
"3rd RU" real,
"4th RU" real,
"Semifinalists" real,
"Total" real
) | How many 3rd ru does Costa Rica have? | SELECT MAX("3rd RU") FROM table_21790 WHERE "Country" = 'Costa Rica' | wikisql |
CREATE TABLE table_77297 (
"Year" real,
"Award" text,
"Category" text,
"Country" text,
"Result" text
) | Which Year has a Category of best original song ( )? | SELECT MAX("Year") FROM table_77297 WHERE "Category" = 'best original song (รอเธอหันมา – โฟกัส จิระกุล)' | wikisql |
CREATE TABLE table_name_99 (
population__2010_ INTEGER,
city VARCHAR
) | What is taipei's lowest 2010 population? | SELECT MIN(population__2010_) FROM table_name_99 WHERE city = "taipei" | sql_create_context |
CREATE TABLE table_204_655 (
id number,
"year" number,
"winner" text,
"album" text,
"other finalists" text
) | who was the most recent winner ? | SELECT "winner" FROM table_204_655 ORDER BY "year" DESC LIMIT 1 | squall |
CREATE TABLE table_name_28 (
leading_scorer VARCHAR,
date VARCHAR
) | Who was the leading scorer on the game played on February 25? | SELECT leading_scorer FROM table_name_28 WHERE date = "february 25" | sql_create_context |
CREATE TABLE table_name_77 (
rank__week_ VARCHAR,
share VARCHAR,
rating VARCHAR
) | What is the weekly rank for the episode with a share over 7 and a rating/share of 2.3/7? | SELECT rank__week_ FROM table_name_77 WHERE share > 7 AND rating / SHARE(18 - 49) = 2.3 / 7 | sql_create_context |
CREATE TABLE Participants_in_Events (
Event_ID INTEGER,
Participant_ID INTEGER
)
CREATE TABLE Events (
Event_ID INTEGER,
Service_ID INTEGER,
Event_Details VARCHAR(255)
)
CREATE TABLE Services (
Service_ID INTEGER,
Service_Type_Code CHAR(15)
)
CREATE TABLE Participants (
Participant_ID... | List all the participant ids and their details using a bar chart, and sort Y in asc order. | SELECT Participant_Details, Participant_ID FROM Participants ORDER BY Participant_ID | nvbench |
CREATE TABLE table_name_97 (
wins VARCHAR,
top_25 VARCHAR,
top_5 VARCHAR
) | What is Wins, when Top-25 is less than 4, and when Top-5 is greater than 0? | SELECT wins FROM table_name_97 WHERE top_25 < 4 AND top_5 > 0 | sql_create_context |
CREATE TABLE VoteTypes (
Id number,
Name text
)
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE FlagTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationD... | Top SO users from Poznan, Poland. | SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation FROM Users WHERE (LOWER(Location) LIKE '%poznan%' OR LOWER(Location) LIKE '%pozna %') AND Reputation >= 100 ORDER BY Reputation DESC | sede |
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 number of patients of american indian/alaska native ethnicity had lab test named transitional epithelial cells? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.ethnicity = "AMERICAN INDIAN/ALASKA NATIVE" AND lab.label = "Transitional Epithelial Cells" | mimicsql_data |
CREATE TABLE table_2169966_2 (
position VARCHAR,
avg_start VARCHAR
) | What position did he finish in the year his average start was 16.8? | SELECT position FROM table_2169966_2 WHERE avg_start = "16.8" | sql_create_context |
CREATE TABLE volume (
volume_id number,
volume_issue text,
issue_date text,
weeks_on_top number,
song text,
artist_id number
)
CREATE TABLE music_festival (
id number,
music_festival text,
date_of_ceremony text,
category text,
volume number,
result text
)
CREATE TABLE a... | Please show the results of music festivals and the number of music festivals that have had each, ordered by this count. | SELECT result, COUNT(*) FROM music_festival GROUP BY result ORDER BY COUNT(*) DESC | spider |
CREATE TABLE table_22904752_1 (
directed_by VARCHAR,
no VARCHAR
) | Who is no. 79 directed by? | SELECT directed_by FROM table_22904752_1 WHERE no = 79 | sql_create_context |
CREATE TABLE table_32704 (
"Res." text,
"Record" text,
"Opponent" text,
"Method" text,
"Event" text,
"Round" real,
"Time" text,
"Location" text
) | What is his record at ufc 67? | SELECT "Record" FROM table_32704 WHERE "Event" = 'ufc 67' | wikisql |
CREATE TABLE table_203_679 (
id number,
"part" text,
"number" text,
"first public release date (first edition)" number,
"latest public release date (edition)" number,
"latest amendment" text,
"title" text,
"description" text
) | how many parts were published in 2005 ? | SELECT COUNT("part") FROM table_203_679 WHERE "first public release date (first edition)" = 2005 | squall |
CREATE TABLE table_name_23 (
loss VARCHAR,
date VARCHAR
) | Which loss was on June 13? | SELECT loss FROM table_name_23 WHERE date = "june 13" | sql_create_context |
CREATE TABLE table_29529 (
"Episode air date" text,
"Audition city" text,
"First audition date" text,
"Audition venue" text,
"Callback audition date" text,
"Callback venue" text,
"Golden tickets" text
) | When were the callback auditions for the audition city in the episode aired on February 9, 2011? | SELECT "Callback audition date" FROM table_29529 WHERE "Episode air date" = 'February 9, 2011' | wikisql |
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime t... | how many days have elapsed since patient 012-20116's last anemia diagnosis in their current hospital encounter? | SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', diagnosis.diagnosistime)) FROM diagnosis WHERE diagnosis.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '012-20116'... | eicu |
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
... | had patient 012-20482 until 2103 been diagnosed with post craniotomy - for hemorrhage? | SELECT COUNT(*) > 0 FROM diagnosis WHERE diagnosis.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '012-20482')) AND diagnosis.diagnosisname = 'post craniotomy - for hemorrhage... | eicu |
CREATE TABLE table_9244 (
"Official Name" text,
"Status" text,
"Area km 2" real,
"Population" real,
"Census Ranking" text
) | What is the area (in km2) for the community that has a status of village, a census ranking of 2,471 of 5,008, and a population of less than 748? | SELECT SUM("Area km 2") FROM table_9244 WHERE "Status" = 'village' AND "Census Ranking" = '2,471 of 5,008' AND "Population" < '748' | wikisql |
CREATE TABLE offering_instructor (
offering_instructor_id int,
offering_id int,
instructor_id int
)
CREATE TABLE ta (
campus_job_id int,
student_id int,
location varchar
)
CREATE TABLE gsi (
course_offering_id int,
student_id int
)
CREATE TABLE program (
program_id int,
name v... | When are the A.M. time slots for PHYSED 482 ? | SELECT DISTINCT course_offering.end_time, course_offering.start_time, semester.semester, semester.year FROM course, course_offering, semester WHERE course_offering.start_time < '12:00:00' AND course_offering.start_time >= '08:00:00' AND course.course_id = course_offering.course_id AND course.department = 'PHYSED' AND c... | advising |
CREATE TABLE table_9821 (
"Division" text,
"1999" real,
"2000" real,
"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 2002 average when 2003 is less than 13.2, 2006 is more than 12.1, 2011 is more than 13.5 and 2001 is 11.5? | SELECT AVG("2002") FROM table_9821 WHERE "2003" < '13.2' AND "2006" > '12.1' AND "2011" > '13.5' AND "2001" = '11.5' | wikisql |
CREATE TABLE table_16434 (
"English name" text,
"Original name" text,
"Area in km\u00b2" text,
"Population at 2010 Census" real,
"Number of settlements and villages" real
) | What is the listed population from the 2010 census of West Bogor? | SELECT MIN("Population at 2010 Census") FROM table_16434 WHERE "English name" = 'West Bogor' | wikisql |
CREATE TABLE table_35522 (
"Position" real,
"Team" text,
"Played" real,
"Wins" real,
"Draws" real,
"Losses" real,
"Scored" real,
"Conceded" real,
"Points" real
) | What was the sum of the draws for the team that had 11 wins, less than 38 points, and a position smaller than 4? | SELECT SUM("Draws") FROM table_35522 WHERE "Position" < '4' AND "Wins" = '11' AND "Points" < '38' | 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... | what is maximum days of hospital stay of patients whose admission location is clinic referral/premature? | SELECT MAX(demographic.days_stay) FROM demographic WHERE demographic.admission_location = "CLINIC REFERRAL/PREMATURE" | mimicsql_data |
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid nu... | what is the dose of sucralfate that is last prescribed to patient 53015 until 05/2105? | SELECT prescriptions.dose_val_rx FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 53015) AND prescriptions.drug = 'sucralfate' AND STRFTIME('%y-%m', prescriptions.startdate) <= '2105-05' ORDER BY prescriptions.startdate DESC LIMIT 1 | mimic_iii |
CREATE TABLE table_67865 (
"Language" text,
"Number" text,
"percentage (%)" text,
"males" text,
"females" text
) | What males speak Polish? | SELECT "males" FROM table_67865 WHERE "Language" = 'polish' | 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... | 负责医疗就诊80647746885中编码为65880344577的费用明细项目的开具医师叫什么?编码是多少? | SELECT HOSP_DOC_CD, HOSP_DOC_NM FROM t_kc22 WHERE MED_EXP_DET_ID = '65880344577' | css |
CREATE TABLE table_70164 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text,
"Money ( $ )" text
) | Name the to par for score of 74-74-74-71=293 | SELECT "To par" FROM table_70164 WHERE "Score" = '74-74-74-71=293' | wikisql |
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 products with a price between 60 and 120, give me the comparison about price over the name , and sort Price in descending order. | SELECT Name, Price FROM Products WHERE Price BETWEEN 60 AND 120 ORDER BY Price DESC | nvbench |
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefined boolean,
PostNoticeDurationId number
)
CREATE TABLE PostsWithDeleted (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
... | Users with less reputation than X, Y and Z. | WITH raw AS (SELECT COUNT(Id) AS "total", COUNT(CASE WHEN Reputation < '##x##' THEN 1 ELSE NULL END) AS "x", COUNT(CASE WHEN Reputation < '##y##' THEN 1 ELSE NULL END) AS "y", COUNT(CASE WHEN Reputation < '##z##' THEN 1 ELSE NULL END) AS "z" FROM Users) SELECT (CAST('x' AS FLOAT) / CAST('total' AS FLOAT)) * 100 AS "x%"... | sede |
CREATE TABLE table_10942714_1 (
finale VARCHAR,
chinese_title VARCHAR
) | What was the finale for | SELECT finale FROM table_10942714_1 WHERE chinese_title = "潮爆大狀" | sql_create_context |
CREATE TABLE table_7954 (
"Rank" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) | What is the average Silver with rank 30 and a Bronze greater than 0 | SELECT AVG("Silver") FROM table_7954 WHERE "Rank" = '30' AND "Bronze" > '0' | wikisql |
CREATE TABLE mzjzjlb (
HXPLC number,
HZXM text,
JLSJ time,
JZJSSJ time,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
JZLSH text,
JZZDBM text,
JZZDSM text,
JZZTDM number,
JZZTMC text,
KH text,
KLX number,
MJZH text,
ML number,
MZZYZDZZBM text,
MZZYZDZZMC ... | 检验报告单13992667471的标本代码是什么?标本名称叫什么?标本状态是什么? | SELECT jybgb.BBDM, jybgb.BBMC, jybgb.BBZT FROM jybgb WHERE jybgb.BGDH = '13992667471' | css |
CREATE TABLE table_1014206_2 (
_number VARCHAR,
commissioned VARCHAR
) | List the # for ships commissioned on september 30, 1967. | SELECT _number FROM table_1014206_2 WHERE commissioned = "September 30, 1967" | 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, return a bar chart about the distribution of name and the sum of price , and group by attribute name, I want to order by the y axis from high to low. | SELECT T2.Name, T1.Price FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name ORDER BY T1.Price DESC | nvbench |
CREATE TABLE 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,
... | 知道在住院就诊67510438967的病患的卡号和卡类型是啥吗 | SELECT zyjzjlb.KH, zyjzjlb.KLX FROM zyjzjlb WHERE zyjzjlb.JZLSH = '67510438967' | css |
CREATE TABLE table_name_18 (
points VARCHAR,
chassis VARCHAR
) | What is the total points of teams using a ligier js11/15 chassis? | SELECT COUNT(points) FROM table_name_18 WHERE chassis = "ligier js11/15" | sql_create_context |
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location t... | how many patients whose admission location was tansfer from hospital/extram have undergone suture of artery procedure? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_location = "TRANSFER FROM HOSP/EXTRAM" AND procedures.short_title = "Suture of artery" | mimicsql_data |
CREATE TABLE program_requirement (
program_id int,
category varchar,
min_credit int,
additional_req varchar
)
CREATE TABLE semester (
semester_id int,
semester varchar,
year int
)
CREATE TABLE area (
course_id int,
area varchar
)
CREATE TABLE offering_instructor (
offering_ins... | What courses on Tech Phys Instructn have no prerequisites ? | SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN area ON course.course_id = area.course_id WHERE (area.area LIKE '%Tech Phys Instructn%' OR course.description LIKE '%Tech Phys Instructn%' OR course.name LIKE '%Tech Phys Instructn%') AND course.enforced_requirement = 'N / A' | advising |
CREATE TABLE flight_leg (
flight_id int,
leg_number int,
leg_flight int
)
CREATE TABLE ground_service (
city_code text,
airport_code text,
transport_type text,
ground_fare int
)
CREATE TABLE airport (
airport_code varchar,
airport_name text,
airport_location text,
state_cod... | show me flights from SEATTLE to SAN FRANCISCO that leave after 1700 | 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_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN FRANCISCO' AND flight.departure_time > 1700 AND flight.to_airport = AIRPORT_SERVICE_1... | atis |
CREATE TABLE table_name_90 (
against INTEGER,
central_murray VARCHAR,
wins VARCHAR
) | What is the number of against when Central Murray is Tooleybuc Manangatang and there are fewer than 13 wins? | SELECT MAX(against) FROM table_name_90 WHERE central_murray = "tooleybuc manangatang" AND wins < 13 | sql_create_context |
CREATE TABLE table_name_21 (
round INTEGER,
method VARCHAR,
opponent VARCHAR
) | What's the lowest round with the opponent John Howard that had a method of Decision (unanimous)? | SELECT MIN(round) FROM table_name_21 WHERE method = "decision (unanimous)" AND opponent = "john howard" | sql_create_context |
CREATE TABLE Player (
pID numeric(5,0),
pName varchar(20),
yCard varchar(3),
HS numeric(5,0)
)
CREATE TABLE College (
cName varchar(20),
state varchar(2),
enr numeric(5,0)
)
CREATE TABLE Tryout (
pID numeric(5,0),
cName varchar(20),
pPos varchar(8),
decision varchar(3)
) | how many students are enrolled in colleges that have student accepted during tryouts, and in which states are those colleges? | SELECT state, enr FROM College AS T1 JOIN Tryout AS T2 ON T1.cName = T2.cName WHERE T2.decision = 'yes' | nvbench |
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,
... | Provide the number of patients that died and had a primary disease of ST elevated myocardial infarction/cardiac cath. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.expire_flag = "1" AND demographic.diagnosis = "ST ELEVATED MYOCARDIAL INFARCTION\CARDIAC CATH" | mimicsql_data |
CREATE TABLE diagnoses (
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 prescriptions... | how many patients are diagnosed with primary disease pituitary bleed and born before 2056? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "PITUITARY BLEED" AND demographic.dob_year < "2056" | mimicsql_data |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.