context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE table_21702 (
"Class" text,
"Part 1" text,
"Part 2" text,
"Part 3" text,
"Part 4" text,
"Verb meaning" text
) | In what class does the verb with part 4 gelopen belong to? | SELECT "Class" FROM table_21702 WHERE "Part 4" = 'gelopen' | wikisql |
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 patients were diagnosised as cardiac arrest by long title and had delta lab test results? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.long_title = "Cardiac arrest" AND lab.flag = "delta" | mimicsql_data |
CREATE TABLE table_37072 (
"Year" real,
"Class" text,
"Team" text,
"Points" real,
"Wins" real
) | What engine class is associated with a year after 1985 and over 0 wins? | SELECT "Class" FROM table_37072 WHERE "Year" > '1985' AND "Wins" > '0' | wikisql |
CREATE TABLE Badges (
Id number,
UserId number,
Name text,
Date time,
Class number,
TagBased boolean
)
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
InputTitle text,
MarkdownInputGuidance text,
MarkdownPostOwnerGuidance text,
MarkdownPrivilege... | View and Answer count for Habib. | SELECT DISTINCT (p1.Id) AS "Answer Id", p2.ViewCount FROM Posts AS p1 JOIN Posts AS p2 ON p1.ParentId = p2.Id WHERE p1.OwnerUserId = 961113 AND (p1.LastEditDate >= '2016-04-01' OR p1.CreationDate > '2016-04-01') | sede |
CREATE TABLE table_203_74 (
id number,
"rank" number,
"urban area" text,
"population\n(2001 census)" number,
"area (km2)" number,
"density (people/km2)" number,
"major subdivisions" text,
"metropolitan area" text
) | how many urban areas have a density below 2,500 ? | SELECT COUNT("urban area") FROM table_203_74 WHERE "density (people/km2)" < 2500 | squall |
CREATE TABLE table_name_57 (
director VARCHAR,
title VARCHAR,
result VARCHAR
) | Who is the director with the Min Dally Nseek title, and won? | SELECT director FROM table_name_57 WHERE title = "min dally nseek" AND result = "won" | sql_create_context |
CREATE TABLE mountain (
mountain_id number,
name text,
height number,
prominence number,
range text,
country text
)
CREATE TABLE climber (
climber_id number,
name text,
country text,
time text,
points number,
mountain_id number
) | What are the names of countains that no climber has climbed? | SELECT name FROM mountain WHERE NOT mountain_id IN (SELECT mountain_id FROM climber) | spider |
CREATE TABLE table_49472 (
"Tongan" text,
"Niuean" text,
"S\u0101moan" text,
"Takuu" text,
"Tahitian" text,
"Rarotongan" text,
"M\u0101ori" text,
"North Marquesan" text,
"South Marquesan" text,
"Hawai'ian" text,
"Mangarevan" text
) | Which Tongan has a North Marquesan of /ha e/? | SELECT "Tongan" FROM table_49472 WHERE "North Marquesan" = '/haʔe/' | wikisql |
CREATE TABLE table_2536 (
"Dateca" text,
"Event #" text,
"Event" text,
"Winner" text,
"Prize" text,
"Entries" text,
"Prize Pool" text,
"Elapsed Time" text
) | Who is the winner with an elapsed time of 12 h 42 min? | SELECT "Winner" FROM table_2536 WHERE "Elapsed Time" = '12 h 42 min' | wikisql |
CREATE TABLE table_58851 (
"Drug" text,
"Mean" real,
"Pleasure" real,
"Psychological dependence" real,
"Physical dependence" real
) | What is the highest Psychological Dependence, when Pleasure is less than 2.3, when Drug is 'Cannabis', and when Physical Dependence is less than 0.8? | SELECT MAX("Psychological dependence") FROM table_58851 WHERE "Pleasure" < '2.3' AND "Drug" = 'cannabis' AND "Physical dependence" < '0.8' | wikisql |
CREATE TABLE table_2241841_1 (
manufacturer VARCHAR,
date VARCHAR
) | Who made the car that won the race on May 21? | SELECT manufacturer FROM table_2241841_1 WHERE date = "May 21" | sql_create_context |
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
... | what were the top four most frequent procedures that patients took within 2 months after receiving prone position in 2105? | SELECT t3.treatmentname FROM (SELECT t2.treatmentname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, treatment.treatmenttime FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'prone position' AND STRFTIME('%y', treat... | eicu |
CREATE TABLE table_name_4 (
year INTEGER,
rank INTEGER
) | What is the sum of Year, when Rank is less than 19? | SELECT SUM(year) FROM table_name_4 WHERE rank < 19 | sql_create_context |
CREATE TABLE table_11111116_6 (
no_in_series INTEGER,
us_viewers__million_ VARCHAR
) | Which episode in the series drew 3.6 million U.S. viewers? | SELECT MIN(no_in_series) FROM table_11111116_6 WHERE us_viewers__million_ = "3.6" | sql_create_context |
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE d_... | whats the cost to get a iatrogenc hypotnsion nec diagnosis. | SELECT DISTINCT cost.cost FROM cost WHERE cost.event_type = 'diagnoses_icd' AND cost.event_id IN (SELECT diagnoses_icd.row_id FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'iatrogenc hypotnsion nec')) | mimic_iii |
CREATE TABLE table_55430 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Attendance" text,
"Record" text
) | What is the record for the game with an attendance of 35,305? | SELECT "Record" FROM table_55430 WHERE "Attendance" = '35,305' | wikisql |
CREATE TABLE table_55865 (
"CERCLIS ID" text,
"Name" text,
"County" text,
"Proposed" text,
"Listed" text,
"Construction completed" text,
"Partially deleted" text,
"Deleted" text
) | On what date was Stauffer Chemical Company (Lemoyne Plant), which was listed on 09/21/1984, deleted? | SELECT "Deleted" FROM table_55865 WHERE "Listed" = '09/21/1984' AND "Name" = 'stauffer chemical company (lemoyne plant)' | wikisql |
CREATE TABLE table_55752 (
"Driver" text,
"Constructor" text,
"Laps" real,
"Time/Retired" text,
"Grid" real
) | For Jo Siffert, what was the highest grid with the number of laps above 12? | SELECT MAX("Grid") FROM table_55752 WHERE "Driver" = 'jo siffert' AND "Laps" > '12' | wikisql |
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 aircraft (
aircraft_code varchar,
aircraft_description varchar,
manufac... | flight from DENVER to SALT LAKE CITY | 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 = 'DENVER' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SALT LA... | atis |
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... | 有多少门诊病人在02年11月4日到14年2月23日内找医生82477447看病? | SELECT COUNT(hz_info.RYBH) 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_in... | css |
CREATE TABLE table_204_455 (
id number,
"rd." number,
"grand prix" text,
"date" text,
"location" text,
"pole position" text,
"fastest lap" text,
"winning driver" text,
"constructor" text,
"report" text
) | how many races occurred before alain prost won a pole position ? | SELECT COUNT(*) FROM table_204_455 WHERE "rd." < (SELECT "rd." FROM table_204_455 WHERE "pole position" = 'alain prost' ORDER BY "rd." LIMIT 1) | squall |
CREATE TABLE table_2527063_3 (
rank INTEGER
) | Name the least rank | SELECT MIN(rank) FROM table_2527063_3 | sql_create_context |
CREATE TABLE table_26561 (
"DVD Name" text,
"Ep #" text,
"Region 1 (US)" text,
"Region 1 (CAN)" text,
"Region 2 (UK)" text,
"Region 2 (Germany)" text,
"Region 4 (Australia)" text
) | How many region 4 dates are associated with a region 2 date of July 9, 2007? | SELECT COUNT("Region 4 (Australia)") FROM table_26561 WHERE "Region 2 (UK)" = 'July 9, 2007' | wikisql |
CREATE TABLE table_name_69 (
game VARCHAR,
opponent VARCHAR,
january VARCHAR
) | What is the total number of games of the team against the Los Angeles Kings after January 5? | SELECT COUNT(game) FROM table_name_69 WHERE opponent = "los angeles kings" AND january > 5 | sql_create_context |
CREATE TABLE table_name_30 (
diameter__km_ VARCHAR,
name VARCHAR
) | What's the diameter of kaiwan fluctus? | SELECT diameter__km_ FROM table_name_30 WHERE name = "kaiwan fluctus" | sql_create_context |
CREATE TABLE table_204_775 (
id number,
"rank" number,
"nation" text,
"gold" number,
"silver" number,
"bronze" number,
"total" number
) | which country came in first with 7 gold medals ? | SELECT "nation" FROM table_204_775 WHERE "gold" = 7 | squall |
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 ... | 从2001年1月15日至2009年6月20日期间列举出病人李慧美所有检验结果指标记录中的检测方法吗? | SELECT jyjgzbb.JCFF 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_in... | css |
CREATE TABLE ta (
campus_job_id int,
student_id int,
location varchar
)
CREATE TABLE course_prerequisite (
pre_course_id int,
course_id int
)
CREATE TABLE jobs (
job_id int,
job_title varchar,
description varchar,
requirement varchar,
city varchar,
state varchar,
countr... | Of the classes , which are available this Summer ? | SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND course.department = 'EECS' AND semester.semester = 'Summer' AND semester.semester_id = course_offering.semester AND semester.year = 2016 | advising |
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
... | what does the cost of efavirenz be? | SELECT DISTINCT cost.cost FROM cost WHERE cost.event_type = 'prescriptions' AND cost.event_id IN (SELECT prescriptions.row_id FROM prescriptions WHERE prescriptions.drug = 'efavirenz') | mimic_iii |
CREATE TABLE table_204_111 (
id number,
"name" text,
"animal type" text,
"introduced" number,
"reintroduced" text,
"retired" number,
"beanie baby resembled" text
) | what is the name of the last pillow pal on this chart ? | SELECT "name" FROM table_204_111 ORDER BY id DESC LIMIT 1 | squall |
CREATE TABLE table_78527 (
"Superlative" text,
"Actor" text,
"Record Set" text,
"Year" text,
"Notes" text
) | What are the notes in 1981? | SELECT "Notes" FROM table_78527 WHERE "Year" = '1981' | wikisql |
CREATE TABLE table_26354 (
"Team" text,
"Location" text,
"Home Ground" text,
"First year in Qld Cup" real,
"Last year in Qld Cup" real,
"Qld Cup Premierships" text
) | What is every entry in the QLD Cup Premierships when home ground is Dairy Farmers Stadium? | SELECT "Qld Cup Premierships" FROM table_26354 WHERE "Home Ground" = 'Dairy Farmers Stadium' | wikisql |
CREATE TABLE table_name_41 (
oklahoma VARCHAR,
nebraska VARCHAR,
year VARCHAR
) | What is the oklahoma has Bush from Nebraska in year 2004? | SELECT oklahoma FROM table_name_41 WHERE nebraska = "bush" AND year = "2004" | sql_create_context |
CREATE TABLE photos (
id int,
camera_lens_id int,
mountain_id int,
color text,
name text
)
CREATE TABLE camera_lens (
id int,
brand text,
name text,
focal_length_mm real,
max_aperture real
)
CREATE TABLE mountain (
id int,
name text,
Height real,
Prominence real... | Draw a bar chart for what are the id and name of the mountains that have at least 2 photos? | SELECT T1.name, T1.id FROM mountain AS T1 JOIN photos AS T2 ON T1.id = T2.mountain_id | nvbench |
CREATE TABLE table_35294 (
"Round" real,
"Player" text,
"Nationality" text,
"NHL team" text,
"College/Junior/Club Team (League)" text
) | which NHL team has a College/Junior/Club Team (League) of shattuck-saint mary's school (midget major aaa)? | SELECT "NHL team" FROM table_35294 WHERE "College/Junior/Club Team (League)" = 'shattuck-saint mary''s school (midget major aaa)' | wikisql |
CREATE TABLE table_39972 (
"Year" real,
"Venue" text,
"Winner" text,
"Country" text,
"Score" text
) | Which Score has a Country of england, and a Year larger than 1971? | SELECT "Score" FROM table_39972 WHERE "Country" = 'england' AND "Year" > '1971' | wikisql |
CREATE TABLE table_45782 (
"Tie no" text,
"Home team" text,
"Score" text,
"Away team" text,
"Date" text
) | What is the Tie number for the match that had away team of Scunthorpe & Lindsey United? | SELECT "Tie no" FROM table_45782 WHERE "Away team" = 'scunthorpe & lindsey united' | wikisql |
CREATE TABLE table_36172 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Game site" text,
"Record" text
) | What was the record at the game on November 13, 1932? | SELECT "Record" FROM table_36172 WHERE "Date" = 'november 13, 1932' | wikisql |
CREATE TABLE table_2509113_2 (
quillacollo_municipality INTEGER,
vinto_municipality VARCHAR
) | If the Vinto Municipality is 18630, what is the Quillacollo Municipality? | SELECT MAX(quillacollo_municipality) FROM table_2509113_2 WHERE vinto_municipality = 18630 | sql_create_context |
CREATE TABLE injury_accident (
game_id int,
id int,
Player text,
Injury text,
Number_of_matches text,
Source text
)
CREATE TABLE stadium (
id int,
name text,
Home_Games int,
Average_Attendance real,
Total_Attendance real,
Capacity_Percentage real
)
CREATE TABLE game (
... | How many injured players not suffering from injury of 'Knee problem' in each match? Show me a bar chart grouping by number of matches, and sort y-axis in desc order please. | SELECT Number_of_matches, COUNT(Number_of_matches) FROM injury_accident WHERE Injury <> 'Knee problem' GROUP BY Number_of_matches ORDER BY COUNT(Number_of_matches) DESC | nvbench |
CREATE TABLE table_name_73 (
sydney VARCHAR,
auckland VARCHAR,
perth VARCHAR
) | Which Sydney has Auckland cancelled and Perth yes? | SELECT sydney FROM table_name_73 WHERE auckland = "cancelled" AND perth = "yes" | sql_create_context |
CREATE TABLE table_name_53 (
home_team VARCHAR
) | What is south melbourne's home side score? | SELECT home_team AS score FROM table_name_53 WHERE home_team = "south melbourne" | sql_create_context |
CREATE TABLE table_name_82 (
mountain_range VARCHAR,
region VARCHAR,
location VARCHAR
) | Which Mountain Range has a Region of haiti, and a Location of 18.3601 n 71.9764 w? | SELECT mountain_range FROM table_name_82 WHERE region = "haiti" AND location = "18.3601°n 71.9764°w" | sql_create_context |
CREATE TABLE table_name_46 (
attendance INTEGER,
home VARCHAR,
visitor VARCHAR
) | What was the attendance of the Florida vs. Montreal game? | SELECT AVG(attendance) FROM table_name_46 WHERE home = "florida" AND visitor = "montreal" | sql_create_context |
CREATE TABLE table_37899 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" text,
"Result" text
) | What is First elected that has republican Party and a Result of retired democratic gain? | SELECT "First elected" FROM table_37899 WHERE "Party" = 'republican' AND "Result" = 'retired democratic gain' | wikisql |
CREATE TABLE table_name_71 (
diameter__km_ VARCHAR,
longitude VARCHAR,
latitude VARCHAR,
name VARCHAR
) | What in Xenia's Diameter in km, with a latitude of 14 and a longitude of 249.4? | SELECT COUNT(diameter__km_) FROM table_name_71 WHERE latitude < 14 AND name = "xenia" AND longitude > 249.4 | sql_create_context |
CREATE TABLE hz_info_mzjzjlb (
JZLSH number,
YLJGDM number,
mzjzjlb_id number
)
CREATE TABLE jyjgzbb (
BGDH text,
BGRQ time,
CKZFWDX text,
CKZFWSX number,
CKZFWXX number,
JCFF text,
JCRGH text,
JCRXM text,
JCXMMC text,
JCZBDM text,
JCZBJGDL number,
JCZBJGDW t... | 混合性焦虑和抑郁障碍的患者的促肾上腺皮质激素在门诊诊断的参考值范围下限和上限都是啥? | SELECT jyjgzbb.CKZFWXX, jyjgzbb.CKZFWSX FROM mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN hz_info_mzjzjlb ON hz_info_mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH AND hz_info_mzjzjlb.JZLSH = mzjzjlb.JZLSH AND hz_info_mzjzjlb.YLJGDM ... | css |
CREATE TABLE table_41370 (
"Party" text,
"Marplan" text,
"Gallup" text,
"National Opinion Polls (NOP)" text,
"Opinion Research Centre (OPC)" text,
"Harris" text
) | What is Opinion Research Centre (OPC), when Party is Conservative? | SELECT "Opinion Research Centre (OPC)" FROM table_41370 WHERE "Party" = 'conservative' | wikisql |
CREATE TABLE table_name_11 (
legs_lost VARCHAR,
player VARCHAR,
played VARCHAR
) | How many legs were lost for Trina Gulliver with more than 3 played? | SELECT COUNT(legs_lost) FROM table_name_11 WHERE player = "trina gulliver" AND played > 3 | sql_create_context |
CREATE TABLE table_2226817_9 (
production_code VARCHAR,
written_by VARCHAR
) | What is the production code of the episode directed by Stacie Lipp? | SELECT production_code FROM table_2226817_9 WHERE written_by = "Stacie Lipp" | sql_create_context |
CREATE TABLE course_offering (
offering_id int,
course_id int,
semester int,
section_number int,
start_time time,
end_time time,
monday varchar,
tuesday varchar,
wednesday varchar,
thursday varchar,
friday varchar,
saturday varchar,
sunday varchar,
has_final_proje... | Next Winter , what special topics classes are there ? | SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester WHERE (course.number = 398 OR course.number = 498 OR course.number = 598) AND course.department = 'E... | advising |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
... | give me the number of patients whose ethnicity is hispanic/latino - puerto rican and year of birth is less than 2200? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "HISPANIC/LATINO - PUERTO RICAN" AND demographic.dob_year < "2200" | mimicsql_data |
CREATE TABLE table_73445 (
"County" text,
"Population" real,
"Unemployment Rate" text,
"Market Income Per Capita" text,
"Poverty Rate" text,
"Status" text
) | What is the market income per capita of the county with the 9.4% poverty rate? | SELECT "Market Income Per Capita" FROM table_73445 WHERE "Poverty Rate" = '9.4%' | wikisql |
CREATE TABLE mzjybgb (
BBCJBW text,
BBDM text,
BBMC text,
BBZT number,
BGDH number,
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,
... | 门诊诊断为O75.901疾病的患者91426562,他的甲状旁腺素的结果定量及其单位分别是什么 | SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM hz_info JOIN mzjzjlb JOIN zyjybgb JOIN jyjgzbb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = zyjybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = zyjybgb.JZLSH_MZJZJLB AND zyjybgb.YLJGDM = jyjgzbb.YLJGDM AND zyjybgb... | css |
CREATE TABLE table_36442 (
"Date" text,
"City" text,
"Opponent" text,
"Results\u00b9" text,
"Type of game" text
) | In what City was Bulgaria the Opponent with Results of 1:0? | SELECT "City" FROM table_36442 WHERE "Results\u00b9" = '1:0' AND "Opponent" = 'bulgaria' | wikisql |
CREATE TABLE table_204_64 (
id number,
"place" text,
"code" number,
"area (km2)" number,
"population" number,
"most spoken language" text
) | is the population of brandfort the same as the population of boipatong ? | SELECT (SELECT "population" FROM table_204_64 WHERE "place" = 'brandfort') = (SELECT "population" FROM table_204_64 WHERE "place" = 'boipatong') | squall |
CREATE TABLE publication (
Publication_ID int,
Book_ID int,
Publisher text,
Publication_Date text,
Price real
)
CREATE TABLE book (
Book_ID int,
Title text,
Issues real,
Writer text
) | A bar chart showing the number of publication dates of books, sort Y from high to low order. | SELECT Publication_Date, COUNT(Publication_Date) FROM publication GROUP BY Publication_Date ORDER BY COUNT(Publication_Date) DESC | nvbench |
CREATE TABLE table_name_88 (
rank INTEGER,
athlete VARCHAR
) | what is the rank for athlete hauffe, seifert, kaeufer, adamski? | SELECT SUM(rank) FROM table_name_88 WHERE athlete = "hauffe, seifert, kaeufer, adamski" | sql_create_context |
CREATE TABLE table_49709 (
"Exit Date" text,
"Pos." text,
"Player" text,
"To club" text,
"Transfer fee" text
) | Teerasil Dangda who had a to club of released plays what position? | SELECT "Pos." FROM table_49709 WHERE "To club" = 'released' AND "Player" = 'teerasil dangda' | wikisql |
CREATE TABLE bdmzjzjlb (
HXPLC number,
HZXM text,
JLSJ time,
JZJSSJ time,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
JZLSH number,
JZZDBM text,
JZZDSM text,
JZZTDM number,
JZZTMC text,
KH text,
KLX number,
MJZH text,
ML number,
MZZYZDZZBM text,
MZZYZDZ... | 患者的身高、体重、体温、呼吸频率、收缩压、舒张压、心率、脉率在门诊就诊72157551077中各是多少? | SELECT wdmzjzjlb.SG, wdmzjzjlb.TZ, wdmzjzjlb.TW, wdmzjzjlb.SSY, wdmzjzjlb.SZY, wdmzjzjlb.XL, wdmzjzjlb.HXPLC, wdmzjzjlb.ML FROM wdmzjzjlb WHERE wdmzjzjlb.JZLSH = '72157551077' UNION SELECT bdmzjzjlb.SG, bdmzjzjlb.TZ, bdmzjzjlb.TW, bdmzjzjlb.SSY, bdmzjzjlb.SZY, bdmzjzjlb.XL, bdmzjzjlb.HXPLC, bdmzjzjlb.ML FROM bdmzjzjlb ... | css |
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
systemicsystolic number,
systemicdiastolic number,
systemicmean number,
observationtime time
)
CREATE TABLE allergy (
allergy... | during this year, what were the top five most frequent procedures that patients received during the same month after receiving a antibacterials - linezolid (zyvox)? | SELECT t3.treatmentname FROM (SELECT t2.treatmentname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, treatment.treatmenttime FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'antibacterials - linezolid (zyvox)' AND ... | eicu |
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 outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime ... | is the white blood cells level of patient 15945 last measured on the current hospital visit greater than it was first measured on the current hospital visit? | SELECT (SELECT labevents.valuenum FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 15945 AND admissions.dischtime IS NULL) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'white blood cells') ORDER BY labevents.... | mimic_iii |
CREATE TABLE table_51240 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
) | On the date April 11, what is the total game number? | SELECT COUNT("Game") FROM table_51240 WHERE "Date" = 'april 11' | wikisql |
CREATE TABLE table_53461 (
"Area in m\u00b2" text,
"Completion" text,
"City" text,
"Country" text,
"Denomination" text
) | What is the country with area of 3,170 in m ? | SELECT "Country" FROM table_53461 WHERE "Area in m\u00b2" = '3,170' | wikisql |
CREATE TABLE table_24989 (
"Year" real,
"Date" text,
"Driver" text,
"Team" text,
"Manufacturer" text,
"Laps" text,
"Miles (km)" text,
"Race Time" text,
"Average Speed (mph)" text,
"Report" text
) | What team had average speed of 107.063 mph? | SELECT "Team" FROM table_24989 WHERE "Average Speed (mph)" = '107.063' | wikisql |
CREATE TABLE table_name_27 (
goal INTEGER,
venue VARCHAR
) | What was the highest number of goals for a game held at Hannover? | SELECT MAX(goal) FROM table_name_27 WHERE venue = "hannover" | sql_create_context |
CREATE TABLE table_78860 (
"Week" real,
"Event" text,
"Air Date" text,
"Winning team" text,
"Winners club" text
) | Which Week has an Air Date of august 2, 2008? | SELECT "Week" FROM table_78860 WHERE "Air Date" = 'august 2, 2008' | wikisql |
CREATE TABLE table_name_90 (
position VARCHAR,
mls_team VARCHAR
) | Which position is the MLS team, Los Angeles Galaxy in? | SELECT position FROM table_name_90 WHERE mls_team = "los angeles galaxy" | sql_create_context |
CREATE TABLE table_29773 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
) | What is the largest game number? | SELECT MAX("Game") FROM table_29773 | wikisql |
CREATE TABLE table_name_40 (
total_goals VARCHAR,
fa_cup_goals VARCHAR,
total_apps VARCHAR,
name VARCHAR
) | how many times is the total apps 1 and the fa cup goals less than 0 for bob mountain? | SELECT COUNT(total_goals) FROM table_name_40 WHERE total_apps = "1" AND name = "bob mountain" AND fa_cup_goals < 0 | sql_create_context |
CREATE TABLE table_name_41 (
opponent VARCHAR,
date VARCHAR
) | What team was the opponent on 03/18/08? | SELECT opponent FROM table_name_41 WHERE date = "03/18/08" | sql_create_context |
CREATE TABLE table_name_69 (
gloss VARCHAR,
pronunciation VARCHAR
) | Name the gloss for [ d m] | SELECT gloss FROM table_name_69 WHERE pronunciation = "[χdəm]" | sql_create_context |
CREATE TABLE table_73754 (
"Season" real,
"Winner" text,
"Runner-Up" text,
"Third Place" text,
"Contestants" real
) | How many contestants were there when the runner-up was S rgio Abreu? | SELECT MAX("Contestants") FROM table_73754 WHERE "Runner-Up" = 'Sérgio Abreu' | wikisql |
CREATE TABLE university (
School_ID int,
School text,
Location text,
Founded real,
Affiliation text,
Enrollment real,
Nickname text,
Primary_conference text
)
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Per... | Return a scatter chart about the correlation between Team_ID and School_ID , and group by attribute ACC_Road. | SELECT Team_ID, School_ID FROM basketball_match GROUP BY ACC_Road | nvbench |
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 cost (
costid number,
uniquepid text,... | give me the total amount of lr ivf that patient 006-70268 took on 04/13/this year. | SELECT SUM(intakeoutput.cellvaluenumeric) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-70268')) AND intakeoutput.celllabel = 'lr iv... | eicu |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
C... | count the number of patients whose admission year is 2129 and lab test item id is 50993. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admityear < "2129" AND lab.itemid = "50993" | mimicsql_data |
CREATE TABLE table_203_60 (
id number,
"outcome" text,
"no." number,
"date" text,
"championship" text,
"surface" text,
"opponent in the final" text,
"score in the final" text
) | what were the total number of times the championship was held in italy ? | SELECT COUNT(*) FROM table_203_60 WHERE "championship" = 'italy' | squall |
CREATE TABLE table_train_165 (
"id" int,
"gender" string,
"hemoglobin_a1c_hba1c" float,
"visual_impairment" bool,
"blood_glucose" int,
"body_mass_index_bmi" float,
"a1c" float,
"age" float,
"NOUSE" float
) | male or female > 60 years of age. | SELECT * FROM table_train_165 WHERE (gender = 'male' OR gender = 'female') AND age > 60 | criteria2sql |
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... | count the number of patients whose ethnicity is black/cape verdean and days of hospital stay is greater than 10? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "BLACK/CAPE VERDEAN" AND demographic.days_stay > "10" | mimicsql_data |
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 Has_Allergy (
StuID INTEGER,
Allergy VARCHAR(20)
)
CREATE TABLE Allergy_Type (
Allergy VARCHAR(20),
... | Plot the total number by grouped by city code as a bar graph, could you list by the Y-axis in descending? | SELECT city_code, COUNT(*) FROM Student GROUP BY city_code ORDER BY COUNT(*) DESC | nvbench |
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE microlab (
microlabid number,
... | when was the last microbiological sputum, expectorated test of patient 025-44495 performed this month? | SELECT microlab.culturetakentime FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '025-44495')) AND microlab.culturesite = 'sputum, expectorated' AN... | eicu |
CREATE TABLE table_16777 (
"Race Name" text,
"Circuit" text,
"Date" text,
"Winning driver" text,
"Constructor" text,
"Report" text
) | What's the report for the Silverstone circuit? | SELECT "Report" FROM table_16777 WHERE "Circuit" = 'Silverstone' | wikisql |
CREATE TABLE table_name_42 (
college VARCHAR,
round VARCHAR,
position VARCHAR
) | Which College has a Round of 11, and a Position of wr? | SELECT college FROM table_name_42 WHERE round = 11 AND position = "wr" | sql_create_context |
CREATE TABLE university (
School_ID int,
School text,
Location text,
Founded real,
Affiliation text,
Enrollment real,
Nickname text,
Primary_conference text
)
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Per... | Return a bar chart about the distribution of ACC_Road and the sum of School_ID , and group by attribute ACC_Road, display in asc by the total number of school id. | SELECT ACC_Road, SUM(School_ID) FROM basketball_match GROUP BY ACC_Road ORDER BY SUM(School_ID) | nvbench |
CREATE TABLE table_3846 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Series" text
) | How many teams were there when chris bosh , lebron james (8) had the high rebounds? | SELECT COUNT("Team") FROM table_3846 WHERE "High rebounds" = 'Chris Bosh , LeBron James (8)' | wikisql |
CREATE TABLE table_65370 (
"Year" real,
"Competition" text,
"Venue" text,
"Position" text,
"Notes" text
) | Which Year has a Position of 2nd, and Notes of -63kg, and a Venue of manchester? | SELECT "Year" FROM table_65370 WHERE "Position" = '2nd' AND "Notes" = '-63kg' AND "Venue" = 'manchester' | 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,
... | provide the number of patients whose admission type is urgent and diagnoses short title is hyperacusis? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admission_type = "URGENT" AND diagnoses.short_title = "Hyperacusis" | mimicsql_data |
CREATE TABLE table_204_70 (
id number,
"pick #" number,
"nfl team" text,
"player" text,
"position" text,
"college" text
) | how many defensive backs are there ? | SELECT COUNT(*) FROM table_204_70 WHERE "position" = 'defensive back' | squall |
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 varchar(2)
)
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decima... | What are the job titles, and range of salaries for jobs with maximum salary between 12000 and 18000 Plot them as bar chart, and I want to list by the names from low to high. | SELECT JOB_TITLE, MAX_SALARY - MIN_SALARY FROM jobs WHERE MAX_SALARY BETWEEN 12000 AND 18000 ORDER BY JOB_TITLE | nvbench |
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 did patient 70516 last come to the hospital since 2104? | SELECT admissions.admission_type FROM admissions WHERE admissions.subject_id = 70516 AND STRFTIME('%y', admissions.admittime) >= '2104' ORDER BY admissions.admittime DESC LIMIT 1 | mimic_iii |
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,
... | 按照不同的科室编码和不同的入院诊断疾病名称,整理出医院9146406所有医疗就诊记录中患者的平均年龄是多少岁 | SELECT gwyjzb.MED_ORG_DEPT_CD, gwyjzb.IN_DIAG_DIS_NM, AVG(gwyjzb.PERSON_AGE) FROM gwyjzb WHERE gwyjzb.MED_SER_ORG_NO = '9146406' GROUP BY gwyjzb.MED_ORG_DEPT_CD, gwyjzb.IN_DIAG_DIS_NM UNION SELECT fgwyjzb.MED_ORG_DEPT_CD, fgwyjzb.IN_DIAG_DIS_NM, AVG(fgwyjzb.PERSON_AGE) FROM fgwyjzb WHERE fgwyjzb.MED_SER_ORG_NO = '91464... | 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 locations (
LOCATION_ID decimal(4,0),
STREET_ADDRESS varchar(4... | For those employees who did not have any job in the past, return a bar chart about the distribution of hire_date and the sum of department_id bin hire_date by time, and I want to display in desc by the Y-axis. | SELECT HIRE_DATE, SUM(DEPARTMENT_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) ORDER BY SUM(DEPARTMENT_ID) DESC | nvbench |
CREATE TABLE table_5126 (
"Race" text,
"Length" text,
"Class" text,
"Circuit" text,
"Date" text
) | What is the date of the Mosport Park circuit? | SELECT "Date" FROM table_5126 WHERE "Circuit" = 'mosport park' | wikisql |
CREATE TABLE table_25345002_1 (
date_of_death VARCHAR,
date_of_birth VARCHAR
) | What are the dates of death of those politicians whose date of birth 1938-08-30 30 august 1938? | SELECT COUNT(date_of_death) FROM table_25345002_1 WHERE date_of_birth = "1938-08-30 30 August 1938" | sql_create_context |
CREATE TABLE table_11803648_20 (
player VARCHAR,
round VARCHAR
) | Which player is in round 5? | SELECT player FROM table_11803648_20 WHERE round = 5 | sql_create_context |
CREATE TABLE table_name_98 (
royal_house VARCHAR,
state VARCHAR
) | Which royal house is in the state of chu? | SELECT royal_house FROM table_name_98 WHERE state = "chu" | sql_create_context |
CREATE TABLE table_24018112_1 (
frequency VARCHAR,
brand_name VARCHAR
) | What frequency does the Pentium processor use? | SELECT frequency FROM table_24018112_1 WHERE brand_name = "Pentium" | sql_create_context |
CREATE TABLE table_name_94 (
score VARCHAR,
competition VARCHAR,
date VARCHAR
) | On 15/04/07 in the competition Super League XII, what was the score? | SELECT score FROM table_name_94 WHERE competition = "super league xii" AND date = "15/04/07" | sql_create_context |
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid... | what changes have been made to the arterial bp mean in patient 14203's last measured on the first icu visit compared to the second to last value measured on the first icu visit? | SELECT (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 = 14203) AND NOT icustays.outtime IS NULL ORDER BY icustays.intime LIMIT 1) AND chartevents.item... | mimic_iii |
CREATE TABLE table_59583 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Record" text
) | What is the home team of the game with a 2-0 record? | SELECT "Home" FROM table_59583 WHERE "Record" = '2-0' | wikisql |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.