context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE table_22355_35 (
silver INTEGER
) | which is the minimun amount of silver medals? | SELECT MIN(silver) FROM table_22355_35 | sql_create_context |
CREATE TABLE music_festival (
ID int,
Music_Festival text,
Date_of_ceremony text,
Category text,
Volume int,
Result text
)
CREATE TABLE volume (
Volume_ID int,
Volume_Issue text,
Issue_Date text,
Weeks_on_Top real,
Song text,
Artist_ID int
)
CREATE TABLE artist (
Ar... | Return the categories of music festivals that have the result 'Awarded', and count them by a bar chart, sort by the X in desc please. | SELECT Category, COUNT(Category) FROM music_festival WHERE Result = "Awarded" GROUP BY Category ORDER BY Category DESC | nvbench |
CREATE TABLE table_name_92 (
win_lose_percentage VARCHAR,
champs VARCHAR,
draw VARCHAR
) | Which Win/Lose Percentage has Champs larger than 0, and a Draw larger than 3? | SELECT win_lose_percentage FROM table_name_92 WHERE champs > 0 AND draw > 3 | sql_create_context |
CREATE TABLE candidate (
candidate_id number,
people_id number,
poll_source text,
date text,
support_rate number,
consider_rate number,
oppose_rate number,
unsure_rate number
)
CREATE TABLE people (
people_id number,
sex text,
name text,
date_of_birth text,
height nu... | Return the top 3 greatest support rates. | SELECT support_rate FROM candidate ORDER BY support_rate DESC LIMIT 3 | spider |
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 of the patients whose other body fluid was tested by lab died in or before the year 2111? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dod_year <= "2111.0" AND lab.fluid = "Other Body Fluid" | mimicsql_data |
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,... | 药品209344在医疗就诊46007129869中的收费项目有哪些等级? | SELECT CHA_ITEM_LEV FROM t_kc22 WHERE MED_CLINIC_ID = '46007129869' AND SOC_SRT_DIRE_CD = '209344' | css |
CREATE TABLE table_204_318 (
id number,
"date" text,
"opponent" text,
"venue" text,
"result" text,
"attendance" number,
"scorers" text
) | did we score more in the plymouth argyle game or in the reading game ? | SELECT "opponent" FROM table_204_318 WHERE "opponent" IN ('plymouth argyle', 'reading') ORDER BY "result" DESC LIMIT 1 | squall |
CREATE TABLE table_65038 (
"Rank" real,
"Rider" text,
"Team" text,
"Speed" text,
"Time" text
) | What is the Speed when the rank is smaller than 3, and time is 1:06.19.90? | SELECT "Speed" FROM table_65038 WHERE "Rank" < '3' AND "Time" = '1:06.19.90' | wikisql |
CREATE TABLE jyjgzbb (
JYZBLSH text,
YLJGDM text,
BGDH text,
BGRQ time,
JYRQ time,
JCRGH text,
JCRXM text,
SHRGH text,
SHRXM text,
JCXMMC text,
JCZBDM text,
JCFF text,
JCZBMC text,
JCZBJGDX text,
JCZBJGDL number,
JCZBJGDW text,
SBBM text,
YQBH text... | 在08年7月28日到10年3月17日期间,陈浩淼这位患者找了多少医生看病 | SELECT COUNT(DISTINCT mzjzjlb.ZZYSGH) FROM person_info JOIN hz_info JOIN mzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX WHERE person_info.XM = '陈浩淼' AND mzjzjlb.JZKSRQ BETWEEN '2008-07-28' AND '2010-03-17' | css |
CREATE TABLE table_name_27 (
sydney VARCHAR,
gold_coast VARCHAR,
perth VARCHAR,
melbourne VARCHAR
) | Which Sydney has a Perth of no, a Melbourne of yes, and a Gold Coast of no? | SELECT sydney FROM table_name_27 WHERE perth = "no" AND melbourne = "yes" AND gold_coast = "no" | 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 diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE procedures (
... | Find the number of patients with other pulmonary insufficiency, not elsewhere classified, who died in or before the year 2132. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.dod_year <= "2132.0" AND diagnoses.long_title = "Other pulmonary insufficiency, not elsewhere classified" | mimicsql_data |
CREATE TABLE table_name_34 (
name VARCHAR,
born_died VARCHAR
) | What is the Name of the Prime Minister with a Born-Died of 1873 1933? | SELECT name FROM table_name_34 WHERE born_died = "1873–1933" | sql_create_context |
CREATE TABLE countries (
country_id text,
country_name text,
region_id number
)
CREATE TABLE jobs (
job_id text,
job_title text,
min_salary number,
max_salary number
)
CREATE TABLE locations (
location_id number,
street_address text,
postal_code text,
city text,
state_p... | What are the department ids for which more than 10 employees had a commission? | SELECT department_id FROM employees GROUP BY department_id HAVING COUNT(commission_pct) > 10 | spider |
CREATE TABLE table_22654073_7 (
high_points VARCHAR,
high_rebounds VARCHAR
) | Name the high points for mo williams , lebron james , j.j. hickson (6) | SELECT COUNT(high_points) FROM table_22654073_7 WHERE high_rebounds = "Mo Williams , LeBron James , J.J. Hickson (6)" | sql_create_context |
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 ... | 那个编号是48679933的患者在2011年3月5日之前都有哪些门诊就诊记录对应的检验报告单?当时的门诊就诊的流水号都是啥? | SELECT mzjzjlb.JZLSH FROM hz_info JOIN mzjzjlb JOIN hz_info_mzjzjlb ON hz_info.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND hz_info_mzjzjlb.JZLSH = mzjzjlb.JZLSH AND hz_info_mzjzjlb.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info_mzjzjlb.JZLSH = mzjzjlb.JZLSH AND hz_info_mzj... | css |
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,
... | 患者郑春华的医疗记录中,有过哪些医疗费总额不少于5187.37元的信息,看看入院诊断疾病名和编码 | SELECT gwyjzb.IN_DIAG_DIS_CD, gwyjzb.IN_DIAG_DIS_NM FROM gwyjzb WHERE gwyjzb.PERSON_NM = '郑春华' AND gwyjzb.MED_CLINIC_ID IN (SELECT t_kc24.MED_CLINIC_ID FROM t_kc24 WHERE t_kc24.MED_AMOUT >= 5187.37) UNION SELECT fgwyjzb.IN_DIAG_DIS_CD, fgwyjzb.IN_DIAG_DIS_NM FROM fgwyjzb WHERE fgwyjzb.PERSON_NM = '郑春华' AND fgwyjzb.MED_... | css |
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 (... | count the number of patients whose admission type is elective and lab test category is chemistry? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_type = "ELECTIVE" AND lab."CATEGORY" = "Chemistry" | mimicsql_data |
CREATE TABLE table_57801 (
"Coach" text,
"Years" text,
"Seasons" real,
"Lost" real,
"Pct." real
) | How many seasons has John Mcfadden coached? | SELECT COUNT("Seasons") FROM table_57801 WHERE "Coach" = 'john mcfadden' | wikisql |
CREATE TABLE station (
id INTEGER,
name TEXT,
lat NUMERIC,
long NUMERIC,
dock_count INTEGER,
city TEXT,
installation_date TEXT
)
CREATE TABLE trip (
id INTEGER,
duration INTEGER,
start_date TEXT,
start_station_name TEXT,
start_station_id INTEGER,
end_date TEXT,
e... | For each station, bin its longitude divided by zero as buckets, and count the frequency in each bucket, and I want to show by the Y in ascending. | SELECT long, COUNT(long) FROM station ORDER BY COUNT(long) | nvbench |
CREATE TABLE table_22269 (
"Departure" text,
"Going to" text,
"Calling at" text,
"Arrival" text,
"Operator" text
) | What is the departure for Peterborough East whose arrival time is 12.40? | SELECT "Departure" FROM table_22269 WHERE "Going to" = 'Peterborough East' AND "Arrival" = '12.40' | wikisql |
CREATE TABLE table_20866024_2 (
engine VARCHAR,
model_designation VARCHAR
) | How many different engines are there for the model with model designation 97G00? | SELECT COUNT(engine) FROM table_20866024_2 WHERE model_designation = "97G00" | sql_create_context |
CREATE TABLE table_74274 (
"Pick" real,
"Player" text,
"Position" text,
"Nationality" text,
"NHL team" text,
"College/junior/club team" text
) | Name the college for andrej podkonicky | SELECT "College/junior/club team" FROM table_74274 WHERE "Player" = 'Andrej Podkonicky' | wikisql |
CREATE TABLE Student (
StuID INTEGER,
LName VARCHAR(12),
Fname VARCHAR(12),
Age INTEGER,
Sex VARCHAR(1),
Major INTEGER,
Advisor INTEGER,
city_code VARCHAR(3)
)
CREATE TABLE Allergy_Type (
Allergy VARCHAR(20),
AllergyType VARCHAR(20)
)
CREATE TABLE Has_Allergy (
StuID INTEGE... | Show all ages and corresponding number of students in a scatter chart | SELECT Age, COUNT(*) FROM Student GROUP BY Age | nvbench |
CREATE TABLE table_28803803_1 (
irst VARCHAR,
original_channel VARCHAR
) | How many IRST figures for the show that premiered on Canale 5 (2006)? | SELECT COUNT(irst) FROM table_28803803_1 WHERE original_channel = "Canale 5 (2006)" | sql_create_context |
CREATE TABLE table_204_161 (
id number,
"name" text,
"1968 cf\ndesignator" text,
"place of\nmanufacture" text,
"primary\nrole(s)" text,
"service\nperiod" text,
"#\nused" number
) | at lease how many bell griffons are in service . | SELECT "#\nused" FROM table_204_161 WHERE "name" = 'bell griffon' | squall |
CREATE TABLE status (
station_id number,
bikes_available number,
docks_available number,
time text
)
CREATE TABLE trip (
id number,
duration number,
start_date text,
start_station_name text,
start_station_id number,
end_date text,
end_station_name text,
end_station_id nu... | Give me the dates when the max temperature was higher than 85. | SELECT date FROM weather WHERE max_temperature_f > 85 | spider |
CREATE TABLE table_name_20 (
price VARCHAR,
downstream VARCHAR
) | What is the price of 150 mbps downstread? | SELECT price FROM table_name_20 WHERE downstream = "150 mbps" | sql_create_context |
CREATE TABLE table_11259 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | Which home team plays at the Western Oval? | SELECT "Home team" FROM table_11259 WHERE "Venue" = 'western oval' | wikisql |
CREATE TABLE table_name_21 (
date VARCHAR,
theme VARCHAR
) | What date has a theme of fate or fortune? | SELECT date FROM table_name_21 WHERE theme = "fate or fortune" | sql_create_context |
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, visualize a bar chart about the distribution of name and the amount of name , and group by attribute name, display by the y-axis in descending. | SELECT T1.Name, COUNT(T1.Name) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name ORDER BY COUNT(T1.Name) DESC | nvbench |
CREATE TABLE table_name_14 (
home VARCHAR,
points INTEGER
) | Which home team has higher than 92 points? | SELECT home FROM table_name_14 WHERE points > 92 | sql_create_context |
CREATE TABLE table_name_49 (
site VARCHAR,
game VARCHAR
) | Name the site with game of game 6 | SELECT site FROM table_name_49 WHERE game = "game 6" | sql_create_context |
CREATE TABLE record (
ID int,
Result text,
Swimmer_ID int,
Event_ID int
)
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
)
... | Give me the comparison about the sum of meter_100 over the Nationality , and group by attribute Nationality. | SELECT Nationality, SUM(meter_100) FROM swimmer GROUP BY Nationality | nvbench |
CREATE TABLE table_203_485 (
id number,
"year" text,
"show" text,
"role" text,
"notes" text
) | the shows with at most 1 cameo | SELECT "show" FROM table_203_485 WHERE "notes" = 'cameo' | squall |
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 l... | is patient 007-16517 prescribed any drugs this year? | SELECT COUNT(*) > 0 FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '007-16517')) AND DATETIME(medication.drugstarttime, 'start of year') = DAT... | eicu |
CREATE TABLE table_3320 (
"Episode #" text,
"Fan Title" text,
"Writer" text,
"Artist(s)" text,
"Start Date" text,
"End Date" text,
"Inc. Dailies?" text,
"Inc. Sundays?" text
) | Who was the artist with a start date of 1966-10-23? | SELECT "Artist(s)" FROM table_3320 WHERE "Start Date" = '1966-10-23' | wikisql |
CREATE TABLE table_name_26 (
seats VARCHAR,
year VARCHAR,
_percentage_votes VARCHAR
) | After 1993, what is the Seats with a % votes of 38.72? | SELECT seats FROM table_name_26 WHERE year > 1993 AND _percentage_votes = 38.72 | sql_create_context |
CREATE TABLE table_22862203_2 (
location VARCHAR,
record VARCHAR
) | Where were games played when the record was 9-1? | SELECT location FROM table_22862203_2 WHERE record = "9-1" | 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 diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions... | provide the number of patients whose marital status is married and diagnoses long title is depressive disorder, not elsewhere classified? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.marital_status = "MARRIED" AND diagnoses.long_title = "Depressive disorder, not elsewhere classified" | 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 diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
C... | what is drug code of subject name kelly gallardo? | SELECT prescriptions.formulary_drug_cd FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.name = "Kelly Gallardo" | mimicsql_data |
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text,
person_info_CSD text,
person_info_CSRQ time,
person_info_GJDM text,
person_info_GJMC text,
person_info_JGDM text,
person_info_JGMC text,
person_info_MZDM text,
person_info_MZMC text,
person_info_XBDM ... | 列出患者韦伟彦所有检验结果指标记录的检测人为郎霞姝的检验指标流水号有多少在在2009-11-03到2010-06-13内? | SELECT jyjgzbb.JYZBLSH FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN 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 = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE hz... | css |
CREATE TABLE Badges (
Id number,
UserId number,
Name text,
Date time,
Class number,
TagBased boolean
)
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostsWithDeleted (
Id number,
PostTypeId number,
AcceptedAnswerId number,
Par... | SELECT TOP 40 u.DisplayName, u.Reputation, u.Location, u.Age, u.Views, u.UpVotes FROM Users u WHERE. | SELECT u.Id, u.DisplayName, u.Reputation, u.Location, u.Age, u.Views, u.UpVotes FROM Users AS u WHERE (u.Location LIKE '%Rockville%' OR u.Location LIKE '%Bethesda%' OR u.Location LIKE '%Silver Spring%' OR u.Location LIKE '%Kensington%' OR u.Location LIKE '%Gaithersburg%') AND (NOT u.Location LIKE '%London%') GROUP BY u... | sede |
CREATE TABLE table_61795 (
"Player" text,
"Pos." text,
"Nationality" text,
"Team" text,
"Previous team" text,
"Years of NBA experience [a ]" real,
"Career with the franchise [b ]" text
) | Which Team has a Previous team of san diego rockets, and a Position of f? | SELECT "Team" FROM table_61795 WHERE "Previous team" = 'san diego rockets' AND "Pos." = 'f' | wikisql |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob te... | provide the number of patients whose days of hospital stay is greater than 4 and lab test category is chemistry? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.days_stay > "4" AND lab."CATEGORY" = "Chemistry" | mimicsql_data |
CREATE TABLE student (
student_id int,
lastname varchar,
firstname varchar,
program_id int,
declare_major varchar,
total_credit int,
total_gpa float,
entered_as varchar,
admit_term int,
predicted_graduation_semester int,
degree varchar,
minor varchar,
internship varch... | Are there any upper level classes that produce 1 credits ? | SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN program_course ON program_course.course_id = course.course_id WHERE course.credits = 1 AND program_course.category LIKE 'ULCS' | advising |
CREATE TABLE table_name_36 (
country VARCHAR,
score VARCHAR,
player VARCHAR
) | What is Scott Hoch with a Score of 66 Country? | SELECT country FROM table_name_36 WHERE score = 66 AND player = "scott hoch" | sql_create_context |
CREATE TABLE table_74101 (
"Status" text,
"2001 number (,000)" real,
"2001 %" text,
"2011 number (,000)" real,
"2011 %" text
) | what is the 2001 % for the status widowed or surviving partner? | SELECT "2001 %" FROM table_74101 WHERE "Status" = 'Widowed or surviving partner' | wikisql |
CREATE TABLE table_15719 (
"Year" real,
"Entrant" text,
"Chassis" text,
"Engine" text,
"Points" real
) | What is the number of points when there was a BMW 269 F2 chassis earlier than 1969? | SELECT COUNT("Points") FROM table_15719 WHERE "Chassis" = 'bmw 269 f2' AND "Year" < '1969' | wikisql |
CREATE TABLE table_79378 (
"Rank" real,
"Athlete" text,
"Country" text,
"Time" text,
"Notes" text
) | What is the sum of the ranks for india? | SELECT SUM("Rank") FROM table_79378 WHERE "Country" = 'india' | wikisql |
CREATE TABLE table_11964047_8 (
leading_scorer VARCHAR,
attendance VARCHAR
) | What is the number of the leading scorer for keyarena 16,640? | SELECT COUNT(leading_scorer) FROM table_11964047_8 WHERE attendance = "KeyArena 16,640" | sql_create_context |
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,
... | How many patients who died in or before year 2138 had pituitary bleed as the primary disease? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "PITUITARY BLEED" AND demographic.dod_year <= "2138.0" | mimicsql_data |
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId number,
UserId number,
CreationDate time,
BountyAmount number
)
CREATE TABLE Tags (
Id number,
TagName text,
Count number,
ExcerptPostId number,
WikiPostId number
)
CREATE TABLE ReviewTaskResults (
Id number,
... | deleteme - Tunisia Top 200. | SELECT Id AS ID, DisplayName AS Name, Reputation, LastAccessDate AS Seen FROM Users WHERE Location LIKE '%Tunisia%' ORDER BY Reputation DESC LIMIT 200 | sede |
CREATE TABLE table_name_86 (
duration VARCHAR,
lok_sabha VARCHAR
) | What is the duration when Lok Sabha shows fifth? | SELECT duration FROM table_name_86 WHERE lok_sabha = "fifth" | sql_create_context |
CREATE TABLE table_15649 (
"Region" text,
"Date" text,
"Label" text,
"Format" text,
"Catalog" text
) | What was the date for a catalog formatted in stereo LP? | SELECT "Date" FROM table_15649 WHERE "Format" = 'stereo lp' | wikisql |
CREATE TABLE table_name_48 (
race_winner VARCHAR,
event_name VARCHAR
) | Who was the Race Winner of the Southern Illinois 100? | SELECT race_winner FROM table_name_48 WHERE event_name = "southern illinois 100" | sql_create_context |
CREATE TABLE table_name_51 (
nationality VARCHAR,
position VARCHAR,
player VARCHAR
) | What nationality is mark eaton, center position? | SELECT nationality FROM table_name_51 WHERE position = "center" AND player = "mark eaton" | 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 inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttim... | patient 90019 had been admitted to the hospital since 5 years ago? | SELECT COUNT(*) > 0 FROM admissions WHERE admissions.subject_id = 90019 AND DATETIME(admissions.admittime) >= DATETIME(CURRENT_TIME(), '-5 year') | mimic_iii |
CREATE TABLE table_name_95 (
date__closing_ VARCHAR,
opening_film VARCHAR
) | What is Date (Closing), when Opening Film is 'Deconstruction of Korean Housewife'? | SELECT date__closing_ FROM table_name_95 WHERE opening_film = "deconstruction of korean housewife" | sql_create_context |
CREATE TABLE table_14213 (
"Title" text,
"Series" text,
"Director" text,
"Production Number" text,
"Release date" text
) | What is the Director of the Filmography The Iceman Ducketh? | SELECT "Director" FROM table_14213 WHERE "Title" = 'the iceman ducketh' | wikisql |
CREATE TABLE table_name_67 (
report VARCHAR,
circuit VARCHAR
) | What's the report for the mosport park circuit? | SELECT report FROM table_name_67 WHERE circuit = "mosport park" | sql_create_context |
CREATE TABLE Reviewer (
rID int,
name text
)
CREATE TABLE Rating (
rID int,
mID int,
stars int,
ratingDate date
)
CREATE TABLE Movie (
mID int,
title text,
year int,
director text
) | Please give me a bar chart to compare the stars by directors, and list by the X-axis from high to low. | SELECT director, stars FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID ORDER BY director DESC | nvbench |
CREATE TABLE offering_instructor (
offering_instructor_id int,
offering_id int,
instructor_id int
)
CREATE TABLE requirement (
requirement_id int,
requirement varchar,
college varchar
)
CREATE TABLE course_offering (
offering_id int,
course_id int,
semester int,
section_number ... | More than 2 professors teach how many courses ? | SELECT COUNT(DISTINCT course_offering.course_id) FROM course, course_offering, offering_instructor AS OFFERING_INSTRUCTOR_0, offering_instructor AS OFFERING_INSTRUCTOR_1, offering_instructor AS OFFERING_INSTRUCTOR_2 WHERE course.course_id = course_offering.course_id AND course.department = 'EECS' AND OFFERING_INSTRUCTO... | advising |
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,
intime time,
outtime time
)
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
s... | how many current patients have been there? | SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.dischtime IS NULL | mimic_iii |
CREATE TABLE table_54444 (
"Party" text,
"Results 2004" text,
"CSA 5/14/09" text,
"Viavoice 5/15/09" text,
"Ifop- La Croix 5/15/09" text,
"Ipsos 5/16/09" text,
"OpinionWay 5/18/09" text,
"CSA 5/20/09" text,
"Ipsos 5/25/09" text,
"TNS-Sofres 5/26/09" text,
"OpinionWay 5/28/09"... | Which Viavoice 5/15/09 has a CSA 5/14/09 of 5%, and a TNS-Sofres 5/28/09 of 4.5%? | SELECT "Viavoice 5/15/09" FROM table_54444 WHERE "CSA 5/14/09" = '5%' AND "TNS-Sofres 5/28/09" = '4.5%' | wikisql |
CREATE TABLE table_17598822_11 (
league VARCHAR,
total VARCHAR
) | Name the total number of league for 5 | SELECT COUNT(league) FROM table_17598822_11 WHERE total = 5 | sql_create_context |
CREATE TABLE table_204_68 (
id number,
"name" text,
"profession" text,
"hometown" text,
"term expires" number,
"office" text
) | how many of the current state regents have a listed office title ? | SELECT COUNT("name") FROM table_204_68 WHERE NOT "office" IS NULL | squall |
CREATE TABLE table_name_89 (
location VARCHAR,
callsign VARCHAR
) | What is the Location of the Frequency with a Callsign of DXBL? | SELECT location FROM table_name_89 WHERE callsign = "dxbl" | sql_create_context |
CREATE TABLE representative (
Representative_ID int,
Name text,
State text,
Party text,
Lifespan text
)
CREATE TABLE election (
Election_ID int,
Representative_ID int,
Date text,
Votes real,
Vote_Percent real,
Seats real,
Place real
) | List the dates and vote percents of elections Show bar chart, order by the names in ascending. | SELECT Date, Vote_Percent FROM election ORDER BY Date | nvbench |
CREATE TABLE table_name_66 (
runner_s__up VARCHAR,
date VARCHAR
) | Who was the Runner(s)-up on the Date 4 Oct 2009? | SELECT runner_s__up FROM table_name_66 WHERE date = "4 oct 2009" | sql_create_context |
CREATE TABLE table_name_75 (
winning_score VARCHAR,
championship VARCHAR,
margin VARCHAR
) | What was the winning score in the u.s. women's open that was won by 5 strokes? | SELECT winning_score FROM table_name_75 WHERE championship = "u.s. women's open" AND margin = "5 strokes" | sql_create_context |
CREATE TABLE table_204_561 (
id number,
"fence" number,
"name" text,
"jockey" text,
"age" number,
"handicap (st-lb)" text,
"starting price" text,
"fate" text
) | which jockey is on top in age | SELECT "jockey" FROM table_204_561 ORDER BY "age" DESC LIMIT 1 | squall |
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE allergy (
allergyid number... | since 5 years ago, had patient 035-10830 been in an er? | SELECT COUNT(*) > 0 FROM patient WHERE patient.uniquepid = '035-10830' AND patient.hospitaladmitsource = 'emergency department' AND DATETIME(patient.unitadmittime) >= DATETIME(CURRENT_TIME(), '-5 year') | eicu |
CREATE TABLE table_64061 (
"School" text,
"City" text,
"Mascot" text,
"Enrollment" real,
"IHSAA Class" text,
"County" text
) | Which IHSAA Class has a Mascot of eagles, and a City of evansville? | SELECT "IHSAA Class" FROM table_64061 WHERE "Mascot" = 'eagles' AND "City" = 'evansville' | wikisql |
CREATE TABLE table_39844 (
"District" text,
"Incumbent" text,
"Party" text,
"Elected" real,
"Status" text,
"2008 Candidates" text,
"Results" text
) | What District had Republican Incumbent Cathy McMorris? | SELECT "District" FROM table_39844 WHERE "Party" = 'republican' AND "Incumbent" = 'cathy mcmorris' | wikisql |
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid num... | when did patient 015-12508 have the first sao2 to be less than 93.0 until 931 days ago? | SELECT vitalperiodic.observationtime FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '015-12508')) AND vitalperiodic.sao2 < 93.0 AND NOT ... | eicu |
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 inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
... | during the first hospital visit, what was the daily average dose of gentamycin irrigatin of patient 11688? | SELECT AVG(inputevents_cv.amount) FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 11688 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1)) AND inp... | mimic_iii |
CREATE TABLE t_kc21_t_kc22 (
MED_CLINIC_ID text,
MED_EXP_DET_ID number
)
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,
C... | 在10年3月5日到13年8月3日期间,韩芳洲这位参保人门诊检查费有多少元 | SELECT SUM(t_kc22.AMOUNT) FROM t_kc21 JOIN t_kc22 JOIN t_kc21_t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc21_t_kc22.MED_CLINIC_ID AND t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID WHERE t_kc21.PERSON_NM = '韩芳洲' AND t_kc21.CLINIC_TYPE = '门诊' AND t_kc22.STA_DATE BETWEEN '2010-03-05' AND '2013-08-03' AND t_kc22.MED_INV_IT... | css |
CREATE TABLE table_name_7 (
music VARCHAR,
result VARCHAR
) | What was the music of the team that was eliminated? | SELECT music FROM table_name_7 WHERE result = "eliminated" | sql_create_context |
CREATE TABLE table_name_40 (
player VARCHAR,
country VARCHAR,
year_s__won VARCHAR
) | What is Player, when Country is 'United States', and when Year(s) Won is '1976'? | SELECT player FROM table_name_40 WHERE country = "united states" AND year_s__won = "1976" | sql_create_context |
CREATE TABLE table_name_49 (
winning_score VARCHAR,
date VARCHAR
) | What's the winning score on Feb 12, 1978? | SELECT winning_score FROM table_name_49 WHERE date = "feb 12, 1978" | sql_create_context |
CREATE TABLE program_requirement (
program_id int,
category varchar,
min_credit int,
additional_req varchar
)
CREATE TABLE offering_instructor (
offering_instructor_id int,
offering_id int,
instructor_id int
)
CREATE TABLE program (
program_id int,
name varchar,
college varchar... | In BCS 533 , would you happen to know who teaches ? | SELECT DISTINCT instructor.name FROM course, course_offering, instructor, offering_instructor WHERE course.course_id = course_offering.course_id AND course.department = 'BCS' AND course.number = 533 AND offering_instructor.instructor_id = instructor.instructor_id AND offering_instructor.offering_id = course_offering.of... | advising |
CREATE TABLE table_21827 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Series" text
) | Name the high points for may 29 | SELECT "High points" FROM table_21827 WHERE "Date" = 'May 29' | wikisql |
CREATE TABLE table_13408 (
"Year" real,
"Champion (average in final)" text,
"Legs" text,
"Runner-up (average in final)" text,
"Sponsor" text,
"Prize Fund" text,
"Champion" text,
"Runner-up" text,
"Venue" text
) | What is the legs when the venue is rwe-sporthalle, m lheim and the runner-up (average in final) is simon whitlock (99.59)? | SELECT "Legs" FROM table_13408 WHERE "Venue" = 'rwe-sporthalle, mülheim' AND "Runner-up (average in final)" = 'simon whitlock (99.59)' | wikisql |
CREATE TABLE club (
clubid number,
clubname text,
clubdesc text,
clublocation text
)
CREATE TABLE student (
stuid number,
lname text,
fname text,
age number,
sex text,
major number,
advisor number,
city_code text
)
CREATE TABLE member_of_club (
stuid number,
clu... | For how many clubs is 'Tracy Kim' a member? | SELECT COUNT(*) FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t3.fname = "Tracy" AND t3.lname = "Kim" | spider |
CREATE TABLE table_name_51 (
year VARCHAR,
role VARCHAR,
theatre VARCHAR
) | Tell me the total number of years for lady cecily waynflete and opera house, kennedy center | SELECT COUNT(year) FROM table_name_51 WHERE role = "lady cecily waynflete" AND theatre = "opera house, kennedy center" | sql_create_context |
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE medication (
medicationid n... | calculate the one year survival rate among the patients who were prescribed with propofol 10 mg/ml after having been diagnosed with swollen extremity, etiology unknown - r/o cellulitis. | SELECT SUM(CASE WHEN patient.hospitaldischargestatus = 'alive' THEN 1 WHEN STRFTIME('%j', patient.hospitaldischargetime) - STRFTIME('%j', t4.diagnosistime) > 1 * 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 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... | 医疗就诊26786067488中所以的病人住院多久? | SELECT qtb.IN_HOSP_DAYS FROM qtb WHERE qtb.MED_CLINIC_ID = '26786067488' UNION SELECT gyb.IN_HOSP_DAYS FROM gyb WHERE gyb.MED_CLINIC_ID = '26786067488' UNION SELECT zyb.IN_HOSP_DAYS FROM zyb WHERE zyb.MED_CLINIC_ID = '26786067488' UNION SELECT mzb.IN_HOSP_DAYS FROM mzb WHERE mzb.MED_CLINIC_ID = '26786067488' | css |
CREATE TABLE airline (
airline_code varchar,
airline_name text,
note text
)
CREATE TABLE time_zone (
time_zone_code text,
time_zone_name text,
hours_from_gmt int
)
CREATE TABLE compartment_class (
compartment varchar,
class_type varchar
)
CREATE TABLE fare_basis (
fare_basis_code ... | show me the latest flight from SALT LAKE CITY to PHOENIX | 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 = 'SALT LAKE CITY' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name =... | atis |
CREATE TABLE table_34761 (
"Operation" text,
"Binary" text,
"Binomial" text,
"Fibonacci" text,
"Pairing" text,
"Brodal ***" text,
"Strict Fibonacci Heap" text
) | Binomial of (1) has what pairing? | SELECT "Pairing" FROM table_34761 WHERE "Binomial" = 'θ(1)' | wikisql |
CREATE TABLE table_38499 (
"Outcome" text,
"Year" real,
"Championship" text,
"Surface" text,
"Partner" text,
"Opponents" text,
"Score" text
) | What is the highest listed year for the partner of Marcel Granollers and a hard surface? | SELECT MAX("Year") FROM table_38499 WHERE "Partner" = 'marcel granollers' AND "Surface" = 'hard' | wikisql |
CREATE TABLE table_74888 (
"Year" real,
"Location" text,
"Gold" text,
"Silver" text,
"Bronze" text
) | What Silver has the Location of Guangzhou? | SELECT "Silver" FROM table_74888 WHERE "Location" = 'guangzhou' | wikisql |
CREATE TABLE table_name_80 (
network VARCHAR,
aspect VARCHAR,
psip_short_name VARCHAR
) | What network has an aspect of 4:3 and a PSIP Short Name of qvc? | SELECT network FROM table_name_80 WHERE aspect = "4:3" AND psip_short_name = "qvc" | sql_create_context |
CREATE TABLE SuggestedEdits (
Id number,
PostId number,
CreationDate time,
ApprovalDate time,
RejectionDate time,
OwnerUserId number,
Comment text,
Text text,
Title text,
Tags text,
RevisionGUID other
)
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId num... | Get score by post type for UserId. | SELECT (SELECT SUM(Score) FROM Posts WHERE OwnerUserId = '##UserId##' AND PostTypeId = 2) AS AnswerScore, (SELECT SUM(Score) FROM Posts WHERE OwnerUserId = '##UserId##' AND PostTypeId = 1) AS QuestionScore, (SELECT SUM(Score) FROM Comments WHERE UserId = '##UserId##') AS CommentScore, (SELECT TOP(1) AS DisplayName FROM... | sede |
CREATE TABLE t_kc22 (
AMOUNT number,
CHA_ITEM_LEV number,
DATA_ID text,
DIRE_TYPE number,
DOSE_FORM text,
DOSE_UNIT text,
EACH_DOSAGE text,
EXP_OCC_DATE time,
FLX_MED_ORG_ID text,
FXBZ number,
HOSP_DOC_CD text,
HOSP_DOC_NM text,
MED_DIRE_CD text,
MED_DIRE_NM text,... | 列出名称不包含心理的科室开出的所有医疗费用明细项目在医疗就诊30612359533中有哪些? | SELECT * FROM t_kc22 JOIN t_kc21_t_kc22 JOIN t_kc21 ON t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID AND t_kc21_t_kc22.MED_CLINIC_ID = t_kc21.MED_CLINIC_ID WHERE t_kc21.MED_CLINIC_ID = '30612359533' AND NOT t_kc22.MED_ORG_DEPT_NM LIKE '%心理%' | css |
CREATE TABLE table_name_15 (
translation VARCHAR,
sign VARCHAR
) | What is the translation of the sign of Aquarius? | SELECT translation FROM table_name_15 WHERE sign = "aquarius" | sql_create_context |
CREATE TABLE course_tags_count (
course_id int,
clear_grading int,
pop_quiz int,
group_projects int,
inspirational int,
long_lectures int,
extra_credit int,
few_tests int,
good_feedback int,
tough_tests int,
heavy_papers int,
cares_for_students int,
heavy_assignments ... | Which class is easiest to fulfill the Core requirement ? | SELECT DISTINCT course.department, course.name, course.number, program_course.workload, program_course.workload FROM course, program_course WHERE program_course.category LIKE '%Core%' AND program_course.course_id = course.course_id AND program_course.workload = (SELECT MIN(PROGRAM_COURSEalias1.workload) FROM program_co... | advising |
CREATE TABLE Manufacturers (
code VARCHAR
)
CREATE TABLE products (
manufacturer VARCHAR
) | Select all the data from the products and each product's manufacturer. | SELECT * FROM products AS T1 JOIN Manufacturers AS T2 ON T1.manufacturer = T2.code | sql_create_context |
CREATE TABLE party_events (
Event_ID int,
Event_Name text,
Party_ID int,
Member_in_charge_ID int
)
CREATE TABLE member (
Member_ID int,
Member_Name text,
Party_ID text,
In_office text
)
CREATE TABLE party (
Party_ID int,
Minister text,
Took_office text,
Left_office text... | Show all party names and the number of members in each party with a bar chart, and rank in desc by the y-axis. | SELECT Party_name, COUNT(*) FROM member AS T1 JOIN party AS T2 ON T1.Party_ID = T2.Party_ID GROUP BY T1.Party_ID ORDER BY COUNT(*) DESC | nvbench |
CREATE TABLE table_name_37 (
team VARCHAR,
losses VARCHAR,
pos VARCHAR
) | Which team had fewer than 2 losses and a position number more than 1? | SELECT team FROM table_name_37 WHERE losses < 2 AND pos > 1 | sql_create_context |
CREATE TABLE table_name_2 (
runners_up INTEGER,
champions INTEGER
) | What is the sum of Runners-Up, when Champions is greater than 5? | SELECT SUM(runners_up) FROM table_name_2 WHERE champions > 5 | sql_create_context |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.