context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE Ref_Document_Types (
Document_Type_Code CHAR(15),
Document_Type_Name VARCHAR(255),
Document_Type_Description VARCHAR(255)
)
CREATE TABLE Documents_to_be_Destroyed (
Document_ID INTEGER,
Destruction_Authorised_by_Employee_ID INTEGER,
Destroyed_by_Employee_ID INTEGER,
Planned_Des... | Return a line on what are all the calendar dates and day Numbers?, and rank in descending by the X-axis. | SELECT Calendar_Date, Day_Number FROM Ref_Calendar ORDER BY Calendar_Date DESC | nvbench |
CREATE TABLE table_62326 (
"Rank" real,
"Name" text,
"Season" text,
"Club" text,
"Goals" real,
"Apps" real,
"Goals per Match" real
) | What is the lowest rank that has goals per match less than 1.237, real madrid as the club, goals less than 53, with apps greater than 40? | SELECT MIN("Rank") FROM table_62326 WHERE "Goals per Match" < '1.237' AND "Club" = 'real madrid' AND "Goals" < '53' AND "Apps" > '40' | wikisql |
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId number,
UserId number,
CreationDate time,
BountyAmount number
)
CREATE TABLE Comments (
Id number,
PostId number,
Score number,
Text text,
CreationDate time,
UserDisplayName text,
UserId number,
ContentLic... | X reoccurs with Tag, post count. | SELECT reoccurs.TagName AS reoccurs, 'WITH' AS presence, '##occurs:string##' AS occurs, COUNT(DISTINCT Posts.Id) AS nposts FROM Tags AS reoccurs, Posts, PostTags AS ptri WHERE Posts.Id = ptri.PostId AND ptri.TagId = reoccurs.Id AND '##occurs:string##' IN (SELECT TagName FROM Tags AS occurs, PostTags AS pti WHERE occurs... | sede |
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... | what is the number of patients whose primary disease is complete heart block and year of birth is less than 2200? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "COMPLETE HEART BLOCK" AND demographic.dob_year < "2200" | mimicsql_data |
CREATE TABLE Courses (
course_id VARCHAR(100),
course_name VARCHAR(120),
course_description VARCHAR(255),
other_details VARCHAR(255)
)
CREATE TABLE Candidates (
candidate_id INTEGER,
candidate_details VARCHAR(255)
)
CREATE TABLE People_Addresses (
person_address_id INTEGER,
person_id I... | Bar graph to show the number of last name from different last name, and I want to order in ascending by the bar. | SELECT last_name, COUNT(last_name) FROM People GROUP BY last_name ORDER BY last_name | nvbench |
CREATE TABLE table_67050 (
"Quarter" text,
"Score" text,
"Club" text,
"Opponent" text,
"Year" text,
"Round" text,
"Venue" text
) | Which opponent has a Club of essendon, and a Score of 13.4.82? | SELECT "Opponent" FROM table_67050 WHERE "Club" = 'essendon' AND "Score" = '13.4.82' | wikisql |
CREATE TABLE party_host (
Party_ID int,
Host_ID int,
Is_Main_in_Charge bool
)
CREATE TABLE host (
Host_ID int,
Name text,
Nationality text,
Age text
)
CREATE TABLE party (
Party_ID int,
Party_Theme text,
Location text,
First_year text,
Last_year text,
Number_of_host... | Display a pie chart for how many hosts does each nationality have? List the nationality and the count. | SELECT Nationality, COUNT(*) FROM host GROUP BY Nationality | nvbench |
CREATE TABLE table_25428629_1 (
opponent VARCHAR,
location VARCHAR
) | If the location is Yangon, Myanmar, what is the opponent total number? | SELECT COUNT(opponent) FROM table_25428629_1 WHERE location = "Yangon, Myanmar" | sql_create_context |
CREATE TABLE table_13696 (
"Season" text,
"Teams" real,
"Minor Ladder Position" text,
"Finals Qualification" text,
"Final Ladder Position" text,
"ACL Qualification" text,
"ACL Placing" text
) | What is the total teams during the 2012-13 season? | SELECT SUM("Teams") FROM table_13696 WHERE "Season" = '2012-13' | wikisql |
CREATE TABLE flight (
flno number(4,0),
origin varchar2(20),
destination varchar2(20),
distance number(6,0),
departure_date date,
arrival_date date,
price number(7,2),
aid number(9,0)
)
CREATE TABLE certificate (
eid number(9,0),
aid number(9,0)
)
CREATE TABLE employee (
ei... | Draw a bar chart for what are the destinations and number of flights to each one?, I want to list from high to low by the Y-axis. | SELECT destination, COUNT(*) FROM flight GROUP BY destination ORDER BY COUNT(*) DESC | nvbench |
CREATE TABLE table_name_92 (
score VARCHAR,
country VARCHAR
) | What score has south africa as the country? | SELECT score FROM table_name_92 WHERE country = "south africa" | sql_create_context |
CREATE TABLE table_203_559 (
id number,
"no." number,
"name" text,
"took office" text,
"left office" text,
"president served under" text,
"notable for" text
) | how many commissioners served under calvin coolidge ? | SELECT COUNT("name") FROM table_203_559 WHERE "president served under" = 'calvin coolidge' | squall |
CREATE TABLE table_31968 (
"Heat Rank" real,
"Lane" real,
"Swimmer" text,
"Country" text,
"Time" real,
"Overall Rank" text
) | For how long did Bolivia have a lane greater than 6? | SELECT COUNT("Time") FROM table_31968 WHERE "Country" = 'bolivia' AND "Lane" > '6' | wikisql |
CREATE TABLE table_name_12 (
try_bonus VARCHAR,
club VARCHAR
) | What is the try bonus for ynysybwl rfc? | SELECT try_bonus FROM table_name_12 WHERE club = "ynysybwl rfc" | sql_create_context |
CREATE TABLE table_75443 (
"Game" real,
"December" real,
"Opponent" text,
"Score" text,
"Record" text,
"Points" real
) | Which Game has a Score of 4 1? | SELECT SUM("Game") FROM table_75443 WHERE "Score" = '4–1' | wikisql |
CREATE TABLE table_name_7 (
position VARCHAR,
losses VARCHAR,
wins VARCHAR,
goals_against VARCHAR
) | How many positions have 14 wins, goals against of 61 and fewer than 19 losses? | SELECT COUNT(position) FROM table_name_7 WHERE wins = 14 AND goals_against = 61 AND losses < 19 | sql_create_context |
CREATE TABLE table_20396710_1 (
drawn VARCHAR
) | when points against is points again, which are the drawn? | SELECT drawn FROM table_20396710_1 WHERE "points_against" = "points_against" | sql_create_context |
CREATE TABLE table_203_735 (
id number,
"rd" number,
"pick" number,
"player" text,
"position" text,
"school" text
) | how many players were from notre dame ? | SELECT COUNT("player") FROM table_203_735 WHERE "school" = 'notre dame' | squall |
CREATE TABLE table_44305 (
"Rank" real,
"Country" text,
"Miss United Continent" real,
"Virreina" real,
"1st RU" real,
"2nd RU" real,
"3rd RU" real,
"4th RU" real,
"Semifinalists" real,
"Total" real
) | How many semifinalists had a total less than 2, 1st RU greater than 0, 2nd RU was 0 and Miss United Continent of 0? | SELECT COUNT("Semifinalists") FROM table_44305 WHERE "Miss United Continent" = '0' AND "2nd RU" = '0' AND "1st RU" > '0' AND "Total" < '2' | wikisql |
CREATE TABLE race (
name VARCHAR,
date VARCHAR,
track_id VARCHAR
)
CREATE TABLE track (
name VARCHAR,
track_id VARCHAR
) | Show the name and date for each race and its track name. | SELECT T1.name, T1.date, T2.name FROM race AS T1 JOIN track AS T2 ON T1.track_id = T2.track_id | sql_create_context |
CREATE TABLE table_name_86 (
position VARCHAR,
team VARCHAR,
college VARCHAR
) | Name the position that has baltimore bullets and college of texas tech | SELECT position FROM table_name_86 WHERE team = "baltimore bullets" AND college = "texas tech" | sql_create_context |
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid number,
wardid number,
admissionheight number,
admissionweight number,
dischargeweight number,
hospitaladmittime time,
... | when did patient 027-178495 take an intake for the last time until 230 days ago? | SELECT intakeoutput.intakeoutputtime FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '027-178495')) AND intakeoutput.cellpath LIKE '%intake... | eicu |
CREATE TABLE table_11208143_9 (
capacity INTEGER,
stadium VARCHAR
) | What is Pittodrie Stadium's maximum capacity? | SELECT MAX(capacity) FROM table_11208143_9 WHERE stadium = "Pittodrie" | sql_create_context |
CREATE TABLE broadcast (
channel_id number,
program_id number,
time_of_day text
)
CREATE TABLE broadcast_share (
channel_id number,
program_id number,
date text,
share_in_percent number
)
CREATE TABLE channel (
channel_id number,
name text,
owner text,
share_in_percent numb... | Which program is broadcast most frequently? Give me the program name. | SELECT t1.name FROM program AS t1 JOIN broadcast AS t2 ON t1.program_id = t2.program_id GROUP BY t2.program_id ORDER BY COUNT(*) DESC LIMIT 1 | spider |
CREATE TABLE ReviewTaskStates (
Id number,
Name text,
Description text
)
CREATE TABLE Users (
Id number,
Reputation number,
CreationDate time,
DisplayName text,
LastAccessDate time,
WebsiteUrl text,
Location text,
AboutMe text,
Views number,
UpVotes number,
DownV... | Get posts starting with '-1'. | SELECT Id AS "post_link" FROM Posts WHERE 'body' LIKE '<p>-1 %' | sede |
CREATE TABLE has_allergy (
stuid number,
allergy text
)
CREATE TABLE student (
stuid number,
lname text,
fname text,
age number,
sex text,
major number,
advisor number,
city_code text
)
CREATE TABLE allergy_type (
allergy text,
allergytype text
) | Which allergy type has most number of allergies? | SELECT allergytype FROM allergy_type GROUP BY allergytype ORDER BY COUNT(*) DESC LIMIT 1 | spider |
CREATE TABLE table_24906653_5 (
field_goals VARCHAR,
player VARCHAR
) | How many long range shots did tonya edwards make. | SELECT COUNT(field_goals) FROM table_24906653_5 WHERE player = "Tonya Edwards" | sql_create_context |
CREATE TABLE table_59413 (
"Year" text,
"Result" text,
"Matches" text,
"Wins" text,
"Draws" text,
"Losses" text
) | What year was the result did not qualify? | SELECT "Year" FROM table_59413 WHERE "Result" = 'did not qualify' | wikisql |
CREATE TABLE t_kc24 (
ACCOUNT_DASH_DATE time,
ACCOUNT_DASH_FLG number,
CASH_PAY number,
CIVIL_SUBSIDY number,
CKC102 number,
CLINIC_ID text,
CLINIC_SLT_DATE time,
COMP_ID text,
COM_ACC_PAY number,
COM_PAY number,
DATA_ID text,
ENT_ACC_PAY number,
ENT_PAY number,
F... | 分别在哪几家医院患者钱婉娜被开出过编码为814113的药品? | SELECT t_kc21.MED_SER_ORG_NO FROM t_kc21 WHERE t_kc21.PERSON_NM = '钱婉娜' AND t_kc21.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.SOC_SRT_DIRE_CD = '814113') | css |
CREATE TABLE table_name_47 (
champion VARCHAR,
location VARCHAR,
semi_finalist__number2 VARCHAR
) | Which champion was from the location of Morrisville, NC, and whose SemiFinalist #2 of Clemson? | SELECT champion FROM table_name_47 WHERE location = "morrisville, nc" AND semi_finalist__number2 = "clemson" | sql_create_context |
CREATE TABLE aircraft (
aircraft_code varchar,
aircraft_description varchar,
manufacturer varchar,
basic_type varchar,
engines int,
propulsion varchar,
wide_body varchar,
wing_span int,
length int,
weight int,
capacity int,
pay_load int,
cruising_speed int,
range_... | does dl stand for DL | SELECT DISTINCT airline_code FROM airline WHERE airline_code = 'DL' AND airline_name LIKE 'DELTA' | atis |
CREATE TABLE table_20214 (
"Date" text,
"Cover model" text,
"Centerfold model" text,
"Interview subject" text,
"20 Questions" text,
"Pictorials" text
) | Who was the interview subject in the 2-86 issue? | SELECT "Interview subject" FROM table_20214 WHERE "Date" = '2-86' | wikisql |
CREATE TABLE person_info (
CSD text,
CSRQ time,
GJDM text,
GJMC text,
JGDM text,
JGMC text,
MZDM text,
MZMC text,
RYBH text,
XBDM number,
XBMC text,
XLDM text,
XLMC text,
XM text,
ZYLBDM text,
ZYMC text
)
CREATE TABLE jyjgzbb (
BGDH text,
BGRQ tim... | 哪些人被门诊诊断为慢性龈炎?并列举出这些的患者的籍贯代码、名称以及相应人数 | SELECT person_info.JGDM, person_info.JGMC, COUNT(person_info.RYBH) FROM person_info JOIN hz_info JOIN txmzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = txmzjzjlb.YLJGDM AND hz_info.KH = txmzjzjlb.KH AND hz_info.KLX = txmzjzjlb.KLX WHERE txmzjzjlb.JZZDSM = '慢性龈炎' GROUP BY person_info.JGDM UNION SELECT pe... | css |
CREATE TABLE table_name_47 (
average VARCHAR,
matches VARCHAR
) | What is the average when the matches are 11? | SELECT average FROM table_name_47 WHERE matches = "11" | sql_create_context |
CREATE TABLE table_74914 (
"Pick #" real,
"Round" text,
"Player" text,
"Position" text,
"College" text
) | What Player is a Wide Receiver? | SELECT "Player" FROM table_74914 WHERE "Position" = 'wide receiver' | wikisql |
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId number,
UserId number,
CreationDate time,
BountyAmount number
)
CREATE TABLE Users (
Id number,
Reputation number,
CreationDate time,
DisplayName text,
LastAccessDate time,
WebsiteUrl text,
Location text,
... | Answer score distribution for a user. Returns the (log 10 of the) distribution of the scores for a given user's answers. | SELECT Score, COUNT(*) FROM Posts WHERE OwnerUserId = '##UserId##' AND PostTypeId = 2 GROUP BY Score ORDER BY Score | sede |
CREATE TABLE PostsWithDeleted (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body text,
OwnerUserId number,
OwnerDisplayName text,
LastEditorUserId number,
LastEditorDispl... | Python Web Framework Trends (# Questions per Tag per Month). | SELECT DATEADD(mm, (YEAR(Posts.CreationDate) - 1900) * 12 + MONTH(Posts.CreationDate) - 1, 0) AS Month, Tags.TagName, COUNT(*) AS Questions FROM Tags LEFT JOIN PostTags ON PostTags.TagId = Tags.Id LEFT JOIN Posts ON Posts.Id = PostTags.PostId LEFT JOIN PostTypes ON PostTypes.Id = Posts.PostTypeId WHERE Tags.TagName IN ... | sede |
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime t... | what was the last value of a lab test of bedside glucose since 31 months ago for patient 011-55939? | SELECT lab.labresult FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '011-55939')) AND lab.labname = 'bedside glucose' AND DATETIME(lab.labresulttime) >= DAT... | eicu |
CREATE TABLE table_204_238 (
id number,
"#" number,
"title" text,
"producer(s)" text,
"performer (s)" text,
"time" text
) | how many tracks last for more than three minutes ? | SELECT COUNT("title") FROM table_204_238 WHERE "time" >= 3 | squall |
CREATE TABLE table_name_17 (
laps INTEGER,
qual VARCHAR
) | How many laps resulted from a Qual of 165.229? | SELECT MAX(laps) FROM table_name_17 WHERE qual = "165.229" | sql_create_context |
CREATE TABLE table_name_28 (
stadium VARCHAR,
week INTEGER
) | What was the stadium that held that game after week 15? | SELECT stadium FROM table_name_28 WHERE week > 15 | sql_create_context |
CREATE TABLE table_269888_1 (
area__km²_ VARCHAR,
population__2010_ VARCHAR
) | Name the area for population of 53542 | SELECT area__km²_ FROM table_269888_1 WHERE population__2010_ = 53542 | sql_create_context |
CREATE TABLE table_65412 (
"Region" text,
"Date" text,
"Format" text,
"Label" text,
"Edition" text
) | When did Avex Entertainment release a CD? | SELECT "Date" FROM table_65412 WHERE "Format" = 'cd' AND "Label" = 'avex entertainment' | wikisql |
CREATE TABLE table_name_63 (
venue VARCHAR,
date VARCHAR
) | Where was the 05/09/1973 venue? | SELECT venue FROM table_name_63 WHERE date = "05/09/1973" | sql_create_context |
CREATE TABLE table_73907 (
"Municipality" text,
"No. of Barangays" real,
"Area (km\u00b2)" text,
"Population (2010)" real,
"Pop. density (per km\u00b2)" text,
"Income Class (2004)" text
) | List the population density per kilometer for the city of abra de ilog. | SELECT "Pop. density (per km\u00b2)" FROM table_73907 WHERE "Municipality" = 'Abra de Ilog' | wikisql |
CREATE TABLE table_39403 (
"Round" real,
"Pick #" real,
"Overall" real,
"Name" text,
"Position" text,
"College" text
) | How many picks have an Overall of 114? | SELECT COUNT("Pick #") FROM table_39403 WHERE "Overall" = '114' | wikisql |
CREATE TABLE person_info (
CSD text,
CSRQ time,
GJDM text,
GJMC text,
JGDM text,
JGMC text,
MZDM text,
MZMC text,
RYBH text,
XBDM number,
XBMC text,
XLDM text,
XLMC text,
XM text,
ZYLBDM text,
ZYMC text
)
CREATE TABLE jybgb (
BBCJBW text,
BBDM tex... | 医院5070509有多少科室在门诊就诊中开出不少于26张检验报告单在2012年3月19日到2015年7月19日期间内? | SELECT COUNT(*) FROM (SELECT jybgb.KSBM FROM mzjzjlb JOIN jybgb JOIN mzjzjlb_jybgb ON mzjzjlb.YLJGDM = mzjzjlb_jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND mzjzjlb_jybgb.YLJGDM = jybgb.YLJGDM AND mzjzjlb_jybgb.BGDH = jybgb.BGDH AND mzjzjlb_jybgb.YLJGDM = jybgb.YLJGDM AND mzjzjlb_jybgb.BGDH = jybgb.B... | css |
CREATE TABLE table_name_50 (
character VARCHAR,
actor_actress VARCHAR
) | What character did actor Damien Richardson play? | SELECT character FROM table_name_50 WHERE actor_actress = "damien richardson" | sql_create_context |
CREATE TABLE table_name_64 (
city_of_license VARCHAR,
call_sign VARCHAR
) | Which City of license has a Call sign of w220ba? | SELECT city_of_license FROM table_name_64 WHERE call_sign = "w220ba" | sql_create_context |
CREATE TABLE table_name_38 (
total_score_week VARCHAR,
status VARCHAR,
scores_by_each_individual_judge VARCHAR
) | Which Total score/week has a Status of eliminated, and Scores by each individual judge of 5 + 5 + 4 = 14? | SELECT total_score_week FROM table_name_38 WHERE status = "eliminated" AND scores_by_each_individual_judge = 5 + 5 + 4 = 14 | sql_create_context |
CREATE TABLE table_25635 (
"Season" text,
"Junior (South) Winners" text,
"Intermediate (South) Winners" text,
"Minor (South) Winners" text,
"Primary (South) Winners" text
) | What isthe minor (South) winners total number is the primary (South) winners is Mendip Gate? | SELECT COUNT("Minor (South) Winners") FROM table_25635 WHERE "Primary (South) Winners" = 'Mendip Gate' | wikisql |
CREATE TABLE table_name_80 (
result VARCHAR,
year VARCHAR,
awards VARCHAR
) | What was the result at the Berlin International Film Festival in a year greater than 1987? | SELECT result FROM table_name_80 WHERE year > 1987 AND awards = "berlin international film festival" | sql_create_context |
CREATE TABLE table_225205_4 (
successor VARCHAR,
reason_for_change VARCHAR
) | Who is the successor when the reason for change is died November 11, 1845? | SELECT successor FROM table_225205_4 WHERE reason_for_change = "Died November 11, 1845" | sql_create_context |
CREATE TABLE table_24938621_3 (
no VARCHAR,
written_by VARCHAR
) | What episode number was written by Gregg Hurwitz? | SELECT no FROM table_24938621_3 WHERE written_by = "Gregg Hurwitz" | sql_create_context |
CREATE TABLE table_76357 (
"Year of release" real,
"Title" text,
"Label" text,
"Format" text,
"Cat. No." text
) | What is the total year of release of the title what goes around comes around? | SELECT COUNT("Year of release") FROM table_76357 WHERE "Title" = 'what goes around comes around' | wikisql |
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 d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE... | what was the four most commonly carried out specimen tests until 2103? | SELECT t1.spec_type_desc FROM (SELECT microbiologyevents.spec_type_desc, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM microbiologyevents WHERE STRFTIME('%y', microbiologyevents.charttime) <= '2103' GROUP BY microbiologyevents.spec_type_desc) AS t1 WHERE t1.c1 <= 4 | mimic_iii |
CREATE TABLE table_59416 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text
) | Which golfer finished with a score of 70-71=141? | SELECT "Player" FROM table_59416 WHERE "Score" = '70-71=141' | wikisql |
CREATE TABLE PostLinks (
Id number,
CreationDate time,
PostId number,
RelatedPostId number,
LinkTypeId number
)
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
RejectionReasonId number,
Comment text
)
CREATE... | Questions with a specific tag. | SELECT p.Id AS "post_link", p.Title FROM Posts AS p LEFT JOIN PostTags AS pt ON p.Id = pt.PostId LEFT JOIN Tags AS t ON pt.TagId = t.Id LEFT JOIN PostTags AS pt2 ON p.Id = pt2.PostId LEFT JOIN Tags AS t2 ON pt2.TagId = t2.Id WHERE PostTypeId = 1 AND t.TagName = 'raw' AND t2.TagName = '##tag:string##' ORDER BY ViewCount... | sede |
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 scatter chart about the correlation between manufacturer and revenue , and group by attribute headquarter. | SELECT Manufacturer, Revenue FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter | nvbench |
CREATE TABLE table_name_16 (
week VARCHAR,
finalist VARCHAR
) | what is the week when the finalist is marcelo r os? | SELECT week FROM table_name_16 WHERE finalist = "marcelo ríos" | sql_create_context |
CREATE TABLE transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
eventtype text,
careunit text,
wardid number,
intime time,
outtime time
)
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
... | did the last serology/blood microbiology test of patient 8005 until 2104 show any organism? | SELECT COUNT(*) > 0 FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 8005) AND microbiologyevents.spec_type_desc = 'serology/blood' AND NOT microbiologyevents.org_name IS NULL AND STRFTIME('%y', microbiologyevents.charttime) <= '2104' O... | mimic_iii |
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,
... | 患有疾病M60.726的患者的在确诊时其D2聚体(柠檬酸盐)的含量参考值范围的下限与上限的数值都是多少? | SELECT jyjgzbb.CKZFWXX, jyjgzbb.CKZFWSX FROM mzjzjlb JOIN zyjybgb JOIN jyjgzbb ON mzjzjlb.YLJGDM = zyjybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = zyjybgb.JZLSH_MZJZJLB AND zyjybgb.YLJGDM = jyjgzbb.YLJGDM AND zyjybgb.BGDH = jyjgzbb.BGDH WHERE mzjzjlb.JZZDBM = 'M60.726' AND jyjgzbb.JCZBMC = 'D2聚体(柠檬酸盐)' UNION SELECT jyjgzbb.... | css |
CREATE TABLE table_9245 (
"Official Name" text,
"Status" text,
"Area km 2" real,
"Population" real,
"Census Ranking" text
) | What is the status for Pointe-Verte, with a population smaller than 1,137? | SELECT "Status" FROM table_9245 WHERE "Population" < '1,137' AND "Official Name" = 'pointe-verte' | wikisql |
CREATE TABLE Customer_Payments (
customer_id INTEGER,
datetime_payment DATETIME,
payment_method_code VARCHAR(10),
amount_payment DOUBLE
)
CREATE TABLE Vehicles (
vehicle_id INTEGER,
vehicle_details VARCHAR(255)
)
CREATE TABLE Addresses (
address_id INTEGER,
line_1_number_building VARCH... | Show the total number from each payment method code, show in desc by the bar. | SELECT payment_method_code, COUNT(*) FROM Customer_Payments GROUP BY payment_method_code ORDER BY payment_method_code DESC | nvbench |
CREATE TABLE table_name_89 (
artist VARCHAR,
theme VARCHAR
) | What artist's song was performed in the week with theme of Billboard #1? | SELECT artist FROM table_name_89 WHERE theme = "billboard #1" | sql_create_context |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,... | how many patients whose year of birth is less than 2200 and item id is 50882? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dob_year < "2200" AND lab.itemid = "50882" | mimicsql_data |
CREATE TABLE table_name_18 (
date VARCHAR,
home_team VARCHAR
) | What date was the Home team fitzroy? | SELECT date FROM table_name_18 WHERE home_team = "fitzroy" | sql_create_context |
CREATE TABLE table_73059 (
"Province" text,
"Capital" text,
"Area (km\u00b2)" text,
"Population" real,
"Density" real,
"Map region" real
) | when province is monse or nouel, what is the area (km )? | SELECT "Area (km\u00b2)" FROM table_73059 WHERE "Province" = 'Monseñor Nouel' | wikisql |
CREATE TABLE table_27755784_11 (
high_rebounds VARCHAR,
game VARCHAR
) | Name the high rebounds for 77 game | SELECT high_rebounds FROM table_27755784_11 WHERE game = 77 | sql_create_context |
CREATE TABLE table_26428602_1 (
absorb__nm_ INTEGER
) | What is the lowest dye absoprtion in nm? | SELECT MIN(absorb__nm_) FROM table_26428602_1 | sql_create_context |
CREATE TABLE person_info (
CSD text,
CSRQ time,
GJDM text,
GJMC text,
JGDM text,
JGMC text,
MZDM text,
MZMC text,
RYBH text,
XBDM number,
XBMC text,
XLDM text,
XLMC text,
XM text,
ZYLBDM text,
ZYMC text
)
CREATE TABLE jyjgzbb (
BGDH text,
BGRQ tim... | 之前,患者葛和悦的住院诊断情况如何? | SELECT wdmzjzjlb.ZYZDBM, wdmzjzjlb.ZYZDMC FROM person_info JOIN hz_info JOIN wdmzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX WHERE person_info.XM = '葛和悦' UNION SELECT bdmzjzjlb.ZYZDBM, bdmzjzjlb.ZYZDMC FROM person_info JOIN... | css |
CREATE TABLE table_38784 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Attendance" text,
"Record" text
) | What is the date of the game with 38,062 people in attendance? | SELECT "Date" FROM table_38784 WHERE "Attendance" = '38,062' | wikisql |
CREATE TABLE table_name_2 (
hosts VARCHAR,
year VARCHAR
) | Who are the hosts for the 2004 event? | SELECT hosts FROM table_name_2 WHERE year = "2004" | sql_create_context |
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_labitems (
row_id number,
itemid number,
label te... | what was the time patient 89840 was discharged from the hospital for the last time until 2104? | SELECT admissions.dischtime FROM admissions WHERE admissions.subject_id = 89840 AND STRFTIME('%y', admissions.dischtime) <= '2104' ORDER BY admissions.dischtime DESC LIMIT 1 | mimic_iii |
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, draw a bar chart about the distribution of headquarter and the average of price , and group by attribute headquarter, and sort bars from high to low order. | SELECT Headquarter, AVG(Price) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter ORDER BY Headquarter DESC | nvbench |
CREATE TABLE table_28742659_2 (
immunity VARCHAR,
finish VARCHAR
) | What is the name of immunity when the finish is 3rd voted out day 9? | SELECT immunity FROM table_28742659_2 WHERE finish = "3rd voted Out Day 9" | sql_create_context |
CREATE TABLE table_name_66 (
population INTEGER,
place VARCHAR,
code VARCHAR,
area__km_2__ VARCHAR
) | What is the Population of Tshepiso with a Code of 70409 or smaller and an Area (km 2) smaller than 5.97? | SELECT MIN(population) FROM table_name_66 WHERE code < 70409 AND area__km_2__ < 5.97 AND place = "tshepiso" | sql_create_context |
CREATE TABLE customer (
cust_ID varchar(3),
cust_name varchar(20),
acc_type char(1),
acc_bal int,
no_of_loans int,
credit_score int,
branch_ID int,
state varchar(20)
)
CREATE TABLE bank (
branch_ID int,
bname varchar(20),
no_of_customers int,
city varchar(10),
state ... | For each account type, find the average account balance of customers with credit score lower than 50 Show bar chart, show by the y-axis in ascending. | SELECT acc_type, AVG(acc_bal) FROM customer WHERE credit_score < 50 GROUP BY acc_type ORDER BY AVG(acc_bal) | nvbench |
CREATE TABLE table_2190919_1 (
top_10 VARCHAR,
avg_finish VARCHAR
) | How many teams finished in the top team with an average finish of 23.3? | SELECT COUNT(top_10) FROM table_2190919_1 WHERE avg_finish = "23.3" | sql_create_context |
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime... | when was the first time that patient 022-61539 got a output amt-blake drain c output since 1074 days ago? | SELECT intakeoutput.intakeoutputtime FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '022-61539')) AND intakeoutput.cellpath LIKE '%output%... | eicu |
CREATE TABLE table_204_184 (
id number,
"#" number,
"title" text,
"producer(s)" text,
"featured guest(s)" text,
"length" text
) | how many tracks are listed in this table ? | SELECT COUNT("title") FROM table_204_184 | squall |
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... | Which prerequisites have I already completed for ASIAN 539 ? | SELECT DISTINCT COURSE_0.department, COURSE_0.name, COURSE_0.number FROM course AS COURSE_0, course AS COURSE_1, course_prerequisite, student_record WHERE COURSE_0.course_id = course_prerequisite.pre_course_id AND COURSE_1.course_id = course_prerequisite.course_id AND COURSE_1.department = 'ASIAN' AND COURSE_1.number =... | advising |
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 ... | when did patient 24547 since 2132 days ago had chest tube #1 output for the first time? | SELECT outputevents.charttime FROM outputevents WHERE outputevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 24547)) AND outputevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'ches... | mimic_iii |
CREATE TABLE table_13706 (
"Outcome" text,
"Date" text,
"Tournament" text,
"Surface" text,
"Opponent in the final" text,
"Score in the final" text
) | What is the score in the final of the tournament with a hard surface? | SELECT "Score in the final" FROM table_13706 WHERE "Surface" = 'hard' | wikisql |
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime t... | how much is the bone fracture(s) - sternum diagnostic cost? | SELECT DISTINCT cost.cost FROM cost WHERE cost.eventtype = 'diagnosis' AND cost.eventid IN (SELECT diagnosis.diagnosisid FROM diagnosis WHERE diagnosis.diagnosisname = 'bone fracture(s) - sternum') | eicu |
CREATE TABLE t_kc21 (
MED_CLINIC_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
COMP_ID text,
PERSON_ID text,
PERSON_NM text,
IDENTITY_CARD text,
SOC_SRT_CARD text,
PERSON_SEX number,
PERSON_AGE number,
IN_HOSP_DATE time,
OUT_HOSP_DATE time,
DIFF_PLACE_FLG numb... | 大病支付金额在医疗就诊02828086375中是多少钱? | SELECT ILL_PAY FROM t_kc24 WHERE MED_CLINIC_ID = '02828086375' | css |
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... | 从20年10月22日到21年8月10日病患袁项明的住院次数是多少次啊? | SELECT COUNT(*) FROM gwyjzb WHERE gwyjzb.PERSON_NM = '袁项明' AND gwyjzb.IN_HOSP_DATE BETWEEN '2020-10-22' AND '2021-08-10' AND gwyjzb.CLINIC_TYPE = '住院' UNION SELECT COUNT(*) FROM fgwyjzb WHERE fgwyjzb.PERSON_NM = '袁项明' AND fgwyjzb.IN_HOSP_DATE BETWEEN '2020-10-22' AND '2021-08-10' AND fgwyjzb.CLINIC_TYPE = '住院' | css |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
C... | provide the number of patients whose ethnicity is white and diagnoses long title is personal history of hodgkin's disease? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.ethnicity = "WHITE" AND diagnoses.long_title = "Personal history of hodgkin's disease" | mimicsql_data |
CREATE TABLE table_17708 (
"Club" text,
"Overall Record" text,
"Goals For" real,
"Goals For Avg." text,
"Goals Against" real,
"Goals Against Avg." text
) | The Kansas City Wizards had a 9-10-9 record and what goals against avg? | SELECT "Goals Against Avg." FROM table_17708 WHERE "Overall Record" = '9-10-9' | wikisql |
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,
... | 有多少木丹颗粒的检查记录在这个医疗机构1885024? | SELECT COUNT(*) FROM gwyjzb JOIN t_kc22 ON gwyjzb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gwyjzb.MED_SER_ORG_NO = '1885024' AND t_kc22.SOC_SRT_DIRE_NM = '木丹颗粒' UNION SELECT COUNT(*) FROM fgwyjzb JOIN t_kc22 ON fgwyjzb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE fgwyjzb.MED_SER_ORG_NO = '1885024' AND t_kc22.SOC_SRT_DI... | css |
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,... | For all employees who have the letters D or S in their first name, return a bar chart about the distribution of hire_date and the average of manager_id bin hire_date by weekday, display Y-axis in desc order. | SELECT HIRE_DATE, AVG(MANAGER_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' ORDER BY AVG(MANAGER_ID) DESC | nvbench |
CREATE TABLE table_name_25 (
elevated VARCHAR,
cardinalatial_title VARCHAR
) | What's listed for the Elevated with a Cardinalatial title of Priest of S. Eusebio and Archbishop of Benevento? | SELECT elevated FROM table_name_25 WHERE cardinalatial_title = "priest of s. eusebio and archbishop of benevento" | sql_create_context |
CREATE TABLE table_name_98 (
attendance INTEGER,
visitor VARCHAR
) | Name the least attendance with visitor of edmonton | SELECT MIN(attendance) FROM table_name_98 WHERE visitor = "edmonton" | sql_create_context |
CREATE TABLE flight_leg (
flight_id int,
leg_number int,
leg_flight int
)
CREATE TABLE date_day (
month_number int,
day_number int,
year int,
day_name varchar
)
CREATE TABLE food_service (
meal_code text,
meal_number int,
compartment text,
meal_description varchar
)
CREATE... | show me what fare codes symbols stand for | SELECT DISTINCT fare_basis_code FROM fare_basis | atis |
CREATE TABLE table_name_82 (
group VARCHAR,
distance VARCHAR
) | What group has 1200 m as the distance? | SELECT group FROM table_name_82 WHERE distance = "1200 m" | sql_create_context |
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime... | has patient 027-68991 visited an emergency room until 2104? | SELECT COUNT(*) > 0 FROM patient WHERE patient.uniquepid = '027-68991' AND patient.hospitaladmitsource = 'emergency department' AND STRFTIME('%y', patient.unitadmittime) <= '2104' | eicu |
CREATE TABLE table_name_54 (
location_attendance VARCHAR,
record VARCHAR
) | What was the location and attendance at the game when the record was 9-6? | SELECT location_attendance FROM table_name_54 WHERE record = "9-6" | sql_create_context |
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
LOCATION_ID decimal(4,0)
)
CREATE TABLE locations (
LOCATION_ID decimal(4,0),
STREET_ADDRESS varchar(40)... | For those employees who do not work in departments with managers that have ids between 100 and 200, return a bar chart about the distribution of hire_date and the average of department_id bin hire_date by weekday, list in asc by the y axis. | SELECT HIRE_DATE, AVG(DEPARTMENT_ID) FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY AVG(DEPARTMENT_ID) | nvbench |
CREATE TABLE student (
stu_num number,
stu_lname text,
stu_fname text,
stu_init text,
stu_dob time,
stu_hrs number,
stu_class text,
stu_gpa number,
stu_transfer number,
dept_code text,
stu_phone text,
prof_num number
)
CREATE TABLE department (
dept_code text,
de... | What is the number of professors who are in the Accounting or Biology departments? | SELECT COUNT(*) FROM professor AS T1 JOIN department AS T2 ON T1.dept_code = T2.dept_code WHERE T2.dept_name = 'Accounting' OR T2.dept_name = 'Biology' | spider |
CREATE TABLE table_42891 (
"Date" text,
"Tournament" text,
"Surface" text,
"Opponent in the final" text,
"Score" text
) | Which Tournament was on 2 October 2006? | SELECT "Tournament" FROM table_42891 WHERE "Date" = '2 october 2006' | wikisql |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.