context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE table_12318 (
"Date" text,
"Score" text,
"Set 1" text,
"Set 2" text,
"Total" text
) | What is the Set 1 with set 2 at 21:17? | SELECT "Set 1" FROM table_12318 WHERE "Set 2" = '21:17' | wikisql |
CREATE TABLE table_36190 (
"Season" text,
"Winner" text,
"Score" text,
"Runner-up" text,
"Venue" text
) | What was the venue during the Season of 2010 11? | SELECT "Venue" FROM table_36190 WHERE "Season" = '2010–11' | wikisql |
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,
... | 在2002年6月28日至2012年4月6日内柏安民患者医保的统筹基金支出总共有多少钱? | SELECT SUM(t_kc24.OVE_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 '2002-06-28' AND '2012-04-06' UNION SELECT SUM(t_kc24.OVE_PAY) FROM fgwyjzb JOIN t_kc24 ON fgwyjzb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE fgwyjzb.PERSON... | css |
CREATE TABLE table_name_58 (
award VARCHAR,
category VARCHAR
) | What is the name of the award given for the category Mercury Prize? | SELECT award FROM table_name_58 WHERE category = "mercury prize" | sql_create_context |
CREATE TABLE table_74627 (
"Club" text,
"Total points" text,
"Bonus points" text,
"Match points" text,
"Games" text,
"Drawn" text,
"Lost" text,
"Points for" text,
"Points against" text,
"Diff" text
) | What is the value of match points when the points for is 570? | SELECT "Match points" FROM table_74627 WHERE "Points against" = '570' | 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 procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
... | how many patients from black/haitian ethnic origin had undergone icd9 code 4611? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.ethnicity = "BLACK/HAITIAN" AND procedures.icd9_code = "4611" | mimicsql_data |
CREATE TABLE table_name_59 (
chassis VARCHAR,
year VARCHAR,
points VARCHAR
) | Which chassis has more than 0 points and was before 1966? | SELECT chassis FROM table_name_59 WHERE year < 1966 AND points > 0 | sql_create_context |
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate time,
drug text,
dose_val_r... | calculate the number of times patient 4900 has received hysteroscopy treatment on their last hospital encounter. | SELECT COUNT(*) FROM procedures_icd WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'hysteroscopy') AND procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 4900 AND NOT admissions.dischtime IS N... | mimic_iii |
CREATE TABLE table_60973 (
"Opposing Teams" text,
"Against" real,
"Date" text,
"Venue" text,
"Status" text
) | What venue has 19 against? | SELECT "Venue" FROM table_60973 WHERE "Against" = '19' | wikisql |
CREATE TABLE table_8637 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text,
"Money ( $ )" real
) | What was Lee Trevino's score? | SELECT "Score" FROM table_8637 WHERE "Player" = 'lee trevino' | 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 cost (
costid num... | has patient 030-42006 ever undergone a hypotonic fluid administration - d5 half-normal saline during this hospital visit? | SELECT COUNT(*) > 0 FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '030-42006' AND patient.hospitaldischargetime IS NULL)) AND treatment.treatme... | eicu |
CREATE TABLE table_name_30 (
chassis VARCHAR,
points VARCHAR
) | Which chassis has 17 points? | SELECT chassis FROM table_name_30 WHERE points = 17 | sql_create_context |
CREATE TABLE code_description (
code varchar,
description text
)
CREATE TABLE ground_service (
city_code text,
airport_code text,
transport_type text,
ground_fare int
)
CREATE TABLE time_interval (
period text,
begin_time int,
end_time int
)
CREATE TABLE fare (
fare_id int,
... | what flights from PITTSBURGH to NEWARK on monday | 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, date_day, days, flight WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'NEWARK' AND date_day.day_number = 21 AND date_day.month_number = 2 AND da... | atis |
CREATE TABLE table_50631 (
"Season" text,
"Series" text,
"Team" text,
"Races" text,
"Wins" text,
"Poles" text,
"F/Laps" text,
"Podiums" text,
"Points" text,
"Position" text
) | What is the Team that has a Races of 4, and a Points of 0? | SELECT "Team" FROM table_50631 WHERE "Races" = '4' AND "Points" = '0' | wikisql |
CREATE TABLE table_204_115 (
id number,
"year" number,
"track" text,
"number" number,
"team" text,
"car" text,
"round result" text
) | what was the round result of the year after the k mart racing team got 3rd ? | SELECT "round result" FROM table_204_115 WHERE "year" > (SELECT "year" FROM table_204_115 WHERE "team" = 'k-mart racing team' AND "round result" = 3) ORDER BY "year" LIMIT 1 | squall |
CREATE TABLE table_name_59 (
score VARCHAR,
opponent VARCHAR
) | What was the score of the Iowa v. Minnesota game? | SELECT score FROM table_name_59 WHERE opponent = "minnesota" | sql_create_context |
CREATE TABLE CMI_Cross_References (
master_customer_id VARCHAR,
source_system_code VARCHAR
)
CREATE TABLE Customer_Master_Index (
cmi_details VARCHAR,
master_customer_id VARCHAR
) | what are the details of the cmi masters that have the cross reference code 'Tax'? | SELECT T1.cmi_details FROM Customer_Master_Index AS T1 JOIN CMI_Cross_References AS T2 ON T1.master_customer_id = T2.master_customer_id WHERE T2.source_system_code = 'Tax' | 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... | 在医院5848543入院期间诊断出A46.X63的医疗记录中最低高医疗费和最高医疗费一共多少钱? | SELECT MIN(t_kc24.MED_AMOUT), MAX(t_kc24.MED_AMOUT) FROM t_kc24 WHERE t_kc24.MED_CLINIC_ID IN (SELECT t_kc24.MED_CLINIC_ID FROM t_kc24 WHERE t_kc24.t_kc21_MED_SER_ORG_NO = '5848543' AND t_kc24.t_kc21_IN_DIAG_DIS_CD = 'A46.X63') | css |
CREATE TABLE table_name_21 (
class_to_1928 VARCHAR,
year_s__of_manufacture VARCHAR,
class_from_1928 VARCHAR
) | Which class to 1928 value had years of manufacture of 1921/23 and class from 1928 of BCi-21? | SELECT class_to_1928 FROM table_name_21 WHERE year_s__of_manufacture = "1921/23" AND class_from_1928 = "bci-21" | sql_create_context |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,... | give the number of patients diagnosed with short title status autm crd dfbrltr. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE diagnoses.short_title = "Status autm crd dfbrltr" | mimicsql_data |
CREATE TABLE table_49622 (
"Region (year)" text,
"No. 1" text,
"No. 2" text,
"No. 3" text,
"No. 4" text,
"No. 5" text,
"No. 6" text,
"No. 7" text,
"No. 8" text,
"No. 9" text,
"No. 10" text
) | What is the No. 2 of the person with a No. 5 of Ethan and NO. 7 of Jackson? | SELECT "No. 2" FROM table_49622 WHERE "No. 4" = 'ethan' AND "No. 7" = 'jackson' | wikisql |
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,0)
)
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25),
EMAIL varchar(25),
PHONE_NUMBER varchar(20),
HIRE_DATE date,
JO... | For those employees who did not have any job in the past, draw a scatter chart about the correlation between commission_pct and manager_id . | SELECT COMMISSION_PCT, MANAGER_ID FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) | nvbench |
CREATE TABLE table_10566855_1 (
premier VARCHAR,
season VARCHAR
) | who's the premier with in 1970 | SELECT premier FROM table_10566855_1 WHERE season = 1970 | sql_create_context |
CREATE TABLE table_name_45 (
industrial_and_commercial_panel VARCHAR,
cultural_and_educational_panel VARCHAR,
labour_panel VARCHAR,
nominated_by_the_taoiseach VARCHAR
) | What is the total of Industrial and Commercial Panels that have a Labour Panel greater than 1, a Nominated by the Taoiseach lesss than 11 and a Cultural and Educational Panel smaller than 0 | SELECT COUNT(industrial_and_commercial_panel) FROM table_name_45 WHERE labour_panel > 1 AND nominated_by_the_taoiseach < 11 AND cultural_and_educational_panel < 0 | sql_create_context |
CREATE TABLE table_204_159 (
id number,
"name" text,
"nation" text,
"position" text,
"league apps" number,
"league goals" number,
"fa cup apps" number,
"fa cup goals" number,
"total apps" number,
"total goals" number
) | average number of goals scored by players from scotland | SELECT AVG("total goals") FROM table_204_159 WHERE "nation" = 'scotland' | squall |
CREATE TABLE table_name_59 (
ngc_number INTEGER,
apparent_magnitude INTEGER
) | What is the average NGC number that has a Apparent magnitude greater than 14.2? | SELECT AVG(ngc_number) FROM table_name_59 WHERE apparent_magnitude > 14.2 | 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... | 在12年3月10日至17年3月23日这个期间科室54818的门诊量是多少? | SELECT COUNT(*) FROM wdmzjzjlb WHERE wdmzjzjlb.JZKSBM = '54818' AND wdmzjzjlb.JZKSRQ BETWEEN '2012-03-10' AND '2017-03-23' UNION SELECT COUNT(*) FROM bdmzjzjlb WHERE bdmzjzjlb.JZKSBM = '54818' AND bdmzjzjlb.JZKSRQ BETWEEN '2012-03-10' AND '2017-03-23' | css |
CREATE TABLE table_name_44 (
issue_date_s_ VARCHAR,
artist VARCHAR
) | When was the song by Andy Gibb issued? | SELECT issue_date_s_ FROM table_name_44 WHERE artist = "andy gibb" | sql_create_context |
CREATE TABLE table_24789 (
"Year (Ceremony)" text,
"English Title" text,
"Vietnamese title" text,
"Director" text,
"Result" text
) | How many directors have vietnamese titles of Gate, Gate, Paragate? | SELECT COUNT("Director") FROM table_24789 WHERE "Vietnamese title" = 'Gate, gate, paragate' | wikisql |
CREATE TABLE time_interval (
period text,
begin_time int,
end_time int
)
CREATE TABLE state (
state_code text,
state_name text,
country_name text
)
CREATE TABLE restriction (
restriction_code text,
advance_purchase int,
stopovers text,
saturday_stay_required text,
minimum_s... | show me flights from MILWAUKEE to ORLANDO | 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 = 'MILWAUKEE' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'ORLA... | atis |
CREATE TABLE table_name_83 (
date VARCHAR,
venue VARCHAR
) | When was a competition held at Pietermaritzburg? | SELECT date FROM table_name_83 WHERE venue = "pietermaritzburg" | sql_create_context |
CREATE TABLE table_22753439_1 (
party VARCHAR,
winner VARCHAR
) | What is every party with a winner of P. Chidambaram? | SELECT party AS a FROM table_22753439_1 WHERE winner = "P. Chidambaram" | sql_create_context |
CREATE TABLE table_name_88 (
surface VARCHAR,
partner VARCHAR
) | The tournament with a partner listed as Aurelija Misevi i t had what kind of surface? | SELECT surface FROM table_name_88 WHERE partner = "aurelija misevičiūtė" | sql_create_context |
CREATE TABLE Users (
Id number,
Reputation number,
CreationDate time,
DisplayName text,
LastAccessDate time,
WebsiteUrl text,
Location text,
AboutMe text,
Views number,
UpVotes number,
DownVotes number,
ProfileImageUrl text,
EmailHash text,
AccountId number
)
CRE... | Count of users with < 15 rep. | SELECT COUNT(CASE WHEN Reputation < 15 THEN 1 END) AS "< 15", COUNT(*) AS total, COUNT(CASE WHEN Reputation < 15 THEN 1 END) / CAST(COUNT(*) AS FLOAT) AS ratio FROM Users | sede |
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 primary disease is transient ischemic attack and age is less than 24? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "TRANSIENT ISCHEMIC ATTACK" AND demographic.age < "24" | mimicsql_data |
CREATE TABLE table_1305623_20 (
silver_medals VARCHAR,
ensemble VARCHAR
) | How many numbers were listed under Silver Medals for Portsmouth HS? | SELECT COUNT(silver_medals) FROM table_1305623_20 WHERE ensemble = "Portsmouth HS" | sql_create_context |
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 (
EMPLOYEE_ID decimal(6,0),
START_DATE date,
END_DATE date,
JOB_ID varchar(10),
DEPARTMENT_ID decimal(4,0)
)
CREATE TABLE regions (
REGION_... | For those employees who was hired before 2002-06-21, visualize a bar chart about the distribution of job_id and the sum of manager_id , and group by attribute job_id. | SELECT JOB_ID, SUM(MANAGER_ID) FROM employees WHERE HIRE_DATE < '2002-06-21' GROUP BY JOB_ID | nvbench |
CREATE TABLE table_37767 (
"Year" real,
"Division" real,
"League" text,
"Reg. Season" text,
"Playoffs" text
) | Which Year is the highest one that has a Reg Season of 3rd, western, and a Division larger than 2? | SELECT MAX("Year") FROM table_37767 WHERE "Reg. Season" = '3rd, western' AND "Division" > '2' | wikisql |
CREATE TABLE round (
round_id number,
member_id number,
decoration_theme text,
rank_in_round number
)
CREATE TABLE member (
member_id number,
name text,
country text,
college_id number
)
CREATE TABLE college (
college_id number,
name text,
leader_name text,
college_loca... | Show the names of members and names of colleges they go to. | SELECT T2.name, T1.name FROM college AS T1 JOIN member AS T2 ON T1.college_id = T2.college_id | spider |
CREATE TABLE table_204_490 (
id number,
"position" text,
"name" text,
"height" text,
"weight" text,
"birthdate" text,
"birthplace" text,
"2009-10 team" text
) | who was the only providence friars member of the 2010 american women 's hockey olympic roster ? | SELECT "name" FROM table_204_490 WHERE "2009-10 team" = 'providence friars' | squall |
CREATE TABLE table_45161 (
"Date" text,
"Race" text,
"Track" text,
"Winner" text,
"Reports" text
) | Where was the race on 09-13-2008? | SELECT "Track" FROM table_45161 WHERE "Date" = '09-13-2008' | wikisql |
CREATE TABLE table_38459 (
"Round" real,
"Player" text,
"Position" text,
"Nationality" text,
"College/Junior/Club Team (League)" text
) | What position does Alexei Lazarenko have? | SELECT "Position" FROM table_38459 WHERE "Player" = 'alexei lazarenko' | wikisql |
CREATE TABLE table_27965906_2 (
b_winning_car VARCHAR,
a_winning_car VARCHAR
) | Name the b winning car for #88 team mitsubishi 88 mitsubishi starion | SELECT b_winning_car FROM table_27965906_2 WHERE a_winning_car = "#88 Team Mitsubishi 88 Mitsubishi Starion" | sql_create_context |
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... | count the number of patients whose admission type is newborn and lab test item id is 51276. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_type = "NEWBORN" AND lab.itemid = "51276" | mimicsql_data |
CREATE TABLE table_49597 (
"Scorer" text,
"Club" text,
"League goals" text,
"FA Cup goals" real,
"League Cup goals" text,
"Total" real
) | Which club has 16 league goals for a total of 20? | SELECT "Club" FROM table_49597 WHERE "League goals" = '16' AND "Total" = '20' | wikisql |
CREATE TABLE table_70478 (
"Name" text,
"Years" text,
"Gender" text,
"Area" text,
"Authority" text,
"Decile" real,
"Roll" real
) | Name the years for elsthorpe school | SELECT "Years" FROM table_70478 WHERE "Name" = 'elsthorpe school' | wikisql |
CREATE TABLE table_17355 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
) | what's the record where score is w 105 92 (ot) | SELECT "Record" FROM table_17355 WHERE "Score" = 'W 105–92 (OT)' | wikisql |
CREATE TABLE Posts (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body text,
OwnerUserId number,
OwnerDisplayName text,
LastEditorUserId number,
LastEditorDisplayName text... | Number of questions per months. | SELECT number = ROW_NUMBER() OVER (ORDER BY STR(YEAR(CreationDate)) + '-' + STR(MONTH(CreationDate))), COUNT(Posts.Id) AS Total FROM Posts WHERE (PostTypeId = 1 AND CreationDate >= '##Date1##' AND CreationDate <= '##Date2##') GROUP BY STR(YEAR(CreationDate)) + '-' + STR(MONTH(CreationDate)) ORDER BY STR(YEAR(CreationDa... | sede |
CREATE TABLE table_21350934_2 (
round VARCHAR,
attendance VARCHAR
) | How many rounds have 6,150 as attendance? | SELECT round FROM table_21350934_2 WHERE attendance = "6,150" | sql_create_context |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (... | provide the number of patients whose ethnicity is hispanic/latino - puerto rican and procedure short title is exc/dest hrt lesion open? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.ethnicity = "HISPANIC/LATINO - PUERTO RICAN" AND procedures.short_title = "Exc/dest hrt lesion open" | mimicsql_data |
CREATE TABLE table_65651 (
"Name" text,
"Height" text,
"Weight" text,
"Spike" text,
"2008 club" text
) | What is the weight for the 2008 club Dynamo Moscow? | SELECT "Weight" FROM table_65651 WHERE "2008 club" = 'dynamo moscow' | 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... | what is maximum age of patients whose death status is 0 and age is greater than or equal to 64? | SELECT MAX(demographic.age) FROM demographic WHERE demographic.expire_flag = "0" AND demographic.age >= "64" | mimicsql_data |
CREATE TABLE table_name_11 (
area VARCHAR,
decile VARCHAR,
name VARCHAR
) | Glenorchy school has a decile less than 10 and is in what area? | SELECT area FROM table_name_11 WHERE decile < 10 AND name = "glenorchy school" | sql_create_context |
CREATE TABLE table_76839 (
"Name" text,
"Took Office" text,
"Left Office" text,
"President" text,
"Party" text
) | What is Left Office, when Took Office is 1998? | SELECT "Left Office" FROM table_76839 WHERE "Took Office" = '1998' | wikisql |
CREATE TABLE table_1013129_8 (
nationality VARCHAR,
pick VARCHAR
) | How many nationalities are the pick 193? | SELECT COUNT(nationality) FROM table_1013129_8 WHERE pick = 193 | sql_create_context |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions... | how many patients whose diagnoses short title is pseudomonas infect nos and drug type is main? | 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 = "Pseudomonas infect NOS" AND prescriptions.drug_type = "MAIN" | mimicsql_data |
CREATE TABLE SuggestedEdits (
Id number,
PostId number,
CreationDate time,
ApprovalDate time,
RejectionDate time,
OwnerUserId number,
Comment text,
Text text,
Title text,
Tags text,
RevisionGUID other
)
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId nu... | Votes received on answers to closed questions vs votes received on all answers. | SELECT * FROM (SELECT u.Id, u.DisplayName, SUM(a.Score) AS allVotes, SUM(a.Score * CASE WHEN q.ClosedDate IS NULL THEN 0 ELSE 1 END) AS closedVotes FROM Users AS u JOIN Posts AS a ON a.PostTypeId = 2 AND u.Id = a.OwnerUserId JOIN Posts AS q ON q.Id = a.ParentId GROUP BY u.Id, u.DisplayName) AS x WHERE x.allVotes > 1000... | sede |
CREATE TABLE home_game (
year number,
league_id text,
team_id text,
park_id text,
span_first text,
span_last text,
games number,
openings number,
attendance number
)
CREATE TABLE salary (
year number,
team_id text,
league_id text,
player_id text,
salary number
)
... | Compute the average salary of the players in the team called 'Boston Red Stockings'. | SELECT AVG(T1.salary) FROM salary AS T1 JOIN team AS T2 ON T1.team_id = T2.team_id_br WHERE T2.name = 'Boston Red Stockings' | spider |
CREATE TABLE table_255829_1 (
pop_density__per_km_2__ VARCHAR,
municipality VARCHAR
) | What is the population density of Caramoran? | SELECT pop_density__per_km_2__ FROM table_255829_1 WHERE municipality = "Caramoran" | sql_create_context |
CREATE TABLE table_1341604_10 (
result VARCHAR,
district VARCHAR
) | how many result with district being florida 14 | SELECT COUNT(result) FROM table_1341604_10 WHERE district = "Florida 14" | sql_create_context |
CREATE TABLE table_name_47 (
opponent VARCHAR,
score VARCHAR
) | Who was the opponent at the game with a score of 6 5 (10)? | SELECT opponent FROM table_name_47 WHERE score = "6–5 (10)" | sql_create_context |
CREATE TABLE table_22598 (
"Team" text,
"Outgoing manager" text,
"Manner of departure" text,
"Date of vacancy" text,
"Replaced by" text,
"Date of appointment" text,
"Position in table" text
) | Which vacancy happened on 4 November 2008? | SELECT "Position in table" FROM table_22598 WHERE "Date of vacancy" = '4 November 2008' | wikisql |
CREATE TABLE table_29823 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
) | What is the date where john wall (11) had the high assists? | SELECT "Date" FROM table_29823 WHERE "High assists" = 'John Wall (11)' | wikisql |
CREATE TABLE table_75199 (
"Nation" text,
"T Score" real,
"A Score" real,
"E Score" real,
"Pen." real,
"Total" real
) | What E score has the T score of 8 and a number smaller than 22.95? | SELECT MIN("E Score") FROM table_75199 WHERE "T Score" = '8' AND "Total" < '22.95' | wikisql |
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,
... | 在11年2月3日到19年7月25日内的C反应蛋白在患者21776586身上是什么情况? | SELECT * FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN mzjzjlb_jybgb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = mzjzjlb_jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.... | css |
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... | 编号99383862652的医疗就诊中,患者的病情描述有哪些症状 | SELECT MAIN_COND_DES FROM t_kc21 WHERE MED_CLINIC_ID = '99383862652' | css |
CREATE TABLE artist (
Famous_Title VARCHAR,
Age VARCHAR
) | Please list the age and famous title of artists in descending order of age. | SELECT Famous_Title, Age FROM artist ORDER BY Age DESC | sql_create_context |
CREATE TABLE table_name_42 (
crowd VARCHAR,
venue VARCHAR
) | What's the total number of people to attend games at junction oval? | SELECT COUNT(crowd) FROM table_name_42 WHERE venue = "junction oval" | sql_create_context |
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location t... | give me the number of patients whose year of birth is less than 2170 and lab test name is urea nitrogen, urine? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dob_year < "2170" AND lab.label = "Urea Nitrogen, Urine" | mimicsql_data |
CREATE TABLE table_16457 (
"No. in season" real,
"No. in series" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"U.S. viewers (million)" text
) | What was the titles of the episodes written by ken lazebnik? | SELECT "Title" FROM table_16457 WHERE "Written by" = 'Ken LaZebnik' | 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... | 名为李红旭的病人有哪些检验报告单的报告日期在零六年三月二十日以后?这些报告单所对应的住院就诊的流水号是什么 | SELECT zyjzjlb.JZLSH FROM person_info JOIN hz_info JOIN zyjzjlb JOIN person_info_hz_info ON person_info.RYBH = person_info_hz_info.RYBH AND hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX AND person_info_hz_info.KH = hz_info.KH AND person_info_hz_info.KLX = hz_info.KLX AND pers... | css |
CREATE TABLE table_name_1 (
mintage VARCHAR,
theme VARCHAR
) | How many cowboy coins were minted? | SELECT mintage FROM table_name_1 WHERE theme = "cowboy" | sql_create_context |
CREATE TABLE table_15416002_1 (
r_miles_ VARCHAR,
chi VARCHAR
) | What are the miles when the Carvill Hurricane Index (CHI) is equal to 9.9? | SELECT r_miles_ FROM table_15416002_1 WHERE chi = "9.9" | sql_create_context |
CREATE TABLE t_kc21 (
MED_CLINIC_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
COMP_ID text,
PERSON_ID text,
PERSON_NM text,
IDENTITY_CARD text,
SOC_SRT_CARD text,
PERSON_SEX number,
PERSON_AGE number,
IN_HOSP_DATE time,
OUT_HOSP_DATE time,
DIFF_PLACE_FLG numb... | 在4535136医院的出院诊断的疾病名称中显示出的不同疾病的平均患者年龄为多少岁呢? | SELECT OUT_DIAG_DIS_NM, AVG(PERSON_AGE) FROM t_kc21 WHERE MED_SER_ORG_NO = '4535136' GROUP BY OUT_DIAG_DIS_NM | css |
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_tit... | how many days have passed since patient 18866 stayed in their current hospital encounter in the ward 23 for the first time? | SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', transfers.intime)) FROM transfers WHERE transfers.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 18866 AND admissions.dischtime IS NULL)) AND transfers.... | mimic_iii |
CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId number
)
CREATE TABLE VoteTypes (
Id number,
Name text
)
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE TagSynonyms (
Id number,
SourceTagName text,
TargetTagName text,
... | Unanswered questions from users with reputation >= 100. | SELECT p.LastActivityDate AS "post_link", p.CreationDate, p.Title, p.Id, p.Score, p.ViewCount, p.AnswerCount, p.Tags, u.Reputation FROM Posts AS p, Users AS u WHERE p.OwnerUserId = u.Id AND u.Reputation >= 100 AND p.DeletionDate IS NULL ORDER BY p.CreationDate DESC LIMIT 100 | sede |
CREATE TABLE Posts (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body text,
OwnerUserId number,
OwnerDisplayName text,
LastEditorUserId number,
LastEditorDisplayName text... | Tag with no usage guidance, but it has a tag wiki, can you help us summarize it?. | SELECT TagsWOWikiExcerpt.Id AS TagId, TagsWOWikiExcerpt.TagName, TagsWOWikiExcerpt.Count, TagsWOWikiExcerpt.ExcerptBody, Posts.Body AS WikiBody, TagsWOWikiExcerpt.PostTypeId, TagsWOWikiExcerpt.CreationDate, TagsWOWikiExcerpt.DeletionDate, TagsWOWikiExcerpt.LastEditDate, TagsWOWikiExcerpt.LastActivityDate FROM (SELECT T... | sede |
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
) | A bar chart for what are the number of the names of products with price at most 200?, display in descending by the Y. | SELECT Name, COUNT(Name) FROM Products WHERE Price <= 200 GROUP BY Name ORDER BY COUNT(Name) DESC | nvbench |
CREATE TABLE table_11696 (
"Round" text,
"Date" text,
"Opponent" text,
"Venue" text,
"Result" text,
"Attendance" text
) | When was Leyton Orient an away team? | SELECT "Date" FROM table_11696 WHERE "Opponent" = 'leyton orient' AND "Venue" = 'away' | wikisql |
CREATE TABLE table_name_89 (
total VARCHAR,
years VARCHAR
) | What is the Total for 1926 1938? | SELECT total FROM table_name_89 WHERE years = "1926–1938" | sql_create_context |
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtim... | how many people died after being diagnosed with esophagitis - regurgitant in the same hospital visit in 2104? | SELECT COUNT(DISTINCT t2.uniquepid) FROM (SELECT t1.uniquepid, t1.diagnosistime, t1.patienthealthsystemstayid FROM (SELECT patient.uniquepid, diagnosis.diagnosistime, patient.patienthealthsystemstayid FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = ... | eicu |
CREATE TABLE table_name_10 (
hometown VARCHAR,
result VARCHAR
) | What is the hometown of the candidate that had a result of 10 fired in week 6 (2-24-2005)? | SELECT hometown FROM table_name_10 WHERE result = "10 fired in week 6 (2-24-2005)" | sql_create_context |
CREATE TABLE table_name_1 (
winning_driver VARCHAR,
pole_position VARCHAR,
fastest_lap VARCHAR
) | Tell me the winning driver for jim clark as pole position and fastest lap | SELECT winning_driver FROM table_name_1 WHERE pole_position = "jim clark" AND fastest_lap = "jim clark" | sql_create_context |
CREATE TABLE table_58778 (
"Position" real,
"Team" text,
"Played" real,
"Drawn" real,
"Lost" real,
"Goals For" real,
"Goals Against" real,
"Goal Difference" text,
"Points 1" text
) | What was the position has a played entry of more than 24? | SELECT COUNT("Position") FROM table_58778 WHERE "Played" > '24' | wikisql |
CREATE TABLE table_name_75 (
elected INTEGER,
status VARCHAR,
incumbent VARCHAR
) | Status of reelected, and a Incumbent of danny marshall iii is what highest elected? | SELECT MAX(elected) FROM table_name_75 WHERE status = "reelected" AND incumbent = "danny marshall iii" | 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... | let me know the age and name of patient with patient id 2560. | SELECT demographic.name, demographic.age FROM demographic WHERE demographic.subject_id = "2560" | mimicsql_data |
CREATE TABLE table_204_643 (
id number,
"release" number,
"artist" text,
"title" text,
"notes" text,
"album" text
) | what year was the first title released ? | SELECT MIN("release") FROM table_204_643 | squall |
CREATE TABLE albums (
id INTEGER,
title VARCHAR(160),
artist_id INTEGER
)
CREATE TABLE playlist_tracks (
playlist_id INTEGER,
track_id INTEGER
)
CREATE TABLE invoice_lines (
id INTEGER,
invoice_id INTEGER,
track_id INTEGER,
unit_price NUMERIC(10,2),
quantity INTEGER
)
CREATE T... | What are the top 5 countries by number of invoices and how many do they have. Plot them as bar chart. | SELECT billing_country, COUNT(*) FROM invoices GROUP BY billing_country ORDER BY COUNT(*) DESC LIMIT 5 | nvbench |
CREATE TABLE table_11207040_5 (
highest INTEGER,
team VARCHAR
) | What is the highest attendance at a game played by St. Johnstone? | SELECT MAX(highest) FROM table_11207040_5 WHERE team = "St. Johnstone" | sql_create_context |
CREATE TABLE table_2388763_1 (
year VARCHAR
) | What team finished in 4th place in 2007? | SELECT 4 AS th_place FROM table_2388763_1 WHERE year = 2007 | sql_create_context |
CREATE TABLE table_name_36 (
format VARCHAR,
region VARCHAR,
label VARCHAR,
catalog VARCHAR
) | What is the format in the region of Europe with an XLCD369 and a label of XL? | SELECT format FROM table_name_36 WHERE label = "xl" AND catalog = "xlcd369" AND region = "europe" | sql_create_context |
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 i... | count the number of patients who have been on sorensons/co intake during this year. | SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE patient.patientunitstayid IN (SELECT intakeoutput.patientunitstayid FROM intakeoutput WHERE intakeoutput.celllabel = 'sorensons/co' AND intakeoutput.cellpath LIKE '%input%' AND DATETIME(intakeoutput.intakeoutputtime, 'start of year') = DATETIME(CURRENT_TIME(),... | eicu |
CREATE TABLE table_17308 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
) | How many high points were there in the game 67? | SELECT COUNT("High points") FROM table_17308 WHERE "Game" = '67' | wikisql |
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,
... | Look for the number of patients on a lorazepam prescription who stayed in hospital for more than 26 days. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.days_stay > "26" AND prescriptions.drug = "Lorazepam" | mimicsql_data |
CREATE TABLE table_name_24 (
videoconferencing VARCHAR,
faxing VARCHAR,
synchronous_conferencing VARCHAR,
web_conferencing VARCHAR
) | What is Videoconferencing, when Synchronous Conferencing is 'No', when Web Conferencing is 'No', and when Faxing is 'Yes'? | SELECT videoconferencing FROM table_name_24 WHERE synchronous_conferencing = "no" AND web_conferencing = "no" AND faxing = "yes" | sql_create_context |
CREATE TABLE table_32317 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | Which home team has an away team score of 11.15 (81)? | SELECT "Home team" FROM table_32317 WHERE "Away team score" = '11.15 (81)' | wikisql |
CREATE TABLE table_51235 (
"Driver" text,
"Car #" real,
"Make" text,
"Points" real,
"Laps" real,
"Winnings" text
) | What was Scott Riggs points when he had more than 400 laps? | SELECT SUM("Points") FROM table_51235 WHERE "Driver" = 'scott riggs' AND "Laps" > '400' | wikisql |
CREATE TABLE table_8480 (
"Election" real,
"Candidate" text,
"Number of votes" text,
"Share of votes" text,
"Outcome of election" text
) | What is the number of votes of candidate edward mahama, who had 0.9% share of votes? | SELECT "Number of votes" FROM table_8480 WHERE "Candidate" = 'edward mahama' AND "Share of votes" = '0.9%' | wikisql |
CREATE TABLE table_name_40 (
wins INTEGER,
points VARCHAR,
year VARCHAR,
championship_finish VARCHAR
) | Which Wins is the highest one that has a Year larger than 1996, and a Championship Finish of 1st, and Points smaller than 168? | SELECT MAX(wins) FROM table_name_40 WHERE year > 1996 AND championship_finish = "1st" AND points < 168 | sql_create_context |
CREATE TABLE Reviewer (
rID int,
name text
)
CREATE TABLE Rating (
rID int,
mID int,
stars int,
ratingDate date
)
CREATE TABLE Movie (
mID int,
title text,
year int,
director text
) | Draw a bar chart for what is the average number of stars that each reviewer awards for a movie?, rank in ascending by the y-axis. | SELECT name, AVG(T1.stars) FROM Rating AS T1 JOIN Reviewer AS T2 ON T1.rID = T2.rID GROUP BY T2.name ORDER BY AVG(T1.stars) | nvbench |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.