context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE table_name_51 (
college VARCHAR,
pick VARCHAR
) | What college had the pick of 85? | SELECT college FROM table_name_51 WHERE pick = 85 | sql_create_context |
CREATE TABLE table_65780 (
"Mother Tongue" text,
"Population (2006)" real,
"Percentage (2006)" text,
"Population (2011)" real,
"Percentage (2011)" text
) | What percentage of the 2011 population had a mother tongue language that was spoken by 45.22% of the population in 2006 (over 120)? | SELECT "Percentage (2011)" FROM table_65780 WHERE "Population (2006)" > '120' AND "Percentage (2006)" = '45.22%' | wikisql |
CREATE TABLE PostHistoryTypes (
Id number,
Name text
)
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
RejectionReasonId number,
Comment text
)
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number... | Top Bash user in Pakistan. | SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS Rank, Id, DisplayName, Reputation, WebsiteUrl, Location FROM Users WHERE Location LIKE '%Pakistan%' LIMIT 100 | sede |
CREATE TABLE table_67957 (
"Year" real,
"Population (Region total)" real,
"Population (Stanthorpe)" real,
"Population (Warwick)" real,
"Population (Allora)" real,
"Population (Glengallan)" real,
"Population (Rosenthal)" real
) | How many people are there for Glengallan having a Rosenthal population less than 1,582 for years before 1976 with a total population of 25,917? | SELECT COUNT("Population (Glengallan)") FROM table_67957 WHERE "Population (Rosenthal)" < '1,582' AND "Year" < '1976' AND "Population (Region total)" = '25,917' | wikisql |
CREATE TABLE table_test_5 (
"id" int,
"systemic_lupus_erythematosus" bool,
"anemia" bool,
"gender" string,
"pregnancy_or_lactation" bool,
"serum_potassium" float,
"hemoglobin_a1c_hba1c" float,
"heart_disease" bool,
"renal_disease" bool,
"creatinine_clearance_cl" float,
"estim... | serum creatinine > 220 umol / l | SELECT * FROM table_test_5 WHERE serum_creatinine > 220 | criteria2sql |
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABL... | what ac embl internl jug vein does it stand for? | SELECT d_icd_diagnoses.long_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'ac embl internl jug vein' UNION SELECT d_icd_procedures.long_title FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'ac embl internl jug vein' | mimic_iii |
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... | 哪位医生是负责01742621044的出院诊断的,把医生的编码和名称找出来 | SELECT gwyjzb.OUT_DIAG_DOC_CD, gwyjzb.OUT_DIAG_DOC_NM FROM gwyjzb WHERE gwyjzb.MED_CLINIC_ID = '01742621044' UNION SELECT fgwyjzb.OUT_DIAG_DOC_CD, fgwyjzb.OUT_DIAG_DOC_NM FROM fgwyjzb WHERE fgwyjzb.MED_CLINIC_ID = '01742621044' | css |
CREATE TABLE table_name_74 (
country VARCHAR,
total VARCHAR
) | Which Country has a Total of 148? | SELECT country FROM table_name_74 WHERE total = 148 | sql_create_context |
CREATE TABLE table_name_74 (
game VARCHAR,
record VARCHAR,
points VARCHAR
) | How many games have a Record of 7 6 3, and Points smaller than 17? | SELECT COUNT(game) FROM table_name_74 WHERE record = "7–6–3" AND points < 17 | sql_create_context |
CREATE TABLE table_name_53 (
surface VARCHAR,
opponent VARCHAR,
score VARCHAR
) | Which Surface has an Opponent of kerry melville reid, and a Score of 6 3, 2 6, 3 6? | SELECT surface FROM table_name_53 WHERE opponent = "kerry melville reid" AND score = "6–3, 2–6, 3–6" | sql_create_context |
CREATE TABLE table_77059 (
"Name" text,
"Gain" real,
"Loss" real,
"Long" real,
"Avg/G" real
) | Which Avg/G is the lowest one that has a Long smaller than 47, and a Name of frank murphy, and a Gain smaller than 569? | SELECT MIN("Avg/G") FROM table_77059 WHERE "Long" < '47' AND "Name" = 'frank murphy' AND "Gain" < '569' | wikisql |
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
)
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
) | For those records from the products and each product's manufacturer, show me about the distribution of founder and the sum of manufacturer , and group by attribute founder in a bar chart, and could you display from high to low by the y-axis? | SELECT Founder, SUM(Manufacturer) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder ORDER BY SUM(Manufacturer) DESC | nvbench |
CREATE TABLE table_name_51 (
co_driver VARCHAR,
laps VARCHAR,
year VARCHAR
) | Who is the co-driver in 1999 with more than 32 laps? | SELECT co_driver FROM table_name_51 WHERE laps > 32 AND year = 1999 | sql_create_context |
CREATE TABLE table_name_24 (
date VARCHAR,
result VARCHAR
) | Name the date for result of eng by 23 runs | SELECT date FROM table_name_24 WHERE result = "eng by 23 runs" | 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 diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
C... | Get me the number of patients admitted before 2145 who have a primary disease of atrial septal defect mitral valve replacement repair atrial-septal defect/sda. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "ATRIAL SEPTAL DEFECT\MITRAL VALVE REPLACEMENT;REPAIR ATRIAL-SEPTAL DEFECT/SDA" AND demographic.admityear < "2145" | mimicsql_data |
CREATE TABLE table_name_49 (
gold VARCHAR,
nation VARCHAR,
silver VARCHAR
) | What is the total number of gold medals Egypt, who has less than 0 silver, has? | SELECT COUNT(gold) FROM table_name_49 WHERE nation = "egypt" AND silver < 0 | sql_create_context |
CREATE TABLE table_17389 (
"No. in series" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production code" text
) | WHO AUTHORED 'RED ASPHALT'? | SELECT "Written by" FROM table_17389 WHERE "Title" = 'Red Asphalt' | wikisql |
CREATE TABLE qtb (
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... | 这个名字叫张智渊的团伙成员最常去的医院排序是什么样的? | SELECT qtb.MED_SER_ORG_NO FROM qtb WHERE qtb.PERSON_NM = '张智渊' GROUP BY qtb.MED_SER_ORG_NO ORDER BY COUNT(*) DESC UNION SELECT gyb.MED_SER_ORG_NO FROM gyb WHERE gyb.PERSON_NM = '张智渊' GROUP BY gyb.MED_SER_ORG_NO ORDER BY COUNT(*) DESC UNION SELECT zyb.MED_SER_ORG_NO FROM zyb WHERE zyb.PERSON_NM = '张智渊' GROUP BY zyb.MED_... | css |
CREATE TABLE table_69955 (
"Year" real,
"Entrant" text,
"Chassis" text,
"Engine" text,
"Pts." real
) | What is the average pots of Alfa Romeo v12 after 1983? | SELECT AVG("Pts.") FROM table_69955 WHERE "Engine" = 'alfa romeo v12' AND "Year" > '1983' | wikisql |
CREATE TABLE table_16638 (
"Rd." real,
"Grand Prix" text,
"Pole Position" text,
"Fastest Lap" text,
"Winning Driver" text,
"Constructor" text,
"Report" text
) | How many on the list are called the Austrian Grand Prix? | SELECT COUNT("Rd.") FROM table_16638 WHERE "Grand Prix" = 'Austrian Grand Prix' | wikisql |
CREATE TABLE table_13738 (
"No. in series" real,
"No. in season" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text
) | Who directed the episode that was greater than 74 in the series, and had 'Life Class' as the title? | SELECT "Directed by" FROM table_13738 WHERE "No. in series" > '74' AND "Title" = 'life class' | wikisql |
CREATE TABLE table_57226 (
"Rank" real,
"Name" text,
"Nation" text,
"SP+FS" real,
"Points" real,
"Places" text
) | What is the rank for more than 120.44 points in East Germany and a SP+FS of 3? | SELECT COUNT("Rank") FROM table_57226 WHERE "Points" > '120.44' AND "Nation" = 'east germany' AND "SP+FS" = '3' | wikisql |
CREATE TABLE Customer_Addresses (
customer_id INTEGER,
premise_id INTEGER,
date_address_from DATETIME,
address_type_code VARCHAR(15),
date_address_to DATETIME
)
CREATE TABLE Products (
product_id INTEGER,
product_category VARCHAR(15),
product_name VARCHAR(80)
)
CREATE TABLE Mailshot_Cu... | Give me a bar chart about the number of customer addresses in each premises type, and could you sort by the y-axis in descending please? | SELECT premises_type, COUNT(premises_type) FROM Customer_Addresses AS T1 JOIN Premises AS T2 ON T1.premise_id = T2.premise_id GROUP BY premises_type ORDER BY COUNT(premises_type) DESC | nvbench |
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
)
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
) | For those records from the products and each product's manufacturer, return a bar chart about the distribution of name and price , and group by attribute headquarter, and could you sort by the Name from low to high? | SELECT T1.Name, T1.Price FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter, T1.Name ORDER BY T1.Name | nvbench |
CREATE TABLE table_name_51 (
away_team VARCHAR
) | How much did the away team St Kilda score? | SELECT away_team AS score FROM table_name_51 WHERE away_team = "st kilda" | sql_create_context |
CREATE TABLE table_21092427_1 (
result VARCHAR,
record VARCHAR
) | Name the result for 9-1 record | SELECT result FROM table_21092427_1 WHERE record = "9-1" | sql_create_context |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id t... | provide the number of patients whose ethnicity is black/african american and diagnoses icd9 code is 34982? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.ethnicity = "BLACK/AFRICAN AMERICAN" AND diagnoses.icd9_code = "34982" | mimicsql_data |
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... | 能知道患者韦宜然在2011.9.2到2012.12.4这段时间,2066190这个医疗机构给他做的检查次数是多少吗 | SELECT COUNT(*) FROM qtb JOIN t_kc22 ON qtb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE qtb.PERSON_NM = '韦宜然' AND t_kc22.STA_DATE BETWEEN '2011-09-02' AND '2012-12-04' AND qtb.MED_SER_ORG_NO = '2066190' AND t_kc22.MED_INV_ITEM_TYPE = '检查费' UNION SELECT COUNT(*) FROM gyb JOIN t_kc22 ON gyb.MED_CLINIC_ID = t_kc22.MED_CLIN... | css |
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_type text,
admission_location text,
discharge_location text,
insurance text,
language text,
marital_status text,
ethnicity text,
age number
)
CREATE ... | when did patient 11426 until 05/05/2102 for the last time have an intake? | SELECT inputevents_cv.charttime FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 11426)) AND STRFTIME('%y-%m-%d', inputevents_cv.charttime) <= '2102-05-05' ORDER BY inputeve... | mimic_iii |
CREATE TABLE table_name_36 (
_number_of_candidates INTEGER,
_percentage_of_popular_vote VARCHAR
) | What is the # of candidates that have a popular vote of 41.37%? | SELECT AVG(_number_of_candidates) FROM table_name_36 WHERE _percentage_of_popular_vote = "41.37%" | sql_create_context |
CREATE TABLE table_name_69 (
release_date VARCHAR,
production_num VARCHAR,
director VARCHAR
) | Which Release date has a Production Num larger than 5888, and a Director of hugh harman and friz freleng? | SELECT release_date FROM table_name_69 WHERE production_num > 5888 AND director = "hugh harman and friz freleng" | sql_create_context |
CREATE TABLE table_204_927 (
id number,
"title" text,
"year" number,
"artist(s)" text,
"album" text,
"writer(s)" text,
"producer(s)" text
) | what is the total number of producing credits that this producer has ? | SELECT COUNT("producer(s)") FROM table_204_927 | squall |
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 prescriptions (
subject_id text,
hadm_id... | how many of the patients with item id 51213 had abnormal lab test result? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE lab.itemid = "51213" AND lab.flag = "abnormal" | mimicsql_data |
CREATE TABLE table_name_66 (
opponent VARCHAR,
tournament VARCHAR,
year VARCHAR
) | Which opponent played in the Chinese Taipei Open in 2000? | SELECT opponent FROM table_name_66 WHERE tournament = "chinese taipei open" AND year = 2000 | sql_create_context |
CREATE TABLE table_12042 (
"Year" real,
"Film name" text,
"Music director" text,
"Lyricist" text,
"Language" text
) | What language does Raj Kamal speak? | SELECT "Language" FROM table_12042 WHERE "Music director" = 'raj kamal' | wikisql |
CREATE TABLE table_name_98 (
object_type VARCHAR,
ngc_number VARCHAR
) | what is the object type when the ngc number is 3314? | SELECT object_type FROM table_name_98 WHERE ngc_number = 3314 | sql_create_context |
CREATE TABLE table_7489 (
"Place" real,
"Team" text,
"Played" real,
"Draw" real,
"Lost" real,
"Goals Scored" real,
"Goals Conceded" real,
"Points" real
) | How many goals that were scored had a place of more than 5, a lost of 11, and goals conceded of less than 45? | SELECT COUNT("Goals Scored") FROM table_7489 WHERE "Place" > '5' AND "Lost" = '11' AND "Goals Conceded" < '45' | wikisql |
CREATE TABLE table_203_481 (
id number,
"n\u00b0" number,
"name" text,
"position" text,
"date of birth" text,
"nationality" text
) | which country as the most people on average ? | SELECT "nationality" FROM table_203_481 GROUP BY "nationality" ORDER BY COUNT("n\u00b0") DESC LIMIT 1 | squall |
CREATE TABLE table_80255 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text,
"Money ( $ )" real
) | Which score has a prize of $400? | SELECT "Score" FROM table_80255 WHERE "Money ( $ )" = '400' | wikisql |
CREATE TABLE table_204_675 (
id number,
"year" number,
"game of the year" text,
"abstract strategy" text,
"advanced strategy" text,
"family" text,
"family card" text,
"family strategy" text,
"party" text,
"puzzle" text,
"word" text,
"historical simulation" text,
"othe... | what was the first game of the year ? | SELECT "game of the year" FROM table_204_675 ORDER BY "year" LIMIT 1 | squall |
CREATE TABLE food_service (
meal_code text,
meal_number int,
compartment text,
meal_description varchar
)
CREATE TABLE aircraft (
aircraft_code varchar,
aircraft_description varchar,
manufacturer varchar,
basic_type varchar,
engines int,
propulsion varchar,
wide_body varchar... | now show me all round trip flights from BURBANK to SEATTLE that arrive before 1900 in SEATTLE | SELECT DISTINCT flight_id FROM flight WHERE (((arrival_time < 1900 AND flight_id IN (SELECT FLIGHT_FAREalias0.flight_id FROM flight_fare AS FLIGHT_FAREalias0 WHERE FLIGHT_FAREalias0.fare_id IN (SELECT FAREalias0.fare_id FROM fare AS FAREalias0 WHERE (NOT FAREalias0.round_trip_cost IS NULL)))) AND to_airport IN (SELECT ... | atis |
CREATE TABLE table_10118412_6 (
indian INTEGER
) | What is the highest Indian population? | SELECT MAX(indian) FROM table_10118412_6 | sql_create_context |
CREATE TABLE table_11568 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | Which home team has a crowd larger than 25,000? | SELECT "Home team" FROM table_11568 WHERE "Crowd" > '25,000' | 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 demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob te... | how many asian patients have ventricular tachycardia primary disease? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "ASIAN" AND demographic.diagnosis = "VENTRICULAR TACHYCARDIA" | mimicsql_data |
CREATE TABLE table_name_85 (
played INTEGER,
goals_against VARCHAR,
lost VARCHAR,
drawn VARCHAR
) | How many played when lost is more than 17, drawn is 15 and goals against is less than 75? | SELECT AVG(played) FROM table_name_85 WHERE lost > 17 AND drawn = 15 AND goals_against < 75 | sql_create_context |
CREATE TABLE table_35299 (
"Storm name" text,
"Dates active" text,
"Max 1-min wind mph (km/h)" text,
"Min. press. ( mbar )" text,
"Damage (millions USD )" text,
"Deaths" text
) | How many deaths occurred during Darby? | SELECT "Deaths" FROM table_35299 WHERE "Storm name" = 'darby' | wikisql |
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,
JOB_ID varchar(10),
SALARY decimal(8,2),
COMMISSION_PCT decimal(2,2),
MANAGER_ID decimal(6,0),
DEPARTMENT_ID decimal(... | For those employees who did not have any job in the past, visualize a bar chart about the distribution of job_id and the sum of salary , and group by attribute job_id. | SELECT JOB_ID, SUM(SALARY) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) GROUP BY JOB_ID | nvbench |
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
RejectionReasonId number,
Comment text
)
CREATE TABLE PostsWithDeleted (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate ti... | Java questions with most answeres. | SELECT * FROM Posts, PostTags WHERE AnswerCount > 1 AND Posts.Id = PostTags.PostId ORDER BY AnswerCount DESC | sede |
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... | count the number of patients whose primary disease is bradycardia and year of birth is less than 2121? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "BRADYCARDIA" AND demographic.dob_year < "2121" | mimicsql_data |
CREATE TABLE month (
month_number int,
month_name text
)
CREATE TABLE compartment_class (
compartment varchar,
class_type varchar
)
CREATE TABLE state (
state_code text,
state_name text,
country_name text
)
CREATE TABLE dual_carrier (
main_airline varchar,
low_flight_number int,
... | i would like to originate my flight in WASHINGTON stop in DENVER with the destination city of SAN FRANCISCO | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, airport_service AS AIRPORT_SERVICE_2, city AS CITY_0, city AS CITY_1, city AS CITY_2, flight, flight_stop WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN FRANCISCO' AND CIT... | atis |
CREATE TABLE table_26853172_1 (
player_1 VARCHAR,
player_3 VARCHAR,
prevailing_wind VARCHAR
) | What is player 1 when player 3 is South and the prevailing wind is South? | SELECT player_1 FROM table_26853172_1 WHERE player_3 = "South" AND prevailing_wind = "South" | sql_create_context |
CREATE TABLE table_name_44 (
nationality VARCHAR,
position VARCHAR,
pick VARCHAR
) | What is Nationality, when Position is 'G', and when Pick is greater than 26? | SELECT nationality FROM table_name_44 WHERE position = "g" AND pick > 26 | sql_create_context |
CREATE TABLE table_17345 (
"#" real,
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Leading scorer" text,
"Attendance" text,
"Record" text,
"Streak" text
) | What is the number of leading scorer of february 21? | SELECT COUNT("Leading scorer") FROM table_17345 WHERE "Date" = 'February 21' | wikisql |
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... | How many patients were born before the year 2071? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.dob_year < "2071" | mimicsql_data |
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate time,
drug text,
... | when did patient 8773 get the first intake of .9% normal saline on the first icu visit? | SELECT inputevents_cv.charttime FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 8773) AND NOT icustays.outtime IS NULL ORDER BY icustays.intime LIMIT 1) AND inputevents_cv.... | mimic_iii |
CREATE TABLE table_19189856_1 (
performer VARCHAR,
last_performance VARCHAR
) | who was the performer that did last performance on 04/08/1963 | SELECT performer FROM table_19189856_1 WHERE last_performance = "04/08/1963" | sql_create_context |
CREATE TABLE table_name_36 (
round VARCHAR,
opponent VARCHAR
) | Which round did the bout against Jonatas Novaes end in? | SELECT round FROM table_name_36 WHERE opponent = "jonatas novaes" | 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... | How many beamer questions are unanswered?. | SELECT Id AS "post_link", Tags FROM Posts WHERE AnswerCount = 0 AND Tags LIKE '<beamer>' ORDER BY CreationDate LIMIT 10 | sede |
CREATE TABLE Settlements (
Settlement_ID INTEGER,
Claim_ID INTEGER,
Date_Claim_Made DATE,
Date_Claim_Settled DATE,
Amount_Claimed INTEGER,
Amount_Settled INTEGER,
Customer_Policy_ID INTEGER
)
CREATE TABLE Payments (
Payment_ID INTEGER,
Settlement_ID INTEGER,
Payment_Method_Code ... | Give me a bar chart that bins the payment date into the day of the week interval and then compute the average amount of each payment, and then sort the bars in ascending order of date. | SELECT Date_Payment_Made, AVG(Amount_Payment) FROM Payments ORDER BY Date_Payment_Made | nvbench |
CREATE TABLE people (
People_ID int,
Sex text,
Name text,
Date_of_Birth text,
Height real,
Weight real
)
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 re... | Show me about the distribution of Name and Weight in a bar chart, and I want to sort in descending by the Y. | SELECT Name, Weight FROM people ORDER BY Weight DESC | nvbench |
CREATE TABLE table_29594 (
"Players" text,
"Games Won" real,
"Games Lost" real,
"Total points" real,
"Grand Average" text,
"Best Winning Average" text,
"Best Run" real
) | How many players had a best winning average of 20? | SELECT COUNT("Games Won") FROM table_29594 WHERE "Best Winning Average" = '20' | 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 average age of patients whose primary disease is left colon cancer and admission year is greater than or equal to 2168? | SELECT AVG(demographic.age) FROM demographic WHERE demographic.diagnosis = "LEFT COLON CANCER" AND demographic.admityear >= "2168" | mimicsql_data |
CREATE TABLE table_60376 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Game site" text,
"Record" text,
"Attendance" real
) | What is the Record of the game with a Result of l 14 16? | SELECT "Record" FROM table_60376 WHERE "Result" = 'l 14–16' | 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
)
... | Let me know the number of patients below 71 years of age who have a hematology lab test category. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.age < "71" AND lab."CATEGORY" = "Hematology" | mimicsql_data |
CREATE TABLE table_18602462_21 (
event VARCHAR,
final__bronze_medal_match VARCHAR
) | When scheffers ( ned ) l 3-6, 1-6 is the final/ bronze medal match what was the event? | SELECT event FROM table_18602462_21 WHERE final__bronze_medal_match = "Scheffers ( NED ) L 3-6, 1-6" | sql_create_context |
CREATE TABLE Faculty (
building VARCHAR
) | Show all the buildings along with the number of faculty members the buildings have. | SELECT building, COUNT(*) FROM Faculty GROUP BY building | sql_create_context |
CREATE TABLE table_name_65 (
to_par VARCHAR,
country VARCHAR
) | What is the to par of canada? | SELECT to_par FROM table_name_65 WHERE country = "canada" | sql_create_context |
CREATE TABLE table_name_35 (
event VARCHAR,
opponent VARCHAR,
method VARCHAR
) | Which event had an opponent of Yasuhito Namekawa with a decision method? | SELECT event FROM table_name_35 WHERE opponent = "yasuhito namekawa" AND method = "decision" | sql_create_context |
CREATE TABLE table_23880 (
"Game" real,
"Date" text,
"Opponent" text,
"Result" text,
"Bruins points" real,
"Opponents" real,
"Record" text
) | What was the record when the Bruins had 41 points? | SELECT "Record" FROM table_23880 WHERE "Bruins points" = '41' | wikisql |
CREATE TABLE table_9428 (
"CERCLIS ID" text,
"Name" text,
"County" text,
"Proposed" text,
"Listed" text,
"Construction completed" text,
"Partially deleted" text
) | What name completed construction on 09/19/2008? | SELECT "Name" FROM table_9428 WHERE "Construction completed" = '09/19/2008' | wikisql |
CREATE TABLE table_72383 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" text,
"Result" text,
"Candidates" text
) | how many candidates with result being new seat democratic gain | SELECT COUNT("Candidates") FROM table_72383 WHERE "Result" = 'New seat Democratic gain' | wikisql |
CREATE TABLE table_name_98 (
visitor VARCHAR,
date VARCHAR
) | What is the visitor team on April 4? | SELECT visitor FROM table_name_98 WHERE date = "april 4" | sql_create_context |
CREATE TABLE table_33822 (
"Province" text,
"Swimsuit" real,
"Evening Gown" real,
"Interview" real,
"Average" real
) | Which Interview has a Province of monte cristi and a Swimsuit larger than 7.27 | SELECT SUM("Interview") FROM table_33822 WHERE "Province" = 'monte cristi' AND "Swimsuit" > '7.27' | wikisql |
CREATE TABLE table_22824199_1 (
rebounds VARCHAR,
points VARCHAR
) | How many rebound did the person who scored 147 points have? | SELECT COUNT(rebounds) FROM table_22824199_1 WHERE points = 147 | sql_create_context |
CREATE TABLE table_20232 (
"Date" text,
"Cover model" text,
"Centerfold model" text,
"Interview subject" text,
"20 Questions" text,
"Pictorials" text
) | Who was asked 20 questions in the issue where the centerfold is Marliece Andrada? | SELECT "20 Questions" FROM table_20232 WHERE "Centerfold model" = 'Marliece Andrada' | wikisql |
CREATE TABLE table_16066063_1 (
city_1 VARCHAR
) | How many passengers (in millions) flew from Seoul in 2012? | SELECT 2012 AS _passengers__in_millions_ FROM table_16066063_1 WHERE city_1 = "Seoul" | sql_create_context |
CREATE TABLE table_77365 (
"Province" text,
"Membership" real,
"Population" real,
"% LDS" text,
"Branches" real,
"Total Congregations" real
) | What's the fewest number of branches with more than 1 total congregations, a population of 1,033,381, and a membership smaller than 5,671? | SELECT MIN("Branches") FROM table_77365 WHERE "Total Congregations" > '1' AND "Population" = '1,033,381' AND "Membership" < '5,671' | wikisql |
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
... | is there any medication that has been prescribed to patient 003-83 in 02/this year? | SELECT COUNT(*) > 0 FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '003-83')) AND DATETIME(medication.drugstarttime, 'start of year') = DATETI... | eicu |
CREATE TABLE table_21273 (
"Team" text,
"Outgoing manager" text,
"Manner of departure" text,
"Date of vacancy" text,
"Replaced by" text,
"Date of appointment" text
) | What was the manner of departure for Edgar Schmitt of the Stuttgarter Kickers? | SELECT "Manner of departure" FROM table_21273 WHERE "Team" = 'Stuttgarter Kickers' AND "Outgoing manager" = 'Edgar Schmitt' | wikisql |
CREATE TABLE days (
days_code varchar,
day_name varchar
)
CREATE TABLE airline (
airline_code varchar,
airline_name text,
note text
)
CREATE TABLE time_zone (
time_zone_code text,
time_zone_name text,
hours_from_gmt int
)
CREATE TABLE time_interval (
period text,
begin_time in... | what flights are there available from PHILADELPHIA to DENVER on wednesday with economy class | 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 AS DATE_DAY_0, date_day AS DATE_DAY_1, days AS DAYS_0, days AS DAYS_1, fare, fare_basis AS FARE_BASIS_0, fare_basis AS FARE_BASIS_1, flight, flight_fare WHERE ((DATE... | atis |
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 prescriptions (
subject_id text,
hadm_id... | how many male patients had emergency room admission? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.gender = "M" AND demographic.admission_location = "EMERGENCY ROOM ADMIT" | mimicsql_data |
CREATE TABLE zyjzjlb_jybgb (
YLJGDM_ZYJZJLB text,
BGDH number,
YLJGDM number
)
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 n... | 列出在2001年9月1日到2013年5月9日内患者72522384被开出的所有检验报告单的检验报告单号分别是哪些? | SELECT jybgb.BGDH FROM hz_info JOIN mzjzjlb JOIN jybgb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE hz_info.RYBH = '72522384' AND jybgb.BGRQ BETWEEN '2001-09-01' AND '2013-05-09' UNION... | css |
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 Comments (
Id number,... | Top 500 users from india. | SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation FROM Users WHERE LOWER(Location) LIKE '%india%' AND DisplayName LIKE '%geek%' ORDER BY Reputation DESC LIMIT 500 | sede |
CREATE TABLE PostTypes (
Id number,
Name text
)
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,
ProfileImage... | Watson Studio questions - July 2019. | SELECT Id, Body, CreationDate, ViewCount, Tags FROM Posts WHERE Tags LIKE '%watson-studio%' AND ParentId IS NULL AND CreationDate > '2019-07-01' AND CreationDate <= '2019-07-31' ORDER BY CreationDate DESC | sede |
CREATE TABLE mzjzjlb (
HXPLC number,
HZXM text,
JLSJ time,
JZJSSJ time,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
JZLSH text,
JZZDBM text,
JZZDSM text,
JZZTDM number,
JZZTMC text,
KH text,
KLX number,
MJZH text,
ML number,
MZZYZDZZBM text,
MZZYZDZZMC ... | 在医疗就诊01582789970里,患者87309423查询检验报告单结果如何? | SELECT * FROM jybgb WHERE jybgb.JZLSH = '01582789970' | css |
CREATE TABLE table_name_96 (
record VARCHAR,
visitor VARCHAR
) | Name the record when the visitor is mavericks | SELECT record FROM table_name_96 WHERE visitor = "mavericks" | sql_create_context |
CREATE TABLE table_64941 (
"Player" text,
"Int'l Debut" text,
"Year" text,
"Cross Code Debut" text,
"Date" text
) | What is the Date of the Int'l Debut of 1967? | SELECT "Date" FROM table_64941 WHERE "Year" = '1967' | wikisql |
CREATE TABLE program_requirement (
program_id int,
category varchar,
min_credit int,
additional_req varchar
)
CREATE TABLE student (
student_id int,
lastname varchar,
firstname varchar,
program_id int,
declare_major varchar,
total_credit int,
total_gpa float,
entered_as ... | Dr. Kenneth Garner taught which classes ? | SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, instructor, offering_instructor WHERE course_offering.semester < (SELECT SEMESTERalias0.semester_id FROM semester AS SEMESTERalias0 WHERE SEMESTERalias0.semester = 'WN' AND SEMESTERalias0.year = 2016) AND course.course_id = cour... | advising |
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE treatment (
treatmentid number... | has patient 030-8973 been given any fat emulsion 20% intake in 12/last year? | SELECT COUNT(*) > 0 FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '030-8973')) AND intakeoutput.cellpath LIKE '%intake%' AND intakeoutput... | eicu |
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 the number of patients whose age is less than 77 and procedure short title is radiotherapeut proc nec? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.age < "77" AND procedures.short_title = "Radiotherapeut proc NEC" | mimicsql_data |
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... | 从03年1月23日至2006年7月17日之间何秀越病患所有检测结果指标记录的质检人为85147197的检验指标流水号是多少? | SELECT jyjgzbb.JYZBLSH FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb ON person_info.RYBH = 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.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = ... | css |
CREATE TABLE table_25487 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
) | When the record was 2-29 who had the most assists? | SELECT "High assists" FROM table_25487 WHERE "Record" = '2-29' | wikisql |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
... | Give me the number of elective hospital admission patients who underwent a fiber-optic bronchoscopy procedure. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_type = "ELECTIVE" AND procedures.long_title = "Fiber-optic bronchoscopy" | mimicsql_data |
CREATE TABLE table_name_56 (
pos VARCHAR,
tyres VARCHAR,
laps VARCHAR
) | What position that has m tyres and 352 or more laps? | SELECT pos FROM table_name_56 WHERE tyres = "m" AND laps > 352 | 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_DIRE_CD text,
MED_DIRE_NM text,... | 对于医疗就诊78843664445与医疗就诊95833976065使用的相同的药品这些药品的名字都叫什么? | SELECT t_kc22.SOC_SRT_DIRE_NM FROM t_kc22 JOIN t_kc21_t_kc22 JOIN t_kc21 ON t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID AND t_kc21_t_kc22.MED_CLINIC_ID = t_kc21.MED_CLINIC_ID WHERE t_kc21_t_kc22.MED_CLINIC_ID = '78843664445' INTERSECT SELECT t_kc22.SOC_SRT_DIRE_NM FROM t_kc22 JOIN t_kc21_t_kc22 JOIN t_kc21 ON ... | css |
CREATE TABLE PostNotices (
Id number,
PostId number,
PostNoticeTypeId number,
CreationDate time,
DeletionDate time,
ExpiryDate time,
Body text,
OwnerUserId number,
DeletionUserId number
)
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTy... | People you attracted into the system. People who 1) started with a question 2) you answered his question 3) he accepted it 4) has now at least one accepted answer | WITH FirstPosts AS (SELECT OwnerUserId, MIN(Id) AS FirstPostId FROM Posts GROUP BY OwnerUserId) SELECT Q.OwnerUserId AS "user_link", Q.Id AS "post_link" FROM Posts AS Q, Posts AS A WHERE Q.AcceptedAnswerId = A.Id AND A.OwnerUserId = '##UserId:int##' AND Q.OwnerUserId IN (SELECT Posts.OwnerUserId FROM Posts, FirstPosts ... | sede |
CREATE TABLE table_name_94 (
date VARCHAR,
scorers VARCHAR
) | What date was the game played in where hegarty was the scorer? | SELECT date FROM table_name_94 WHERE scorers = "hegarty" | sql_create_context |
CREATE TABLE table_55453 (
"Team" text,
"Class" text,
"Day 1" text,
"Day 2" text,
"Behind" text
) | For the team with a class of gt2 and 3:59.820 on day 2, what was the behind? | SELECT "Behind" FROM table_55453 WHERE "Class" = 'gt2' AND "Day 2" = '3:59.820' | wikisql |
CREATE TABLE table_23248420_1 (
city_town VARCHAR,
rank VARCHAR
) | When 2 is the rank what is the city/town? | SELECT city_town FROM table_23248420_1 WHERE rank = 2 | sql_create_context |
CREATE TABLE Lives_in (
stuid INTEGER,
dormid INTEGER,
room_number INTEGER
)
CREATE TABLE Has_amenity (
dormid INTEGER,
amenid INTEGER
)
CREATE TABLE Dorm_amenity (
amenid INTEGER,
amenity_name VARCHAR(25)
)
CREATE TABLE Dorm (
dormid INTEGER,
dorm_name VARCHAR(20),
student_ca... | Find the number of amenities for each of the dorms that can accommodate more than 100 students. Show scatter chart. | SELECT COUNT(*), T1.dormid FROM Dorm AS T1 JOIN Has_amenity AS T2 ON T1.dormid = T2.dormid WHERE T1.student_capacity > 100 GROUP BY T1.dormid | nvbench |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.