context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE table_32985 (
"Chapter" text,
"Colonized" text,
"Chartered" text,
"School" text,
"State" text,
"Status" text,
"Charter Range" text
) | What state has colony as a status and shippensburg university as the school? | SELECT "State" FROM table_32985 WHERE "Status" = 'colony' AND "School" = 'shippensburg university' | wikisql |
CREATE TABLE CLASS (
CLASS_CODE varchar(5),
CRS_CODE varchar(10),
CLASS_SECTION varchar(2),
CLASS_TIME varchar(20),
CLASS_ROOM varchar(8),
PROF_NUM int
)
CREATE TABLE COURSE (
CRS_CODE varchar(10),
DEPT_CODE varchar(10),
CRS_DESCRIPTION varchar(35),
CRS_CREDIT float(8)
)
CREATE... | Show birthdates of the professors in charge of ACCT-211 and bin the date by year interval in a line chart, and I want to order x axis in desc order. | SELECT EMP_DOB, COUNT(EMP_DOB) FROM EMPLOYEE AS T1 JOIN CLASS AS T2 ON T1.EMP_NUM = T2.PROF_NUM WHERE CRS_CODE = "ACCT-211" ORDER BY EMP_DOB DESC | nvbench |
CREATE TABLE table_27435931_1 (
year VARCHAR,
continent VARCHAR
) | In what year is australia/oceania listed? | SELECT COUNT(year) FROM table_27435931_1 WHERE continent = "Australia/Oceania" | sql_create_context |
CREATE TABLE table_1342338_6 (
party VARCHAR,
incumbent VARCHAR
) | What is the party for richard j. welch? | SELECT party FROM table_1342338_6 WHERE incumbent = "Richard J. Welch" | sql_create_context |
CREATE TABLE table_name_67 (
quantity_made VARCHAR,
class VARCHAR
) | What is the quantity made of the locomotive with a Waterford class? | SELECT quantity_made FROM table_name_67 WHERE class = "waterford" | sql_create_context |
CREATE TABLE status (
station_id INTEGER,
bikes_available INTEGER,
docks_available INTEGER,
time TEXT
)
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... | What is the total cloud cover rates of the dates (bin into year interval) that had the top 5 cloud cover rates? You can draw me a bar chart for this purpose, and could you sort by the total number of cloud cover in asc? | SELECT date, SUM(cloud_cover) FROM weather ORDER BY SUM(cloud_cover) | nvbench |
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 ... | has patient 97834 got a creatinine test? | SELECT COUNT(*) > 0 FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'creatinine') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 97834) | mimic_iii |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions... | count the number of patients whose diagnoses short title is malnutrition mild degree? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE diagnoses.short_title = "Malnutrition mild degree" | 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 diagnoses (
... | give me the number of patients whose age is less than 79 and drug code is labe100i? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.age < "79" AND prescriptions.formulary_drug_cd = "LABE100I" | mimicsql_data |
CREATE TABLE table_13535824_2 (
Id VARCHAR
) | what's the minimum 180s value | SELECT MIN(180 AS s) FROM table_13535824_2 | sql_create_context |
CREATE TABLE table_2293 (
"No. in series" real,
"No. in season" real,
"Title" text,
"Directedby" text,
"Writtenby" text,
"Originalairdate" text,
"Production code" text,
"U.S. viewers (million)" text
) | What episode is titled 'Authority Vested'? | SELECT MAX("No. in season") FROM table_2293 WHERE "Title" = 'Authority Vested' | wikisql |
CREATE TABLE table_name_72 (
opponents_in_final VARCHAR,
score_in_final VARCHAR
) | Who were the opponents in the match or matches that ended in a score of W/O? | SELECT opponents_in_final FROM table_name_72 WHERE score_in_final = "w/o" | 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 procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
... | count the number of private health insurance patients who have diagnoses icd9 code 45341. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.insurance = "Private" AND diagnoses.icd9_code = "45341" | mimicsql_data |
CREATE TABLE table_54138 (
"Rank" real,
"Airline/Holding" text,
"Passenger Fleet" real,
"Current Destinations" real,
"Alliance/ Association" text
) | For airlines named Aeroflot Group, what is the alliance? | SELECT "Alliance/ Association" FROM table_54138 WHERE "Airline/Holding" = 'aeroflot group' | wikisql |
CREATE TABLE table_26826304_1 (
us_viewers__millions_ VARCHAR,
directed_by VARCHAR
) | How many were the US viewers (in millions) of the episode that was written by Gordon C. Lonsdale? | SELECT us_viewers__millions_ FROM table_26826304_1 WHERE directed_by = "Gordon C. Lonsdale" | sql_create_context |
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime time,
v... | what is the minimum total hospital cost that involves 1 int mam-cor art bypass in this year? | SELECT MIN(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.hadm_id IN (SELECT procedures_icd.hadm_id FROM procedures_icd WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = '1 int mam-cor art bypass')) AND DATETIME(cost.chargetime,... | mimic_iii |
CREATE TABLE table_54740 (
"Round" real,
"Overall" real,
"Player" text,
"Nationality" text,
"Club team" text
) | What round was Nick Gillis? | SELECT "Round" FROM table_54740 WHERE "Player" = 'nick gillis' | wikisql |
CREATE TABLE table_204_477 (
id number,
"pos" number,
"no" number,
"driver" text,
"team" text,
"laps" number,
"time/retired" text,
"grid" number,
"points" number
) | which driver had the least number of laps ? | SELECT "driver" FROM table_204_477 ORDER BY "laps" LIMIT 1 | squall |
CREATE TABLE table_4926 (
"Player" text,
"Span" text,
"Lost" text,
"Draw" text,
"Tries" text,
"Conv" text,
"Pens" text,
"Drop" text
) | What is the lost for span 2006- when conv is 0? | SELECT "Lost" FROM table_4926 WHERE "Conv" = '0' AND "Span" = '2006-' | wikisql |
CREATE TABLE table_2211 (
"Irrigation District" text,
"Juntas de Regantes (WUB)" text,
"Asociaciones (WUA) (#)" real,
"Tareas (15.9 tareas = 1 ha)" real,
"Users (#)" real
) | Which irrigation district has 4733 users? | SELECT "Irrigation District" FROM table_2211 WHERE "Users (#)" = '4733' | wikisql |
CREATE TABLE table_13428 (
"Name" text,
"Type" text,
"Relation" text,
"Length" text,
"Year" real
) | Which Relation has a Type of tv, and a Name of ohanami? | SELECT "Relation" FROM table_13428 WHERE "Type" = 'tv' AND "Name" = 'ohanami' | wikisql |
CREATE TABLE table_1169 (
"Year" real,
"Division" real,
"League" text,
"Regular Season" text,
"Playoffs" text,
"Open Cup" text
) | What was the playoff result when they finished 5th, north in the regular sesason? | SELECT "Playoffs" FROM table_1169 WHERE "Regular Season" = '5th, North' | wikisql |
CREATE TABLE table_21436373_6 (
stadium VARCHAR,
date_year VARCHAR
) | Which stadium has the date/year of Fri 06/25/82? | SELECT stadium FROM table_21436373_6 WHERE date_year = "Fri 06/25/82" | sql_create_context |
CREATE TABLE comment_instructor (
instructor_id int,
student_id int,
score int,
comment_text varchar
)
CREATE TABLE offering_instructor (
offering_instructor_id int,
offering_id int,
instructor_id int
)
CREATE TABLE student_record (
student_id int,
course_id int,
semester int,
... | Name the classes that will be offered over the next 6 semester . | SELECT DISTINCT course.name, course.number, semester.semester, semester.year FROM course, course_offering, semester WHERE ((semester.semester = 'FA' AND semester.year = 2016) OR (semester.semester = 'FA' AND semester.year = 2017) OR (semester.semester = 'FA' AND semester.year = 2018) OR (semester.semester = 'WN' AND se... | advising |
CREATE TABLE table_75115 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Record" text
) | What was the record of the game with a score of 12 6? | SELECT "Record" FROM table_75115 WHERE "Score" = '12–6' | wikisql |
CREATE TABLE table_name_44 (
last_cf INTEGER,
team VARCHAR,
cf_appearances VARCHAR,
cf_wins VARCHAR
) | What is the average last cf of the st. louis blues, who has less than 4 cf appearances and less than 1 cf wins? | SELECT AVG(last_cf) FROM table_name_44 WHERE cf_appearances < 4 AND cf_wins < 1 AND team = "st. louis blues" | sql_create_context |
CREATE TABLE table_76130 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Attendance" real
) | What is the lowest Week when the result was l 6 0? | SELECT MIN("Week") FROM table_76130 WHERE "Result" = 'l 6–0' | wikisql |
CREATE TABLE table_1341522_50 (
status VARCHAR,
opponent VARCHAR
) | What was the result of the election of doc hastings (r) 53.3% jay inslee (d) 46.7% | SELECT status FROM table_1341522_50 WHERE opponent = "Doc Hastings (R) 53.3% Jay Inslee (D) 46.7%" | sql_create_context |
CREATE TABLE table_name_85 (
version INTEGER,
code VARCHAR,
year VARCHAR
) | Name the lowest version with a code of u+1034a that began after 2001. | SELECT MIN(version) FROM table_name_85 WHERE code = "u+1034a" AND year > 2001 | sql_create_context |
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,0)
)
CREATE TABLE locations (
LOCATION_ID decimal(4,0),
STREET_ADDRESS varchar(40),
POSTAL_CODE varchar(12),
CITY varchar(30),
STATE_PROVINCE varchar(25),
COUNTRY_ID varc... | For those employees who was hired before 2002-06-21, return a bar chart about the distribution of hire_date and the average of employee_id bin hire_date by weekday, show in ascending by the y axis please. | SELECT HIRE_DATE, AVG(EMPLOYEE_ID) FROM employees WHERE HIRE_DATE < '2002-06-21' ORDER BY AVG(EMPLOYEE_ID) | nvbench |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id t... | how many patients have born before the year 2134 with the primary disease transient ischemic attack? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "TRANSIENT ISCHEMIC ATTACK" AND demographic.dob_year < "2134" | mimicsql_data |
CREATE TABLE table_25831483_1 (
character VARCHAR,
actor_actress VARCHAR
) | How many characters where actor/actress is larry lamb? | SELECT COUNT(character) FROM table_25831483_1 WHERE actor_actress = "Larry Lamb" | sql_create_context |
CREATE TABLE table_73941 (
"Year" real,
"Championship" text,
"Surface" text,
"Partner" text,
"Opponents in final" text,
"Score in final" text
) | What was the final score in 1986? | SELECT "Score in final" FROM table_73941 WHERE "Year" = '1986' | 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 name and the average of price , and group by attribute name, and visualize them by a bar chart. | SELECT T2.Name, T1.Price FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name | nvbench |
CREATE TABLE table_4619 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | What is the away team that had a score of 15.9 (99)? | SELECT "Away team" FROM table_4619 WHERE "Away team score" = '15.9 (99)' | wikisql |
CREATE TABLE table_name_22 (
time_retired VARCHAR,
laps VARCHAR,
grid VARCHAR
) | Who retired at lap 77 and was grid 11? | SELECT time_retired FROM table_name_22 WHERE laps = "77" AND grid = "11" | sql_create_context |
CREATE TABLE table_203_782 (
id number,
"year" number,
"actor" text,
"award" text,
"category" text,
"role" text,
"episode" text,
"result" text
) | how many actors were nominated but did n't win ? | SELECT COUNT("award") FROM table_203_782 WHERE "result" = 'nominated' | squall |
CREATE TABLE Payments (
Payment_Method_Code VARCHAR
) | With which kind of payment method were the least number of payments processed? | SELECT Payment_Method_Code FROM Payments GROUP BY Payment_Method_Code ORDER BY COUNT(*) LIMIT 1 | sql_create_context |
CREATE TABLE table_68215 (
"Year" real,
"Manufacturer" text,
"Start" real,
"Finish" real,
"Team" text
) | Name the most year with start less than 2 | SELECT MAX("Year") FROM table_68215 WHERE "Start" < '2' | wikisql |
CREATE TABLE table_name_82 (
home VARCHAR,
date VARCHAR
) | Which Home is on january 11? | SELECT home FROM table_name_82 WHERE date = "january 11" | sql_create_context |
CREATE TABLE table_name_80 (
losses INTEGER,
against VARCHAR,
wins VARCHAR
) | What is the greatest number of losses when the against is 1465 and there are more than 7 wins? | SELECT MAX(losses) FROM table_name_80 WHERE against = 1465 AND wins > 7 | sql_create_context |
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
systemics... | what was patient 016-19759's last prescribed time for ondansetron 2 mg/1 ml 2ml sdv inj during their first hospital visit? | SELECT medication.drugstarttime FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '016-19759' AND NOT patient.hospitaldischargetime IS NULL ORDER... | eicu |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
C... | how many of the patients were discharged to home after a hospital stay of more than 26 days? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.discharge_location = "HOME" AND demographic.days_stay > "26" | mimicsql_data |
CREATE TABLE table_79340 (
"Rank" real,
"Group" text,
"Athlete" text,
"Nationality" text,
"Result" real
) | What is the average rank for Group A athlete Yanina Karolchyk, and a result higher than 18? | SELECT AVG("Rank") FROM table_79340 WHERE "Group" = 'a' AND "Athlete" = 'yanina karolchyk' AND "Result" > '18' | wikisql |
CREATE TABLE table_26222468_1 (
f_laps INTEGER
) | What is the minimum number of f/laps? | SELECT MIN(f_laps) FROM table_26222468_1 | 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 PostTypes (
Id number,
Name text
)
CREATE TABLE PostLin... | posts from a user containing images. Find all posts from a specific user containing imgur images | SELECT p.Id, p.Id AS "post_link", pt.Name AS "type", p.Score, p.CreationDate, p.Tags FROM Posts AS p INNER JOIN PostTypes AS pt ON pt.Id = p.PostTypeId WHERE p.Body LIKE '%imgur%' ORDER BY p.CreationDate DESC LIMIT 1000 | 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... | 编号88417567835的医疗就诊出院时被诊断出来的是什么疾病,疾病的编号是什么 | SELECT t_kc21.OUT_DIAG_DIS_CD, t_kc21.OUT_DIAG_DIS_NM FROM t_kc21 WHERE t_kc21.MED_CLINIC_ID = '88417567835' | css |
CREATE TABLE table_name_33 (
record VARCHAR,
home VARCHAR
) | What is the record when the Nuggets are the home team? | SELECT record FROM table_name_33 WHERE home = "nuggets" | sql_create_context |
CREATE TABLE voting_record (
stuid number,
registration_date text,
election_cycle text,
president_vote number,
vice_president_vote number,
secretary_vote number,
treasurer_vote number,
class_president_vote number,
class_senator_vote number
)
CREATE TABLE student (
stuid number,
... | Count the number of voting records for each election cycle. | SELECT election_cycle, COUNT(*) FROM voting_record GROUP BY election_cycle | spider |
CREATE TABLE table_name_35 (
position VARCHAR,
player VARCHAR
) | What is John Curtice's position? | SELECT position FROM table_name_35 WHERE player = "john curtice" | sql_create_context |
CREATE TABLE table_name_73 (
laps VARCHAR,
constructor VARCHAR,
driver VARCHAR
) | What is the number of laps with a Constructor of renault, and a driver of jacques villeneuve? | SELECT laps FROM table_name_73 WHERE constructor = "renault" AND driver = "jacques villeneuve" | sql_create_context |
CREATE TABLE code_description (
code varchar,
description text
)
CREATE TABLE airline (
airline_code varchar,
airline_name text,
note text
)
CREATE TABLE restriction (
restriction_code text,
advance_purchase int,
stopovers text,
saturday_stay_required text,
minimum_stay int,
... | what 's the earliest flight from SAN JOSE to HOUSTON | 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 = 'SAN JOSE' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'HOUS... | atis |
CREATE TABLE table_name_94 (
latin_motto VARCHAR,
translation VARCHAR
) | What is the Latin motto of the sign that translates to spouse? | SELECT latin_motto FROM table_name_94 WHERE translation = "spouse" | sql_create_context |
CREATE TABLE table_13619135_7 (
high_assists VARCHAR,
team VARCHAR
) | How many people had the high assists @ minnesota? | SELECT COUNT(high_assists) FROM table_13619135_7 WHERE team = "@ Minnesota" | sql_create_context |
CREATE TABLE city (
city_id number,
city text,
hanzi text,
hanyu_pinyin text,
regional_population number,
gdp number
)
CREATE TABLE hosting_city (
year number,
match_id number,
host_city text
)
CREATE TABLE temperature (
city_id number,
jan number,
feb number,
mar n... | IN which year did city 'Taizhou ( Zhejiang )' serve as a host city? | SELECT T2.year FROM city AS T1 JOIN hosting_city AS T2 ON T1.city_id = T2.host_city WHERE T1.city = "Taizhou ( Zhejiang )" | spider |
CREATE TABLE table_60050 (
"Draft" real,
"Round" text,
"Pick" real,
"Player" text,
"Nationality" text
) | Which Player has a Round of 7, a Pick larger than 187, a Nationality of united states, and a Draft larger than 2000? | SELECT "Player" FROM table_60050 WHERE "Round" = '7' AND "Pick" > '187' AND "Nationality" = 'united states' AND "Draft" > '2000' | wikisql |
CREATE TABLE mzjzjlb (
HXPLC number,
HZXM text,
JLSJ time,
JZJSSJ time,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
JZLSH text,
JZZDBM text,
JZZDSM text,
JZZTDM number,
JZZTMC text,
KH text,
KLX number,
MJZH text,
ML number,
MZZYZDZZBM text,
MZZYZDZZMC ... | 检测指标816429在被门诊确诊为疾病H11.754的病人身上参考值范围下限和上限是多少? | SELECT jyjgzbb.CKZFWXX, jyjgzbb.CKZFWSX FROM mzjzjlb JOIN jyjgzbb ON mzjzjlb.YLJGDM = jyjgzbb.jybgb_YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jyjgzbb.jybgb_JZLSH_MZJZJLB WHERE mzjzjlb.JZZDBM = 'H11.754' AND jyjgzbb.JCZBDM = '816429' | css |
CREATE TABLE addresses (
address_id number,
line_1_number_building text,
town_city text,
zip_postcode text,
state_province_county text,
country text
)
CREATE TABLE individuals (
individual_id number,
individual_first_name text,
individual_middle_name text,
inidividual_phone text... | What are the different types of forms? | SELECT DISTINCT form_type_code FROM forms | spider |
CREATE TABLE table_23239946_3 (
starts INTEGER
) | How many starts are there? | SELECT MIN(starts) FROM table_23239946_3 | sql_create_context |
CREATE TABLE table_68659 (
"Member" text,
"Party" text,
"Electorate" text,
"State" text,
"Term in office" text
) | Which term in office has an Electorate of hinkler? | SELECT "Term in office" FROM table_68659 WHERE "Electorate" = 'hinkler' | wikisql |
CREATE TABLE Person (
name varchar(20),
age INTEGER,
city TEXT,
gender TEXT,
job TEXT
)
CREATE TABLE PersonFriend (
name varchar(20),
friend varchar(20),
year INTEGER
) | Count job title of all people ordered by their names using a bar chart. | SELECT job, COUNT(job) FROM Person GROUP BY job ORDER BY name | nvbench |
CREATE TABLE gwyjzb (
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,
... | 郑红香这位患者自10.12.12起,到15.4.16止,看过的最主要的病是什么 | SELECT gwyjzb.IN_DIAG_DIS_CD, gwyjzb.IN_DIAG_DIS_NM FROM gwyjzb WHERE gwyjzb.PERSON_NM = '郑红香' AND gwyjzb.IN_HOSP_DATE BETWEEN '2010-12-12' AND '2015-04-16' GROUP BY gwyjzb.IN_DIAG_DIS_CD ORDER BY COUNT(*) DESC LIMIT 1 UNION SELECT fgwyjzb.IN_DIAG_DIS_CD, fgwyjzb.IN_DIAG_DIS_NM FROM fgwyjzb WHERE fgwyjzb.PERSON_NM = '郑... | css |
CREATE TABLE Documents (
receipt_date VARCHAR,
document_id VARCHAR
) | What is the receipt date of the document with id 3? | SELECT receipt_date FROM Documents WHERE document_id = 3 | sql_create_context |
CREATE TABLE table_name_11 (
to_par VARCHAR,
score VARCHAR
) | For which to par was the score 71-74-68=213? | SELECT to_par FROM table_name_11 WHERE score = 71 - 74 - 68 = 213 | sql_create_context |
CREATE TABLE table_48814 (
"Position" real,
"Team" text,
"Played" real,
"Drawn" real,
"Lost" real,
"Goals For" real,
"Goals Against" real,
"Goal Difference" text,
"Points 1" text
) | How many lost when goals for is 43 and the position number is higher than 15? | SELECT AVG("Lost") FROM table_48814 WHERE "Goals For" = '43' AND "Position" > '15' | wikisql |
CREATE TABLE table_14035132_3 (
original_air_date VARCHAR,
storyboarded_by VARCHAR,
no_in_series VARCHAR
) | On what date did the episode with a series number 31, with a story written by William Reiss, air for the first time? | SELECT original_air_date FROM table_14035132_3 WHERE storyboarded_by = "William Reiss" AND no_in_series = "31" | sql_create_context |
CREATE TABLE table_204_524 (
id number,
"season" text,
"tier" number,
"division" text,
"place" text
) | what the tier before 2006/7 ? | SELECT "tier" FROM table_204_524 WHERE "season" < '2006/07' ORDER BY "season" DESC LIMIT 1 | squall |
CREATE TABLE table_57319 (
"Game" real,
"Date" text,
"Score" text,
"Location" text,
"Time" text,
"Attendance" real
) | What is the earliest game that had 42,707 attending? | SELECT MIN("Game") FROM table_57319 WHERE "Attendance" = '42,707' | wikisql |
CREATE TABLE table_1566852_4 (
interview_subject VARCHAR
) | Who was featured in 20 questions when the subject of the interview was Mike Piazza? | SELECT 20 AS _questions FROM table_1566852_4 WHERE interview_subject = "Mike Piazza" | sql_create_context |
CREATE TABLE table_name_63 (
venue VARCHAR,
year VARCHAR,
notes VARCHAR
) | What is the Venue before 2003 with Notes of 57.73 m? | SELECT venue FROM table_name_63 WHERE year < 2003 AND notes = "57.73 m" | sql_create_context |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
... | count the number of patients taking sodium chloride nasal medication who are diagnosed with unspecified fall. | 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.long_title = "Unspecified fall" AND prescriptions.drug = "Sodium Chloride Nasal" | mimicsql_data |
CREATE TABLE table_name_54 (
erp_w VARCHAR,
frequency_mhz VARCHAR,
city_of_license VARCHAR
) | Which ERP W has a Frequency MHz larger than 89.1, and a City of license of de queen, arkansas? | SELECT erp_w FROM table_name_54 WHERE frequency_mhz > 89.1 AND city_of_license = "de queen, arkansas" | sql_create_context |
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25),
EMAIL varchar(25),
PHONE_NUMBER varchar(20),
HIRE_DATE date,
JOB_ID varchar(10),
SALARY decimal(8,2),
COMMISSION_PCT decimal(2,2),
MANAGER_ID decimal(6,0),
DEPARTMENT_ID decimal(... | For those employees who do not work in departments with managers that have ids between 100 and 200, visualize a line chart about the change of commission_pct over hire_date . | SELECT HIRE_DATE, COMMISSION_PCT FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) | nvbench |
CREATE TABLE table_name_98 (
try_bonus VARCHAR,
tries_for VARCHAR
) | What is Try Bonus, when Tries For is '39'? | SELECT try_bonus FROM table_name_98 WHERE tries_for = "39" | sql_create_context |
CREATE TABLE table_name_56 (
black VARCHAR,
moves VARCHAR,
tournament VARCHAR
) | What's the black with 24 moves in the dortmund tournament? | SELECT black FROM table_name_56 WHERE moves = 24 AND tournament = "dortmund" | sql_create_context |
CREATE TABLE table_59825 (
"Region" text,
"Date" text,
"Label" text,
"Format" text,
"Catalog" text
) | What Label has a Format of cd, and a Catalog of crgd 86136? | SELECT "Label" FROM table_59825 WHERE "Format" = 'cd' AND "Catalog" = 'crgd 86136' | wikisql |
CREATE TABLE table_29799 (
"No(s). in series" real,
"No(s). in season" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production code(s)" real,
"U.S. viewers (millions)" text
) | What is the episode number of the episode whose production code is 226407? | SELECT MIN("No(s). in season") FROM table_29799 WHERE "Production code(s)" = '226407' | wikisql |
CREATE TABLE table_name_6 (
probate_activities VARCHAR,
reserved_instruments VARCHAR,
regulator VARCHAR
) | What is Probate Activities, when Reserved Instruments is No, and when Regulator is Chartered Institute of Legal Executives? | SELECT probate_activities FROM table_name_6 WHERE reserved_instruments = "no" AND regulator = "chartered institute of legal executives" | sql_create_context |
CREATE TABLE days (
days_code varchar,
day_name varchar
)
CREATE TABLE compartment_class (
compartment varchar,
class_type varchar
)
CREATE TABLE month (
month_number int,
month_name text
)
CREATE TABLE class_of_service (
booking_class varchar,
rank int,
class_description text
)
... | very well i'm working on scenario three i'm interested in a flight on a 727 from WASHINGTON to ATLANTA GA | SELECT DISTINCT flight.flight_id FROM aircraft, airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, equipment_sequence, flight WHERE (aircraft.basic_type = '727' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'ATLANTA' AND CITY_1.state_c... | 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 demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
... | let me know the number of patients born before 2126 who had drug code fent25p. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.dob_year < "2126" AND prescriptions.formulary_drug_cd = "FENT25P" | mimicsql_data |
CREATE TABLE table_name_63 (
score VARCHAR,
set_3 VARCHAR
) | What was the overall score when the score of set 3 was 29 27? | SELECT score FROM table_name_63 WHERE set_3 = "29–27" | sql_create_context |
CREATE TABLE table_12860 (
"Designation" text,
"Launch date/time ( GMT )" text,
"Mass" text,
"Apogee" text,
"Inclination" text
) | What is Designation, when Launch Date/Time ( GMT ) is 29 June 1972, 03:47? | SELECT "Designation" FROM table_12860 WHERE "Launch date/time ( GMT )" = '29 june 1972, 03:47' | wikisql |
CREATE TABLE table_46776 (
"Game" real,
"Date" text,
"Opponent" text,
"Score" text,
"Location" text,
"Record" text
) | Can you tell me the Record that has the Location of fleetcenter, and the Date of fri. apr. 5? | SELECT "Record" FROM table_46776 WHERE "Location" = 'fleetcenter' AND "Date" = 'fri. apr. 5' | wikisql |
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod... | among patients diagnosed with malnutrition mod degree, show me the three year survival probability. | SELECT SUM(CASE WHEN patients.dod IS NULL THEN 1 WHEN STRFTIME('%j', patients.dod) - STRFTIME('%j', t2.charttime) > 3 * 365 THEN 1 ELSE 0 END) * 100 / COUNT(*) FROM (SELECT t1.subject_id, t1.charttime FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id... | mimic_iii |
CREATE TABLE mzjzjlb (
HXPLC number,
HZXM text,
JLSJ time,
JZJSSJ time,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
JZLSH text,
JZZDBM text,
JZZDSM text,
JZZTDM number,
JZZTMC text,
KH text,
KLX number,
MJZH text,
ML number,
MZZYZDZZBM text,
MZZYZDZZMC ... | 编号为94261760的病人从13年1月18日到2018年7月13日为止检测人为王锐利的所有检验结果指标记录的检验指标流水号码是多少? | SELECT jyjgzbb.JYZBLSH FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN jybgb_jyjgzbb 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 jybgb.YLJGDM = jybgb_jyjgzbb.YLJGDM AND jybgb.BGD... | css |
CREATE TABLE table_32794 (
"Player" text,
"Tries" text,
"Conv" text,
"Pens" text,
"Drop" text,
"Venue" text,
"Date" text
) | How many drops occurred with 0 pens and Fangatapu Apikotoa playing? | SELECT "Drop" FROM table_32794 WHERE "Pens" = '0' AND "Player" = 'fangatapu apikotoa' | wikisql |
CREATE TABLE table_52968 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | What is the stadium of melbourne? | SELECT "Venue" FROM table_52968 WHERE "Home team" = 'melbourne' | wikisql |
CREATE TABLE table_1183842_1 (
institution VARCHAR,
enrollment VARCHAR
) | 3488 is the enrollment amount of what college? | SELECT institution FROM table_1183842_1 WHERE enrollment = 3488 | sql_create_context |
CREATE TABLE table_20791 (
"product" text,
"dimensions (mm)" text,
"dpi" real,
"pages per minute (color)" real,
"max page size" text,
"interface" text
) | What are the mm dimensions for the Fujitsu fi-6130 a4 Series Scanner? | SELECT "dimensions (mm)" FROM table_20791 WHERE "product" = 'Fujitsu fi-6130 A4 Series Scanner' | wikisql |
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25),
EMAIL varchar(25),
PHONE_NUMBER varchar(20),
HIRE_DATE date,
JOB_ID varchar(10),
SALARY decimal(8,2),
COMMISSION_PCT decimal(2,2),
MANAGER_ID decimal(6,0),
DEPARTMENT_ID decimal(... | For those employees whose salary is in the range of 8000 and 12000 and commission is not null or department number does not equal to 40, return a scatter chart about the correlation between employee_id and manager_id . | SELECT EMPLOYEE_ID, MANAGER_ID FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 | nvbench |
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... | how many married patients had done the lab test thyroxine (t4)? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.marital_status = "MARRIED" AND lab.label = "Thyroxine (T4)" | mimicsql_data |
CREATE TABLE table_name_97 (
year VARCHAR,
award VARCHAR
) | What year has american music awards? | SELECT COUNT(year) FROM table_name_97 WHERE award = "american music awards" | sql_create_context |
CREATE TABLE table_56807 (
"Team" text,
"Games Played" real,
"Wins" real,
"Losses" real,
"Ties" real,
"Goals For" real,
"Goals Against" real
) | What is the lowest Goals Against by a team with more than 5 wins? | SELECT MIN("Goals Against") FROM table_56807 WHERE "Wins" > '5' | wikisql |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE medication (
medicationid number,
pat... | what are patient 033-2671's gender? | SELECT DISTINCT patient.gender FROM patient WHERE patient.uniquepid = '033-2671' | eicu |
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... | what time is the first time patient 006-167444 was prescribed a medicine via intravenous route until 64 months ago? | SELECT medication.drugstarttime FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-167444')) AND medication.routeadmin = 'intravenous' AND DA... | eicu |
CREATE TABLE table_57916 (
"Race" text,
"Circuit" text,
"Date" text,
"Pole position" text,
"Fastest lap" text,
"Winning driver" text,
"Constructor" text,
"Tyre" text,
"Report" text
) | Who is the Winnning driver in which lorenzo bandini has the fastest lap as well as the Pole position? | SELECT "Winning driver" FROM table_57916 WHERE "Fastest lap" = 'lorenzo bandini' AND "Pole position" = 'lorenzo bandini' | wikisql |
CREATE TABLE table_29343 (
"Genus/Species" text,
"Gene Name" text,
"Accession number" text,
"Sequence Length" text,
"Sequence similarity" real
) | Name the gene name for methylobacterium nodulans | SELECT "Gene Name" FROM table_29343 WHERE "Genus/Species" = 'Methylobacterium nodulans' | wikisql |
CREATE TABLE code_description (
code varchar,
description text
)
CREATE TABLE class_of_service (
booking_class varchar,
rank int,
class_description text
)
CREATE TABLE fare (
fare_id int,
from_airport varchar,
to_airport varchar,
fare_basis_code text,
fare_airline text,
res... | tell me about ground transportation in ST. PETERSBURG airport | SELECT DISTINCT ground_service.transport_type FROM airport, airport_service, city, ground_service WHERE airport.airport_code = airport_service.airport_code AND city.city_code = airport_service.city_code AND city.city_name = 'ST. PETERSBURG' AND ground_service.airport_code = airport.airport_code | atis |
CREATE TABLE Students_in_Detention (
student_id INTEGER,
detention_id INTEGER,
incident_id INTEGER
)
CREATE TABLE Detention (
detention_id INTEGER,
detention_type_code VARCHAR(10),
teacher_id INTEGER,
datetime_detention_start DATETIME,
datetime_detention_end DATETIME,
detention_summ... | Give me the comparison about the amount of date_address_to over the date_address_to bin date_address_to by weekday. | SELECT date_address_to, COUNT(date_address_to) FROM Student_Addresses ORDER BY monthly_rental DESC | nvbench |
CREATE TABLE table_80216 (
"Rank" real,
"Heat" real,
"Lane" real,
"Name" text,
"Nationality" text,
"Time" text
) | Name the least lane for kasey giteau and rank less than 18 | SELECT MIN("Lane") FROM table_80216 WHERE "Name" = 'kasey giteau' AND "Rank" < '18' | wikisql |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.