context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE table_38733 (
"Date" text,
"Venue" text,
"Score" text,
"Result" text,
"Competition" text
) | Which Result has a Date of 4 april 1993? | SELECT "Result" FROM table_38733 WHERE "Date" = '4 april 1993' | wikisql |
CREATE TABLE table_26593762_2 (
team VARCHAR,
manager VARCHAR
) | Who is the captain of Dave Jones' team? | SELECT team AS captain FROM table_26593762_2 WHERE manager = "Dave Jones" | sql_create_context |
CREATE TABLE Comments (
Id number,
PostId number,
Score number,
Text text,
CreationDate time,
UserDisplayName text,
UserId number,
ContentLicense text
)
CREATE TABLE PostNotices (
Id number,
PostId number,
PostNoticeTypeId number,
CreationDate time,
DeletionDate time... | R questions with no answers, no comments and score >= 2. | SELECT p.Id AS "post_link", p.Score, p.CreationDate FROM Posts AS p INNER JOIN PostTags AS pt ON p.Id = pt.PostId INNER JOIN Tags AS t ON pt.TagId = t.Id WHERE p.PostTypeId = 1 AND p.Score >= '##MinScore:int?2##' AND p.ClosedDate IS NULL AND COALESCE(p.AnswerCount, 0) = 0 AND COALESCE(p.CommentCount, 0) = 0 AND t.TagNa... | sede |
CREATE TABLE table_30691 (
"Rank" real,
"Player" text,
"Year" real,
"Opponent" text,
"Passing yards" real,
"Rushing yards" real,
"Total offense" real
) | What is the number of rushing yards when the opponentis Indiana and the player is Denard Robinson? | SELECT MAX("Rushing yards") FROM table_30691 WHERE "Opponent" = 'Indiana' AND "Player" = 'Denard Robinson' | wikisql |
CREATE TABLE table_name_97 (
position VARCHAR,
college VARCHAR
) | What is Position, when College is 'Houston'? | SELECT position FROM table_name_97 WHERE college = "houston" | sql_create_context |
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... | 患者49189270有多少次住院发生在2006年4月30日到2019年3月21日之间? | SELECT COUNT(*) FROM zyb WHERE zyb.PERSON_NM = '49189270' AND zyb.IN_HOSP_DAYS BETWEEN '2006-04-30' AND '2019-03-21' | css |
CREATE TABLE table_2351952_1 (
railroad VARCHAR,
numbers VARCHAR
) | How many railroads have the numbers 864-873? | SELECT COUNT(railroad) FROM table_2351952_1 WHERE numbers = "864-873" | sql_create_context |
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... | 编号为34349699182的这次门诊就诊中,就诊的状态和对应的代码分别是什么 | SELECT zzmzjzjlb.JZZTDM, zzmzjzjlb.JZZTMC FROM zzmzjzjlb WHERE zzmzjzjlb.JZLSH = '34349699182' UNION SELECT fzzmzjzjlb.JZZTDM, fzzmzjzjlb.JZZTMC FROM fzzmzjzjlb WHERE fzzmzjzjlb.JZLSH = '34349699182' | css |
CREATE TABLE table_15164 (
"Year" real,
"Entrant" text,
"Chassis" text,
"Engine" text,
"Points" real
) | Which entrant used the chassis de tomaso 505? | SELECT "Entrant" FROM table_15164 WHERE "Chassis" = 'de tomaso 505' | wikisql |
CREATE TABLE table_dev_10 (
"id" int,
"gender" string,
"hba1c" float,
"serum_creatinine" float,
"alcohol_abuse" bool,
"baseline_hemoglobin_hgb" float,
"NOUSE" float
) | baseline hgb < 11.7 g / dl in female | SELECT * FROM table_dev_10 WHERE baseline_hemoglobin_hgb < 11.7 AND gender = 'female' | criteria2sql |
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
s... | what is the yearly maximum of heart rate for patient 808 since 05/30/2100? | SELECT MAX(chartevents.valuenum) FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 808)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'heart ... | mimic_iii |
CREATE TABLE table_name_60 (
date VARCHAR,
week VARCHAR,
result VARCHAR
) | On what date was the week less than 3 with a result of w 24-13? | SELECT date FROM table_name_60 WHERE week < 3 AND result = "w 24-13" | sql_create_context |
CREATE TABLE table_204_227 (
id number,
"week" number,
"date" text,
"opponent" text,
"score" text,
"result" text,
"record" text
) | what is the average number of points scored by opponents in the five games lost this season ? | SELECT AVG("score") FROM table_204_227 WHERE "result" = 'loss' | squall |
CREATE TABLE table_39852 (
"Matches" real,
"Wins" real,
"Losses" real,
"No Result" real,
"Success Rate" text
) | How many total No Results occured when the team had less than 46 wins and more than 16 matches? | SELECT SUM("No Result") FROM table_39852 WHERE "Matches" > '16' AND "Wins" < '46' | wikisql |
CREATE TABLE class (
class_code text,
crs_code text,
class_section text,
class_time text,
class_room text,
prof_num number
)
CREATE TABLE enroll (
class_code text,
stu_num number,
enroll_grade text
)
CREATE TABLE professor (
emp_num number,
dept_code text,
prof_office t... | Find the name of the department that offers the largest number of credits of all classes. | SELECT T3.dept_name FROM course AS T1 JOIN class AS T2 ON T1.crs_code = T2.crs_code JOIN department AS T3 ON T1.dept_code = T3.dept_code GROUP BY T1.dept_code ORDER BY SUM(T1.crs_credit) DESC LIMIT 1 | spider |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE prescriptions... | what is the number of patients whose gender is m and age is less than 55? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.gender = "M" AND demographic.age < "55" | mimicsql_data |
CREATE TABLE table_40080 (
"Date" text,
"Cover model" text,
"Centerfold model" text,
"Interview subject" text,
"Pictorials" text
) | Who was the Centerfold model in the issue in which the Interview subject was Jos Napole n Duarte? | SELECT "Centerfold model" FROM table_40080 WHERE "Interview subject" = 'josé napoleón duarte' | 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,
... | 28140515这个病人的检验报告单结果指标均异常的有哪些?看看检验报告的单号 | SELECT jybgb.BGDH FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN person_info_hz_info JOIN person_info 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 AND person_info_hz_info.KH = hz_info.KH AND pers... | css |
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... | 郎正豪患者之前确诊的病有哪些 | SELECT t_kc21.IN_DIAG_DIS_CD, t_kc21.IN_DIAG_DIS_NM FROM t_kc21 WHERE t_kc21.PERSON_NM = '郎正豪' | css |
CREATE TABLE table_name_44 (
fis_nordic_world_ski_championships VARCHAR,
winter_olympics VARCHAR
) | Which FIS Nordic World Ski Championships has Winter Olympics of 1960? | SELECT fis_nordic_world_ski_championships FROM table_name_44 WHERE winter_olympics = "1960" | sql_create_context |
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE cost (
c... | last time patient 018-20179 was diagnosed with coagulopathy - heparin administration? | SELECT diagnosis.diagnosistime FROM diagnosis WHERE diagnosis.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '018-20179')) AND diagnosis.diagnosisname = 'coagulopathy - hepari... | eicu |
CREATE TABLE table_72761 (
"Track Name" text,
"Location" text,
"Length" text,
"Sanction" text,
"Program" text
) | Who sanctioned the event in lincoln, illinois? | SELECT "Sanction" FROM table_72761 WHERE "Location" = 'Lincoln, Illinois' | wikisql |
CREATE TABLE table_name_76 (
destination VARCHAR,
origin VARCHAR
) | What is the destination of the rail with Dhanbad as the origin? | SELECT destination FROM table_name_76 WHERE origin = "dhanbad" | sql_create_context |
CREATE TABLE table_name_94 (
date VARCHAR,
surface VARCHAR
) | Tell me the total number of date for carpet | SELECT COUNT(date) FROM table_name_94 WHERE surface = "carpet" | sql_create_context |
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE icustays (
row_id number,
s... | when did patient 97314 get prescribed a drug via iv for the last time until 3 months ago? | SELECT prescriptions.startdate FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 97314) AND prescriptions.route = 'iv' AND DATETIME(prescriptions.startdate) <= DATETIME(CURRENT_TIME(), '-3 month') ORDER BY prescriptions.startdate DESC LIMIT 1 | mimic_iii |
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE m... | what was the name of the output the first time patient 017-41154 had on 06/24/last year? | SELECT intakeoutput.celllabel FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '017-41154')) AND intakeoutput.cellpath LIKE '%output%' AND D... | eicu |
CREATE TABLE table_name_55 (
surface VARCHAR,
partner VARCHAR,
score_in_the_final VARCHAR
) | What was the surface for Julie Halard when the final score was 6 3, 6 2? | SELECT surface FROM table_name_55 WHERE partner = "julie halard" AND score_in_the_final = "6–3, 6–2" | sql_create_context |
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,
... | Count the number of patients with diagnoses icd9 code 2930 who had a pleural fluid lab test. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.icd9_code = "2930" AND lab.fluid = "Pleural" | mimicsql_data |
CREATE TABLE table_203_547 (
id number,
"ship" text,
"built" number,
"in service for cunard" text,
"type" text,
"tonnage" text,
"notes" text
) | the year the last intermediate ship was built . | SELECT MAX("built") FROM table_203_547 WHERE "type" = 'intermediate' | squall |
CREATE TABLE table_58388 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | What was the home team score when the VFL played at Western Oval? | SELECT "Home team score" FROM table_58388 WHERE "Venue" = 'western oval' | wikisql |
CREATE TABLE table_17133 (
"Series #" real,
"Season #" real,
"Title" text,
"Director(s)" text,
"Writer(s)" text,
"Original airdate" text
) | Who was the director for the title, 'funhouse'? | SELECT "Director(s)" FROM table_17133 WHERE "Title" = 'Funhouse' | wikisql |
CREATE TABLE table_26745426_2 (
Ends VARCHAR,
country VARCHAR,
Canada VARCHAR
) | Name the ends lost for canada | SELECT Ends AS lost FROM table_26745426_2 WHERE country = Canada | sql_create_context |
CREATE TABLE table_name_91 (
character VARCHAR,
episodes INTEGER
) | What character is in over 22 episodes? | SELECT character FROM table_name_91 WHERE episodes > 22 | sql_create_context |
CREATE TABLE table_51631 (
"Date" text,
"Three" text,
"Four" text,
"Five" text,
"Seven" text
) | Name the seven for 29 november 1690 | SELECT "Seven" FROM table_51631 WHERE "Date" = '29 november 1690' | wikisql |
CREATE TABLE code_description (
code varchar,
description text
)
CREATE TABLE food_service (
meal_code text,
meal_number int,
compartment text,
meal_description varchar
)
CREATE TABLE dual_carrier (
main_airline varchar,
low_flight_number int,
high_flight_number int,
dual_airli... | show me return flights from CINCINNATI to SALT LAKE CITY nonstop | 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 = 'CINCINNATI' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SA... | atis |
CREATE TABLE table_56067 (
"Rank" real,
"Name" text,
"City" text,
"Height" text,
"Floors" real
) | What city is the lamar tower 1, ranked above 5? | SELECT "City" FROM table_56067 WHERE "Rank" < '5' AND "Name" = 'lamar tower 1' | wikisql |
CREATE TABLE PostsWithDeleted (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body text,
OwnerUserId number,
OwnerDisplayName text,
LastEditorUserId number,
LastEditorDispl... | RANK, parition by id order by value_type. | WITH test AS (SELECT 1 AS id, 'B' AS value_type UNION ALL SELECT 1, 'B' UNION ALL SELECT 1, 'A' UNION ALL SELECT 2, 'A' UNION ALL SELECT 2, 'A'), summary AS (SELECT t.*, RANK() OVER (PARTITION BY t.id ORDER BY t.value_type DESC) AS rank FROM test AS t) SELECT * FROM summary WHERE rank = 1 | sede |
CREATE TABLE table_66827 (
"Date" text,
"Venue" text,
"Score" text,
"Result" text,
"Competition" text
) | What is the Competition On 26 jan 2005 | SELECT "Competition" FROM table_66827 WHERE "Date" = '26 jan 2005' | wikisql |
CREATE TABLE Catalog_Structure (
catalog_level_number INTEGER,
catalog_id INTEGER,
catalog_level_name VARCHAR(50)
)
CREATE TABLE Attribute_Definitions (
attribute_id INTEGER,
attribute_name VARCHAR(30),
attribute_data_type VARCHAR(10)
)
CREATE TABLE Catalog_Contents (
catalog_entry_id INTE... | Find the dates on which more than one revisions were made, and the bin the date of latest revision into weekday interval and count them as a bar chart. | SELECT date_of_latest_revision, COUNT(date_of_latest_revision) FROM Catalogs | nvbench |
CREATE TABLE table_73523 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
) | Who has high points when verizon center 17,152 is location attendance? | SELECT "High points" FROM table_73523 WHERE "Location Attendance" = 'Verizon Center 17,152' | wikisql |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE diagnoses (
... | provide the number of patients whose admission location is emergency room admit and procedure icd9 code is 14? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_location = "EMERGENCY ROOM ADMIT" AND procedures.icd9_code = "14" | mimicsql_data |
CREATE TABLE table_1590967_2 (
episode_number INTEGER,
air_date VARCHAR
) | Name the most episode numbers of 6 january 2006 | SELECT MAX(episode_number) FROM table_1590967_2 WHERE air_date = "6 January 2006" | sql_create_context |
CREATE TABLE actor (
Actor_ID int,
Name text,
Musical_ID int,
Character text,
Duration text,
age int
)
CREATE TABLE musical (
Musical_ID int,
Name text,
Year int,
Award text,
Category text,
Nominee text,
Result text
) | Calculate the number of actors in each duration of actors using a bar chart, order by the how many duration in descending. | SELECT Duration, COUNT(Duration) FROM actor GROUP BY Duration ORDER BY COUNT(Duration) DESC | nvbench |
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,
... | 63144287347这次医疗就诊需要的住院时长如何 | SELECT t_kc21.IN_HOSP_DAYS FROM t_kc21 WHERE t_kc21.MED_CLINIC_ID = '63144287347' | css |
CREATE TABLE table_name_58 (
region VARCHAR,
total_gdp__€_bn__ VARCHAR
) | What is the Region that has a Total GDP ( bn ) of 11,745.353? | SELECT region FROM table_name_58 WHERE total_gdp__€_bn__ = "€11,745.353" | sql_create_context |
CREATE TABLE table_77531 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Game site" text,
"Attendance" text
) | Who did the Jets play in their post-week 15 game? | SELECT "Opponent" FROM table_77531 WHERE "Week" > '15' | wikisql |
CREATE TABLE table_4257 (
"Name" text,
"Family name" text,
"Receptor" text,
"Coreceptor" text,
"Property" text,
"Chromosomal location" text
) | What are the names listed in the family il-1f2? | SELECT "Name" FROM table_4257 WHERE "Family name" = 'IL-1F2' | wikisql |
CREATE TABLE table_15372 (
"Year" real,
"Team" text,
"Co-Drivers" text,
"Class" text,
"Laps" real,
"Pos." text
) | Who were the co-drivers with more than 377 laps in 1st position? | SELECT "Co-Drivers" FROM table_15372 WHERE "Laps" > '377' AND "Pos." = '1st' | wikisql |
CREATE TABLE competition_result (
Competition_ID int,
Club_ID_1 int,
Club_ID_2 int,
Score text
)
CREATE TABLE competition (
Competition_ID int,
Year real,
Competition_type text,
Country text
)
CREATE TABLE club_rank (
Rank real,
Club_ID int,
Gold real,
Silver real,
... | A stacked bar chart about the total number in each competition type, and then split by country, could you order by the bars from low to high? | SELECT Country, COUNT(Country) FROM competition GROUP BY Competition_type, Country ORDER BY Country | nvbench |
CREATE TABLE products (
code number,
name text,
price number,
manufacturer number
)
CREATE TABLE manufacturers (
code number,
name text,
headquarter text,
founder text,
revenue number
) | What are the names of companies with revenue between 100 and 150? | SELECT name FROM manufacturers WHERE revenue BETWEEN 100 AND 150 | spider |
CREATE TABLE table_46916 (
"Year" real,
"Winner" text,
"Jockey" text,
"Trainer" text,
"Owner" text
) | Who was the winner after 1989 when Stronach Stable was the owner? | SELECT "Winner" FROM table_46916 WHERE "Year" > '1989' AND "Owner" = 'stronach stable' | wikisql |
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Percent text,
ACC_Home text,
ACC_Road text,
All_Games text,
All_Games_Percent int,
All_Home text,
All_Road text,
All_Neutral text
)
CREATE TABLE university (
Scho... | Visualize a bar chart about the distribution of All_Home and the average of Team_ID , and group by attribute All_Home, and rank from low to high by the y-axis please. | SELECT All_Home, AVG(Team_ID) FROM basketball_match GROUP BY All_Home ORDER BY AVG(Team_ID) | nvbench |
CREATE TABLE table_4309 (
"Round" real,
"Overall" real,
"Player" text,
"Position" text,
"College" text
) | Which college was the player selected from in round 1? | SELECT "College" FROM table_4309 WHERE "Round" = '1' | wikisql |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
C... | provide the number of patients whose year of birth is less than 1821 and drug route is left eye? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.dob_year < "1821" AND prescriptions.route = "LEFT EYE" | mimicsql_data |
CREATE TABLE table_27293285_4 (
points_for VARCHAR
) | Name the total number of points for for played | SELECT COUNT(points_for) FROM table_27293285_4 WHERE "played" = "played" | sql_create_context |
CREATE TABLE table_27209 (
"Player" text,
"Minutes" real,
"Field Goals" real,
"Rebounds" real,
"Assists" real,
"Steals" real,
"Blocks" real,
"Points" real
) | What is Tiffani Johnson's maximum steals? | SELECT MAX("Steals") FROM table_27209 WHERE "Player" = 'Tiffani Johnson' | wikisql |
CREATE TABLE swimmer (
ID int,
name text,
Nationality text,
meter_100 real,
meter_200 text,
meter_300 text,
meter_400 text,
meter_500 text,
meter_600 text,
meter_700 text,
Time text
)
CREATE TABLE stadium (
ID int,
name text,
Capacity int,
City text,
Coun... | Create a bar chart showing the number of meter 200 across meter 200, and rank by the Y from low to high. | SELECT meter_200, COUNT(meter_200) FROM swimmer GROUP BY meter_200 ORDER BY COUNT(meter_200) | nvbench |
CREATE TABLE table_168482_1 (
_number_of_seats_won INTEGER
) | What is the largest number of seats won? | SELECT MAX(_number_of_seats_won) FROM table_168482_1 | sql_create_context |
CREATE TABLE table_name_35 (
grand_slam VARCHAR,
winner VARCHAR,
year VARCHAR,
round VARCHAR
) | What is the grand slam in 1987, when round shows first round, and Ivan Lendl won? | SELECT grand_slam FROM table_name_35 WHERE year = 1987 AND round = "first round" AND winner = "ivan lendl" | sql_create_context |
CREATE TABLE table_10360823_1 (
overall VARCHAR,
college VARCHAR
) | Which overall pick was traded to the Cleveland Browns? | SELECT overall FROM table_10360823_1 WHERE college = "Traded to the Cleveland Browns" | sql_create_context |
CREATE TABLE table_name_20 (
tournament VARCHAR,
partnering VARCHAR
) | Partnering of franco ferreiro had what tournament? | SELECT tournament FROM table_name_20 WHERE partnering = "franco ferreiro" | sql_create_context |
CREATE TABLE table_15124 (
"Date" text,
"Venue" text,
"Score" text,
"Result" text,
"Competition" text
) | Name the venue for score of 1-3 | SELECT "Venue" FROM table_15124 WHERE "Score" = '1-3' | wikisql |
CREATE TABLE t_kc24 (
ACCOUNT_DASH_DATE time,
ACCOUNT_DASH_FLG number,
CASH_PAY number,
CIVIL_SUBSIDY number,
CKC102 number,
CLINIC_ID text,
CLINIC_SLT_DATE time,
COMP_ID text,
COM_ACC_PAY number,
COM_PAY number,
DATA_ID text,
ENT_ACC_PAY number,
ENT_PAY number,
F... | 参保人华依波门诊医疗费总额一年是多少? | SELECT SUM(mzb.MED_CLINIC_ID) FROM mzb WHERE mzb.PERSON_SEX = '华依波' | css |
CREATE TABLE requirement (
requirement_id int,
requirement varchar,
college varchar
)
CREATE TABLE offering_instructor (
offering_instructor_id int,
offering_id int,
instructor_id int
)
CREATE TABLE program_requirement (
program_id int,
category varchar,
min_credit int,
additio... | Next semester is Prof. Lauren Benjamin teaching 453 ? | SELECT COUNT(*) > 0 FROM course, course_offering, instructor, offering_instructor, semester WHERE course.course_id = course_offering.course_id AND course.department = 'EECS' AND course.number = 453 AND instructor.name LIKE '%Lauren Benjamin%' AND offering_instructor.instructor_id = instructor.instructor_id AND offering... | advising |
CREATE TABLE table_name_26 (
method VARCHAR,
opponent VARCHAR
) | What is the method against Paula Mataele? | SELECT method FROM table_name_26 WHERE opponent = "paula mataele" | sql_create_context |
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,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 departments (
DEPARTMENT_ID decimal... | For those employees whose salary is in the range of 8000 and 12000 and commission is not null or department number does not equal to 40, give me the comparison about the average of salary over the hire_date bin hire_date by time, show by the y-axis in ascending please. | SELECT HIRE_DATE, AVG(SALARY) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 ORDER BY AVG(SALARY) | nvbench |
CREATE TABLE table_33916 (
"Year" real,
"Championship" text,
"Winning score" text,
"Margin" text,
"Runner(s)-up" text
) | What is the Margin in 1953 when Patty Berg was Runner(s)-up? | SELECT "Margin" FROM table_33916 WHERE "Runner(s)-up" = 'patty berg' AND "Year" = '1953' | 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 are with procedure icd9 code 17? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE procedures.icd9_code = "17" | mimicsql_data |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE prescription... | give me the number of patients whose gender is f and procedure short title is parent infus nutrit sub? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.gender = "F" AND procedures.short_title = "Parent infus nutrit sub" | mimicsql_data |
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid n... | among patients who were prescribed potassium chl 40 meq / 1000 ml d5ns, what are the five most frequently prescribed drugs at the same time since 1 year ago? | SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, prescriptions.startdate FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE prescriptions.drug = 'potassium chl 40 meq / 1000 ml d5ns' AND DATETIME(prescriptions.s... | mimic_iii |
CREATE TABLE table_2468961_6 (
directed_by VARCHAR,
no_in_series VARCHAR
) | When 102 is the number in series who is the director? | SELECT directed_by FROM table_2468961_6 WHERE no_in_series = 102 | sql_create_context |
CREATE TABLE table_9418 (
"Round" real,
"Pick" real,
"Player" text,
"Position" text,
"Nationality" text,
"School/Club Team" text
) | Which player has fewer than 2 rounds? | SELECT "Player" FROM table_9418 WHERE "Round" < '2' | wikisql |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE prescriptions... | provide the number of patients whose admission location is emergency room admit and admission year is less than 2155? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_location = "EMERGENCY ROOM ADMIT" AND demographic.admityear < "2155" | mimicsql_data |
CREATE TABLE table_name_37 (
total INTEGER,
bask VARCHAR,
base VARCHAR
) | What is the highest total value when bask and base are each 3? | SELECT MAX(total) FROM table_name_37 WHERE bask = "3" AND base = "3" | sql_create_context |
CREATE TABLE table_20726262_3 (
no_in_season VARCHAR,
production_code VARCHAR
) | What season number did production code 2wab12? | SELECT no_in_season FROM table_20726262_3 WHERE production_code = "2WAB12" | sql_create_context |
CREATE TABLE person_info (
CSD text,
CSRQ time,
GJDM text,
GJMC text,
JGDM text,
JGMC text,
MZDM text,
MZMC text,
RYBH text,
XBDM number,
XBMC text,
XLDM text,
XLMC text,
XM text,
ZYLBDM text,
ZYMC text
)
CREATE TABLE hz_info (
KH text,
KLX number... | 90549392这个病人在二一年十一月一日之前有哪些住院就诊的检验报告单?查一下这些住院就诊流水号 | SELECT zyjzjlb.JZLSH FROM hz_info JOIN zyjzjlb ON hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX WHERE hz_info.RYBH = '90549392' AND NOT zyjzjlb.JZLSH IN (SELECT zyjybgb.JZLSH FROM zyjybgb WHERE zyjybgb.BGRQ >= '2021-11-01' UNION SELECT mzjybgb.JZLSH FROM mzjybgb WHERE mzjybgb... | css |
CREATE TABLE companies (
id number,
name text,
headquarters text,
industry text,
sales_billion number,
profits_billion number,
assets_billion number,
market_value_billion text
)
CREATE TABLE buildings (
id number,
name text,
city text,
height number,
stories number,
... | List the name and assets of each company in ascending order of company name. | SELECT name, assets_billion FROM companies ORDER BY name | spider |
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... | 统计一下医疗记录中患者年龄不高于17岁的平均治病费总额一共是多少? | SELECT AVG(t_kc24.MED_AMOUT) FROM t_kc24 WHERE t_kc24.MED_CLINIC_ID IN (SELECT gwyjzb.MED_CLINIC_ID FROM gwyjzb WHERE gwyjzb.PERSON_AGE <= 17 UNION SELECT fgwyjzb.MED_CLINIC_ID FROM fgwyjzb WHERE fgwyjzb.PERSON_AGE <= 17) | css |
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefined boolean,
PostNoticeDurationId number
)
C... | Populist badge candidate users and posts. | SELECT answers.OwnerUserId AS "user_link", answers.Id AS "post_link", answers.CreationDate, answers.Score AS "user_score", acceptedanswers.Score AS "accepted_answer_score" FROM Posts AS answers INNER JOIN Posts AS questions ON answers.ParentId = questions.Id INNER JOIN Posts AS acceptedanswers ON questions.AcceptedAnsw... | sede |
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... | 患者28022050的医疗记录中,有过哪些医疗费总额不小于7272.12元的信息,看看入院诊断疾病名和编码 | SELECT t_kc21.IN_DIAG_DIS_CD, t_kc21.IN_DIAG_DIS_NM FROM t_kc21 WHERE t_kc21.PERSON_ID = '28022050' AND t_kc21.MED_CLINIC_ID IN (SELECT t_kc21_t_kc24.MED_CLINIC_ID FROM t_kc24 WHERE t_kc24.MED_AMOUT >= 7272.12) | css |
CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
LOCATION_ID decimal(4,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... | For those employees whose salary is in the range of 8000 and 12000 and commission is not null or department number does not equal to 40, a bar chart shows the distribution of job_id and the sum of salary , and group by attribute job_id. | SELECT JOB_ID, SUM(SALARY) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 GROUP BY JOB_ID | nvbench |
CREATE TABLE table_name_12 (
player VARCHAR,
sets VARCHAR,
event VARCHAR
) | What Player in 2005 Wimbledon had less than 5 Sets? | SELECT player FROM table_name_12 WHERE sets < 5 AND event = "2005 wimbledon" | sql_create_context |
CREATE TABLE table_46529 (
"car model" text,
"displacement & configuration" text,
"max. motive power @ rpm" text,
"max. torque @ rpm" text,
"max. speed" text,
"emissions CO2" text
) | What displacement & configuration does the car model Panamera 4s have? | SELECT "displacement & configuration" FROM table_46529 WHERE "car model" = 'panamera 4s' | wikisql |
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospit... | what are the five year survival rates for those who were prescribed pantoprazole sod after having been diagnosed with pericardial tamponade - by echocardiogram? | SELECT SUM(CASE WHEN patient.hospitaldischargestatus = 'alive' THEN 1 WHEN STRFTIME('%j', patient.hospitaldischargetime) - STRFTIME('%j', t4.diagnosistime) > 5 * 365 THEN 1 ELSE 0 END) * 100 / COUNT(*) FROM (SELECT t2.uniquepid, t2.diagnosistime FROM (SELECT t1.uniquepid, t1.diagnosistime FROM (SELECT patient.uniquepid... | eicu |
CREATE TABLE Products_for_hire (
product_id VARCHAR,
booked_amount INTEGER
)
CREATE TABLE products_booked (
product_id VARCHAR,
booked_amount INTEGER
) | How many products are never booked with amount higher than 200? | SELECT COUNT(*) FROM Products_for_hire WHERE NOT product_id IN (SELECT product_id FROM products_booked WHERE booked_amount > 200) | sql_create_context |
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
)
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
) | For those records from the products and each product's manufacturer, show me about the distribution of name and the sum of code , and group by attribute name in a bar chart, and sort from high to low by the total number. | SELECT T2.Name, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name ORDER BY T1.Code DESC | nvbench |
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,0)
)
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
CREATE TABLE job_history (
EMPLOYEE_ID decimal(6,0),
START_DATE date,
END_DATE date,
JOB_ID... | For those employees who did not have any job in the past, show me about the distribution of hire_date and the average of manager_id bin hire_date by time in a bar chart. | SELECT HIRE_DATE, AVG(MANAGER_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) | nvbench |
CREATE TABLE table_name_98 (
erp_w INTEGER,
frequency_mhz VARCHAR
) | Which ERP W has a Frequency MHz of 89.3 fm? | SELECT MAX(erp_w) FROM table_name_98 WHERE frequency_mhz = "89.3 fm" | sql_create_context |
CREATE TABLE table_20770 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Ground" text,
"Crowd" real,
"Date" text
) | What is the home team score where the home team is Fremantle? | SELECT "Home team score" FROM table_20770 WHERE "Home team" = 'Fremantle' | wikisql |
CREATE TABLE table_29743 (
"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 the record was 18 12? | SELECT "Date" FROM table_29743 WHERE "Record" = '18–12' | wikisql |
CREATE TABLE comment_instructor (
instructor_id int,
student_id int,
score int,
comment_text varchar
)
CREATE TABLE course_prerequisite (
pre_course_id int,
course_id int
)
CREATE TABLE jobs (
job_id int,
job_title varchar,
description varchar,
requirement varchar,
city var... | Which classes must I take in order to declare a major in COMP ? | SELECT DISTINCT course.department, course.name, course.number FROM course, program_course WHERE course.department LIKE '%COMP%' AND program_course.category LIKE 'PreMajor' AND program_course.course_id = course.course_id | advising |
CREATE TABLE table_203_289 (
id number,
"version" text,
"length" text,
"album" text,
"remixed by" text,
"year" number,
"comment" text
) | which version was around 7 minutes in length but remixed by enzo mori and stephan clark ? | SELECT "version" FROM table_203_289 WHERE "length" = 7 AND "remixed by" = 'enzo mori and stephan clark' | squall |
CREATE TABLE table_2764267_2 (
country VARCHAR,
currency VARCHAR
) | Name the country that has the yen | SELECT country FROM table_2764267_2 WHERE currency = "Yen" | sql_create_context |
CREATE TABLE table_68577 (
"Res." text,
"Record" text,
"Opponent" text,
"Method" text,
"Event" text,
"Round" text
) | Which method has a record of 3-0? | SELECT "Method" FROM table_68577 WHERE "Record" = '3-0' | wikisql |
CREATE TABLE table_31373 (
"Country with flag" text,
"Area (km\u00b2)" real,
"Population (1 July 2005 est.)" real,
"Population density (per km\u00b2)" text,
"Capital" text
) | How many entries for area correspond to a population density of 207.9? | SELECT COUNT("Area (km\u00b2)") FROM table_31373 WHERE "Population density (per km\u00b2)" = '207.9' | wikisql |
CREATE TABLE table_40053 (
"Year" real,
"Division" text,
"League" text,
"Regular Season" text,
"Playoffs" text,
"Open Cup" text
) | Which League that has a Open Cup of 1st round, and a Year of 2009? | SELECT "League" FROM table_40053 WHERE "Open Cup" = '1st round' AND "Year" = '2009' | wikisql |
CREATE TABLE table_38252 (
"Election" text,
"D\u00e1il" text,
"Share of votes" text,
"Seats" real,
"Government" text
) | What is the lowest number of seats from the election with 27.0% of votes? | SELECT MIN("Seats") FROM table_38252 WHERE "Share of votes" = '27.0%' | wikisql |
CREATE TABLE table_73889 (
"\u00d7" text,
"Faisaly" text,
"Wehdat" text,
"Ramtha" text,
"Ahli" text,
"Jazeera" text,
"Hussein" text,
"Amman" text,
"Orthodoxy" text,
"Jeel" text,
"Ain Karem" text
) | What is ramtha when jeel is 1-0 and hussein is 1-0? | SELECT "Ramtha" FROM table_73889 WHERE "Jeel" = '1-0' AND "Hussein" = '1-0' | wikisql |
CREATE TABLE Courses (
course_id INTEGER,
author_id INTEGER,
subject_id INTEGER,
course_name VARCHAR(120),
course_description VARCHAR(255)
)
CREATE TABLE Students (
student_id INTEGER,
date_of_registration DATETIME,
date_of_latest_logon DATETIME,
login_name VARCHAR(40),
password... | Visualize a bar chart about the distribution of personal_name and author_id . | SELECT personal_name, author_id FROM Course_Authors_and_Tutors ORDER BY personal_name | nvbench |
CREATE TABLE table_27170 (
"Outcome" text,
"Year" real,
"Championship" text,
"Surface" text,
"Partner" text,
"Opponents" text,
"Score" text
) | Who were the opponents in the Rome championship? | SELECT "Opponents" FROM table_27170 WHERE "Championship" = 'Rome' | wikisql |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.