context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
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 d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE chart... | did patient 23930 go through any procedure? | SELECT COUNT(*) > 0 FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 23930) | mimic_iii |
CREATE TABLE bank (
bname VARCHAR,
branch_id VARCHAR
)
CREATE TABLE customer (
cust_id VARCHAR,
credit_score INTEGER
)
CREATE TABLE loan (
branch_id VARCHAR,
cust_id VARCHAR
) | Find the names of bank branches that have provided a loan to any customer whose credit score is below 100. | SELECT T2.bname FROM loan AS T1 JOIN bank AS T2 ON T1.branch_id = T2.branch_id JOIN customer AS T3 ON T1.cust_id = T3.cust_id WHERE T3.credit_score < 100 | sql_create_context |
CREATE TABLE Premises (
premise_id INTEGER,
premises_type VARCHAR(15),
premise_details VARCHAR(255)
)
CREATE TABLE Customers (
customer_id INTEGER,
payment_method VARCHAR(15),
customer_name VARCHAR(80),
customer_phone VARCHAR(80),
customer_email VARCHAR(80),
customer_address VARCHAR... | A pie chart showing the number of customer addresses in each premises type. | 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 | nvbench |
CREATE TABLE table_67684 (
"Club" text,
"Played" text,
"Drawn" text,
"Lost" text,
"Points for" text,
"Points against" text,
"Tries for" text,
"Tries against" text,
"Try bonus" text,
"Losing bonus" text,
"Points" text
) | What is the Club, when the value for Played is 22, and when the value for Tries is 41? | SELECT "Club" FROM table_67684 WHERE "Played" = '22' AND "Tries for" = '41' | wikisql |
CREATE TABLE table_18857 (
"District" text,
"2012 Commission" text,
"2010 Commission" text,
"2007 Commission" text,
"2002 Commission" text,
"1999 Commission" text
) | What district for charlie oliver of the 2012 commission? | SELECT "District" FROM table_18857 WHERE "2012 Commission" = 'Charlie Oliver' | wikisql |
CREATE TABLE table_name_97 (
score VARCHAR,
team VARCHAR
) | What was the score for the game against San Antonio? | SELECT score FROM table_name_97 WHERE team = "san antonio" | sql_create_context |
CREATE TABLE table_74877 (
"Position" real,
"Team" text,
"Points" real,
"Played" real,
"Drawn" real,
"Lost" real,
"Against" real,
"Difference" text
) | Which Lost is the highest one that has a Drawn smaller than 4, and a Played smaller than 9? | SELECT MAX("Lost") FROM table_74877 WHERE "Drawn" < '4' AND "Played" < '9' | wikisql |
CREATE TABLE table_name_45 (
goals INTEGER,
leading_scorer VARCHAR
) | Leading Scorer of Ian rush is what lowest # of goals? | SELECT MIN(goals) FROM table_name_45 WHERE leading_scorer = "ian rush" | sql_create_context |
CREATE TABLE PostHistory (
Id number,
PostHistoryTypeId number,
PostId number,
RevisionGUID other,
CreationDate time,
UserId number,
UserDisplayName text,
Comment text,
Text text,
ContentLicense text
)
CREATE TABLE SuggestedEdits (
Id number,
PostId number,
CreationD... | Check if owner ID and QID in data dump are linked to API. | SELECT * FROM Users WHERE Users.Id = 61 | sede |
CREATE TABLE t_kc21 (
MED_CLINIC_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
COMP_ID text,
PERSON_ID text,
PERSON_NM text,
IDENTITY_CARD text,
SOC_SRT_CARD text,
PERSON_SEX number,
PERSON_AGE number,
IN_HOSP_DATE time,
OUT_HOSP_DATE time,
DIFF_PLACE_FLG numb... | 在哪几次医疗记录中给72363456患者开出过金额不低于7610.85元的药品以及医疗就诊编号是多少? | SELECT MED_CLINIC_ID FROM t_kc21 WHERE PERSON_ID = '72363456' AND MED_CLINIC_ID IN (SELECT MED_CLINIC_ID FROM t_kc22 WHERE AMOUNT >= 7610.85) | css |
CREATE TABLE table_69748 (
"Year" text,
"Team" text,
"Tackles" text,
"Solo" real,
"Sacks" real,
"INT YDS" real
) | What is the value for lowest Sacks, when the Team is New Orleans Saints, and when the value for Tackles is 132? | SELECT MIN("Sacks") FROM table_69748 WHERE "Team" = 'new orleans saints' AND "Tackles" = '132' | wikisql |
CREATE TABLE table_name_33 (
pick INTEGER,
overall VARCHAR
) | What is the smallest Pick with Overall of 244? | SELECT MIN(pick) FROM table_name_33 WHERE overall = 244 | sql_create_context |
CREATE TABLE t_kc21 (
MED_CLINIC_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
COMP_ID text,
PERSON_ID text,
PERSON_NM text,
IDENTITY_CARD text,
SOC_SRT_CARD text,
PERSON_SEX number,
PERSON_AGE number,
IN_HOSP_DATE time,
OUT_HOSP_DATE time,
DIFF_PLACE_FLG numb... | 列出按平均住院时长升序排序各科室在医院3701034的名称、编码以及平均住院时长都是什么? | SELECT MED_ORG_DEPT_CD, MED_ORG_DEPT_NM, AVG(IN_HOSP_DAYS) FROM t_kc21 WHERE MED_SER_ORG_NO = '3701034' GROUP BY MED_ORG_DEPT_CD ORDER BY AVG(IN_HOSP_DAYS) | css |
CREATE TABLE table_name_21 (
attendance INTEGER,
decision VARCHAR,
visitor VARCHAR
) | What was the lowest attendance at the game against chicago when conklin made the decision? | SELECT MIN(attendance) FROM table_name_21 WHERE decision = "conklin" AND visitor = "chicago" | sql_create_context |
CREATE TABLE table_name_81 (
december VARCHAR,
score VARCHAR,
game VARCHAR
) | How much December has a Score of 5 2, and a Game smaller than 27? | SELECT COUNT(december) FROM table_name_81 WHERE score = "5–2" AND game < 27 | sql_create_context |
CREATE TABLE table_14598_9 (
females___percentage_ VARCHAR,
literate_persons___percentage_ VARCHAR
) | What is the percentage of all females that are literate people have a percentage of 68.74? | SELECT females___percentage_ FROM table_14598_9 WHERE literate_persons___percentage_ = "68.74" | sql_create_context |
CREATE TABLE table_39283 (
"Game" real,
"October" real,
"Opponent" text,
"Score" text,
"Record" text,
"Points" real
) | How many Points have a Score of 3 0? | SELECT COUNT("Points") FROM table_39283 WHERE "Score" = '3–0' | wikisql |
CREATE TABLE table_name_12 (
against VARCHAR,
opposing_teams VARCHAR,
date VARCHAR
) | What is Against, when Opposing Teams is 'Australia', and when Date is '27/07/1991'? | SELECT against FROM table_name_12 WHERE opposing_teams = "australia" AND date = "27/07/1991" | sql_create_context |
CREATE TABLE table_name_61 (
wins VARCHAR,
scored VARCHAR,
draws VARCHAR
) | How many Wins has a Scored of 27 and Draws smaller than 5? | SELECT COUNT(wins) FROM table_name_61 WHERE scored = 27 AND draws < 5 | sql_create_context |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,... | count the number of patients whose diagnoses short title is pyelonephritis nos? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE diagnoses.short_title = "Pyelonephritis NOS" | mimicsql_data |
CREATE TABLE table_74873 (
"Name" text,
"Hanzi" text,
"Origin" text,
"Launch" text,
"Owner" text
) | What is the Hanzi of Phoenix Television Chinese that launched in 1996? | SELECT "Hanzi" FROM table_74873 WHERE "Launch" = '1996' AND "Name" = 'phoenix television chinese' | wikisql |
CREATE TABLE table_54273 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | What's the home team for the junction oval venue? | SELECT "Home team score" FROM table_54273 WHERE "Venue" = 'junction oval' | wikisql |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
... | How many jewish patients had a lab test named monocytes? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.religion = "JEWISH" AND lab.label = "Monocytes" | mimicsql_data |
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... | what is the number of patients who died in or before 2168 with lab test item id 51131? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dod_year <= "2168.0" AND lab.itemid = "51131" | mimicsql_data |
CREATE TABLE geographic (
city_name varchar,
county varchar,
region varchar
)
CREATE TABLE restaurant (
id int,
name varchar,
food_type varchar,
city_name varchar,
rating "decimal
)
CREATE TABLE location (
restaurant_id int,
house_number int,
street_name varchar,
city_n... | where is a good arabic restaurant on buchanan in san francisco ? | SELECT location.house_number, restaurant.name FROM location, restaurant WHERE location.city_name = 'san francisco' AND location.street_name = 'buchanan' AND restaurant.food_type = 'arabic' AND restaurant.id = location.restaurant_id AND restaurant.rating > 2.5 | restaurants |
CREATE TABLE event (
Date VARCHAR,
Name VARCHAR,
venue VARCHAR,
Event_Attendance VARCHAR
) | Show the dates, places, and names of events in descending order of the attendance. | SELECT Date, Name, venue FROM event ORDER BY Event_Attendance DESC | sql_create_context |
CREATE TABLE table_2866456_1 (
directed_by VARCHAR,
production_code VARCHAR
) | Who is the directed by when 2t6404 is the production code? | SELECT directed_by FROM table_2866456_1 WHERE production_code = "2T6404" | sql_create_context |
CREATE TABLE table_1973729_1 (
joined VARCHAR,
nickname VARCHAR
) | How many years are listed under joined for the Nor'easters? | SELECT COUNT(joined) FROM table_1973729_1 WHERE nickname = "Nor'easters" | 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 employees (
EMPLOYEE_ID decimal(6,0... | 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, show me about the distribution of hire_date and the amount of hire_date bin hire_date by time in a bar chart, show by the y axis in desc. | SELECT HIRE_DATE, COUNT(HIRE_DATE) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 ORDER BY COUNT(HIRE_DATE) DESC | nvbench |
CREATE TABLE fgwyjzb (
CLINIC_ID text,
CLINIC_TYPE text,
COMP_ID text,
DATA_ID text,
DIFF_PLACE_FLG number,
FERTILITY_STS number,
FLX_MED_ORG_ID text,
HOSP_LEV number,
HOSP_STS number,
IDENTITY_CARD text,
INPT_AREA_BED text,
INSURED_IDENTITY number,
INSURED_STS text,
... | 编号为26289441351的患者去了哪个定点医疗单位编码是多少号? | SELECT gwyjzb.FLX_MED_ORG_ID FROM gwyjzb WHERE gwyjzb.MED_CLINIC_ID = '26289441351' UNION SELECT fgwyjzb.FLX_MED_ORG_ID FROM fgwyjzb WHERE fgwyjzb.MED_CLINIC_ID = '26289441351' | css |
CREATE TABLE table_63074 (
"Rank" real,
"Lane" real,
"Name" text,
"Nationality" text,
"Time" real
) | how many times is the name matt targett and the lane higher than 7? | SELECT COUNT("Time") FROM table_63074 WHERE "Name" = 'matt targett' AND "Lane" > '7' | wikisql |
CREATE TABLE table_204_261 (
id number,
"rank" number,
"nation" text,
"gold" number,
"silver" number,
"bronze" number,
"total" number
) | which nation has the most bronze medals ? | SELECT "nation" FROM table_204_261 ORDER BY "bronze" DESC LIMIT 1 | squall |
CREATE TABLE Student_Addresses (
monthly_rental INTEGER
) | Find the maximum and minimum monthly rental for all student addresses. | SELECT MAX(monthly_rental), MIN(monthly_rental) FROM Student_Addresses | sql_create_context |
CREATE TABLE table_19046 (
"Grand Cru" text,
"Region" text,
"Village" text,
"Wine style" text,
"Vineyard surface (2010)" text
) | what's the wine style with grand cru being roman e-conti | SELECT "Wine style" FROM table_19046 WHERE "Grand Cru" = 'Romanée-Conti' | wikisql |
CREATE TABLE trip (
id INTEGER,
duration INTEGER,
start_date TEXT,
start_station_name TEXT,
start_station_id INTEGER,
end_date TEXT,
end_station_name TEXT,
end_station_id INTEGER,
bike_id INTEGER,
subscription_type TEXT,
zip_code INTEGER
)
CREATE TABLE status (
station_i... | A bar chart for giveing me the number of the dates when the max temperature was higher than 85, and sort in descending by the Y. | SELECT date, COUNT(date) FROM weather WHERE max_temperature_f > 85 ORDER BY COUNT(date) DESC | nvbench |
CREATE TABLE table_25800134_3 (
director VARCHAR,
airdate VARCHAR
) | Who was the director for the episode on May 2, 1959? | SELECT director FROM table_25800134_3 WHERE airdate = "May 2, 1959" | sql_create_context |
CREATE TABLE table_22363 (
"No. in series" real,
"No. in season" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"U.S. viewers (in millions)" text
) | What is the title when u.s. viewers (millions) is 3.97? | SELECT "Title" FROM table_22363 WHERE "U.S. viewers (in millions)" = '3.97' | wikisql |
CREATE TABLE table_203_108 (
id number,
"kilometers" number,
"name" text,
"location" text,
"intersecting routes" text
) | which section is longest ?? | SELECT "name" FROM table_203_108 ORDER BY "kilometers" DESC LIMIT 1 | squall |
CREATE TABLE table_6003 (
"Stage" text,
"Winner" text,
"General classification" text,
"Points classification" text,
"Mountains classification" text,
"Combination classification" text,
"Team classification" text
) | Which Mountains classification has Points classification of not awarded? | SELECT "Mountains classification" FROM table_6003 WHERE "Points classification" = 'not awarded' | wikisql |
CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
LOCATION_ID decimal(4,0)
)
CREATE TABLE locations (
LOCATION_ID decimal(4,0),
STREET_ADDRESS varchar(40),
POSTAL_CODE varchar(12),
CITY varchar(30),
STATE_PROVINCE varchar(25... | You can give me a bar chart, that groups and counts the country name, list X-axis in descending order. | SELECT COUNTRY_NAME, COUNT(COUNTRY_NAME) FROM countries GROUP BY COUNTRY_NAME ORDER BY COUNTRY_NAME DESC | nvbench |
CREATE TABLE table_name_9 (
body_length_mm INTEGER,
lead_pitch_mm INTEGER
) | Which Body Length/mm has a Lead Pitch/mm smaller than 0.5? | SELECT AVG(body_length_mm) FROM table_name_9 WHERE lead_pitch_mm < 0.5 | sql_create_context |
CREATE TABLE table_name_12 (
h_a_n VARCHAR,
score VARCHAR
) | What was the H/A/N for the game that ended in a score of 108-102? | SELECT h_a_n FROM table_name_12 WHERE score = "108-102" | sql_create_context |
CREATE TABLE table_62308 (
"Season" real,
"Team" text,
"Country" text,
"League" text,
"Level" real,
"Apps" real,
"Goals" real
) | What is the total Level with 27 Apps after 2006? | SELECT SUM("Level") FROM table_62308 WHERE "Apps" = '27' AND "Season" > '2006' | wikisql |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TA... | number of patients who have had a bronchial lavage microbiology test until 2103. | SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE patient.patientunitstayid IN (SELECT microlab.patientunitstayid FROM microlab WHERE microlab.culturesite = 'bronchial lavage' AND STRFTIME('%y', microlab.culturetakentime) <= '2103') | eicu |
CREATE TABLE student_tests_taken (
registration_id number,
date_test_taken time,
test_result text
)
CREATE TABLE students (
student_id number,
date_of_registration time,
date_of_latest_logon time,
login_name text,
password text,
personal_name text,
middle_name text,
family_n... | Find the student ID and login name of the student with the most course enrollments | SELECT T1.student_id, T2.login_name FROM student_course_enrolment AS T1 JOIN students AS T2 ON T1.student_id = T2.student_id GROUP BY T1.student_id ORDER BY COUNT(*) DESC LIMIT 1 | spider |
CREATE TABLE Ref_Colors (
color_code VARCHAR(15),
color_description VARCHAR(80)
)
CREATE TABLE Characteristics (
characteristic_id INTEGER,
characteristic_type_code VARCHAR(15),
characteristic_data_type VARCHAR(10),
characteristic_name VARCHAR(80),
other_characteristic_details VARCHAR(255)
... | What are the number of the descriptions of the categories that products with product descriptions that contain the letter t are in? | SELECT product_category_description, COUNT(product_category_description) FROM Ref_Product_Categories AS T1 JOIN Products AS T2 ON T1.product_category_code = T2.product_category_code WHERE T2.product_description LIKE '%t%' GROUP BY product_category_description | nvbench |
CREATE TABLE table_24399615_4 (
airdate VARCHAR,
cable_rank VARCHAR
) | What date did the episode air that had a ranking of 17 for cable? | SELECT airdate FROM table_24399615_4 WHERE cable_rank = "17" | 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... | 在2014年2月21日到2017年10月12日期间,4874036医疗机构有过多少次特需门诊的就诊记录 | SELECT COUNT(*) FROM ftxmzjzjlb WHERE ftxmzjzjlb.ZSEBZ = '4874036' AND ftxmzjzjlb.JZKSRQ BETWEEN '2014-02-21' AND '2017-10-12' | css |
CREATE TABLE job_history (
EMPLOYEE_ID decimal(6,0),
START_DATE date,
END_DATE date,
JOB_ID varchar(10),
DEPARTMENT_ID decimal(4,0)
)
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALA... | 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 average of manager_id , and group by attribute job_id, and rank names in desc order please. | SELECT JOB_ID, AVG(MANAGER_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 GROUP BY JOB_ID ORDER BY JOB_ID DESC | nvbench |
CREATE TABLE table_204_215 (
id number,
"airline" text,
"destination(s)" text,
"aircraft scheduled" text,
"service date(s)" text,
"comments" text
) | how many destinations does air florida have at this airport ? | SELECT "destination(s)" FROM table_204_215 WHERE "airline" = 'air florida' | squall |
CREATE TABLE table_name_47 (
bronze INTEGER,
sport VARCHAR,
gold VARCHAR
) | What is the lowest number of bronze a short track athlete with 0 gold medals has? | SELECT MIN(bronze) FROM table_name_47 WHERE sport = "short track" AND gold = 0 | sql_create_context |
CREATE TABLE table_65388 (
"Name" text,
"Position" text,
"League Apps" text,
"League Goals" real,
"FA Cup Apps" text,
"FA Cup Goals" real,
"League Cup Apps" text,
"League Cup Goals" real,
"FLT Apps" text,
"FLT Goals" real,
"Total Apps" text,
"Total Goals" real
) | What league apps with 1 flt apps, 0 goals, and more than 1 league goals? | SELECT "League Apps" FROM table_65388 WHERE "FLT Apps" = '1' AND "Total Goals" > '0' AND "League Goals" > '1' | wikisql |
CREATE TABLE table_19189 (
"Cast" text,
"1951 ( BBC )" text,
"1957 (BBC)" text,
"1968 (BBC)" text,
"1970 (film)" text,
"2000 ( Carlton Television )" text
) | Name the 1970 film for when 1968 being neil mcdermott | SELECT "1970 (film)" FROM table_19189 WHERE "1968 (BBC)" = 'Neil McDermott' | wikisql |
CREATE TABLE elimination (
elimination_id text,
wrestler_id text,
team text,
eliminated_by text,
elimination_move text,
time text
)
CREATE TABLE wrestler (
wrestler_id number,
name text,
reign text,
days_held text,
location text,
event text
) | Please show the most common reigns of wrestlers. | SELECT reign FROM wrestler GROUP BY reign ORDER BY COUNT(*) DESC LIMIT 1 | spider |
CREATE TABLE table_52101 (
"Team" text,
"Points" real,
"Played" real,
"Drawn" real,
"Lost" real,
"Against" real,
"Diff" real
) | Which loss had a player lower than 18? | SELECT MIN("Lost") FROM table_52101 WHERE "Played" < '18' | wikisql |
CREATE TABLE table_5485 (
"Rank" real,
"Player" text,
"Country" text,
"Earnings ( $ )" real,
"Wins" real
) | What is the highest earnings for the golfer who has more than 37 wins? | SELECT MAX("Earnings ( $ )") FROM table_5485 WHERE "Wins" > '37' | wikisql |
CREATE TABLE table_60852 (
"Position" real,
"Club" text,
"Played" real,
"Wins" real,
"Draws" real,
"Losses" real,
"Goals for" real,
"Goals against" real,
"Points" real,
"Goal Difference" real
) | Can you tell me the sum of Wins that has the Club of abuls smiltene, and the Goals smaller than 18? | SELECT SUM("Wins") FROM table_60852 WHERE "Club" = 'abuls smiltene' AND "Goals for" < '18' | wikisql |
CREATE TABLE table_name_43 (
silver INTEGER,
total VARCHAR,
rank VARCHAR
) | What is the sum of silver medals for the entry with rank 3 and a total of 4 medals? | SELECT SUM(silver) FROM table_name_43 WHERE total = 4 AND rank = "3" | sql_create_context |
CREATE TABLE table_name_38 (
points VARCHAR,
visitor VARCHAR,
home VARCHAR
) | How many points have pittsburgh as the visitor, and philadelphia as the home? | SELECT COUNT(points) FROM table_name_38 WHERE visitor = "pittsburgh" AND home = "philadelphia" | sql_create_context |
CREATE TABLE table_15185133_1 (
no_in_season VARCHAR,
written_by VARCHAR,
directed_by VARCHAR
) | What season has an episode written by john o'bryan and directed by ethan spaulding? | SELECT no_in_season FROM table_15185133_1 WHERE written_by = "John O'Bryan" AND directed_by = "Ethan Spaulding" | sql_create_context |
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 demographic (... | give me the number of patients whose diagnoses short title is chronic sinusitis nos and drug route is inhalation? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.short_title = "Chronic sinusitis NOS" AND prescriptions.route = "INHALATION" | mimicsql_data |
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... | 那位在门诊就诊的84220777179号病人的中医诊断编号以及名字分别是什么? | SELECT mzjzjlb.MZZYZDZZBM, mzjzjlb.MZZYZDZZMC FROM mzjzjlb WHERE mzjzjlb.JZLSH = '84220777179' | css |
CREATE TABLE table_name_89 (
score VARCHAR,
tie_no VARCHAR
) | What was the score when the Tie no was 6? | SELECT score FROM table_name_89 WHERE tie_no = 6 | sql_create_context |
CREATE TABLE table_name_56 (
rank INTEGER,
notes VARCHAR,
time VARCHAR
) | What is the highest rank for a 6:52.70 time and notes of sa/b? | SELECT MAX(rank) FROM table_name_56 WHERE notes = "sa/b" AND time = "6:52.70" | sql_create_context |
CREATE TABLE table_27756314_8 (
game INTEGER,
team VARCHAR
) | What is the highest game with team @ l.a. clippers? | SELECT MAX(game) FROM table_27756314_8 WHERE team = "@ L.A. Clippers" | sql_create_context |
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE cost (
row_id number,
subject_id number,
hadm... | during the last month was calcium gluconate prescribed to patient 57023? | SELECT COUNT(*) > 0 FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 57023) AND prescriptions.drug = 'calcium gluconate' AND DATETIME(prescriptions.startdate, 'start of month') = DATETIME(CURRENT_TIME(), 'start of month', '-1 month') | mimic_iii |
CREATE TABLE table_14342210_14 (
player VARCHAR,
touchdowns__5_points_ VARCHAR
) | How many players made 4 touchdowns? | SELECT COUNT(player) FROM table_14342210_14 WHERE touchdowns__5_points_ = 4 | sql_create_context |
CREATE TABLE gyb (
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... | 列一下医院1996297全部就诊记录中,不同科室编码与入院时诊断疾病编码下民政补助的金额与总医疗费用比值最大是多少,然后按照降序的顺序排序 | SELECT qtb.MED_ORG_DEPT_CD, qtb.IN_DIAG_DIS_NM, MAX(t_kc24.CIVIL_SUBSIDY) FROM qtb JOIN t_kc24 ON qtb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE qtb.MED_SER_ORG_NO = '1996297' GROUP BY qtb.MED_ORG_DEPT_CD, qtb.IN_DIAG_DIS_NM ORDER BY MAX(t_kc24.CIVIL_SUBSIDY / t_kc24.MED_AMOUT) DESC UNION SELECT gyb.MED_ORG_DEPT_CD, gy... | css |
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,
TargetRepChange number
)
CREATE TABLE PostFeedback (
Id number,
PostId number,
IsAnonymous boolean,
VoteTypeId number,
CreationD... | Which badges that Jon Skeet doesn't have, have I ?. | SELECT DISTINCT Name FROM Badges AS b WHERE UserId = 22656 | sede |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic ... | provide the number of patients whose year of death is less than or equal to 2148 and procedure short title is percu endosc gastrostomy? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.dod_year <= "2148.0" AND procedures.short_title = "Percu endosc gastrostomy" | mimicsql_data |
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 ... | what were the top five frequent input events until 2101? | SELECT d_items.label FROM d_items WHERE d_items.itemid IN (SELECT t1.itemid FROM (SELECT inputevents_cv.itemid, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM inputevents_cv WHERE STRFTIME('%y', inputevents_cv.charttime) <= '2101' GROUP BY inputevents_cv.itemid) AS t1 WHERE t1.c1 <= 5) | mimic_iii |
CREATE TABLE table_name_16 (
college VARCHAR,
pick__number VARCHAR
) | Pick # of 203 went to which college? | SELECT college FROM table_name_16 WHERE pick__number = 203 | sql_create_context |
CREATE TABLE table_66741 (
"Round" real,
"Pick" real,
"Player" text,
"Position" text,
"School/Club Team" text
) | What was the school for the player who was a DL? | SELECT "School/Club Team" FROM table_66741 WHERE "Position" = 'dl' | wikisql |
CREATE TABLE table_name_66 (
grid INTEGER,
laps VARCHAR
) | What's the average Grid with Laps of 88? | SELECT AVG(grid) FROM table_name_66 WHERE laps = 88 | sql_create_context |
CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId number
)
CREATE TABLE Tags (
Id number,
TagName text,
Count number,
ExcerptPostId number,
WikiPostId number
)
CREATE TABLE ReviewTasks (
Id number,
ReviewTaskTypeId number,
Creation... | Vetrans Query Tag combinations Counts. | SELECT COUNT(QuestionPost.Id) AS size, QuestionPost.Tags AS tagName FROM Posts AS QuestionPost WHERE (QuestionPost.Tags LIKE '%<string>%') AND QuestionPost.PostTypeId = (SELECT Id FROM PostTypes WHERE Name = 'Question') AND NOT QuestionPost.Tags LIKE '%<%<%<%' GROUP BY (QuestionPost.Tags) ORDER BY size DESC | sede |
CREATE TABLE table_238124_1 (
prothrombin_time VARCHAR,
condition VARCHAR
) | What is the prothrombin time of von willebrand disease? | SELECT COUNT(prothrombin_time) FROM table_238124_1 WHERE condition = "Von Willebrand disease" | sql_create_context |
CREATE TABLE requirement (
requirement_id int,
requirement varchar,
college varchar
)
CREATE TABLE semester (
semester_id int,
semester varchar,
year int
)
CREATE TABLE program_requirement (
program_id int,
category varchar,
min_credit int,
additional_req varchar
)
CREATE TABL... | To take HUMGEN 553 , is the prerequisite HUMGEN 632 ? | SELECT COUNT(*) > 0 FROM course AS COURSE_0, course AS COURSE_1, course_prerequisite WHERE COURSE_0.course_id = course_prerequisite.pre_course_id AND COURSE_0.department = 'HUMGEN' AND COURSE_0.number = 632 AND COURSE_1.course_id = course_prerequisite.course_id AND COURSE_1.department = 'HUMGEN' AND COURSE_1.number = 5... | advising |
CREATE TABLE table_29320 (
"No. in series" real,
"No. in season" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production code" text,
"U.S. viewers (million)" text
) | What's the title in the number 10 in the season? | SELECT "Title" FROM table_29320 WHERE "No. in season" = '10' | wikisql |
CREATE TABLE table_45072 (
"Tie no" text,
"Home team" text,
"Score" text,
"Away team" text,
"Date" text
) | Who was the home team that had a replay of Tie Number and played against the Bolton Wanderers? | SELECT "Home team" FROM table_45072 WHERE "Tie no" = 'replay' AND "Away team" = 'bolton wanderers' | wikisql |
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE icustays (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
first_careunit text,
last_careunit text,
first_wardid number,
last_wardid number,
... | was the potassium value last measured on the first hospital visit of patient 7073 less than second to last measured on the first hospital visit? | SELECT (SELECT labevents.valuenum FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 7073 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label =... | mimic_iii |
CREATE TABLE locations (
location_id number,
location_name text,
address text,
other_details text
)
CREATE TABLE museums (
museum_id number,
museum_details text
)
CREATE TABLE staff (
staff_id number,
tourist_attraction_id number,
name text,
other_details text
)
CREATE TABLE f... | For each tourist attraction, return its name and the date when the tourists named Vincent or Vivian visited there. | SELECT T1.name, T3.visit_date FROM tourist_attractions AS T1 JOIN visitors AS T2 JOIN visits AS T3 ON T1.tourist_attraction_id = T3.tourist_attraction_id AND T2.tourist_id = T3.tourist_id WHERE T2.tourist_details = "Vincent" OR T2.tourist_details = "Vivian" | spider |
CREATE TABLE t_kc22 (
MED_EXP_DET_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
MED_CLINIC_ID text,
MED_EXP_BILL_ID text,
SOC_SRT_DIRE_CD text,
SOC_SRT_DIRE_NM text,
DIRE_TYPE number,
CHA_ITEM_LEV number,
MED_INV_ITEM_TYPE text,
MED_DIRE_CD text,
MED_DIRE_NM text,... | 请提供编号77219096这位团伙成员最喜欢去的医院排序 | SELECT MED_SER_ORG_NO FROM t_kc21 WHERE PERSON_ID = '77219096' GROUP BY MED_SER_ORG_NO ORDER BY COUNT(*) DESC | css |
CREATE TABLE table_name_95 (
years_as_tallest VARCHAR,
floors VARCHAR,
street_address VARCHAR
) | During what years did the tallest building, located at 211 Union Street, have less than 31 floors? | SELECT years_as_tallest FROM table_name_95 WHERE floors < 31 AND street_address = "211 union street" | sql_create_context |
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
eventtype tex... | calculate the number of patients who have received a non-invasive mech vent two or more times until 4 years ago. | SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, COUNT(*) AS c1 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 = 'non-invasive mech ven... | mimic_iii |
CREATE TABLE table_40450 (
"Constituency" text,
"Michael D. Higgins" text,
"Se\u00e1n Gallagher" text,
"Martin McGuinness" text,
"Gay Mitchell" text,
"David Norris" text,
"Dana Rosemary Scallon" text,
"Mary Davis" text
) | What is the Martin McGuinness with a David Norris that is 10.3%? | SELECT "Martin McGuinness" FROM table_40450 WHERE "David Norris" = '10.3%' | 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, return a bar chart about the distribution of name and code , and group by attribute founder, and rank from low to high by the Y. | SELECT T1.Name, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder, T1.Name ORDER BY T1.Code | nvbench |
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
value... | so, what was the last heart rate of patient 28443 in the previous day? | SELECT 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 = 28443)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'heart rat... | mimic_iii |
CREATE TABLE restriction (
restriction_code text,
advance_purchase int,
stopovers text,
saturday_stay_required text,
minimum_stay int,
maximum_stay int,
application text,
no_discounts text
)
CREATE TABLE airline (
airline_code varchar,
airline_name text,
note text
)
CREATE ... | list seating capacities of DL flights from SEATTLE to SALT LAKE CITY | SELECT DISTINCT aircraft_code FROM aircraft WHERE aircraft_code IN (SELECT EQUIPMENT_SEQUENCEalias0.aircraft_code FROM equipment_sequence AS EQUIPMENT_SEQUENCEalias0 WHERE EQUIPMENT_SEQUENCEalias0.aircraft_code_sequence IN (SELECT FLIGHTalias0.aircraft_code_sequence FROM flight AS FLIGHTalias0 WHERE ((FLIGHTalias0.from... | atis |
CREATE TABLE jobs (
job_id int,
job_title varchar,
description varchar,
requirement varchar,
city varchar,
state varchar,
country varchar,
zip int
)
CREATE TABLE course_tags_count (
course_id int,
clear_grading int,
pop_quiz int,
group_projects int,
inspirational int... | Which courses in Radiat Shield are 1 credits ? | SELECT DISTINCT department, name, number FROM course WHERE (description LIKE '%Radiat Shield%' OR name LIKE '%Radiat Shield%') AND credits = 1 | advising |
CREATE TABLE table_40625 (
"Japanese name" text,
"Kana" text,
"Hanja / Kanji" text,
"Korean name" text,
"Hangul" text
) | What is the Kana of the Province with a Korean name of Chungcheong-Namdo? | SELECT "Kana" FROM table_40625 WHERE "Korean name" = 'chungcheong-namdo' | wikisql |
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
InputTitle text,
MarkdownInputGuidance text,
MarkdownPostOwnerGuidance text,
MarkdownPrivilegedUserGuidance text,
MarkdownConcensusDescription text,
CreationDate time,
CreationModeratorId number,
ApprovalDa... | Length of posts over time. | SELECT DATE(CreationDate), SUM(LENGTH(Body)) FROM Posts WHERE PostTypeId = 1 OR PostTypeId = 2 GROUP BY DATE(CreationDate) ORDER BY DATE(CreationDate) | sede |
CREATE TABLE table_65559 (
"Elector" text,
"Nationality" text,
"Cardinalatial order and title" text,
"Elevated" text,
"Elevator" text
) | What is the Cardinalatial order and title that Pedro Mart nez de Luna y Gotor elevated? | SELECT "Cardinalatial order and title" FROM table_65559 WHERE "Elector" = 'pedro martínez de luna y gotor' | wikisql |
CREATE TABLE flight_stop (
flight_id int,
stop_number int,
stop_days text,
stop_airport text,
arrival_time int,
arrival_airline text,
arrival_flight_number int,
departure_time int,
departure_airline text,
departure_flight_number int,
stop_time int
)
CREATE TABLE date_day (
... | what is the first flight that goes from ATLANTA to BALTIMORE that serves BREAKFAST | 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, food_service WHERE ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BALTIMORE' AND flight.to_airport = AIRPORT_SERVICE_1.airport_code AND food... | atis |
CREATE TABLE table_14145 (
"Manufacturer" text,
"Transmission" text,
"Engine Capacity" real,
"Fuel Type" text,
"L/100km Urban (Cold)" real,
"L/100km Extra-Urban" real,
"L/100km Combined" real,
"mpg-UK Urban (Cold)" real,
"mpg-UK Extra-Urban" real,
"mpg-UK Combined" real,
"mpg... | What is the mpg-UK urban (cold) for a fuel type of diesel, extraurban MPG in the UK over 68.9, engine capacity of 1422, and L/100km urban (cold) over 5.1? | SELECT "mpg-UK Urban (Cold)" FROM table_14145 WHERE "Fuel Type" = 'diesel' AND "mpg-UK Extra-Urban" > '68.9' AND "Engine Capacity" = '1422' AND "L/100km Urban (Cold)" > '5.1' | wikisql |
CREATE TABLE table_6025 (
"Letter" text,
"Players" text,
"Pitch" text,
"Ret#" text,
"Records" text
) | what pitcher scored 4 | SELECT "Ret#" FROM table_6025 WHERE "Records" = '4' | wikisql |
CREATE TABLE table_name_30 (
opponent VARCHAR,
week VARCHAR,
game_site VARCHAR
) | Who was the opponent at the game at Sullivan Stadium before week 11? | SELECT opponent FROM table_name_30 WHERE week < 11 AND game_site = "sullivan stadium" | sql_create_context |
CREATE TABLE table_48539 (
"Gatchaman" text,
"Eagle Riders" text,
"Rank" text,
"Bird Uniform" text,
"Weapon" text,
"Mecha" text,
"Japanese voice actor" text,
"Voice actor (Eagle Riders)" text
) | What is the Mecha of the Japanese voice actor Shingo Kanemoto? | SELECT "Mecha" FROM table_48539 WHERE "Japanese voice actor" = 'shingo kanemoto' | wikisql |
CREATE TABLE table_14598 (
"Perfect stem" text,
"Future stem" text,
"Imperfect stem" text,
"Short stem" text,
"Meaning" text
) | What is the imperfect stem of the word that means 'take away, remove'? | SELECT "Imperfect stem" FROM table_14598 WHERE "Meaning" = 'take away, remove' | wikisql |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
... | find the average days of hospital stay for patients who died before the year 2174. | SELECT AVG(demographic.days_stay) FROM demographic WHERE demographic.dod_year < "2174.0" | mimicsql_data |
CREATE TABLE cinema (
Cinema_ID int,
Name text,
Openning_year int,
Capacity int,
Location text
)
CREATE TABLE schedule (
Cinema_ID int,
Film_ID int,
Date text,
Show_times_per_day int,
Price float
)
CREATE TABLE film (
Film_ID int,
Rank_in_series int,
Number_in_seaso... | For each record in schedule, show average of the price for each day in a bar chart. | SELECT Date, AVG(Price) FROM schedule AS T1 JOIN film AS T2 ON T1.Film_ID = T2.Film_ID JOIN cinema AS T3 ON T1.Cinema_ID = T3.Cinema_ID GROUP BY Date | nvbench |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.