context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE table_78952 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text
) | Who placed t5 and had a score of 70-72=142? | SELECT "Player" FROM table_78952 WHERE "Place" = 't5' AND "Score" = '70-72=142' | wikisql |
CREATE TABLE table_41414 (
"Club" text,
"Position in 2013" text,
"First season" real,
"First season of current spell" real,
"Number of seasons in Superettan" real,
"Number of seasons in second tier" real
) | Which First season of current spell is the highest one that has a Position in 2013 of 9th, and a Number of seasons in second tier larger than 14? | SELECT MAX("First season of current spell") FROM table_41414 WHERE "Position in 2013" = '9th' AND "Number of seasons in second tier" > '14' | wikisql |
CREATE TABLE table_23239946_3 (
driver VARCHAR,
points VARCHAR
) | How many drivers have 1942 points? | SELECT COUNT(driver) FROM table_23239946_3 WHERE points = 1942 | sql_create_context |
CREATE TABLE table_name_9 (
seats INTEGER,
_percentage_votes VARCHAR,
change VARCHAR,
party VARCHAR
) | How many seats does the party of others have with a change of -1 and more than 0% votes? | SELECT SUM(seats) FROM table_name_9 WHERE change = -1 AND party = "others" AND _percentage_votes > 0 | sql_create_context |
CREATE TABLE table_name_47 (
runner_s__up VARCHAR,
date VARCHAR
) | What is Runner(s)-up, when Date is 21 Jan 2007? | SELECT runner_s__up FROM table_name_47 WHERE date = "21 jan 2007" | sql_create_context |
CREATE TABLE song (
song_name varchar2(50),
artist_name varchar2(50),
country varchar2(20),
f_id number(10),
genre_is varchar2(20),
rating number(10),
languages varchar2(20),
releasedate Date,
resolution number(10)
)
CREATE TABLE artist (
artist_name varchar2(50),
country va... | Return a bar chart on what are the names of all genres in alphabetical order, combined with its ratings? | SELECT g_name, rating FROM genre ORDER BY g_name | nvbench |
CREATE TABLE table_21091145_1 (
opponents VARCHAR,
game VARCHAR
) | Name the opponents for game 5 | SELECT opponents FROM table_21091145_1 WHERE game = 5 | sql_create_context |
CREATE TABLE table_19897294_16 (
original_air_date VARCHAR,
family_families VARCHAR
) | Name the original air date for the potter family | SELECT original_air_date FROM table_19897294_16 WHERE family_families = "The Potter Family" | sql_create_context |
CREATE TABLE table_19498 (
"Pick #" real,
"NFL Team" text,
"Player" text,
"Position" text,
"College" text
) | who is the the player where pick # is 64 | SELECT "Player" FROM table_19498 WHERE "Pick #" = '64' | wikisql |
CREATE TABLE table_69076 (
"Rank" real,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) | Name the most rank with bronze of 0 and silver more than 1 and gold more than 0 | SELECT MAX("Rank") FROM table_69076 WHERE "Bronze" = '0' AND "Silver" > '1' AND "Gold" > '0' | wikisql |
CREATE TABLE table_1270 (
"School" text,
"Nickname" text,
"Colors" text,
"League" text,
"Class" text,
"Division" text
) | What are all the schools that use the colors maroon and white | SELECT "School" FROM table_1270 WHERE "Colors" = 'Maroon and White' | wikisql |
CREATE TABLE table_4001 (
"District" text,
"Incumbent" text,
"Cook" text,
"Rothenberg" text,
"CQ Politics" text,
"Crystal Ball" text
) | Who is the incumbent of district pa-8? | SELECT "Incumbent" FROM table_4001 WHERE "District" = 'PA-8' | wikisql |
CREATE TABLE table_65546 (
"Rank" text,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) | What is the average total when the silver is larger than 2, and a gold larger than 1, and a nation of total? | SELECT AVG("Total") FROM table_65546 WHERE "Silver" > '2' AND "Gold" > '1' AND "Nation" = 'total' | wikisql |
CREATE TABLE table_68800 (
"Year" real,
"Men's singles" text,
"Women's singles" text,
"Men's doubles" text,
"Women's doubles" text,
"Mixed doubles" text
) | After 1999, who played Men's Doubles when Kasper Ipsen played Men's Singles? | SELECT "Men's doubles" FROM table_68800 WHERE "Year" > '1999' AND "Men's singles" = 'kasper ipsen' | wikisql |
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Percent text,
ACC_Home text,
ACC_Road text,
All_Games text,
All_Games_Percent int,
All_Home text,
All_Road text,
All_Neutral text
)
CREATE TABLE university (
Scho... | Give me a bar chart for team_id of each all neutral, and order total number in asc order please. | SELECT All_Neutral, Team_ID FROM basketball_match ORDER BY Team_ID | nvbench |
CREATE TABLE table_13366 (
"European election (UK)" real,
"Name" text,
"Share of votes" text,
"Seats" real,
"Share of seats" text
) | Which European election (UK) has a Share of votes of 19%? | SELECT "European election (UK)" FROM table_13366 WHERE "Share of votes" = '19%' | wikisql |
CREATE TABLE table_name_28 (
year INTEGER,
day_in_release VARCHAR,
day_of_week VARCHAR
) | What is the average year for releases on Friday and weeks larger than 2 days? | SELECT AVG(year) FROM table_name_28 WHERE day_in_release = "friday" AND day_of_week > 2 | sql_create_context |
CREATE TABLE Student_Course_Enrolment (
registration_id INTEGER,
student_id INTEGER,
course_id INTEGER,
date_of_enrolment DATETIME,
date_of_completion DATETIME
)
CREATE TABLE Course_Authors_and_Tutors (
author_id INTEGER,
author_tutor_ATB VARCHAR(3),
login_name VARCHAR(40),
password... | List the name and the number of enrolled student for each course Show bar chart, display x-axis from low to high order. | SELECT course_name, COUNT(*) FROM Courses AS T1 JOIN Student_Course_Enrolment AS T2 ON T1.course_id = T2.course_id GROUP BY T1.course_name ORDER BY course_name | nvbench |
CREATE TABLE table_name_47 (
wins INTEGER,
year VARCHAR,
points VARCHAR
) | What is the Wins before 1960 with less than 2 Points? | SELECT SUM(wins) FROM table_name_47 WHERE year < 1960 AND points < 2 | sql_create_context |
CREATE TABLE Ref_Budget_Codes (
Budget_Type_Code CHAR(15),
Budget_Type_Description VARCHAR(255)
)
CREATE TABLE Documents_with_Expenses (
Document_ID INTEGER,
Budget_Type_Code CHAR(15),
Document_Details VARCHAR(255)
)
CREATE TABLE Ref_Document_Types (
Document_Type_Code CHAR(15),
Document_T... | How many documents are created in each day? Bin the document date by weekday and group by document type with a stacked bar chart, sort Y from high to low order. | SELECT Document_Date, COUNT(Document_Date) FROM Ref_Document_Types AS T1 JOIN Documents AS T2 ON T1.Document_Type_Code = T2.Document_Type_Code GROUP BY Document_Type_Name ORDER BY COUNT(Document_Date) DESC | nvbench |
CREATE TABLE table_21690339_1 (
country VARCHAR,
_percentage_of_imports_from_russia VARCHAR
) | What country had 20% imports from russia? | SELECT country FROM table_21690339_1 WHERE _percentage_of_imports_from_russia = "20%" | sql_create_context |
CREATE TABLE table_203_7 (
id number,
"pos." number,
"artist" text,
"single" text,
"year" number,
"sales" number,
"peak" number
) | elton john released the candle in the wind , the # 2 hit single of the 1990s , in 1997 . what was an earlier top 100 hit single of elton john 's in the 1990s ? | SELECT "single" FROM table_203_7 WHERE "artist" = 'elton john' AND "single" <> '"candle in the wind"' | squall |
CREATE TABLE table_63218 (
"Island" text,
"Country" text,
"Population" text,
"Area km\u00b2" text,
"Density (per km\u00b2)" text
) | What is the area km for a population of 99,685 (2008)? | SELECT "Area km\u00b2" FROM table_63218 WHERE "Population" = '99,685 (2008)' | wikisql |
CREATE TABLE table_51958 (
"Year" text,
"Driver" text,
"Constructor" text,
"Location" text,
"Report" text
) | What is the location where Denny Hulme was the driver? | SELECT "Location" FROM table_51958 WHERE "Driver" = 'denny hulme' | wikisql |
CREATE TABLE table_35743 (
"Name" text,
"Location" text,
"State" text,
"Opened (closing date if defunct)" text,
"Surface" text,
"Length" text
) | What is the Location for the route 66 raceway? | SELECT "Location" FROM table_35743 WHERE "Name" = 'route 66 raceway' | wikisql |
CREATE TABLE table_13618584_2 (
district VARCHAR,
incumbent VARCHAR
) | What district is incument terry kilgore from? | SELECT district FROM table_13618584_2 WHERE incumbent = "Terry Kilgore" | sql_create_context |
CREATE TABLE table_3998 (
"Country" text,
"Name" text,
"Presenter(s)" text,
"Judges" text,
"Network" text,
"Premiere / Air dates" text
) | How many networks are there that include the judges pete goffe-wood andrew atkinson benny masekwameng? | SELECT COUNT("Network") FROM table_3998 WHERE "Judges" = 'Pete Goffe-Wood Andrew Atkinson Benny Masekwameng' | wikisql |
CREATE TABLE table_24296 (
"Date" text,
"Time" text,
"ACC Team" text,
"Big Ten Team" text,
"Location" text,
"Television" text,
"Attendance" real,
"Winner" text,
"Challenge Leader" text
) | Which location has a time of 9:30pm? | SELECT "Location" FROM table_24296 WHERE "Time" = '9:30PM' | wikisql |
CREATE TABLE table_name_26 (
japanese_title VARCHAR,
tv_station VARCHAR,
average_ratings VARCHAR
) | What Japanese show on NHK had average ratings of 9.2%? | SELECT japanese_title FROM table_name_26 WHERE tv_station = "nhk" AND average_ratings = "9.2%" | sql_create_context |
CREATE TABLE PostFeedback (
Id number,
PostId number,
IsAnonymous boolean,
VoteTypeId number,
CreationDate time
)
CREATE TABLE PostLinks (
Id number,
CreationDate time,
PostId number,
RelatedPostId number,
LinkTypeId number
)
CREATE TABLE SuggestedEdits (
Id number,
Pos... | select AnswerCount,Title,Id from Posts. | SELECT AnswerCount, Title, Id FROM Posts | sede |
CREATE TABLE table_69165 (
"Name" text,
"Years" text,
"Gender" text,
"Area" text,
"Authority" text,
"Decile" real,
"Roll" real
) | What was the Authority for Avalon School with a roll less than 358? | SELECT "Authority" FROM table_69165 WHERE "Area" = 'avalon' AND "Roll" < '358' AND "Name" = 'avalon school' | wikisql |
CREATE TABLE table_21613 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
) | @ Chicago had a high points of what? | SELECT "High points" FROM table_21613 WHERE "Team" = '@ Chicago' | wikisql |
CREATE TABLE table_name_17 (
goals INTEGER,
player VARCHAR,
rank VARCHAR
) | What was Thierry Henry's average goal when his rank was higher than 7? | SELECT AVG(goals) FROM table_name_17 WHERE player = "thierry henry" AND rank > 7 | sql_create_context |
CREATE TABLE table_name_42 (
time_retired VARCHAR,
grid VARCHAR
) | What is the time/retired when the grid is 19? | SELECT time_retired FROM table_name_42 WHERE grid = "19" | sql_create_context |
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,0)
)
CREATE TABLE job_history (
EMPLOYEE_ID decimal(6,0),
START_DATE date,
END_DATE date,
JOB_ID... | For all employees who have the letters D or S in their first name, visualize a scatter chart about the correlation between salary and commission_pct . | SELECT SALARY, COMMISSION_PCT FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' | nvbench |
CREATE TABLE table_14004 (
"Position" real,
"Team" text,
"Played" real,
"Wins" real,
"Draws" real,
"Losses" real,
"Scored" real,
"Conceded" real,
"Points" real
) | How many total games were played by the team which had a total of 16 points and less than 4 draws? | SELECT SUM("Played") FROM table_14004 WHERE "Points" = '16' AND "Draws" < '4' | wikisql |
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE locations (
LOCATION_ID decimal(4,0),
STREET_ADDRESS varchar(40),
POSTAL_CODE varchar(12),
CITY varchar(30),
STATE_PROVINCE varchar(25),
COUNTRY_ID varchar(2)
)
CREATE T... | For all employees who have the letters D or S in their first name, visualize a bar chart about the distribution of hire_date and the sum of employee_id bin hire_date by weekday. | SELECT HIRE_DATE, SUM(EMPLOYEE_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' | nvbench |
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
)
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
) | For those records from the products and each product's manufacturer, return a scatter chart about the correlation between price and revenue , and group by attribute founder. | SELECT Price, Revenue FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder | nvbench |
CREATE TABLE office_locations (
building_id number,
company_id number,
move_in_year number
)
CREATE TABLE buildings (
id number,
name text,
city text,
height number,
stories number,
status text
)
CREATE TABLE companies (
id number,
name text,
headquarters text,
indu... | Please show the names of the buildings whose status is 'on-hold', in ascending order of stories. | SELECT name FROM buildings WHERE status = "on-hold" ORDER BY stories | spider |
CREATE TABLE table_18736 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Result" text,
"Candidates" text
) | Which party was the incumbent from when the cadidates were henry e. barbour (r) 52.1% henry hawson (d) 47.9%? Answer: Democratic | SELECT COUNT("Party") FROM table_18736 WHERE "Candidates" = 'Henry E. Barbour (R) 52.1% Henry Hawson (D) 47.9%' | wikisql |
CREATE TABLE zyjzjlb (
CYBQDM text,
CYBQMC text,
CYCWH text,
CYKSDM text,
CYKSMC text,
CYSJ time,
CYZTDM number,
HZXM text,
JZKSDM text,
JZKSMC text,
JZLSH text,
KH text,
KLX number,
MZBMLX number,
MZJZLSH text,
MZZDBM text,
MZZDMC text,
MZZYZDZZBM... | 10564497940这次住院就诊的主要诊断如何?需要编码的类型和列表,还有名称列表 | SELECT zyjzjlb.ZYBMLX, zyjzjlb.ZYZDBM, zyjzjlb.ZYZDMC FROM zyjzjlb WHERE zyjzjlb.JZLSH = '10564497940' | css |
CREATE TABLE table_6677 (
"Year" real,
"Competition" text,
"Venue" text,
"Position" text,
"Notes" text
) | What position did the person finish in with a notes of junior men individual 5.64km? | SELECT "Position" FROM table_6677 WHERE "Notes" = 'junior men individual 5.64km' | wikisql |
CREATE TABLE table_56328 (
"Round" text,
"Pick" text,
"Player" text,
"Position" text,
"Nationality" text,
"Team" text,
"College" text
) | Who is the player that plays position f from Fort Wayne Pistons? | SELECT "Player" FROM table_56328 WHERE "Team" = 'fort wayne pistons' AND "Position" = 'f' | wikisql |
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 inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
cha... | until 1 year ago what was the first procedure time of muscle or fascia graft for patient 19352? | SELECT procedures_icd.charttime FROM procedures_icd WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'muscle or fascia graft') AND procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 19352) AND D... | mimic_iii |
CREATE TABLE Detention (
detention_id INTEGER,
detention_type_code VARCHAR(10),
teacher_id INTEGER,
datetime_detention_start DATETIME,
datetime_detention_end DATETIME,
detention_summary VARCHAR(255),
other_details VARCHAR(255)
)
CREATE TABLE Ref_Incident_Type (
incident_type_code VARCHA... | Show me about the change of the average of monthly_rental over date_address_to , and group by attribute date_address_to in a line chart. | SELECT date_address_to, AVG(monthly_rental) FROM Student_Addresses GROUP BY date_address_to ORDER BY monthly_rental DESC | nvbench |
CREATE TABLE table_73152 (
"#" real,
"Episode" text,
"UK air date" text,
"Timeslot" text,
"Viewers (millions)" text,
"Audience share in timeslot" text
) | Name the timeslot for 6.51 viewers | SELECT "Timeslot" FROM table_73152 WHERE "Viewers (millions)" = '6.51' | wikisql |
CREATE TABLE table_name_69 (
against INTEGER,
round VARCHAR
) | Which Against has a Round of fourth round? | SELECT MIN(against) FROM table_name_69 WHERE round = "fourth round" | sql_create_context |
CREATE TABLE table_name_53 (
stories VARCHAR,
height__m_ VARCHAR,
year_of_completion VARCHAR
) | How many stories have a height less than 138 meters with a completion date in 1971? | SELECT stories FROM table_name_53 WHERE height__m_ < 138 AND year_of_completion = 1971 | sql_create_context |
CREATE TABLE jybgb (
BBCJBW text,
BBDM text,
BBMC text,
BBZT number,
BGDH text,
BGJGDM text,
BGJGMC text,
BGRGH text,
BGRQ time,
BGRXM text,
BGSJ time,
CJRQ time,
JSBBRQSJ time,
JSBBSJ time,
JYBBH text,
JYJGMC text,
JYJSGH text,
JYJSQM text,
JY... | 门诊就诊80538748012的就诊状态代码以及名称分别是什么? | SELECT zzmzjzjlb.JZZTDM, zzmzjzjlb.JZZTMC FROM zzmzjzjlb WHERE zzmzjzjlb.JZLSH = '80538748012' UNION SELECT fzzmzjzjlb.JZZTDM, fzzmzjzjlb.JZZTMC FROM fzzmzjzjlb WHERE fzzmzjzjlb.JZLSH = '80538748012' | css |
CREATE TABLE table_80261 (
"Year" real,
"Tournament" text,
"Venue" text,
"Result" text,
"Event" text
) | What is earliest year that had a 50km event with a 2nd place result played in London, United Kingdom? | SELECT MIN("Year") FROM table_80261 WHERE "Event" = '50km' AND "Result" = '2nd' AND "Venue" = 'london, united kingdom' | wikisql |
CREATE TABLE table_name_35 (
icao VARCHAR,
country VARCHAR,
city VARCHAR
) | What is the ICAO for Riyadh, Saudi Arabia? | SELECT icao FROM table_name_35 WHERE country = "saudi arabia" AND city = "riyadh" | sql_create_context |
CREATE TABLE table_name_2 (
margin_of_victory VARCHAR,
winning_score VARCHAR
) | What was the margin of victory when the winning score was 14 (63-67-73-67=270)? | SELECT margin_of_victory FROM table_name_2 WHERE winning_score = −14(63 - 67 - 73 - 67 = 270) | sql_create_context |
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
sy... | show the sao2 changes of patient 033-3009 second measured on the last intensive care unit visit compared to the first value measured on the last intensive care unit visit? | SELECT (SELECT vitalperiodic.sao2 FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '033-3009') AND NOT patient.unitdischargetime IS NULL O... | eicu |
CREATE TABLE table_53212 (
"Year" text,
"2010" real,
"2009" real,
"2008" real,
"2005" real,
"2000" real,
"1995" real,
"1990" real,
"1985" real
) | What is the lowest 2009 value with a 2010 value of 141 and a 1985 value bigger than 165? | SELECT MIN("2009") FROM table_53212 WHERE "2010" = '141' AND "1985" > '165' | wikisql |
CREATE TABLE table_28417 (
"No." real,
"#" real,
"Title" text,
"Directed by" text,
"Written by" text,
"U.S. viewers (million)" text,
"Rank (week)" text,
"Original air date" text,
"Production code" text
) | How many episode numbers were directed by Steven DePaul and titled 'Sudden Flight'? | SELECT COUNT("#") FROM table_28417 WHERE "Directed by" = 'Steven DePaul' AND "Title" = 'Sudden Flight' | wikisql |
CREATE TABLE zyjzjlb (
CYBQDM text,
CYBQMC text,
CYCWH text,
CYKSDM text,
CYKSMC text,
CYSJ time,
CYZTDM number,
HZXM text,
JZKSDM text,
JZKSMC text,
JZLSH text,
KH text,
KLX number,
MZBMLX number,
MZJZLSH text,
MZZDBM text,
MZZDMC text,
MZZYZDZZBM... | 在2006年5月28日到2010年11月23日之间患者柏蕴秀所有检验结果指标记录的检测人为花嘉淑的检验指标流水号分别是多少? | SELECT jyjgzbb.JYZBLSH FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN hz_info_mzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND hz_info_mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jy... | css |
CREATE TABLE table_18678 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Result" text,
"Candidates" text
) | What was the result of the election in the Arkansas 4 district? | SELECT "Result" FROM table_18678 WHERE "District" = 'Arkansas 4' | wikisql |
CREATE TABLE table_25563779_4 (
season VARCHAR,
national_trophy_rookie VARCHAR
) | If the national trophy/rookie is Simone Iaquinta, what is the season total number? | SELECT COUNT(season) FROM table_25563779_4 WHERE national_trophy_rookie = "Simone Iaquinta" | sql_create_context |
CREATE TABLE table_name_7 (
attendance INTEGER,
record VARCHAR
) | What is the lowest number of people in attendance when the record was 9 26? | SELECT MIN(attendance) FROM table_name_7 WHERE record = "9–26" | sql_create_context |
CREATE TABLE mzb (
CLINIC_ID text,
COMP_ID text,
DATA_ID text,
DIFF_PLACE_FLG number,
FERTILITY_STS number,
FLX_MED_ORG_ID text,
HOSP_LEV number,
HOSP_STS number,
IDENTITY_CARD text,
INPT_AREA_BED text,
INSURED_IDENTITY number,
INSURED_STS text,
INSU_TYPE text,
IN... | 把2005年1月7日到2016年10月5日期间患者18154604在4531182的医疗机构一共看检查过多少次查看一下 | SELECT COUNT(*) FROM qtb JOIN t_kc22 ON qtb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE qtb.PERSON_ID = '18154604' AND t_kc22.STA_DATE BETWEEN '2005-01-07' AND '2016-10-05' AND qtb.MED_SER_ORG_NO = '4531182' AND t_kc22.MED_INV_ITEM_TYPE = '检查费' UNION SELECT COUNT(*) FROM gyb JOIN t_kc22 ON gyb.MED_CLINIC_ID = t_kc22.MED... | css |
CREATE TABLE table_27208 (
"Player" text,
"Games Played" real,
"Rebounds" real,
"Assists" real,
"Steals" real,
"Blocks" real,
"Points" real
) | What is the maximum number of assists for players named Anastasia Kostaki? | SELECT MAX("Assists") FROM table_27208 WHERE "Player" = 'Anastasia Kostaki' | wikisql |
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,
... | tell me the number of times patient 006-2586 had a continuous infusion meds intake on the current intensive care unit visit? | SELECT COUNT(*) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-2586') AND patient.unitdischargetime IS NULL) AND intakeoutput.cellpat... | eicu |
CREATE TABLE table_4737 (
"Year" real,
"BB Hot" text,
"BB CW" text,
"BB AC" text,
"CB CW" text
) | What was the CB CW for the year of 1982? | SELECT "CB CW" FROM table_4737 WHERE "Year" = '1982' | 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... | what is the average age of patients who stayed in hospital for 11 days and died before 2155? | SELECT AVG(demographic.age) FROM demographic WHERE demographic.days_stay = "11" AND demographic.dod_year < "2155.0" | mimicsql_data |
CREATE TABLE table_2820584_2 (
partner VARCHAR,
surface VARCHAR
) | Who was Betty's partner when the surface is hard? | SELECT partner FROM table_2820584_2 WHERE surface = "Hard" | sql_create_context |
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... | give me the number of patients whose marital status is married and admission year is less than 2194? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.marital_status = "MARRIED" AND demographic.admityear < "2194" | mimicsql_data |
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25),
EMAIL varchar(25),
PHONE_NUMBER varchar(20),
HIRE_DATE date,
JOB_ID varchar(10),
SALARY decimal(8,2),
COMMISSION_PCT decimal(2,2),
MANAGER_ID decimal(6,0),
DEPARTMENT_ID decimal(... | Bar graph to show how many country name from different country name, and rank by the names in desc. | SELECT COUNTRY_NAME, COUNT(COUNTRY_NAME) FROM countries GROUP BY COUNTRY_NAME ORDER BY COUNTRY_NAME DESC | nvbench |
CREATE TABLE table_1341930_18 (
party VARCHAR,
incumbent VARCHAR
) | which affiliation does edwin e. willis affiliate with | SELECT party FROM table_1341930_18 WHERE incumbent = "Edwin E. Willis" | sql_create_context |
CREATE TABLE table_203_198 (
id number,
"season" text,
"series" text,
"team" text,
"races" number,
"wins" number,
"poles" number,
"fast laps" number,
"points" number,
"pos." text
) | which season held the most series ? | SELECT "season" FROM table_203_198 GROUP BY "season" ORDER BY COUNT("series") DESC LIMIT 1 | squall |
CREATE TABLE table_50296 (
"Player" text,
"Nationality" text,
"Position" text,
"Years for Grizzlies" text,
"School/Club Team" text
) | What year did the Grizzlies play for the UNLV team? | SELECT "Years for Grizzlies" FROM table_50296 WHERE "School/Club Team" = 'unlv' | wikisql |
CREATE TABLE table_204_183 (
id number,
"rank" number,
"nation" text,
"gold" number,
"silver" number,
"bronze" number,
"total" number
) | who is the top ranked nation ? | SELECT "nation" FROM table_204_183 ORDER BY "rank" LIMIT 1 | squall |
CREATE TABLE table_22321 (
"Rank" real,
"Place" text,
"County" text,
"Per Capita Income" text,
"Median House- hold Income" text,
"Population" real,
"Number of Households" real
) | For Pigeon Creek what is the per capita income? | SELECT "Per Capita Income" FROM table_22321 WHERE "Place" = 'Pigeon Creek' | wikisql |
CREATE TABLE student (
stuid number,
lname text,
fname text,
age number,
sex text,
major number,
advisor number,
city_code text
)
CREATE TABLE voting_record (
stuid number,
registration_date text,
election_cycle text,
president_vote number,
vice_president_vote number... | What are the distinct president votes on 08/30/2015? | SELECT DISTINCT president_vote FROM voting_record WHERE registration_date = "08/30/2015" | spider |
CREATE TABLE table_44470 (
"Rank" text,
"s Wicket" text,
"Player" text,
"Matches" text,
"Average" text
) | Which value for s wicket is associated with Shaun Young? | SELECT "s Wicket" FROM table_44470 WHERE "Player" = 'shaun young' | wikisql |
CREATE TABLE student_record (
student_id int,
course_id int,
semester int,
grade varchar,
how varchar,
transfer_source varchar,
earn_credit varchar,
repeat_term varchar,
test_id varchar
)
CREATE TABLE offering_instructor (
offering_instructor_id int,
offering_id int,
ins... | Is one of the MDE classes that I can take ROMLING 414 ? | SELECT COUNT(*) > 0 FROM course, program, program_course WHERE course.department = 'ROMLING' AND course.number = 414 AND program_course.category LIKE '%MDE%' AND program_course.course_id = course.course_id AND program.name LIKE '%CS-LSA%' AND program.program_id = program_course.program_id | advising |
CREATE TABLE jobs (
job_id int,
job_title varchar,
description varchar,
requirement varchar,
city varchar,
state varchar,
country varchar,
zip int
)
CREATE TABLE course_prerequisite (
pre_course_id int,
course_id int
)
CREATE TABLE program (
program_id int,
name varchar... | What high-level HISTART classes are being offered this Fall ? | SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, program_course, semester WHERE course.course_id = course_offering.course_id AND course.department = 'HISTART' AND program_course.category LIKE '%ULCS%' AND program_course.course_id = course.course_id AND semester.semester = 'Fal... | advising |
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_typ... | how many patient have died after they were diagnosed with chronic sinusitis nos within 2 months? | SELECT COUNT(DISTINCT t2.subject_id) FROM (SELECT t1.subject_id, t1.charttime FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_di... | mimic_iii |
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE icustays (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
first_careunit text,
last_careunit text,
first_wardid number,
... | indicate the daily average arterial bp [diastolic] of patient 7476 since 50 months ago. | SELECT AVG(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 = 7476)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'arter... | mimic_iii |
CREATE TABLE table_13018116_1 (
pts_agst INTEGER,
pts_for VARCHAR
) | Name the most points against when points for is 860 | SELECT MAX(pts_agst) FROM table_13018116_1 WHERE pts_for = 860 | 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 (
... | get the number of patients diagnosed with acidosis who have ou route of drug administration. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.short_title = "Acidosis" AND prescriptions.route = "OU" | mimicsql_data |
CREATE TABLE table_35525 (
"Position" real,
"Team" text,
"Played" real,
"Wins" real,
"Draws" real,
"Losses" real,
"Scored" real,
"Conceded" real,
"Points" real
) | What is the lowest number conceded for the team that had less than 8 wins, scored 21, and had less than 23 points? | SELECT MIN("Conceded") FROM table_35525 WHERE "Wins" < '8' AND "Scored" = '21' AND "Points" < '23' | wikisql |
CREATE TABLE table_63727 (
"Rank" real,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) | Japan (JPN) with a total of less than 5, has what average gold medals? | SELECT AVG("Gold") FROM table_63727 WHERE "Nation" = 'japan (jpn)' AND "Total" < '5' | wikisql |
CREATE TABLE table_name_85 (
cat__number VARCHAR,
release_date VARCHAR
) | What is the category number that was released in November 2007? | SELECT cat__number FROM table_name_85 WHERE release_date = "november 2007" | sql_create_context |
CREATE TABLE playlists (
id INTEGER,
name VARCHAR(120)
)
CREATE TABLE employees (
id INTEGER,
last_name VARCHAR(20),
first_name VARCHAR(20),
title VARCHAR(30),
reports_to INTEGER,
birth_date TIMESTAMP,
hire_date TIMESTAMP,
address VARCHAR(70),
city VARCHAR(40),
state VAR... | List the number of the name of all playlist, display in asc by the names. | SELECT name, COUNT(name) FROM playlists GROUP BY name ORDER BY name | nvbench |
CREATE TABLE table_56829 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | When the Away team is fitzroy on the Date of 15 july 1967, what was the Home team playing? | SELECT "Home team" FROM table_56829 WHERE "Date" = '15 july 1967' AND "Away team" = 'fitzroy' | wikisql |
CREATE TABLE table_35556 (
"Date" text,
"Tournament" text,
"Location" text,
"Winner" text,
"Score" text,
"1st prize ( $ )" text
) | What was the score of Ken Still (3) when he won first place? | SELECT "Score" FROM table_35556 WHERE "Winner" = 'ken still (3)' | wikisql |
CREATE TABLE table_71555 (
"Name" text,
"Years" text,
"Gender" text,
"Area" text,
"Authority" text,
"Decile" real,
"Roll" real
) | What is the Gender of students at a school with a Decile of 5 and a Roll of 90? | SELECT "Gender" FROM table_71555 WHERE "Decile" = '5' AND "Roll" = '90' | wikisql |
CREATE TABLE status (
station_id INTEGER,
bikes_available INTEGER,
docks_available INTEGER,
time TEXT
)
CREATE TABLE station (
id INTEGER,
name TEXT,
lat NUMERIC,
long NUMERIC,
dock_count INTEGER,
city TEXT,
installation_date TEXT
)
CREATE TABLE weather (
date TEXT,
... | I want a bar chart to show the frequency of the dates that have the 5 highest cloud cover rates each year. | SELECT date, COUNT(date) FROM weather | nvbench |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TA... | for patients who have been given oxygen therapy (> 60%) - 60-70% , what are the top three most frequent diagnoses that followed within 2 months? | SELECT t3.diagnosisname FROM (SELECT t2.diagnosisname, 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 = 'oxygen therapy (> 60%) - 60-70%') AS t1 ... | eicu |
CREATE TABLE Services (
Service_ID INTEGER,
Service_Type_Code CHAR(15)
)
CREATE TABLE Events (
Event_ID INTEGER,
Service_ID INTEGER,
Event_Details VARCHAR(255)
)
CREATE TABLE Participants (
Participant_ID INTEGER,
Participant_Type_Code CHAR(15),
Participant_Details VARCHAR(255)
)
CREA... | Give me a pie chart to show the proportion of each event details. | SELECT Event_Details, COUNT(Event_Details) FROM Events GROUP BY Event_Details | nvbench |
CREATE TABLE table_58446 (
"Date of Issue" text,
"Denomination" text,
"Design" text,
"Paper Type" text,
"First Day Cover Cancellation" text
) | What is the first day cover cancellation for the Karen Smith Design stamp? | SELECT "First Day Cover Cancellation" FROM table_58446 WHERE "Design" = 'karen smith design' | wikisql |
CREATE TABLE table_25462 (
"#" real,
"Date" text,
"Team" text,
"Score" text,
"Location Attendance" text,
"High Points" text,
"High Rebounds" text,
"High Assists" text,
"Record" text
) | Name the high assists for american airlines center 19,585 | SELECT "High Assists" FROM table_25462 WHERE "Location Attendance" = 'American Airlines Center 19,585' | wikisql |
CREATE TABLE table_28670 (
"District" real,
"Incumbent" text,
"Party" text,
"Elected" text,
"Status" text,
"2010 Candidates" text
) | Who is the incumbent when the elected year is 2004, the status is re-elected and the party is republican? | SELECT "Incumbent" FROM table_28670 WHERE "Elected" = '2004' AND "Status" = 'Re-elected' AND "Party" = 'Republican' | wikisql |
CREATE TABLE table_name_3 (
crowd INTEGER,
home_team VARCHAR
) | What is the largest Crowd number for the Home team of North Melbourne? | SELECT MAX(crowd) FROM table_name_3 WHERE home_team = "north melbourne" | sql_create_context |
CREATE TABLE table_26121 (
"Date" text,
"Total USAAF" real,
"Tot Officers" real,
"Tot Enlisted" real,
"# overseas" real,
"Officers o/s" real,
"Enlisted o/s" real
) | How many Tot enlisted were there on the day when the number of total USAAF was 2329534? | SELECT MAX("Tot Enlisted") FROM table_26121 WHERE "Total USAAF" = '2329534' | wikisql |
CREATE TABLE table_24637 (
"Team" text,
"Car(s)" text,
"#" real,
"Driver(s)" text,
"Primary Sponsor(s)" text,
"Listed Owner(s)" text,
"Crew Chief" text
) | What number is on the car that Geoffrey Bodine drives? | SELECT MIN("#") FROM table_24637 WHERE "Driver(s)" = 'Geoffrey Bodine' | 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,
... | specify the admission location of patient kelly gallardo | SELECT demographic.admission_location FROM demographic WHERE demographic.name = "Kelly Gallardo" | mimicsql_data |
CREATE TABLE table_12590 (
"Year" real,
"Date" text,
"Home Team" text,
"Result" text,
"Visiting Team" text,
"Venue" text,
"Attendance" real
) | What is the latest year with a 34-0 result? | SELECT MAX("Year") FROM table_12590 WHERE "Result" = '34-0' | wikisql |
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... | 编码为18795530病人在医院0561875入院诊断疾病名称不包含分裂的医疗就诊记录号码是多少? | SELECT gwyjzb.MED_CLINIC_ID FROM gwyjzb WHERE gwyjzb.PERSON_ID = '18795530' AND gwyjzb.MED_SER_ORG_NO = '0561875' AND NOT gwyjzb.IN_DIAG_DIS_NM LIKE '%分裂%' UNION SELECT fgwyjzb.MED_CLINIC_ID FROM fgwyjzb WHERE fgwyjzb.PERSON_ID = '18795530' AND fgwyjzb.MED_SER_ORG_NO = '0561875' AND NOT fgwyjzb.IN_DIAG_DIS_NM LIKE '%分裂... | css |
CREATE TABLE table_name_9 (
nationality VARCHAR,
pick VARCHAR,
school_club_team VARCHAR
) | What is the nationality of the player from Drexel who had a pick larger than 183? | SELECT nationality FROM table_name_9 WHERE pick > 183 AND school_club_team = "drexel" | sql_create_context |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.