context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE table_name_23 (
competition VARCHAR,
date VARCHAR
) | On 11 Feb 1990, the competition is listed as what? | SELECT competition FROM table_name_23 WHERE date = "11 feb 1990" | sql_create_context |
CREATE TABLE table_name_48 (
player VARCHAR,
round VARCHAR,
college_junior_club_team__league_ VARCHAR
) | Which Player has a Round smaller than 4, and a College/junior/club team (league) of usa u-18? | SELECT player FROM table_name_48 WHERE round < 4 AND college_junior_club_team__league_ = "usa u-18" | sql_create_context |
CREATE TABLE PostHistoryTypes (
Id number,
Name text
)
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
RejectionReasonId number,
Comment text
)
CREATE TABLE Comments (
Id number,
PostId number,
Score number,... | How many of my answers are accepted?. | WITH Counts AS (SELECT CASE WHEN q.Id IS NULL THEN 0 ELSE 1 END AS IsAccepted FROM Posts AS a LEFT JOIN Posts AS q ON q.AcceptedAnswerId = a.Id WHERE a.PostTypeId = 2 AND a.OwnerUserId = '##UserId##'), Result AS (SELECT * FROM Counts PIVOT(COUNT(IsAccepted) FOR IsAccepted IN ('0', '1')) AS Result) SELECT '1' AS Accepte... | sede |
CREATE TABLE t_kc21_t_kc22 (
MED_CLINIC_ID text,
MED_EXP_DET_ID number
)
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,
H... | 从2004年3月27到日2006年6月22日,患者柏德华一共买了多少次西药? | SELECT COUNT(*) FROM t_kc21 JOIN t_kc22 JOIN t_kc21_t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc21_t_kc22.MED_CLINIC_ID AND t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID WHERE t_kc21.PERSON_NM = '柏德华' AND t_kc22.STA_DATE BETWEEN '2004-03-27' AND '2006-06-22' AND t_kc22.MED_INV_ITEM_TYPE = '西药费' | css |
CREATE TABLE table_name_65 (
runner_s__up VARCHAR,
winning_score VARCHAR
) | Who is the runner(s)-up for a winning score of 3 (71-74-66-66=277)? | SELECT runner_s__up FROM table_name_65 WHERE winning_score = −3(71 - 74 - 66 - 66 = 277) | sql_create_context |
CREATE TABLE table_1342013_20 (
first_elected INTEGER,
incumbent VARCHAR
) | John W. Heselton was first elected in what year? | SELECT MAX(first_elected) FROM table_1342013_20 WHERE incumbent = "John W. Heselton" | sql_create_context |
CREATE TABLE table_2098 (
"Pick #" real,
"Player" text,
"Position" text,
"Nationality" text,
"NHL team" text,
"College/junior/club team" text
) | What player was drafted to the Detroit Red Wings? | SELECT "Player" FROM table_2098 WHERE "NHL team" = 'Detroit Red Wings' | wikisql |
CREATE TABLE table_62239 (
"Rank" text,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) | What is the highest bronze number when silver is 0, and the total is smaller than 1? | SELECT MAX("Bronze") FROM table_62239 WHERE "Silver" = '0' AND "Total" < '1' | 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 lab (
subject_id text,
hadm_id text,
... | how many of the patients diagnosed with mv collision nos-driver received id therapy? | 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 = "Mv collision NOS-driver" AND prescriptions.route = "ID" | mimicsql_data |
CREATE TABLE table_23585197_3 (
position VARCHAR,
songwriter_s_ VARCHAR
) | What is the position of the song that adam sandahl wrote? | SELECT position FROM table_23585197_3 WHERE songwriter_s_ = "Adam Sandahl" | sql_create_context |
CREATE TABLE table_67563 (
"Season" text,
"Player" text,
"Team" text,
"Position" text,
"Rating" text,
"Win #" text
) | What is Patrice Bergeron's rating? | SELECT "Rating" FROM table_67563 WHERE "Player" = 'patrice bergeron' | wikisql |
CREATE TABLE time_zone (
time_zone_code text,
time_zone_name text,
hours_from_gmt int
)
CREATE TABLE flight_fare (
flight_id int,
fare_id int
)
CREATE TABLE food_service (
meal_code text,
meal_number int,
compartment text,
meal_description varchar
)
CREATE TABLE ground_service (
... | PITTSBURGH to DENVER | 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 = 'PITTSBURGH' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'DEN... | atis |
CREATE TABLE table_name_88 (
name VARCHAR,
call_sign VARCHAR
) | Which owner has the call sign of KDSU? | SELECT name FROM table_name_88 WHERE call_sign = "kdsu" | sql_create_context |
CREATE TABLE table_name_30 (
avg INTEGER,
rank INTEGER
) | What is the highest average for teams ranked higher than 9? | SELECT MAX(avg) FROM table_name_30 WHERE rank > 9 | sql_create_context |
CREATE TABLE locations (
LOCATION_ID decimal(4,0),
STREET_ADDRESS varchar(40),
POSTAL_CODE varchar(12),
CITY varchar(30),
STATE_PROVINCE varchar(25),
COUNTRY_ID varchar(2)
)
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decima... | For those employees who did not have any job in the past, return a scatter chart about the correlation between employee_id and commission_pct . | SELECT EMPLOYEE_ID, COMMISSION_PCT FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) | nvbench |
CREATE TABLE table_71770 (
"Tournament" text,
"Wins" real,
"Top-25" real,
"Events" real,
"Cuts made" real
) | What is the total number of top-25 a tournament with less than 2 events has? | SELECT COUNT("Top-25") FROM table_71770 WHERE "Events" < '2' | wikisql |
CREATE TABLE table_73123 (
"Number One(s)" real,
"Artist(s)" text,
"Song(s) \u2014 Weeks" text,
"Issue Years" real,
"Whole Weeks" real
) | What is the longest number of weeks any 1 song was at number #1? | SELECT MAX("Whole Weeks") FROM table_73123 | wikisql |
CREATE TABLE table_2249 (
"Season" real,
"Series" text,
"Team" text,
"Races" real,
"Wins" real,
"Poles" real,
"F/Laps" real,
"Podiums" real,
"Points" text,
"Position" text
) | How many poles had 72 points? | SELECT COUNT("Poles") FROM table_2249 WHERE "Points" = '72' | wikisql |
CREATE TABLE table_73854 (
"Season" real,
"Series" text,
"Team" text,
"Car No." real,
"Races" real,
"Poles" real,
"Wins" real,
"FLaps" real,
"Points" text,
"Position" text
) | Name the position for eifelland racing | SELECT "Position" FROM table_73854 WHERE "Team" = 'Eifelland Racing' | wikisql |
CREATE TABLE table_63260 (
"Draw" real,
"Artist" text,
"Song" text,
"Percentage" text,
"Place" real
) | What Percentage has a Place of 5? | SELECT "Percentage" FROM table_63260 WHERE "Place" = '5' | wikisql |
CREATE TABLE table_name_49 (
poll_source VARCHAR,
nathan_deal VARCHAR,
john_oxendine VARCHAR
) | In what poll is Nathan Deal at 13% and John Oxendine at 28%? | SELECT poll_source FROM table_name_49 WHERE nathan_deal = "13%" AND john_oxendine = "28%" | sql_create_context |
CREATE TABLE table_name_67 (
result VARCHAR,
year VARCHAR
) | What was the result of the tournament in 2001? | SELECT result FROM table_name_67 WHERE year = 2001 | sql_create_context |
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
CREATE TABLE jyjgzbb (
BGDH text,
BGRQ time,
CKZFWDX text,
CKZFWSX number,
CKZFWXX number,
JCFF text,
JCRGH text,
JCRXM text,
JCXMMC text,
JCZBDM text,
JCZBJGDL number,
JCZBJGDW text,
... | 那些已经被门诊诊断为维生素B缺乏病的病患们的检测指标514736的平均数值以及最值都是多少? | SELECT AVG(jyjgzbb.JCZBJGDL), MIN(jyjgzbb.JCZBJGDL), MAX(jyjgzbb.JCZBJGDL) FROM mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN hz_info_mzjzjlb ON hz_info_mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH AND hz_info_mzjzjlb.JZLSH = mzjzjl... | css |
CREATE TABLE table_27791 (
"Stage" real,
"Winner" text,
"General Classification" text,
"Mountains Classification" text,
"Sprint Classification" text,
"Young Rider Classification" text,
"Team Classification" text,
"Aggressive Rider" text
) | What was the young rider classification when manuel cardoso was the winner? | SELECT "Young Rider Classification" FROM table_27791 WHERE "Winner" = 'Manuel Cardoso' | wikisql |
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE vitalperiodic (
vitalperio... | when was the first time until 4 years ago patient 002-7771 was discharged from the hospital. | SELECT patient.hospitaldischargetime FROM patient WHERE patient.uniquepid = '002-7771' AND DATETIME(patient.hospitaldischargetime) <= DATETIME(CURRENT_TIME(), '-4 year') ORDER BY patient.hospitaldischargetime LIMIT 1 | eicu |
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... | Next semester , what 300 -level classes are there ? | SELECT DISTINCT course.department, course.name, course.number 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 = 'FA' AND semester.semester_id = course_offering.semester AND semester... | advising |
CREATE TABLE table_64456 (
"Kanji" text,
"Name" text,
"Builder" text,
"Laid down" text,
"Launched" text,
"Completed" text
) | when was the ship completed when laid down is 21 august 1925? | SELECT "Completed" FROM table_64456 WHERE "Laid down" = '21 august 1925' | wikisql |
CREATE TABLE table_29196 (
"No. in series" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original airdate" text,
"Production code" text
) | The episode with production code 693-002, has how many original airdates? | SELECT COUNT("Original airdate") FROM table_29196 WHERE "Production code" = '693-002' | wikisql |
CREATE TABLE table_24501530_1 (
age VARCHAR,
result VARCHAR
) | How many age figures for the player fired in week 6? | SELECT COUNT(age) FROM table_24501530_1 WHERE result = "Fired in week 6" | sql_create_context |
CREATE TABLE table_17658 (
"Series #" real,
"Season #" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Total viewers (in millions)" text
) | How many millions of total viewers watched series #57? | SELECT COUNT("Total viewers (in millions)") FROM table_17658 WHERE "Series #" = '57' | wikisql |
CREATE TABLE table_12598 (
"State" text,
"Status" text,
"Association Agreement" text,
"Membership Application" text,
"Candidate status" text,
"Negotiations start" text,
"Screening completed" text,
"Acquis Chapters open/closed" text
) | What is the association agreement for bosnia and herzegovina? | SELECT "Association Agreement" FROM table_12598 WHERE "State" = 'bosnia and herzegovina' | wikisql |
CREATE TABLE table_18266 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Result" text,
"Candidates" text
) | How many districts have Mac Sweeney as incumbent? | SELECT COUNT("Candidates") FROM table_18266 WHERE "Incumbent" = 'Mac Sweeney' | wikisql |
CREATE TABLE jybgb (
BBCJBW text,
BBDM text,
BBMC text,
BBZT number,
BGDH text,
BGJGDM text,
BGJGMC text,
BGRGH text,
BGRQ time,
BGRXM text,
BGSJ time,
CJRQ time,
JSBBRQSJ time,
JSBBSJ time,
JYBBH text,
JYJGMC text,
JYJSGH text,
JYJSQM text,
JY... | 医生83321772在01年10月5日至2003年1月20日之间门诊量共有多少? | SELECT COUNT(*) FROM zzmzjzjlb WHERE zzmzjzjlb.ZZYSGH = '83321772' AND zzmzjzjlb.JZKSRQ BETWEEN '2001-10-05' AND '2003-01-20' UNION SELECT COUNT(*) FROM fzzmzjzjlb WHERE fzzmzjzjlb.ZZYSGH = '83321772' AND fzzmzjzjlb.JZKSRQ BETWEEN '2001-10-05' AND '2003-01-20' | css |
CREATE TABLE table_204_4 (
id number,
"date" text,
"race" text,
"competition" text,
"rider" text,
"country" text,
"location" text
) | how many wins did tom boonen made ? | SELECT COUNT(*) FROM table_204_4 WHERE "rider" = 'tom boonen' | squall |
CREATE TABLE table_48578 (
"Date" text,
"Tournament" text,
"Surface" text,
"Opponent in the final" text,
"Score" text
) | In which tournament was Silke Meier the opponent in the final? | SELECT "Tournament" FROM table_48578 WHERE "Opponent in the final" = 'silke meier' | wikisql |
CREATE TABLE table_name_38 (
country VARCHAR,
total VARCHAR,
solar VARCHAR
) | What country has a less than 136.1 total and a 0.02 solar? | SELECT country FROM table_name_38 WHERE total < 136.1 AND solar = 0.02 | sql_create_context |
CREATE TABLE table_2064747_1 (
location_s_ VARCHAR,
accreditation VARCHAR
) | What schools are accredited by COE? | SELECT location_s_ FROM table_2064747_1 WHERE accreditation = "COE" | sql_create_context |
CREATE TABLE table_7316 (
"Tournament" text,
"1998" text,
"1999" text,
"2000" text,
"2001" text,
"2002" text,
"2003" text,
"2004" text,
"2005" text,
"2006" text,
"2007" text,
"2008" text,
"2009" text,
"Career W-L" text
) | What is the value for 2005 when A is 2009 and 2000? | SELECT "2005" FROM table_7316 WHERE "2009" = 'a' AND "2000" = 'a' | wikisql |
CREATE TABLE competition_result (
competition_id number,
club_id_1 number,
club_id_2 number,
score text
)
CREATE TABLE club (
club_id number,
name text,
region text,
start_year text
)
CREATE TABLE competition (
competition_id number,
year number,
competition_type text,
... | What is the average number of gold medals for clubs? | SELECT AVG(gold) FROM club_rank | spider |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions... | give the number of patients whose item id is 51218. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE lab.itemid = "51218" | mimicsql_data |
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 the comparison about All_Games_Percent over the ACC_Regular_Season by a bar chart, rank All_Games_Percent from low to high order. | SELECT ACC_Regular_Season, All_Games_Percent FROM basketball_match ORDER BY All_Games_Percent | nvbench |
CREATE TABLE table_name_6 (
film_title_used_in_nomination VARCHAR,
country VARCHAR
) | What was the film nomination in the Netherlands? | SELECT film_title_used_in_nomination FROM table_name_6 WHERE country = "netherlands" | sql_create_context |
CREATE TABLE zyb (
CLINIC_ID 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,
INSU_TYPE text,
IN... | 患者范明喆在二00一年六月一日到二00五年八月二十一日期间,刷医保卡的金额有多少 | SELECT SUM(t_kc24.PER_ACC_PAY) FROM qtb JOIN t_kc24 ON qtb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE qtb.PERSON_NM = '范明喆' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2001-06-01' AND '2003-12-05' UNION SELECT SUM(t_kc24.PER_ACC_PAY) FROM gyb JOIN t_kc24 ON gyb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE gyb.PERSON_NM = '范明喆' A... | css |
CREATE TABLE table_name_97 (
population_per_square_km VARCHAR,
population_112006 VARCHAR
) | Name the total number of population per square km with population 1.12006 of 12.757 | SELECT COUNT(population_per_square_km) FROM table_name_97 WHERE population_112006 = 12.757 | sql_create_context |
CREATE TABLE table_204_195 (
id number,
"team" text,
"home city" text,
"stadium" text,
"capacity" number,
"last season" text
) | what is the total number of team ? | SELECT COUNT("team") FROM table_204_195 | squall |
CREATE TABLE table_56415 (
"Player" text,
"Position" text,
"Date of Birth (Age)" text,
"Caps" real,
"Club/province" text
) | What position does Toby Flood, who is from Newcastle and has fewer than 24 caps, play? | SELECT "Position" FROM table_56415 WHERE "Club/province" = 'newcastle' AND "Caps" < '24' AND "Player" = 'toby flood' | wikisql |
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,
... | 在入院诊断疾病结果和出院诊断疾病结果的检测中医院3472324在2005年3月11号到2006年10月26号这段时间的医疗记录中有哪些不一样? | SELECT * FROM gwyjzb WHERE gwyjzb.MED_SER_ORG_NO = '3472324' AND gwyjzb.IN_HOSP_DATE BETWEEN '2005-03-11' AND '2006-10-26' UNION SELECT * FROM fgwyjzb WHERE fgwyjzb.MED_SER_ORG_NO = '3472324' AND fgwyjzb.IN_HOSP_DATE BETWEEN '2005-03-11' AND '2006-10-26' EXCEPT SELECT * FROM gwyjzb WHERE gwyjzb.MED_SER_ORG_NO = '347232... | css |
CREATE TABLE table_43393 (
"Date" text,
"Tournament" text,
"Winning score" text,
"Margin of victory" text,
"Runner(s)-up" text
) | What date had a margin victory of 2 strokes? | SELECT "Date" FROM table_43393 WHERE "Margin of victory" = '2 strokes' | wikisql |
CREATE TABLE jybgb (
BBCJBW text,
BBDM text,
BBMC text,
BBZT number,
BGDH text,
BGJGDM text,
BGJGMC text,
BGRGH text,
BGRQ time,
BGRXM text,
BGSJ time,
CJRQ time,
JSBBRQSJ time,
JSBBSJ time,
JYBBH text,
JYJGMC text,
JYJSGH text,
JYJSQM text,
JY... | 在2007年7月16日到2020年8月1日内,医院5860255有几个科室在门诊就诊中开出不超过19张检验报告单? | SELECT COUNT(*) FROM (SELECT jybgb.KSBM FROM zzmzjzjlb JOIN jybgb ON zzmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND zzmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE zzmzjzjlb.YLJGDM = '5860255' AND jybgb.BGRQ BETWEEN '2007-07-16' AND '2020-08-01' GROUP BY jybgb.KSBM HAVING COUNT(*) < 19 UNION SELECT jybgb.KSBM FROM fzzmzjzjlb ... | css |
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
... | what drugs were last prescribed to patient 55027 in 08/2105 via the both eyes route? | SELECT prescriptions.drug FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 55027) AND prescriptions.route = 'both eyes' AND STRFTIME('%y-%m', prescriptions.startdate) = '2105-08' ORDER BY prescriptions.startdate DESC LIMIT 1 | mimic_iii |
CREATE TABLE table_name_76 (
save VARCHAR,
loss VARCHAR
) | What's the save when the loss was santiago (2 2)? | SELECT save FROM table_name_76 WHERE loss = "santiago (2–2)" | sql_create_context |
CREATE TABLE table_name_21 (
margin_of_victory VARCHAR,
date VARCHAR
) | What is the Margin of victory on oct 5, 1997? | SELECT margin_of_victory FROM table_name_21 WHERE date = "oct 5, 1997" | sql_create_context |
CREATE TABLE Nurse (
EmployeeID INTEGER,
Name VARCHAR(30),
Position VARCHAR(30),
Registered BOOLEAN,
SSN INTEGER
)
CREATE TABLE Prescribes (
Physician INTEGER,
Patient INTEGER,
Medication INTEGER,
Date DATETIME,
Appointment INTEGER,
Dose VARCHAR(30)
)
CREATE TABLE On_Call (... | List the names of patients who have made appointments, and count them by a bar chart, display names from low to high order. | SELECT Name, COUNT(Name) FROM Appointment AS T1 JOIN Patient AS T2 ON T1.Patient = T2.SSN GROUP BY Name ORDER BY Name | nvbench |
CREATE TABLE table_name_93 (
top_25 INTEGER,
top_10 INTEGER
) | What is the average number of top-25s for events with less than 2 top-10s? | SELECT AVG(top_25) FROM table_name_93 WHERE top_10 < 2 | sql_create_context |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
... | provide the number of patients whose diagnosis long title is sinoatrial node dysfunction | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE diagnoses.long_title = "Sinoatrial node dysfunction" | mimicsql_data |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id t... | for patient id 52012, specify the admission type and icd9 code. | SELECT demographic.admission_type, procedures.long_title FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.subject_id = "52012" | mimicsql_data |
CREATE TABLE table_76934 (
"Place" text,
"Player" text,
"Country" text,
"Score" real,
"To par" text
) | Who scored more than 72? | SELECT "Player" FROM table_76934 WHERE "Score" > '72' | wikisql |
CREATE TABLE instructor (
instructor_id int,
name varchar,
uniqname varchar
)
CREATE TABLE program (
program_id int,
name varchar,
college varchar,
introduction varchar
)
CREATE TABLE jobs (
job_id int,
job_title varchar,
description varchar,
requirement varchar,
city v... | Is course 492 or course 181 harder ? | SELECT DISTINCT course.number FROM course, program_course WHERE (course.number = 492 OR course.number = 181) AND course.department = 'EECS' AND program_course.course_id = course.course_id ORDER BY program_course.workload DESC LIMIT 1 | advising |
CREATE TABLE table_58571 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | What was the attendance at the Fitzroy home game? | SELECT SUM("Crowd") FROM table_58571 WHERE "Home team" = 'fitzroy' | wikisql |
CREATE TABLE table_25828 (
"Episode #" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Viewers (in millions)" text
) | What was the title of the episode written by Mark Goffman? | SELECT "Title" FROM table_25828 WHERE "Written by" = 'Mark Goffman' | wikisql |
CREATE TABLE table_38113 (
"Outcome" text,
"Date" text,
"Surface" text,
"Partner" text,
"Opponent in the Final" text,
"Score" text
) | What was the Opponent on the game played on a Hard Surface with a Score of 3 6, 6 3, [7 10]? | SELECT "Opponent in the Final" FROM table_38113 WHERE "Surface" = 'hard' AND "Score" = '3–6, 6–3, [7–10]' | wikisql |
CREATE TABLE table_37854 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Record" text
) | Who was home on November 26? | SELECT "Home" FROM table_37854 WHERE "Date" = 'november 26' | wikisql |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
C... | how many patients are diagnosed with personal history of transient ischemic attack (tia), and cerebral infarction without residual deficits? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE diagnoses.long_title = "Personal history of transient ischemic attack (TIA), and cerebral infarction without residual deficits" | mimicsql_data |
CREATE TABLE table_62578 (
"Tie no" real,
"Home team" text,
"Score" text,
"Away team" text,
"Attendance" real
) | What was the final score in Tie #28? | SELECT "Score" FROM table_62578 WHERE "Tie no" = '28' | wikisql |
CREATE TABLE table_204_693 (
id number,
"place" text,
"total" number,
"men" number,
"women" number,
"children" number,
"elderly" number,
"serbs" number,
"jews" number,
"romani" number,
"rusyns" number,
"hungarians" number,
"russians" number
) | what is the difference in total victims between vilovo and novi sad ? | SELECT ABS((SELECT "total" FROM table_204_693 WHERE "place" = 'vilovo') - (SELECT "total" FROM table_204_693 WHERE "place" = 'novi sad')) | squall |
CREATE TABLE table_name_97 (
nationality VARCHAR,
round VARCHAR
) | WHAT NATIONALITY HAS ROUND 3? | SELECT nationality FROM table_name_97 WHERE round = 3 | sql_create_context |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
... | how many of the patients belonging to black/cape verdean ethnic origin remained admitted in hospital for more than 10 days? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "BLACK/CAPE VERDEAN" AND demographic.days_stay > "10" | mimicsql_data |
CREATE TABLE table_19399 (
"#" real,
"Episode Title" text,
"Situation" text,
"Date of Situation" text,
"Nature of Situation" text,
"Original U.S. Airdate" text
) | For the 8 October 2005 12 October 2005 situation dates what was the nature of the situation? | SELECT "Nature of Situation" FROM table_19399 WHERE "Date of Situation" = '8 October 2005 – 12 October 2005' | wikisql |
CREATE TABLE table_55374 (
"Player" text,
"Rec." real,
"Yards" real,
"Avg." real,
"Long" real
) | Which has and average less than 3 and the lowest yards? | SELECT MIN("Yards") FROM table_55374 WHERE "Avg." < '3' | wikisql |
CREATE TABLE Employees (
role_code VARCHAR
) | Show all role codes and the number of employees in each role. | SELECT role_code, COUNT(*) FROM Employees GROUP BY role_code | sql_create_context |
CREATE TABLE table_43734 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"Location Attendance" text,
"Record" text
) | What high points did San Francisco have in a game later than 69? | SELECT "High points" FROM table_43734 WHERE "Game" > '69' AND "Team" = 'san francisco' | wikisql |
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,
... | 从16年5月5日到21年10月18日之中患者华萍雅自己的医保的账户支出总共多少钱? | SELECT SUM(t_kc24.PER_ACC_PAY) FROM gwyjzb JOIN t_kc24 ON gwyjzb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE gwyjzb.PERSON_NM = '华萍雅' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2016-05-05' AND '2021-10-18' UNION SELECT SUM(t_kc24.PER_ACC_PAY) FROM fgwyjzb JOIN t_kc24 ON fgwyjzb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE fgwyjz... | css |
CREATE TABLE table_56401 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | When the Away team scored 6.13 (49), what was the Home teams score? | SELECT "Home team score" FROM table_56401 WHERE "Away team score" = '6.13 (49)' | 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... | 在2005年12月29日至2010年12月28日之中风湿免疫科的云南白药胶囊的共开药量有多些呢? | SELECT COUNT(*) FROM t_kc22 WHERE MED_ORG_DEPT_NM = '风湿免疫科' AND STA_DATE BETWEEN '2005-12-29' AND '2010-12-28' AND SOC_SRT_DIRE_NM = '云南白药胶囊' | css |
CREATE TABLE person_info (
CSD text,
CSRQ time,
GJDM text,
GJMC text,
JGDM text,
JGMC text,
MZDM text,
MZMC text,
RYBH text,
XBDM number,
XBMC text,
XLDM text,
XLMC text,
XM text,
ZYLBDM text,
ZYMC text
)
CREATE TABLE jyjgzbb (
BGDH text,
BGRQ tim... | 请把患者陶浩阔在二零零八年十二月十一日到二零一七年十月十日内所有检验结果指标记录中的仪器编号以及名称都找出来 | SELECT jyjgzbb.YQBH, jyjgzbb.YQMC FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN person_info_hz_info ON person_info.RYBH = person_info_hz_info.RYBH AND 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... | css |
CREATE TABLE wrestler (
Wrestler_ID int,
Name text,
Reign text,
Days_held text,
Location text,
Event text
)
CREATE TABLE Elimination (
Elimination_ID text,
Wrestler_ID text,
Team text,
Eliminated_By text,
Elimination_Move text,
Time text
) | Show different teams in eliminations and the number of eliminations from each team. Visualize by bar chart. | SELECT Team, COUNT(*) FROM Elimination GROUP BY Team | nvbench |
CREATE TABLE conference (
cid int,
homepage varchar,
name varchar
)
CREATE TABLE domain (
did int,
name varchar
)
CREATE TABLE cite (
cited int,
citing int
)
CREATE TABLE organization (
continent varchar,
homepage varchar,
name varchar,
oid int
)
CREATE TABLE keyword (
... | return me the number of papers on VLDB conference after 2000 . | SELECT COUNT(DISTINCT (publication.title)) FROM conference, publication WHERE conference.name = 'VLDB' AND publication.cid = conference.cid AND publication.year > 2000 | academic |
CREATE TABLE table_12946 (
"Player" text,
"Position" text,
"League" text,
"Team" text,
"Years" text
) | Who is the player on a team from the 1970s? | SELECT "Player" FROM table_12946 WHERE "Team" = '1970s' | wikisql |
CREATE TABLE table_name_29 (
bronze INTEGER,
silver VARCHAR,
sport VARCHAR
) | What is the lowest Bronze that has a Total larger than 18 and a Silver smaller than 143? | SELECT MIN(bronze) FROM table_name_29 WHERE "total" > 18 AND sport = "total" AND silver < 143 | 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... | A scatter chart showing the relationship between average and minimum weight for each gender. | SELECT AVG(Weight), MIN(Weight) FROM people GROUP BY Sex | nvbench |
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 diagnoses (
... | count the number of patients whose year of death is less than or equal to 2111? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.dod_year <= "2111.0" | mimicsql_data |
CREATE TABLE table_64523 (
"Position" real,
"Name" text,
"Played" real,
"Drawn" real,
"Lost" real,
"Points" real
) | How many points did the ESC Riverrats Geretsried, who lost more than 3 games, score? | SELECT SUM("Points") FROM table_64523 WHERE "Lost" > '3' AND "Name" = 'esc riverrats geretsried' | wikisql |
CREATE TABLE table_15353123_1 (
pick__number VARCHAR,
player VARCHAR
) | How many players named Dean Kirkland were picked | SELECT COUNT(pick__number) FROM table_15353123_1 WHERE player = "Dean Kirkland" | sql_create_context |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREA... | how many days had it been since patient 015-59552 was admitted to the hospital? | SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', patient.hospitaladmittime)) FROM patient WHERE patient.uniquepid = '015-59552' AND patient.hospitaldischargetime IS NULL | eicu |
CREATE TABLE table_name_56 (
interview INTEGER,
evening_gown VARCHAR
) | Which biggest interview score had an evening gown stat of 9.286? | SELECT MAX(interview) FROM table_name_56 WHERE evening_gown = 9.286 | sql_create_context |
CREATE TABLE table_name_85 (
place VARCHAR,
team VARCHAR,
played VARCHAR
) | how many times is the team tauro and played less than 18? | SELECT COUNT(place) FROM table_name_85 WHERE team = "tauro" AND played < 18 | sql_create_context |
CREATE TABLE table_71783 (
"Date" text,
"Region" text,
"Label" text,
"Catalogue" text,
"Format" text
) | Which label has UK for its region, is on a CD, and is dated from 1986? | SELECT "Label" FROM table_71783 WHERE "Region" = 'uk' AND "Date" = '1986' AND "Format" = 'cd' | wikisql |
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 demographic (... | what is the discharge location and date of death of patient with patient id 8323? | SELECT demographic.discharge_location, demographic.dod FROM demographic WHERE demographic.subject_id = "8323" | mimicsql_data |
CREATE TABLE table_56028 (
"Rd #" real,
"Pick #" real,
"Player" text,
"Team (League)" text,
"Reg GP" real,
"Pl GP" real
) | What's the largest pick number for corrie d'alessio with a rd number over 6? | SELECT MAX("Pick #") FROM table_56028 WHERE "Player" = 'corrie d''alessio' AND "Rd #" > '6' | wikisql |
CREATE TABLE table_name_18 (
film VARCHAR,
award VARCHAR
) | What is the name of the film with an award of 5,380? | SELECT film FROM table_name_18 WHERE award = "£5,380" | sql_create_context |
CREATE TABLE table_30894 (
"Month Sequence" real,
"Numbered Month" text,
"Month Name" text,
"Regular Year" text,
"Defective Year" real,
"Excessive Year" real
) | How many month names are there for the tenth numbered month? | SELECT COUNT("Month Name") FROM table_30894 WHERE "Numbered Month" = 'Tenth' | wikisql |
CREATE TABLE table_39790 (
"Year" real,
"Award" text,
"Category" text,
"Nominated Work" text,
"Result" text
) | How many years has the Mercury Prize award been given? | SELECT COUNT("Year") FROM table_39790 WHERE "Award" = 'mercury prize' | wikisql |
CREATE TABLE table_name_45 (
against INTEGER,
date VARCHAR
) | What was the average of againsts on 21/5/1997? | SELECT AVG(against) FROM table_name_45 WHERE date = "21/5/1997" | sql_create_context |
CREATE TABLE table_27455867_1 (
audition_city VARCHAR,
audition_venue VARCHAR
) | In how many different audition cities were the Bridgestone arena auditions held? | SELECT COUNT(audition_city) FROM table_27455867_1 WHERE audition_venue = "Bridgestone Arena" | sql_create_context |
CREATE TABLE route (
train_id int,
station_id int
)
CREATE TABLE weekly_weather (
station_id int,
day_of_week text,
high_temperature int,
low_temperature int,
precipitation real,
wind_speed_mph int
)
CREATE TABLE station (
id int,
network_name text,
services text,
local... | Give me a bar chart for the number of services of each services | SELECT services, COUNT(services) FROM station GROUP BY services | nvbench |
CREATE TABLE table_30706 (
"Track no." real,
"Track" text,
"Original Artist" text,
"Soloist(s)" text,
"Vocal Percussionist" text,
"Arranger(s)" text
) | What track name had Terry Tamm as the soloist? | SELECT "Track" FROM table_30706 WHERE "Soloist(s)" = 'Terry Tamm' | wikisql |
CREATE TABLE table_name_20 (
tournament VARCHAR,
runner_s__up VARCHAR
) | Which tournament had a runner-up of Val Skinner? | SELECT tournament FROM table_name_20 WHERE runner_s__up = "val skinner" | 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,
... | 看看09年7月25号到17年3月26号8275886这个医疗机构的新生儿门诊的就诊记录 | SELECT COUNT(*) FROM txmzjzjlb WHERE txmzjzjlb.YLJGDM = '8275886' AND txmzjzjlb.JZKSRQ BETWEEN '2009-07-25' AND '2017-03-26' AND txmzjzjlb.ZSEBZ > 0 UNION SELECT COUNT(*) FROM ftxmzjzjlb WHERE ftxmzjzjlb.YLJGDM = '8275886' AND ftxmzjzjlb.JZKSRQ BETWEEN '2009-07-25' AND '2017-03-26' AND ftxmzjzjlb.ZSEBZ > 0 | css |
CREATE TABLE table_name_41 (
week INTEGER,
attendance VARCHAR
) | what is the lowest week when the attendance is 54,714? | SELECT MIN(week) FROM table_name_41 WHERE attendance = 54 OFFSET 714 | sql_create_context |
CREATE TABLE table_66069 (
"Game" text,
"Date" text,
"Opponent" text,
"Result" text,
"Record" text
) | What was the date for game 13? | SELECT "Date" FROM table_66069 WHERE "Game" = '13' | wikisql |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.