context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
LOCATION_ID decimal(4,0)
)
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,0)
)
CREATE TABLE job_history (
EMPLO... | For those employees who do not work in departments with managers that have ids between 100 and 200, give me the comparison about salary over the phone_number by a bar chart, and order from high to low by the Y. | SELECT PHONE_NUMBER, SALARY FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY SALARY DESC | nvbench |
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 admission year is less than 2158 and procedure short title is injection oxazolidinone? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admityear < "2158" AND procedures.short_title = "Injection oxazolidinone" | mimicsql_data |
CREATE TABLE table_18934 (
"Year (Ceremony)" text,
"Film title used in nomination" text,
"Original title" text,
"Director" text,
"Result" text
) | What title was used in the nomination for the title Biola Tak Berdawai? | SELECT "Film title used in nomination" FROM table_18934 WHERE "Original title" = 'Biola tak berdawai' | wikisql |
CREATE TABLE Courses (
course_id INTEGER,
author_id INTEGER,
subject_id INTEGER,
course_name VARCHAR(120),
course_description VARCHAR(255)
)
CREATE TABLE Student_Tests_Taken (
registration_id INTEGER,
date_test_taken DATETIME,
test_result VARCHAR(255)
)
CREATE TABLE Subjects (
subj... | Bar chart x axis date of enrolment y axis the number of date of enrolment, and list y axis from low to high order. | SELECT date_of_enrolment, COUNT(date_of_enrolment) FROM Student_Course_Enrolment ORDER BY COUNT(date_of_enrolment) | nvbench |
CREATE TABLE table_18056 (
"Competition" text,
"Round" text,
"Opponent" text,
"Result" text,
"Score" text,
"Home/Away" text,
"Venue" text,
"Attendance" text,
"Date" text
) | Who was the opponent in round 2? | SELECT "Opponent" FROM table_18056 WHERE "Round" = '2' | wikisql |
CREATE TABLE table_18442691_2 (
no INTEGER,
album VARCHAR
) | When bat out of hell is the album what is the lowest number? | SELECT MIN(no) FROM table_18442691_2 WHERE album = "Bat Out of Hell" | sql_create_context |
CREATE TABLE table_21155 (
"Player" text,
"GP" real,
"K. Ret." real,
"KR Yds" real,
"KR Avg." text,
"KR TD" real,
"KR LG" real,
"P. Ret." real,
"PR Yds" real,
"PR Avg." text,
"PR TD" real,
"PR LG" real,
"MFG Ret." real,
"MFG Yds" real,
"MFG Avg." text,
"MF... | How many p.ret are there when kr avg is 11.3 ? | SELECT COUNT("P. Ret.") FROM table_21155 WHERE "KR Avg." = '11.3' | wikisql |
CREATE TABLE table_name_10 (
score VARCHAR,
player VARCHAR,
country VARCHAR,
place VARCHAR
) | What is Score, when Country is 'United States', when Place is 'T3', and when Player is 'Phil Blackmar'? | SELECT score FROM table_name_10 WHERE country = "united states" AND place = "t3" AND player = "phil blackmar" | sql_create_context |
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
chartti... | what organism was found during the first pleural fluid test of patient 17398 until 40 months ago? | SELECT microbiologyevents.org_name FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 17398) AND microbiologyevents.spec_type_desc = 'pleural fluid' AND NOT microbiologyevents.org_name IS NULL AND DATETIME(microbiologyevents.charttime) <=... | mimic_iii |
CREATE TABLE Staff (
staff_id INTEGER,
staff_name VARCHAR(255),
gender VARCHAR(1),
other_staff_details VARCHAR(255)
)
CREATE TABLE Assets (
asset_id INTEGER,
maintenance_contract_id INTEGER,
supplier_company_id INTEGER,
asset_details VARCHAR(255),
asset_make VARCHAR(20),
asset_m... | How many assets can each parts be used in? List the part name and the number, and order y-axis in asc order. | SELECT part_name, COUNT(*) FROM Parts AS T1 JOIN Asset_Parts AS T2 ON T1.part_id = T2.part_id GROUP BY T1.part_name ORDER BY COUNT(*) | nvbench |
CREATE TABLE table_name_23 (
frequency VARCHAR,
location VARCHAR
) | Which frequency is located in Dagupan? | SELECT frequency FROM table_name_23 WHERE location = "dagupan" | sql_create_context |
CREATE TABLE table_name_25 (
set_1 VARCHAR,
set_3 VARCHAR
) | Which Set 1 has a Set 3 of 16 25? | SELECT set_1 FROM table_name_25 WHERE set_3 = "16–25" | sql_create_context |
CREATE TABLE table_16718 (
"Season" real,
"Premier" text,
"Runner Up" text,
"Score" text,
"Venue" text,
"Attendance" real,
"Premiership" text
) | Who are all the runner ups when the score is 9.12 (66) 5.6 (36)? | SELECT "Runner Up" FROM table_16718 WHERE "Score" = '9.12 (66) – 5.6 (36)' | wikisql |
CREATE TABLE tracks (
id INTEGER,
name VARCHAR(200),
album_id INTEGER,
media_type_id INTEGER,
genre_id INTEGER,
composer VARCHAR(220),
milliseconds INTEGER,
bytes INTEGER,
unit_price NUMERIC(10,2)
)
CREATE TABLE media_types (
id INTEGER,
name VARCHAR(120)
)
CREATE TABLE cus... | Bar chart x axis name y axis how many name | SELECT name, COUNT(name) FROM playlists GROUP BY name | nvbench |
CREATE TABLE documents (
document_id number,
document_type_code text,
project_id number,
document_date time,
document_name text,
document_description text,
other_details text
)
CREATE TABLE projects (
project_id number,
project_details text
)
CREATE TABLE ref_budget_codes (
bud... | What are the names and ids of documents that have the type code BK? | SELECT document_name, document_id FROM documents WHERE document_type_code = "BK" | spider |
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE labevents (
row... | what is the maximum heart rate of patient 739 today? | SELECT MAX(chartevents.valuenum) 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 = 'heart ... | mimic_iii |
CREATE TABLE table_10015132_21 (
position VARCHAR,
player VARCHAR
) | Which position does Loren Woods play? | SELECT position FROM table_10015132_21 WHERE player = "Loren Woods" | sql_create_context |
CREATE TABLE table_75859 (
"Date" text,
"Time" text,
"Home" text,
"Away" text,
"Score" text,
"Ground" text
) | What is the Away with a Ground that is humber college lakeshore? | SELECT "Away" FROM table_75859 WHERE "Ground" = 'humber college lakeshore' | 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... | 统计一下医疗记录中入院诊断为Q34.984在医院9479649里的最低和最高医疗费总额是多少? | SELECT MIN(t_kc24.MED_AMOUT), MAX(t_kc24.MED_AMOUT) FROM t_kc24 WHERE t_kc24.MED_CLINIC_ID IN (SELECT gwyjzb.MED_CLINIC_ID FROM gwyjzb WHERE gwyjzb.MED_SER_ORG_NO = '9479649' AND gwyjzb.IN_DIAG_DIS_CD = 'Q34.984' UNION SELECT fgwyjzb.MED_CLINIC_ID FROM fgwyjzb WHERE fgwyjzb.MED_SER_ORG_NO = '9479649' AND fgwyjzb.IN_DIA... | css |
CREATE TABLE jyjgzbb (
BGDH text,
BGRQ time,
CKZFWDX text,
CKZFWSX number,
CKZFWXX number,
JCFF text,
JCRGH text,
JCRXM text,
JCXMMC text,
JCZBDM text,
JCZBJGDL number,
JCZBJGDW text,
JCZBJGDX text,
JCZBMC text,
JLDW text,
JYRQ time,
JYZBLSH text,
... | 患者83706671的030972指标是什么情况在17年的10月30号到11月23号期间 | SELECT * FROM hz_info JOIN mzjzjlb JOIN jyjgzbb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jyjgzbb.jybgb_YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jyjgzbb.jybgb_JZLSH_MZJZJLB WHERE hz_info.RYBH = '83706671' AND jyjgzbb.JYRQ BETWEEN '2017-10-30' AND '2017-1... | css |
CREATE TABLE program_requirement (
program_id int,
category varchar,
min_credit int,
additional_req varchar
)
CREATE TABLE offering_instructor (
offering_instructor_id int,
offering_id int,
instructor_id int
)
CREATE TABLE program (
program_id int,
name varchar,
college varchar... | What are the Special Latin American Studies courses of 2 credits ? | SELECT DISTINCT department, name, number FROM course WHERE (description LIKE '%Special Latin American Studies%' OR name LIKE '%Special Latin American Studies%') AND credits = 2 | advising |
CREATE TABLE personfriend (
name text,
friend text,
year number
)
CREATE TABLE person (
name text,
age number,
city text,
gender text,
job text
) | Find Alice's friends of friends. | SELECT DISTINCT T4.name FROM personfriend AS T1 JOIN person AS T2 ON T1.name = T2.name JOIN personfriend AS T3 ON T1.friend = T3.name JOIN personfriend AS T4 ON T3.friend = T4.name WHERE T2.name = 'Alice' AND T4.name <> 'Alice' | spider |
CREATE TABLE table_33454 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | What venue featured a home score of 8.9 (57)? | SELECT "Venue" FROM table_33454 WHERE "Home team score" = '8.9 (57)' | 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 lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,... | what is the minimum age of female patients dicharged to the rehab/distinct part of the hosp? | SELECT MIN(demographic.age) FROM demographic WHERE demographic.gender = "F" AND demographic.discharge_location = "REHAB/DISTINCT PART HOSP" | mimicsql_data |
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,
TargetRepChange number
)
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE Votes (
Id number,
... | examples of first score if body contains 'downvote'. | SELECT p.Id, p.Score AS ave FROM Posts AS p LEFT JOIN Users AS u ON p.OwnerUserId = u.Id LEFT JOIN (SELECT u.Id AS u_id, MIN(p.Id) AS min_pid FROM Posts AS p LEFT JOIN Users AS u ON p.OwnerUserId = u.Id GROUP BY u.Id) AS mp ON mp.u_id = u.Id AND mp.min_pid = p.Id WHERE p.PostTypeId = 1 AND p.Body LIKE '%downvote%' AND ... | sede |
CREATE TABLE table_16555 (
"Season" real,
"Grand FinalDate" text,
"WinningTeam" text,
"Score" text,
"LosingTeam" text,
"Location" text,
"GF Attendance" real,
"Clive Churchill Medal" text
) | How many seasons did the canterbury bulldogs (8) win? | SELECT COUNT("Season") FROM table_16555 WHERE "WinningTeam" = 'Canterbury Bulldogs (8)' | wikisql |
CREATE TABLE table_25730209_2 (
extra_points INTEGER
) | What was the least amount of points scored? | SELECT MIN(extra_points) FROM table_25730209_2 | sql_create_context |
CREATE TABLE table_203_276 (
id number,
"album#" text,
"english title" text,
"chinese (traditional)" text,
"chinese (simplified)" text,
"release date" text,
"label" text
) | what is the name of her last album produced with rock records ? | SELECT "english title" FROM table_203_276 WHERE "label" = 'rock records' ORDER BY id DESC LIMIT 1 | squall |
CREATE TABLE table_22399 (
"Episode" text,
"Garfield Episode 1" text,
"U.S. Acres Episode" text,
"Garfield Episode 2" text,
"Original Airdate" text
) | Which episode in Garfield episode 1 is the worst pizza in the history of mankind? | SELECT "Episode" FROM table_22399 WHERE "Garfield Episode 1" = 'The Worst Pizza in the History of Mankind' | wikisql |
CREATE TABLE table_77571 (
"Position" real,
"Club" text,
"Played" real,
"Points" text,
"Wins" real,
"Draws" real,
"Losses" real,
"Goals for" real,
"Goals against" real,
"Goal Difference" real
) | What is the highest number of loss with a 7 position and more than 45 goals? | SELECT MAX("Losses") FROM table_77571 WHERE "Position" = '7' AND "Goals for" > '45' | wikisql |
CREATE TABLE table_name_61 (
season INTEGER,
position VARCHAR
) | What is the highest season for the 7th position? | SELECT MAX(season) FROM table_name_61 WHERE position = "7th" | sql_create_context |
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
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,
... | 检测指标294608的参考值范围下限和上限在哪个数值范围内,门诊可诊断患者患有病理性赌博 | SELECT jyjgzbb.CKZFWXX, jyjgzbb.CKZFWSX FROM wdmzjzjlb JOIN jybgb JOIN jyjgzbb ON wdmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND wdmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE wdmzjzjlb.JZZDSM = '病理性赌博' AND jyjgzbb.JCZBDM = '294608' UNION SELECT jyjgzbb.CKZFWXX,... | css |
CREATE TABLE table_25793 (
"Rank" real,
"City/Town" text,
"County" text,
"Region/Province" text,
"Population" real,
"Country" text
) | When fleetwood is the city/town how many sets of population are there? | SELECT COUNT("Population") FROM table_25793 WHERE "City/Town" = 'Fleetwood' | wikisql |
CREATE TABLE table_55368 (
"Title" text,
"Original story author" text,
"Director" text,
"Original U.S. air-date" text,
"Original Canadian air-date" text
) | What was the Original Canadian air-date for the episode directed by mark rydell? | SELECT "Original Canadian air-date" FROM table_55368 WHERE "Director" = 'mark rydell' | wikisql |
CREATE TABLE table_name_94 (
tournament VARCHAR,
date VARCHAR
) | Which tournament took place on June 18, 2013? | SELECT tournament FROM table_name_94 WHERE date = "june 18, 2013" | sql_create_context |
CREATE TABLE table_name_89 (
championship VARCHAR,
margin VARCHAR
) | Which championship has a margin of 8 strokes? | SELECT championship FROM table_name_89 WHERE margin = "8 strokes" | sql_create_context |
CREATE TABLE t_kc22 (
AMOUNT number,
CHA_ITEM_LEV number,
DATA_ID text,
DIRE_TYPE number,
DOSE_FORM text,
DOSE_UNIT text,
EACH_DOSAGE text,
EXP_OCC_DATE time,
FLX_MED_ORG_ID text,
FXBZ number,
HOSP_DOC_CD text,
HOSP_DOC_NM text,
MED_CLINIC_ID text,
MED_DIRE_CD tex... | 患者水雯华就诊过的医院有哪几家,时间是从01年12月24日到08年4月20日 | SELECT COUNT(gwyjzb.MED_SER_ORG_NO) FROM gwyjzb WHERE gwyjzb.PERSON_NM = '水雯华' AND gwyjzb.IN_HOSP_DATE BETWEEN '2001-12-24' AND '2008-04-20' UNION SELECT COUNT(fgwyjzb.MED_SER_ORG_NO) FROM fgwyjzb WHERE fgwyjzb.PERSON_NM = '水雯华' AND fgwyjzb.IN_HOSP_DATE BETWEEN '2001-12-24' AND '2008-04-20' | css |
CREATE TABLE takes (
id text,
course_id text,
sec_id text,
semester text,
year number,
grade text
)
CREATE TABLE prereq (
course_id text,
prereq_id text
)
CREATE TABLE teaches (
id text,
course_id text,
sec_id text,
semester text,
year number
)
CREATE TABLE departm... | What is the title of a course that is listed in both the Statistics and Psychology departments? | SELECT title FROM course WHERE dept_name = 'Statistics' INTERSECT SELECT title FROM course WHERE dept_name = 'Psychology' | spider |
CREATE TABLE table_train_77 (
"id" int,
"gender" string,
"pregnancy_or_lactation" bool,
"language" string,
"hiv_aids" bool,
"age" float,
"NOUSE" float
) | age 50 and older. | SELECT * FROM table_train_77 WHERE age >= 50 | criteria2sql |
CREATE TABLE table_22993636_2 (
home_record VARCHAR,
percentage VARCHAR
) | What's the home record of the team with percentage of .168? | SELECT home_record FROM table_22993636_2 WHERE percentage = ".168" | sql_create_context |
CREATE TABLE table_25664518_3 (
second_couple VARCHAR,
itv1_weekly_ranking VARCHAR
) | Who was the second couple for the episode having an ITV1 ranking of 29? | SELECT second_couple FROM table_25664518_3 WHERE itv1_weekly_ranking = 29 | sql_create_context |
CREATE TABLE catalog_contents_additional_attributes (
catalog_entry_id number,
catalog_level_number number,
attribute_id number,
attribute_value text
)
CREATE TABLE catalogs (
catalog_id number,
catalog_name text,
catalog_publisher text,
date_of_publication time,
date_of_latest_revi... | Find the names of all the products whose stock number starts with '2'. | SELECT catalog_entry_name FROM catalog_contents WHERE product_stock_number LIKE "2%" | spider |
CREATE TABLE table_name_75 (
mintage INTEGER,
artist VARCHAR
) | What is the sum of Artist Steve Hepburn's Mintage? | SELECT SUM(mintage) FROM table_name_75 WHERE artist = "steve hepburn" | sql_create_context |
CREATE TABLE table_train_178 (
"id" int,
"gender" string,
"pregnancy_or_lactation" bool,
"hiv_infection" bool,
"hepatitis_c" bool,
"renal_disease" bool,
"hypoglycemia" bool,
"serum_creatinine" float,
"seizure_disorder" bool,
"body_mass_index_bmi" float,
"NOUSE" float
) | pregnant / breastfeeding female | SELECT * FROM table_train_178 WHERE pregnancy_or_lactation = 1 AND gender = 'female' | criteria2sql |
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... | Draw a pie chart about the proportion of All_Games and All_Games_Percent. | SELECT All_Games, All_Games_Percent FROM basketball_match | nvbench |
CREATE TABLE dual_carrier (
main_airline varchar,
low_flight_number int,
high_flight_number int,
dual_airline varchar,
service_name text
)
CREATE TABLE city (
city_code varchar,
city_name varchar,
state_code varchar,
country_name varchar,
time_zone_code varchar
)
CREATE TABLE c... | please show me FIRST class flights from INDIANAPOLIS to MEMPHIS one way leaving before 1000 | 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, fare, fare_basis, flight, flight_fare WHERE (((fare.round_trip_required = 'NO') AND fare_basis.class_type = 'FIRST' AND fare.fare_basis_code = fare_basis.fare_basis_code AND ... | atis |
CREATE TABLE field (
fieldid int
)
CREATE TABLE writes (
paperid int,
authorid int
)
CREATE TABLE paperfield (
fieldid int,
paperid int
)
CREATE TABLE keyphrase (
keyphraseid int,
keyphrasename varchar
)
CREATE TABLE venue (
venueid int,
venuename varchar
)
CREATE TABLE dataset ... | how many papers use ImageNet ? | SELECT DISTINCT COUNT(DISTINCT paper.paperid) FROM dataset, paper, paperdataset WHERE dataset.datasetname LIKE 'ImageNet' AND paperdataset.datasetid = dataset.datasetid AND paper.paperid = paperdataset.paperid | scholar |
CREATE TABLE table_69886 (
"Club" text,
"Played" text,
"Drawn" text,
"Lost" text,
"Try BP" text,
"Losing BP" text
) | Can you tell me the Losing BP that has Played of 22, and the Lost of 5? | SELECT "Losing BP" FROM table_69886 WHERE "Played" = '22' AND "Lost" = '5' | wikisql |
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location t... | how many patients whose diagnoses short title is chr blood loss anemia and drug route is po? | 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 = "Chr blood loss anemia" AND prescriptions.route = "PO" | mimicsql_data |
CREATE TABLE table_5269 (
"Position" text,
"Race Number" real,
"Driver" text,
"Country" text,
"Laps" text
) | what is the race number of bob wollek | SELECT "Race Number" FROM table_5269 WHERE "Driver" = 'bob wollek' | wikisql |
CREATE TABLE table_203_165 (
id number,
"rank" number,
"nation" text,
"gold" number,
"silver" number,
"bronze" number,
"total" number
) | how many combined silver medals did china , india , and japan earn ? | SELECT SUM("silver") FROM table_203_165 WHERE "nation" IN ('china', 'india', 'japan') | squall |
CREATE TABLE Movie (
title VARCHAR,
mID VARCHAR
)
CREATE TABLE Rating (
mID VARCHAR,
stars VARCHAR
) | What are the names of movies that get 3 star and 4 star? | SELECT T2.title FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID WHERE T1.stars = 3 INTERSECT SELECT T2.title FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID WHERE T1.stars = 4 | 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,
... | let me know the long title of diagnoses for patient michelle skidmore. | SELECT diagnoses.long_title FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.name = "Michelle Skidmore" | mimicsql_data |
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
systemicsystolic number,
systemicdiastolic number,
systemicmean number,
observationtime time
)
CREATE TABLE medication (
medi... | tell me the five year survival rate of patients who were prescribed hydralazine hcl 20 mg/ml inj soln (range) prn after being diagnosed with acute renal failure - due to hypovolemia/decreased circulating volume? | SELECT SUM(CASE WHEN patient.hospitaldischargestatus = 'alive' THEN 1 WHEN STRFTIME('%j', patient.hospitaldischargetime) - STRFTIME('%j', t4.diagnosistime) > 5 * 365 THEN 1 ELSE 0 END) * 100 / COUNT(*) FROM (SELECT t2.uniquepid, t2.diagnosistime FROM (SELECT t1.uniquepid, t1.diagnosistime FROM (SELECT patient.uniquepid... | eicu |
CREATE TABLE PostLinks (
Id number,
CreationDate time,
PostId number,
RelatedPostId number,
LinkTypeId number
)
CREATE TABLE SuggestedEdits (
Id number,
PostId number,
CreationDate time,
ApprovalDate time,
RejectionDate time,
OwnerUserId number,
Comment text,
Text te... | Count of answers of the site by day. | SELECT DATEDIFF(day, @SiteStart, CreationDate) AS Age, COUNT(*) AS Count FROM Posts WHERE PostTypeId = 2 AND Id IN (SELECT PostId FROM Votes WHERE VoteTypeId = 2) GROUP BY DATEDIFF(day, @SiteStart, CreationDate) ORDER BY Age | sede |
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
)
... | what is age and language of subject id 8990? | SELECT demographic.age, demographic.language FROM demographic WHERE demographic.subject_id = "8990" | mimicsql_data |
CREATE TABLE table_79036 (
"South West DFL" text,
"Wins" real,
"Byes" real,
"Losses" real,
"Draws" real,
"Against" real
) | How many wins have 16 losses and an Against smaller than 3213? | SELECT SUM("Wins") FROM table_79036 WHERE "Losses" = '16' AND "Against" < '3213' | wikisql |
CREATE TABLE customer_payments (
customer_id number,
datetime_payment time,
payment_method_code text,
amount_payment number
)
CREATE TABLE customers (
customer_id number,
customer_address_id number,
customer_status_code text,
date_became_customer time,
date_of_birth time,
first_... | What are the details of the car with id 1? | SELECT vehicle_details FROM vehicles WHERE vehicle_id = 1 | spider |
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... | Get me the number of patients who have a chemistry lab test category along with diagnoses icd9 code 2760. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.icd9_code = "2760" AND lab."CATEGORY" = "Chemistry" | mimicsql_data |
CREATE TABLE table_name_36 (
studio_analysts VARCHAR,
studio_host VARCHAR,
year VARCHAR
) | WHich Studio analysts has a Studio host of gary tanguay in 2009-10? | SELECT studio_analysts FROM table_name_36 WHERE studio_host = "gary tanguay" AND year = "2009-10" | sql_create_context |
CREATE TABLE table_name_93 (
city VARCHAR,
opponent VARCHAR
) | What city was the game held in when the opponent was Towson? | SELECT city FROM table_name_93 WHERE opponent = "towson" | sql_create_context |
CREATE TABLE table_34366 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Record" text,
"Game Site" text,
"Attendance" real
) | In what Week were there more than 23,875 in Attendance at Memorial Stadium with Detroit Lions as the Opponent? | SELECT AVG("Week") FROM table_34366 WHERE "Attendance" > '23,875' AND "Game Site" = 'memorial stadium' AND "Opponent" = 'detroit lions' | wikisql |
CREATE TABLE table_66043 (
"Rank" real,
"Stadium" text,
"Capacity" text,
"Location" text,
"Home Team" text
) | Which location has 101,119 as the capacity? | SELECT "Location" FROM table_66043 WHERE "Capacity" = '101,119' | wikisql |
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime ti... | how did patient 40059 this year first admitted to hospital? | SELECT admissions.admission_type FROM admissions WHERE admissions.subject_id = 40059 AND DATETIME(admissions.admittime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') ORDER BY admissions.admittime LIMIT 1 | mimic_iii |
CREATE TABLE table_22489 (
"Township" text,
"County" text,
"Pop. (2010)" real,
"Land ( sqmi )" text,
"Water (sqmi)" text,
"Latitude" text,
"Longitude" text,
"GEO ID" real,
"ANSI code" real
) | Name the latitude for 3810536900 | SELECT "Latitude" FROM table_22489 WHERE "GEO ID" = '3810536900' | wikisql |
CREATE TABLE table_51398 (
"Player" text,
"Position" text,
"Date of Birth (Age)" text,
"Caps" real,
"Club/province" text
) | What is the date of birth of Kameli Ratuvou? | SELECT "Date of Birth (Age)" FROM table_51398 WHERE "Player" = 'kameli ratuvou' | wikisql |
CREATE TABLE table_73148 (
"Game" real,
"Date" text,
"Opponent" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location" text,
"Record" text
) | Name the opponent for june 12 | SELECT "Opponent" FROM table_73148 WHERE "Date" = 'June 12' | wikisql |
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationDate time,
CloseReasonTypeId number,
CloseAsOffTopicReasonTypeId number,
DuplicateOfQuestionId number,
BelongsOnBaseHostAddress text
)
CREATE TABLE Badges (
Id number,
UserId number,
Name text,
... | Dump your own posts as Graph. Dump your own posts, e.g. for backup purposes. | SELECT * FROM Posts WHERE OwnerUserId = @UserID | sede |
CREATE TABLE table_name_69 (
player VARCHAR,
score VARCHAR
) | Name the player for 68-68-75-74=285 | SELECT player FROM table_name_69 WHERE score = 68 - 68 - 75 - 74 = 285 | sql_create_context |
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellv... | the first intake that patient 008-40862 had since 1562 days ago what is the name of it? | SELECT intakeoutput.celllabel FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '008-40862')) AND intakeoutput.cellpath LIKE '%intake%' AND D... | eicu |
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... | A pie chart shows the proportion of ACC_Road and the amount of ACC_Road. | SELECT ACC_Road, COUNT(ACC_Road) FROM basketball_match GROUP BY ACC_Road | nvbench |
CREATE TABLE table_name_56 (
years VARCHAR,
points VARCHAR,
goals VARCHAR
) | What years did the player play when he scored 78 points and 22 goals? | SELECT years FROM table_name_56 WHERE points = "78" AND goals = "22" | sql_create_context |
CREATE TABLE table_3042 (
"Episode no." real,
"Airdate" text,
"Viewers" real,
"BBC Three weekly ranking" real,
"Cable rank" real
) | What is the highest cable ranking? | SELECT MAX("Cable rank") FROM table_3042 | wikisql |
CREATE TABLE table_23808 (
"BSE Code" text,
"Company" text,
"City" text,
"GICS Sector" text,
"Free float" text,
"Index weighting (%" text
) | How many values of free float for the BSE code of 4EH? | SELECT COUNT("Free float") FROM table_23808 WHERE "BSE Code" = '4EH' | wikisql |
CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
LOCATION_ID decimal(4,0)
)
CREATE TABLE locations (
LOCATION_ID decimal(4,0),
STREET_ADDRESS varchar(40),
POSTAL_CODE varchar(12),
CITY varchar(30),
STATE_PROVINCE varchar(25... | For those employees who did not have any job in the past, return a bar chart about the distribution of hire_date and the average of manager_id bin hire_date by weekday, I want to list in ascending by the the average of manager id. | SELECT HIRE_DATE, AVG(MANAGER_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) ORDER BY AVG(MANAGER_ID) | nvbench |
CREATE TABLE table_204_355 (
id number,
"#" text,
"player" text,
"country" text,
"score" text,
"to par" number,
"money ($)" number
) | what was the to par difference between betty jameson and patty berg ? | SELECT (SELECT "to par" FROM table_204_355 WHERE "player" = 'betty jameson') - (SELECT "to par" FROM table_204_355 WHERE "player" = 'patty berg') | squall |
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 demographic ... | what is admission time and drug name of subject id 42963? | SELECT demographic.admittime, prescriptions.drug FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.subject_id = "42963" | mimicsql_data |
CREATE TABLE table_79147 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Results" text
) | Which Democratic incumbent was first elected in 1998? | SELECT "Incumbent" FROM table_79147 WHERE "Party" = 'democratic' AND "First elected" = '1998' | wikisql |
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
... | how many patients were prescribed the drug nitroglycerin oint. 2% until 2101? | SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT prescriptions.hadm_id FROM prescriptions WHERE prescriptions.drug = 'nitroglycerin oint. 2%' AND STRFTIME('%y', prescriptions.startdate) <= '2101') | mimic_iii |
CREATE TABLE table_name_54 (
postseason VARCHAR,
rank VARCHAR,
win_percentage VARCHAR,
games VARCHAR
) | What postseason has a win% between 0.40700000000000003 and 108 with a rank of 1? | SELECT postseason FROM table_name_54 WHERE win_percentage > 0.40700000000000003 AND games < 108 AND rank = 1 | sql_create_context |
CREATE TABLE table_67369 (
"Rank" real,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) | What is the total silver with a Rank larger than 9, and a Total larger than 1? | SELECT SUM("Silver") FROM table_67369 WHERE "Rank" > '9' AND "Total" > '1' | wikisql |
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
systemicsystolic number,
systemicdiastolic number,
systemicmean number,
observationtime time
)
CREATE TABLE microlab (
microl... | have any organisms been detected in patient 031-4987's last microbiological nasopharynx test since 3 years ago? | SELECT COUNT(*) > 0 FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-4987')) AND microlab.culturesite = 'nasopharynx' AND DATETIME(microlab.cul... | eicu |
CREATE TABLE table_name_64 (
score VARCHAR,
date VARCHAR
) | What was the score on October 30? | SELECT score FROM table_name_64 WHERE date = "october 30" | sql_create_context |
CREATE TABLE table_10730 (
"Player" text,
"Position" text,
"School" text,
"Hometown" text,
"College" text
) | Who went to ohio state? | SELECT "Player" FROM table_10730 WHERE "College" = 'ohio state' | wikisql |
CREATE TABLE t_kc24 (
ACCOUNT_DASH_DATE time,
ACCOUNT_DASH_FLG number,
CASH_PAY number,
CIVIL_SUBSIDY number,
CKC102 number,
CLINIC_ID text,
CLINIC_SLT_DATE time,
COMP_ID text,
COM_ACC_PAY number,
COM_PAY number,
DATA_ID text,
ENT_ACC_PAY number,
ENT_PAY number,
F... | 在11-02-09到20-05-11期间,60366088的患者被开出多少次药品3367-2 | SELECT COUNT(*) FROM gwyjzb JOIN t_kc22 ON gwyjzb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gwyjzb.PERSON_ID = '60366088' AND t_kc22.STA_DATE BETWEEN '2011-02-09' AND '2020-05-11' AND t_kc22.SOC_SRT_DIRE_CD = '3367-2' UNION SELECT COUNT(*) FROM fgwyjzb JOIN t_kc22 ON fgwyjzb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE ... | css |
CREATE TABLE table_2071644_1 (
cross_section_area__cm_2__ VARCHAR,
moment_of_inertia_in_torsion__j___cm_4__ VARCHAR
) | What is the cross section area (cm 2) for the moment of intertia in torsion (j) (cm 4) 2.54? | SELECT cross_section_area__cm_2__ FROM table_2071644_1 WHERE moment_of_inertia_in_torsion__j___cm_4__ = "2.54" | sql_create_context |
CREATE TABLE table_2875 (
"Episode Number" real,
"Title" text,
"Directed By" text,
"Written By" text,
"Original Air Date" text,
"Production Code" real
) | What was the title of the episode that aired February 9, 1979? | SELECT "Title" FROM table_2875 WHERE "Original Air Date" = 'February 9, 1979' | wikisql |
CREATE TABLE takes (
ID varchar(5),
course_id varchar(8),
sec_id varchar(8),
semester varchar(6),
year numeric(4,0),
grade varchar(2)
)
CREATE TABLE time_slot (
time_slot_id varchar(4),
day varchar(1),
start_hr numeric(2),
start_min numeric(2),
end_hr numeric(2),
end_min... | Find the number of rooms with more than 50 capacity for each building Show bar chart, and could you sort by the the total number in desc? | SELECT building, COUNT(*) FROM classroom WHERE capacity > 50 GROUP BY building ORDER BY COUNT(*) DESC | nvbench |
CREATE TABLE Tourist_Attractions (
Tourist_Attraction_ID INTEGER,
Attraction_Type_Code CHAR(15),
Location_ID INTEGER,
How_to_Get_There VARCHAR(255),
Name VARCHAR(255),
Description VARCHAR(255),
Opening_Hours VARCHAR(255),
Other_Details VARCHAR(255)
)
CREATE TABLE Features (
Feature_... | What are the names and ids of the tourist attractions that are visited at most once. Show the proportion. | SELECT T1.Name, T1.Tourist_Attraction_ID FROM Tourist_Attractions AS T1 JOIN Visits AS T2 ON T1.Tourist_Attraction_ID = T2.Tourist_Attraction_ID | nvbench |
CREATE TABLE table_14966537_1 (
opponent VARCHAR,
date VARCHAR
) | Who was the team's opponent of October 25, 1970? | SELECT opponent FROM table_14966537_1 WHERE date = "October 25, 1970" | sql_create_context |
CREATE TABLE table_20424140_3 (
couple VARCHAR,
average VARCHAR
) | How many couples have an average of 25.3? | SELECT COUNT(couple) FROM table_20424140_3 WHERE average = "25.3" | sql_create_context |
CREATE TABLE zyjzjlb (
CYBQDM text,
CYBQMC text,
CYCWH text,
CYKSDM text,
CYKSMC text,
CYSJ time,
CYZTDM number,
HZXM text,
JZKSDM text,
JZKSMC text,
JZLSH text,
KH text,
KLX number,
MZBMLX number,
MZJZLSH text,
MZZDBM text,
MZZDMC text,
MZZYZDZZBM... | 在医疗就诊53717022339中,为患者22288436的检验报告做审核的人有谁?他们的工号是什么 | SELECT jybgb.SHRGH, jybgb.SHRXM FROM jybgb WHERE jybgb.JZLSH = '53717022339' | css |
CREATE TABLE table_name_68 (
player VARCHAR,
overall VARCHAR
) | Which Player has an Overall of 126? | SELECT player FROM table_name_68 WHERE overall = "126" | sql_create_context |
CREATE TABLE table_12164 (
"Name" text,
"Championship" real,
"League Cup" real,
"FA Cup" real,
"Total" real
) | What is the smallest championship when the FA Cup is 0 and the League Cup is 1? | SELECT MIN("Championship") FROM table_12164 WHERE "FA Cup" = '0' AND "League Cup" = '1' | wikisql |
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 lab (
labid number,
pa... | among female patients diagnosed with chronic renal insufficiency in 2105, what are the top three most frequently prescribed medications that followed afterwards within the same hospital visit to the chronic renal insufficiency patients aged 20s? | SELECT t3.drugname FROM (SELECT t2.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime, patient.patienthealthsystemstayid FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'chronic renal i... | eicu |
CREATE TABLE table_6303 (
"Country" text,
"Track" text,
"Length (m)" real,
"Vertical Drop (m)" real,
"Maximum Grade (%)" text,
"Bobsleigh-skeleton curves" text
) | What is the highest vertical drop among the 1,200 meter long tracks? | SELECT MAX("Vertical Drop (m)") FROM table_6303 WHERE "Length (m)" = '1,200' | wikisql |
CREATE TABLE table_66840 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text,
"Money ( $ )" real
) | What is the monetary sum with a score of 75-71-75-72=293? | SELECT SUM("Money ( $ )") FROM table_66840 WHERE "Score" = '75-71-75-72=293' | wikisql |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
C... | what is death status and procedure long title of subject name bruce harris? | SELECT demographic.expire_flag, procedures.long_title FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.name = "Bruce Harris" | mimicsql_data |
CREATE TABLE table_name_40 (
name_and_flag VARCHAR,
water_area__km_2__ VARCHAR
) | Which province and flag has a water area (km 2) of 0? | SELECT name_and_flag FROM table_name_40 WHERE water_area__km_2__ = 0 | 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 admission type is urgent and lab test category is blood gas? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_type = "URGENT" AND lab."CATEGORY" = "Blood Gas" | mimicsql_data |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.