context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE table_78513 (
"Date" text,
"Visiting Team" text,
"Final Score" text,
"Host Team" text,
"Stadium" text
) | Tell me the final score for january 9 for cincinnati bengals | SELECT "Final Score" FROM table_78513 WHERE "Date" = 'january 9' AND "Host Team" = 'cincinnati bengals' | 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, find founder and the average of revenue , and group by attribute founder, and visualize them by a bar chart, could you sort x-axis in ascending order please? | SELECT Founder, AVG(Revenue) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder ORDER BY Founder | nvbench |
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 prescriptions (
subject_id text,
hadm_id... | what is the number of patients whose marital status is married and admission year is less than 2198? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.marital_status = "MARRIED" AND demographic.admityear < "2198" | mimicsql_data |
CREATE TABLE table_25802689_14 (
stage INTEGER,
mountains_classification VARCHAR
) | What is the earliest stage where mountains classifications was awarded to Peter Stetina? | SELECT MIN(stage) FROM table_25802689_14 WHERE mountains_classification = "Peter Stetina" | 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... | 从2008年2月4日直到2014年5月24日列出患者凤德容在编码为8078105的医院中被开出的所有药品编码和名称各是什么? | SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM t_kc22 WHERE t_kc22.MED_CLINIC_ID IN (SELECT qtb.MED_CLINIC_ID FROM qtb WHERE qtb.PERSON_NM = '凤德容' AND qtb.MED_SER_ORG_NO = '8078105' AND qtb.IN_HOSP_DATE BETWEEN '2008-02-04' AND '2014-05-24' UNION SELECT gyb.MED_CLINIC_ID FROM gyb WHERE gyb.PERSON_NM = '凤德容'... | css |
CREATE TABLE table_name_62 (
hometown VARCHAR,
height VARCHAR,
name VARCHAR
) | What is the hometown of Devon Bookert who is 6-3 tall? | SELECT hometown FROM table_name_62 WHERE height = "6-3" AND name = "devon bookert" | sql_create_context |
CREATE TABLE table_40717 (
"Draw" real,
"Song" text,
"Performer" text,
"Points" real,
"Rank" text
) | What is the sum of Points, when the Performer is fe-mail? | SELECT SUM("Points") FROM table_40717 WHERE "Performer" = 'fe-mail' | wikisql |
CREATE TABLE transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
eventtype text,
careunit text,
wardid number,
intime time,
outtime time
)
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
chart... | how many times adefovir dipivoxil has been prescribed to patient 18159 on their last hospital encounter? | SELECT COUNT(*) FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 18159 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime DESC LIMIT 1) AND prescriptions.drug = 'adefovir dipivoxil' | mimic_iii |
CREATE TABLE table_name_39 (
country VARCHAR,
player VARCHAR
) | What is jos mar a olaz bal's country? | SELECT country FROM table_name_39 WHERE player = "josé maría olazábal" | sql_create_context |
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
CREATE TABLE jyjgzbb (
BGDH text,
BGRQ time,
CKZFWDX text,
CKZFWSX number,
CKZFWXX number,
JCFF text,
JCRGH text,
JCRXM text,
JCXMMC text,
JCZBDM text,
JCZBJGDL number,
JCZBJGDW text,
... | 为病人陶宏伯检测降钙素原的在06年5月31日到21年10月31日内的医务人员工号及姓名都是什么? | SELECT jyjgzbb.JCRGH, jyjgzbb.JCRXM FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN hz_info_mzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND hz_info_mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzj... | css |
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 in 2104 were staying in the tsicu careunit? | SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT transfers.hadm_id FROM transfers WHERE transfers.careunit = 'tsicu' AND STRFTIME('%y', transfers.intime) = '2104') | mimic_iii |
CREATE TABLE Asset_Parts (
asset_id INTEGER,
part_id INTEGER
)
CREATE TABLE Maintenance_Engineers (
engineer_id INTEGER,
company_id INTEGER,
first_name VARCHAR(50),
last_name VARCHAR(50),
other_details VARCHAR(255)
)
CREATE TABLE Engineer_Visits (
engineer_visit_id INTEGER,
contact... | Show the number of assets and group by asset make in a bar chart, order in asc by the how many asset make. | SELECT asset_make, COUNT(asset_make) FROM Assets GROUP BY asset_make ORDER BY COUNT(asset_make) | nvbench |
CREATE TABLE table_10470082_8 (
us_air_date VARCHAR,
writer VARCHAR
) | When did the episode written by Jim Morris air? | SELECT us_air_date FROM table_10470082_8 WHERE writer = "Jim Morris" | 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... | Bring the number of white-russian patients who have an id route of drug administration. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.ethnicity = "WHITE - RUSSIAN" AND prescriptions.route = "ID" | mimicsql_data |
CREATE TABLE table_203_715 (
id number,
"year" number,
"competition" text,
"venue" text,
"position" text,
"notes" text
) | which country had more competitions , germany or greece ? | SELECT "venue" FROM table_203_715 WHERE "venue" IN ('germany', 'greece') GROUP BY "venue" ORDER BY COUNT("competition") DESC LIMIT 1 | squall |
CREATE TABLE table_name_88 (
total_passengers INTEGER,
capacity_in_use VARCHAR
) | what is the number of passengers when the capacity is 81.2%? | SELECT SUM(total_passengers) FROM table_name_88 WHERE capacity_in_use = "81.2%" | sql_create_context |
CREATE TABLE date_day (
month_number int,
day_number int,
year int,
day_name varchar
)
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 t... | what are the flights from ONTARIO to MEMPHIS | 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 = 'ONTARIO' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'MEMPHI... | atis |
CREATE TABLE table_72772 (
"School" text,
"Record" text,
"Conference" text,
"Conf. record" text,
"Regular season finish" text,
"Regular season second place" text
) | Which conference is Belmont in? | SELECT "Conference" FROM table_72772 WHERE "School" = 'Belmont' | wikisql |
CREATE TABLE table_65668 (
"Name" text,
"Gain" real,
"Loss" real,
"Long" real,
"Avg/G" real
) | How many gains have a long greater than 8, with avg/g of 124.9? | SELECT SUM("Gain") FROM table_65668 WHERE "Long" > '8' AND "Avg/G" = '124.9' | wikisql |
CREATE TABLE table_68590 (
"Year" real,
"Entrant" text,
"Chassis" text,
"Engine" text,
"Points" real
) | What is the average points that Centro Asegurador earned with the McLaren M23 chassis? | SELECT AVG("Points") FROM table_68590 WHERE "Chassis" = 'mclaren m23' AND "Entrant" = 'centro asegurador' | wikisql |
CREATE TABLE table_47718 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Ground" text,
"Crowd" real,
"Date" text
) | Which Home team has a score of 12.10 (82)? | SELECT "Home team" FROM table_47718 WHERE "Home team score" = '12.10 (82)' | wikisql |
CREATE TABLE table_10531 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | Where was the game played that had an away team score of 20.17 (137)? | SELECT "Venue" FROM table_10531 WHERE "Away team score" = '20.17 (137)' | wikisql |
CREATE TABLE table_name_83 (
away_team VARCHAR,
home_team VARCHAR
) | What was the away team score when the home team was the Brisbane Lions? | SELECT away_team AS score FROM table_name_83 WHERE home_team = "brisbane lions" | sql_create_context |
CREATE TABLE table_name_61 (
location VARCHAR,
team VARCHAR
) | What is the Location when the team was seve ballesteros & manuel pi ero? | SELECT location FROM table_name_61 WHERE team = "seve ballesteros & manuel piñero" | sql_create_context |
CREATE TABLE music_festival (
id number,
music_festival text,
date_of_ceremony text,
category text,
volume number,
result text
)
CREATE TABLE artist (
artist_id number,
artist text,
age number,
famous_title text,
famous_release_date text
)
CREATE TABLE volume (
volume_i... | How many distinct artists do the volumes associate to? | SELECT COUNT(DISTINCT artist_id) FROM volume | spider |
CREATE TABLE table_203_554 (
id number,
"year" number,
"place" text,
"gold" text,
"silver" text,
"bronze" text
) | what is the first place listed in this chart ? | SELECT "place" FROM table_203_554 WHERE id = 1 | squall |
CREATE TABLE table_name_10 (
loss VARCHAR,
date VARCHAR
) | who lost on august 21? | SELECT loss FROM table_name_10 WHERE date = "august 21" | sql_create_context |
CREATE TABLE table_72868 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
) | On what date did the Rockets play Memphis? | SELECT "Date" FROM table_72868 WHERE "Team" = 'Memphis' | wikisql |
CREATE TABLE code_description (
code varchar,
description text
)
CREATE TABLE dual_carrier (
main_airline varchar,
low_flight_number int,
high_flight_number int,
dual_airline varchar,
service_name text
)
CREATE TABLE airport (
airport_code varchar,
airport_name text,
airport_lo... | flights from ATLANTA to SEATTLE | 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 = 'ATLANTA' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SEATTL... | atis |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
... | what is the number of patients whose admission year is less than 2172 and diagnoses long title is other persistent mental disorders due to conditions classified elsewhere? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admityear < "2172" AND diagnoses.long_title = "Other persistent mental disorders due to conditions classified elsewhere" | mimicsql_data |
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid number,
wardid number,
admissionheight number,
admissionweight number,
dischargeweight number,
hospitaladmittime time,
... | what was the top four most common diagnoses until 2104. | SELECT t1.diagnosisname FROM (SELECT diagnosis.diagnosisname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM diagnosis WHERE STRFTIME('%y', diagnosis.diagnosistime) <= '2104' GROUP BY diagnosis.diagnosisname) AS t1 WHERE t1.c1 <= 4 | eicu |
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate time,
drug text,
dose_val_rx text,
dose_unit_rx text,
route text
)
CREATE TABLE icustays (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
... | how many patients have undergone oth cardiac mon output this year after inject ca chemother nec procedure within 2 months? | SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, procedures_icd.charttime FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'inject ca c... | mimic_iii |
CREATE TABLE table_59596 (
"Rank" text,
"County" text,
"State" text,
"Land area (km\u00b2)" text,
"Land area (mi\u00b2)" text,
"April 1, 2010 census" text,
"April 1, 2010 density (/km\u00b2)" text,
"April 1, 2010 density (/mi\u00b2)" text,
"July 1, 2010 official estimate" text,
"... | What is the mid-2010 to mid-2011 change where the July 1, 2011 density is 508? | SELECT "Mid-2010 to mid-2011 change (%)" FROM table_59596 WHERE "July 1, 2011 density (/mi\u00b2)" = '508' | wikisql |
CREATE TABLE table_64789 (
"Draw" real,
"Song" text,
"Artist" text,
"Points" real,
"Place" text
) | Which artist has 13 points? | SELECT "Artist" FROM table_64789 WHERE "Points" = '13' | wikisql |
CREATE TABLE table_2581397_2 (
group VARCHAR,
venue VARCHAR
) | What group was sunline in when he was at moonee valley? | SELECT group FROM table_2581397_2 WHERE venue = "Moonee Valley" | sql_create_context |
CREATE TABLE table_70002 (
"Unit" text,
"Reactortype" text,
"Net capacity" text,
"Gross capacity" text,
"Construction started" text,
"Electricity Grid" text,
"Commercial Operation" text,
"Shutdown" text
) | Which Unit's Construction started on 01.07.1967? | SELECT "Unit" FROM table_70002 WHERE "Construction started" = '01.07.1967' | wikisql |
CREATE TABLE table_1473672_10 (
position VARCHAR,
player VARCHAR
) | How many positions did 1972 NHL Draft pick Rene Lambert play? | SELECT COUNT(position) FROM table_1473672_10 WHERE player = "Rene Lambert" | sql_create_context |
CREATE TABLE table_27537518_9 (
record VARCHAR,
opponent VARCHAR
) | What was the record for the game where the opponent was the Carolina Hurricanes? | SELECT record FROM table_27537518_9 WHERE opponent = "Carolina Hurricanes" | sql_create_context |
CREATE TABLE table_name_27 (
city VARCHAR,
average VARCHAR
) | Which City has an Average of 6.85? | SELECT city FROM table_name_27 WHERE average = 6.85 | sql_create_context |
CREATE TABLE table_name_3 (
year VARCHAR,
attempts VARCHAR
) | When has Attempts of 282 ? | SELECT year FROM table_name_3 WHERE attempts = "282" | sql_create_context |
CREATE TABLE table_name_20 (
call_sign VARCHAR,
erp_w VARCHAR
) | Name the call sign for ERP W of 4 | SELECT call_sign FROM table_name_20 WHERE erp_w = 4 | sql_create_context |
CREATE TABLE table_name_12 (
kickoff_ VARCHAR,
a_ VARCHAR,
game_site VARCHAR
) | What is the kickoff time for the Hubert H. Humphrey Metrodome? | SELECT kickoff_ AS "a_" FROM table_name_12 WHERE game_site = "hubert h. humphrey metrodome" | sql_create_context |
CREATE TABLE paper (
paperid int,
title varchar,
venueid int,
year int,
numciting int,
numcitedby int,
journalid int
)
CREATE TABLE keyphrase (
keyphraseid int,
keyphrasename varchar
)
CREATE TABLE cite (
citingpaperid int,
citedpaperid int
)
CREATE TABLE journal (
jou... | What are the latest papers by Bill Howe ? | SELECT DISTINCT writes.paperid FROM author, paper, writes WHERE author.authorname = 'Bill Howe' AND writes.authorid = author.authorid AND writes.paperid = paper.paperid ORDER BY paper.year DESC | scholar |
CREATE TABLE table_17416221_1 (
area__km_2__ INTEGER,
largest_city VARCHAR
) | what is minimum area where the largest city is bloemfontein? | SELECT MIN(area__km_2__) FROM table_17416221_1 WHERE largest_city = "Bloemfontein" | sql_create_context |
CREATE TABLE table_26781 (
"Railroad" text,
"Game Cost" text,
"Real-Life Years of Operation" text,
"Real-Life Eventual Outcome" text,
"Currently\u00b9 Part Of..." text
) | Name the real life years of operation for amtrak | SELECT "Real-Life Years of Operation" FROM table_26781 WHERE "Currently\u00b9 Part Of..." = 'Amtrak' | wikisql |
CREATE TABLE table_name_63 (
player INTEGER,
year VARCHAR,
sets VARCHAR,
aces VARCHAR
) | What is the highest number of players during 1r year with a clay set and more than 4 aces? | SELECT MAX(player) FROM table_name_63 WHERE year = "1r" AND sets = "clay" AND NOT aces > 4 | sql_create_context |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
... | what is the number of patients whose year of birth is less than 2110 and lab test name is asparate aminotransferase (ast)? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dob_year < "2110" AND lab.label = "Asparate Aminotransferase (AST)" | mimicsql_data |
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId number,
UserId number,
CreationDate time,
BountyAmount number
)
CREATE TABLE ReviewTaskStates (
Id number,
Name text,
Description text
)
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
... | Top upvote generators history, as stacked bar. | WITH Raw AS (SELECT YEAR(Votes.CreationDate) AS Year, Posts.OwnerUserId AS UserId, COUNT(*) AS Count FROM Posts, Votes WHERE Votes.VoteTypeId = 2 AND Votes.PostId = Posts.Id GROUP BY YEAR(Votes.CreationDate), Posts.OwnerUserId), Raw2 AS (SELECT Year, UserId, Count, DENSE_RANK() OVER (PARTITION BY Year ORDER BY Count DE... | sede |
CREATE TABLE flight_fare (
flight_id int,
fare_id int
)
CREATE TABLE airport_service (
city_code varchar,
airport_code varchar,
miles_distant int,
direction varchar,
minutes_distant int
)
CREATE TABLE flight (
aircraft_code_sequence text,
airline_code varchar,
airline_flight te... | what flights go from BOSTON to DALLAS | 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 = 'BOSTON' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'DALLAS'... | atis |
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 lab (
subject_id text,
hadm_id text,
... | provide the number of patients whose age is less than 67 and diagnoses long title is schizoaffective disorder, unspecified? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.age < "67" AND diagnoses.long_title = "Schizoaffective disorder, unspecified" | mimicsql_data |
CREATE TABLE table_name_4 (
constructor VARCHAR,
time_retired VARCHAR,
driver VARCHAR
) | Who constructed olivier panis' car that retired after +1 lap? | SELECT constructor FROM table_name_4 WHERE time_retired = "+1 lap" AND driver = "olivier panis" | sql_create_context |
CREATE TABLE table_name_35 (
height_in_ft VARCHAR,
position VARCHAR,
school_club_team_country VARCHAR
) | Name the height in feet for the guard from north carolina-charlotte | SELECT height_in_ft FROM table_name_35 WHERE position = "guard" AND school_club_team_country = "north carolina-charlotte" | sql_create_context |
CREATE TABLE table_name_58 (
chassis VARCHAR,
points VARCHAR
) | Which Chassis has 0 points? | SELECT chassis FROM table_name_58 WHERE points = 0 | sql_create_context |
CREATE TABLE table_13657749_2 (
rnd VARCHAR,
gto_winning_team VARCHAR
) | What is GTO Winning Team Mike Keyser's RND number? | SELECT rnd FROM table_13657749_2 WHERE gto_winning_team = "Mike Keyser" | sql_create_context |
CREATE TABLE t_kc21 (
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年7月15日到2002年11月9日内医保的个人账户支出统共是多少钱? | SELECT SUM(t_kc24.PER_ACC_PAY) FROM t_kc21 JOIN t_kc24 JOIN t_kc21_t_kc24 ON t_kc21.MED_CLINIC_ID = t_kc21_t_kc24.MED_CLINIC_ID AND t_kc21_t_kc24.MED_SAFE_PAY_ID = t_kc24.MED_SAFE_PAY_ID WHERE t_kc21.PERSON_NM = '苗香馨' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2002-07-15' AND '2002-11-09' | css |
CREATE TABLE table_33592 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | What date did the home team have a score of 9.18 (72)? | SELECT "Date" FROM table_33592 WHERE "Home team score" = '9.18 (72)' | wikisql |
CREATE TABLE PostLinks (
Id number,
CreationDate time,
PostId number,
RelatedPostId number,
LinkTypeId number
)
CREATE TABLE PostHistoryTypes (
Id number,
Name text
)
CREATE TABLE PostTags (
PostId number,
TagId number
)
CREATE TABLE Tags (
Id number,
TagName text,
Cou... | Top 10 users in Kolhapur. | SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation FROM Users WHERE LOWER(Location) LIKE '%kolhapur%' OR UPPER(Location) LIKE '%KOLHAPUR' ORDER BY Reputation DESC LIMIT 10 | sede |
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
RejectionReasonId number,
Comment text
)
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationDate time,
CloseReasonTypeId number,
... | SELECT ROW_NUMBER() OVER(ORDER BY Reputation DESC) AS [#], Id AS [User Link], Reputati. | SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation FROM Users WHERE LOWER(Location) LIKE LOWER('%croatia%') ORDER BY Reputation DESC | sede |
CREATE TABLE PostHistoryTypes (
Id number,
Name text
)
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId number,
UserId number,
CreationDate time,
BountyAmount number
)
CREATE TABLE PostsWithDeleted (
Id number,
PostTypeId number,
AcceptedAnswerId number,
Parent... | Angular vs Ember vs React in Last Month. | SELECT rate.TagName AS Tag, rate.Month AS Month, rate.Year AS Year, rate.Rate AS NumQuestions FROM (SELECT COUNT(PostId) AS Rate, TagName, YEAR(Posts.CreationDate) AS Year, MONTH(Posts.CreationDate) AS Month FROM Tags, PostTags, Posts WHERE Tags.Id = PostTags.TagId AND Posts.Id = PostId AND Posts.CreationDate > DATEADD... | sede |
CREATE TABLE table_31 (
"Player" text,
"Total W\u2013L" text,
"Singles W\u2013L" text,
"Doubles W\u2013L" text,
"Ties played" real,
"Debut" real,
"Years played" real
) | what is the total number of singles w l where doubles w l is 11 14 | SELECT COUNT("Singles W\u2013L") FROM table_31 WHERE "Doubles W\u2013L" = '11–14' | 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... | give the number of patients whose drug code is csa50i and lab test fluid is ascites. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE prescriptions.formulary_drug_cd = "CSA50I" AND lab.fluid = "Ascites" | mimicsql_data |
CREATE TABLE table_name_49 (
res VARCHAR,
record VARCHAR
) | Record of 47 5 (1) involved what res? | SELECT res FROM table_name_49 WHERE record = "47–5 (1)" | sql_create_context |
CREATE TABLE table_10570 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | Where did carlton play while away? | SELECT "Venue" FROM table_10570 WHERE "Away team" = 'carlton' | wikisql |
CREATE TABLE table_7935 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
) | Which Location Attendance has a Date of april 15? | SELECT "Location Attendance" FROM table_7935 WHERE "Date" = 'april 15' | wikisql |
CREATE TABLE Customer_Orders (
order_id INTEGER,
customer_id INTEGER,
order_status_code VARCHAR(10),
order_date DATETIME
)
CREATE TABLE Department_Stores (
dept_store_id INTEGER,
dept_store_chain_id INTEGER,
store_name VARCHAR(80),
store_address VARCHAR(255),
store_phone VARCHAR(80)... | Give the maximum product price for each product type in a bar chart, I want to sort in asc by the total number. | SELECT product_type_code, MAX(product_price) FROM Products GROUP BY product_type_code ORDER BY MAX(product_price) | nvbench |
CREATE TABLE table_name_63 (
loss VARCHAR,
record VARCHAR
) | What was the loss of the game with a record of 54 42? | SELECT loss FROM table_name_63 WHERE record = "54–42" | sql_create_context |
CREATE TABLE table_24126518_2 (
date VARCHAR,
opponent VARCHAR
) | Name the number of dates for alouettes | SELECT COUNT(date) FROM table_24126518_2 WHERE opponent = "Alouettes" | sql_create_context |
CREATE TABLE table_train_247 (
"id" int,
"mini_mental_state_examination_mmse" int,
"creatinine_consistently" float,
"creatinine_clearance_cl" float,
"seizure_disorder" bool,
"age" float,
"NOUSE" float
) | age: 30 to 80 years old | SELECT * FROM table_train_247 WHERE age >= 30 AND age <= 80 | criteria2sql |
CREATE TABLE table_11710 (
"Airing date" text,
"English Title (Chinese title)" text,
"Number of episodes" real,
"Theme song (T) Sub-theme song (ST)" text,
"Genre" text,
"Official website" text
) | Which title aired on 18 dec 2006- 10 feb 2007? | SELECT "English Title (Chinese title)" FROM table_11710 WHERE "Airing date" = '18 dec 2006- 10 feb 2007' | wikisql |
CREATE TABLE table_name_59 (
tie_no VARCHAR,
away_team VARCHAR
) | Which tie number has Bolton Wanderers as away? | SELECT tie_no FROM table_name_59 WHERE away_team = "bolton wanderers" | sql_create_context |
CREATE TABLE table_name_30 (
venue VARCHAR,
result VARCHAR,
extra VARCHAR
) | what is the venue when the result is 2nd and extra is 4 x 100 m relay? | SELECT venue FROM table_name_30 WHERE result = "2nd" AND extra = "4 x 100 m relay" | sql_create_context |
CREATE TABLE table_8225 (
"Position" real,
"Name" text,
"Played" real,
"Drawn" real,
"Lost" real,
"Points" real
) | What is the average Lost that has a Name of ec amberg (n), and a Position smaller than 4? | SELECT AVG("Lost") FROM table_8225 WHERE "Name" = 'ec amberg (n)' AND "Position" < '4' | wikisql |
CREATE TABLE table_name_96 (
total VARCHAR,
finish VARCHAR
) | What is the total for the player with a Finish of T39? | SELECT total FROM table_name_96 WHERE finish = "t39" | sql_create_context |
CREATE TABLE table_name_35 (
result VARCHAR,
year INTEGER
) | What result has a year after 2002? | SELECT result FROM table_name_35 WHERE year > 2002 | sql_create_context |
CREATE TABLE table_1139835_3 (
grand_finalist VARCHAR,
scores VARCHAR
) | who is the grand finalist where scores is 11.11 (77) 10.8 (68) | SELECT grand_finalist FROM table_1139835_3 WHERE scores = "11.11 (77) – 10.8 (68)" | sql_create_context |
CREATE TABLE table_204_889 (
id number,
"date" text,
"week (stage)" text,
"song choice" text,
"original artist" text,
"theme" text,
"result" text
) | which was the first song he performed that was originally a beatles song ? | SELECT "song choice" FROM table_204_889 WHERE "original artist" = 'the beatles' ORDER BY "date" LIMIT 1 | squall |
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 (... | what is minimum age of patients whose discharge location is home and primary disease is posterior communicating aneurysm/sda? | SELECT MIN(demographic.age) FROM demographic WHERE demographic.discharge_location = "HOME" AND demographic.diagnosis = "POSTERIOR COMMUNICATING ANEURYSM/SDA" | mimicsql_data |
CREATE TABLE table_15333005_1 (
Ends VARCHAR,
l VARCHAR,
stolen_ends VARCHAR
) | Name the number ends won when L is 4 and stolen ends is 17 | SELECT COUNT(Ends) AS won FROM table_15333005_1 WHERE l = 4 AND stolen_ends = 17 | sql_create_context |
CREATE TABLE table_55086 (
"Series ^" text,
"Model" text,
"CPU clock ( MHz )" text,
"CPU cores" real,
"TDP ( W )" text,
"L2 cache (KiB)" text,
"Radeon cores" real,
"DDR3 speed" real
) | Name the CPU clock for L2 cache of 2*512 and series ^ of e-series and DDR3 speed of 1066 | SELECT "CPU clock ( MHz )" FROM table_55086 WHERE "L2 cache (KiB)" = '2*512' AND "Series ^" = 'e-series' AND "DDR3 speed" = '1066' | wikisql |
CREATE TABLE table_10413 (
"Class" text,
"Type" text,
"Quantity" real,
"Date" text,
"LNER Class" text,
"1946 LNER nos." text
) | Which type has a quantity of 11? | SELECT "Type" FROM table_10413 WHERE "Quantity" = '11' | wikisql |
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob... | count the number of patients who had received a laboratory test of sodium, urine in this year. | SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT labevents.hadm_id FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'sodium, urine') AND DATETIME(labevents.charttime, 'start of year') = DATETIME(CURRENT_TIME(), 's... | mimic_iii |
CREATE TABLE table_name_97 (
total INTEGER,
year_s__won VARCHAR
) | The golfer who won in 1993 had what total has his total? | SELECT SUM(total) FROM table_name_97 WHERE year_s__won = "1993" | sql_create_context |
CREATE TABLE table_train_32 (
"id" int,
"pregnancy_or_lactation" bool,
"renal_disease" bool,
"hemachromatosis" bool,
"glucose_6_phosphate_dehydrogenase_deficiency_g6pd" int,
"prisoners" bool,
"NOUSE" float
) | member of a protected population ( pregnant, prisoner ) | SELECT * FROM table_train_32 WHERE pregnancy_or_lactation = 1 OR prisoners = 1 | criteria2sql |
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid number,
wardid number,
admissionheight number,
admissionweight number,
dischargeweight number,
hospitaladmittime time,
... | how many days have passed since the last time patient 004-79017 has received a insertion of venous catheter for hemodialysis treatment in this hospital visit? | SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', treatment.treatmenttime)) FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '004-79017'... | eicu |
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,... | 药品366134-y所属的三大目录类别在医疗就诊98602602756中分别是? | SELECT t_kc22.DIRE_TYPE 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.MED_CLINIC_ID = '98602602756' AND t_kc22.SOC_SRT_DIRE_CD = '366134-y' | css |
CREATE TABLE batting_postseason (
year INTEGER,
round TEXT,
player_id TEXT,
team_id TEXT,
league_id TEXT,
g INTEGER,
ab INTEGER,
r INTEGER,
h INTEGER,
double INTEGER,
triple INTEGER,
hr INTEGER,
rbi INTEGER,
sb INTEGER,
cs NUMERIC,
bb INTEGER,
so INTEG... | Show the trend about the number of attendance at home games change over the years, bin year into year interval, order year in ascending order please. | SELECT year, SUM(attendance) FROM home_game ORDER BY year | nvbench |
CREATE TABLE table_name_15 (
call_sign VARCHAR,
erp_w VARCHAR
) | What is the call sign with a 222 erp w? | SELECT call_sign FROM table_name_15 WHERE erp_w = 222 | sql_create_context |
CREATE TABLE race (
Race_ID int,
Name text,
Class text,
Date text,
Track_ID text
)
CREATE TABLE track (
Track_ID int,
Name text,
Location text,
Seating real,
Year_Opened real
) | What are the different classes of races, and how many races correspond to each Show bar chart, could you rank by the X in desc? | SELECT Class, COUNT(*) FROM race GROUP BY Class ORDER BY Class DESC | nvbench |
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... | provide the number of patients whose admission type is emergency and lab test name is uric acid? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_type = "EMERGENCY" AND lab.label = "Uric Acid" | mimicsql_data |
CREATE TABLE table_269920_3 (
l2_cache__mb_ INTEGER
) | What's the maximal L3 cache for any of the models given? | SELECT MAX(l2_cache__mb_) FROM table_269920_3 | sql_create_context |
CREATE TABLE table_31034 (
"No. in series" real,
"No. in season" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production code" text
) | Who are the writers of the episode titled 'Mac Bangs Dennis' Mom'? | SELECT "Written by" FROM table_31034 WHERE "Title" = 'Mac Bangs Dennis'' Mom' | wikisql |
CREATE TABLE table_name_5 (
iata VARCHAR,
airport VARCHAR
) | What kind of IATA has an Airport of hamburg airport? | SELECT iata FROM table_name_5 WHERE airport = "hamburg airport" | sql_create_context |
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
InputTitle text,
MarkdownInputGuidance text,
MarkdownPostOwnerGuidance text,
MarkdownPrivilegedUserGuidance text,
MarkdownConcensusDescription text,
CreationDate time,
CreationModeratorId number,
ApprovalDa... | Top 200 users from Bulgaria. | SELECT Id AS "user_link", DisplayName, Reputation, Location FROM Users WHERE Location LIKE '%Sofia%' OR Location LIKE '%Bulgaria%' ORDER BY Reputation DESC LIMIT 200 | sede |
CREATE TABLE table_64932 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Attendance" real,
"Record" text,
"Arena" text,
"Points" real
) | Which Attendance has an Arena of arrowhead pond of anaheim, and Points smaller than 5? | SELECT "Attendance" FROM table_64932 WHERE "Arena" = 'arrowhead pond of anaheim' AND "Points" < '5' | 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... | 病人编号为16815496在06年9月29日到2016年1月16日这段时间,病人被开出的所有检验报告单的科室编码以及名称分别是多少? | SELECT jybgb.KSBM, jybgb.KSMC 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 = '16815496' AND jybgb.BGRQ BETWEEN '2006-09-29' AND '2016-... | css |
CREATE TABLE table_28418 (
"No." real,
"#" real,
"Title" text,
"Directed by" text,
"Written by" text,
"U.S. viewers (million)" text,
"Rank (week)" text,
"Original air date" text,
"Production code" text
) | What was the ranking of episode #19? | SELECT "Rank (week)" FROM table_28418 WHERE "#" = '19' | wikisql |
CREATE TABLE table_name_45 (
driver VARCHAR,
grid VARCHAR
) | Which Driver has a Grid of 1? | SELECT driver FROM table_name_45 WHERE grid = "1" | sql_create_context |
CREATE TABLE table_76507 (
"Finished" text,
"Horse" text,
"Jockey" text,
"Trainer" text,
"Odds" text
) | Which Horse finished in 8? | SELECT "Horse" FROM table_76507 WHERE "Finished" = '8' | wikisql |
CREATE TABLE table_name_49 (
rank VARCHAR,
assets__bn$_ VARCHAR,
market_value__bn$_ VARCHAR
) | How many ranks have assets of $70.74 billion and market value greater than $11.29 billion? | SELECT COUNT(rank) FROM table_name_49 WHERE assets__bn$_ = 70.74 AND market_value__bn$_ > 11.29 | sql_create_context |
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number... | calculate patient 006-254232's duration of stay of the last stay in the icu. | SELECT STRFTIME('%j', patient.unitdischargetime) - STRFTIME('%j', patient.unitadmittime) FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-254232') AND NOT patient.unitadmittime IS NULL ORDER BY patient.unitadmittime DESC LIMIT ... | eicu |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.