context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE d... | what was the name of the organism found in the last blood, venipuncture microbiology test of patient 031-3355 this month. | SELECT microlab.organism FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-3355')) AND microlab.culturesite = 'blood, venipuncture' AND DATETIME... | eicu |
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 treatment (
treatmentid number... | what is the yearly average amount of output amt-chest tube a that patient 005-48105 had since 07/20/2105? | SELECT AVG(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 = '005-48105')) AND intakeoutput.celllabel = 'outpu... | eicu |
CREATE TABLE table_193 (
"Round" real,
"Grand Prix" text,
"Pole Position" text,
"Fastest Lap" text,
"Winning Driver" text,
"Winning Constructor" text,
"Report" text
) | What is the report for round 3? | SELECT "Report" FROM table_193 WHERE "Round" = '3' | wikisql |
CREATE TABLE table_5667 (
"Draw" real,
"Artist" text,
"Song" text,
"Jury" real,
"Televoting" real,
"Points" real,
"Place" real
) | Jury larger than 6, and a Artist of zhenya rasskazova, and a Draw larger than 9 had what sum of points? | SELECT SUM("Points") FROM table_5667 WHERE "Jury" > '6' AND "Artist" = 'zhenya rasskazova' AND "Draw" > '9' | wikisql |
CREATE TABLE table_68058 (
"Tournament" text,
"1999" text,
"2002" text,
"2004" text,
"2006" text,
"2007" text,
"2010" text,
"2011" text,
"2012" text
) | What is the 2004 value with a sf in 2010? | SELECT "2004" FROM table_68058 WHERE "2010" = 'sf' | wikisql |
CREATE TABLE table_7284 (
"Position" text,
"2014" text,
"2013" text,
"2012" text,
"2011" text
) | Who held the Communications Rep position in 2011? | SELECT "2011" FROM table_7284 WHERE "Position" = 'communications rep' | wikisql |
CREATE TABLE table_25002 (
"Character" text,
"Original Manchester Performer" text,
"Original West End Performer" text,
"Original Broadway Performer" text,
"Original UK Tour Performer" text,
"Original Non-Equity US Tour Performer" text,
"Original Italian Tour Performer" text,
"Original So... | Who was the origianal south korean performer when Adebayo Bolaji performed in Manchester? | SELECT "Original South Korean Performer" FROM table_25002 WHERE "Original Manchester Performer" = 'Adebayo Bolaji' | wikisql |
CREATE TABLE table_67997 (
"Year" real,
"Entrant" text,
"Chassis" text,
"Engine" text,
"Points" real
) | What 1957 engine has a Chassis of connaught type b? | SELECT "Engine" FROM table_67997 WHERE "Chassis" = 'connaught type b' AND "Year" > '1957' | wikisql |
CREATE TABLE table_name_18 (
away_team VARCHAR,
tie_no VARCHAR
) | What is the away team at the game with a Tie no of 2? | SELECT away_team FROM table_name_18 WHERE tie_no = "2" | sql_create_context |
CREATE TABLE table_22858557_1 (
score_in_final VARCHAR,
championship VARCHAR,
outcome VARCHAR
) | What is the amount of US open runner-up score? | SELECT COUNT(score_in_final) FROM table_22858557_1 WHERE championship = "US Open" AND outcome = "Runner-up" | sql_create_context |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE diagnoses (
... | how many patients whose admission location is emergency room admit and year of birth is less than 2049? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_location = "EMERGENCY ROOM ADMIT" AND demographic.dob_year < "2049" | mimicsql_data |
CREATE TABLE table_58496 (
"Name" text,
"Years" text,
"Area" text,
"Authority" text,
"Decile" text,
"Roll" text
) | What is the area of the school with a decile of 2 and a roll number 222? | SELECT "Area" FROM table_58496 WHERE "Decile" = '2' AND "Roll" = '222' | wikisql |
CREATE TABLE table_62896 (
"Title" text,
"Type" text,
"Artist" text,
"Label" text,
"Standard number" text,
"Release date" text
) | Which Artist has the Label of Columbia and the Standard number of COCC-72073? | SELECT "Artist" FROM table_62896 WHERE "Label" = 'columbia' AND "Standard number" = 'cocc-72073' | wikisql |
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
)
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
) | For those records from the products and each product's manufacturer, return a scatter chart about the correlation between code and manufacturer , and group by attribute founder. | SELECT T1.Code, T1.Manufacturer FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder | nvbench |
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
RejectionReasonId number,
Comment text
)
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE Tags (
Id number,
TagName text,
... | Python 2.x vs. Python 3.x - Number of Questions - Quarterly. The goal of this query is to compare the trend of the number of Python 2 vs. Python 3 related questions. I started with 2012, because there were very few questions before that.
For more information on the purpose of the query, see https://www.webucator.com... | SELECT LEFT(t.TagName, 8) AS Tag, YEAR(p.CreationDate) AS y, COUNT(p.Id) AS NumPosts FROM Tags AS t JOIN PostTags AS pt ON pt.TagId = t.Id JOIN Posts AS p ON p.Id = pt.PostId WHERE (t.TagName LIKE 'python-2%' OR t.TagName LIKE 'python-3%') AND YEAR(p.CreationDate) >= 2012 GROUP BY LEFT(t.TagName, 8), YEAR(p.CreationDat... | sede |
CREATE TABLE prereq (
course_id varchar(8),
prereq_id varchar(8)
)
CREATE TABLE course (
course_id varchar(8),
title varchar(50),
dept_name varchar(20),
credits numeric(2,0)
)
CREATE TABLE section (
course_id varchar(8),
sec_id varchar(8),
semester varchar(6),
year numeric(4,0)... | Find the sum of credits of courses that have more than one prerequisites for each department with a bar chart, and rank from high to low by the bar. | SELECT dept_name, SUM(credits) FROM course AS T1 JOIN prereq AS T2 ON T1.course_id = T2.course_id GROUP BY dept_name ORDER BY dept_name DESC | nvbench |
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE cost (
row_id number,
subject_id number,
hadm... | what is the number of patients who died after diagnosis of atriovent block-1st degr in the same month during this year? | 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 outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_type t... | what is the difference between arterial bp mean last measured on the first icu visit compared to the second to last value measured on the first icu visit for patient 3663? | 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 = 3663) AND NOT icustays.outtime IS NULL ORDER BY icustays.intime LIMIT 1) AND chartevents.itemi... | mimic_iii |
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
... | how many times patient 19473 has received the cv cath plcmt w guidance until 1 year ago? | SELECT COUNT(*) FROM procedures_icd WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'cv cath plcmt w guidance') AND procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 19473) AND DATETIME(proced... | mimic_iii |
CREATE TABLE table_name_93 (
plur_pret VARCHAR,
subj_pret VARCHAR,
inf_stem VARCHAR
) | What is the plural preterite that is associated with a subjunctive preterite of and has an infinitive stem of e + l/r + cons.? | SELECT plur_pret FROM table_name_93 WHERE subj_pret = "ü" AND inf_stem = "e + l/r + cons." | sql_create_context |
CREATE TABLE table_55955 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Attendance" text
) | Where Date is september 13, 1998 what is result? | SELECT "Result" FROM table_55955 WHERE "Date" = 'september 13, 1998' | wikisql |
CREATE TABLE table_name_56 (
nat VARCHAR,
goals INTEGER
) | What is the nationality for the player with over 64 goals? | SELECT nat FROM table_name_56 WHERE goals > 64 | sql_create_context |
CREATE TABLE table_203_126 (
id number,
"date" text,
"opponent#" text,
"rank#" text,
"site" text,
"result" text,
"attendance" number
) | what was the score of the top game ? | SELECT "result" FROM table_203_126 ORDER BY id LIMIT 1 | squall |
CREATE TABLE DEPARTMENT (
DEPT_CODE varchar(10),
DEPT_NAME varchar(30),
SCHOOL_CODE varchar(8),
EMP_NUM int,
DEPT_ADDRESS varchar(20),
DEPT_EXTENSION varchar(4)
)
CREATE TABLE STUDENT (
STU_NUM int,
STU_LNAME varchar(15),
STU_FNAME varchar(15),
STU_INIT varchar(1),
STU_DOB d... | How many different locations does each school have. Show bar chart. | SELECT SCHOOL_CODE, COUNT(DISTINCT DEPT_ADDRESS) FROM DEPARTMENT | nvbench |
CREATE TABLE table_33349 (
"Translator Call Letters" text,
"B Mountain Channel" text,
"Laurel Mountain Channel" text,
"PSIP" text,
"Station Call Letters" text,
"Network Affiliation ID" text,
"Original Channel" text,
"Signal Quality" text
) | What Laurel Mountain Channel is associated with B Mountain Channel of 7? | SELECT "Laurel Mountain Channel" FROM table_33349 WHERE "B Mountain Channel" = '7' | wikisql |
CREATE TABLE table_name_18 (
shooter VARCHAR,
score_points VARCHAR,
total VARCHAR,
event VARCHAR
) | Which shooter had a total of 11 at the WC Munich with a score of 6? | SELECT shooter FROM table_name_18 WHERE total = "11" AND event = "wc munich" AND score_points = "6" | 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 demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob te... | Find the number of dead patients who had unspecified osteomyelitis and other specified sites diagnoses. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.expire_flag = "1" AND diagnoses.long_title = "Unspecified osteomyelitis, other specified sites" | mimicsql_data |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescription... | what is the number of patients whose ethnicity is white and days of hospital stay is greater than 7? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "WHITE" AND demographic.days_stay > "7" | mimicsql_data |
CREATE TABLE table_40307 (
"Date" text,
"Result" text,
"Opponent" text,
"Location" text,
"Method" text,
"Round" real,
"Record" text
) | Which Round has a Location of auckland, new zealand, and a Method of tko on 1994-11-24? | SELECT AVG("Round") FROM table_40307 WHERE "Location" = 'auckland, new zealand' AND "Method" = 'tko' AND "Date" = '1994-11-24' | wikisql |
CREATE TABLE table_name_43 (
team VARCHAR,
matches VARCHAR
) | Tell me the team which has matches of 13 | SELECT team FROM table_name_43 WHERE matches = 13 | sql_create_context |
CREATE TABLE table_55594 (
"Order" real,
"Title" text,
"Story timeline" text,
"Published" real,
"In order of publication" text
) | What is the story timeline that was published first prior to 1984? | SELECT "Story timeline" FROM table_55594 WHERE "Published" < '1984' AND "In order of publication" = 'first' | wikisql |
CREATE TABLE table_name_90 (
points INTEGER,
year INTEGER
) | What is the lowest points of British Racing after 1963? | SELECT MIN(points) FROM table_name_90 WHERE year > 1963 | sql_create_context |
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
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),
... | Find employee with ID and name of the country presently where (s)he is working Visualize by bar chart, and I want to order by the bars from low to high. | SELECT COUNTRY_NAME, SUM(EMPLOYEE_ID) FROM employees AS T1 JOIN departments AS T2 ON T1.DEPARTMENT_ID = T2.DEPARTMENT_ID JOIN locations AS T3 ON T2.LOCATION_ID = T3.LOCATION_ID JOIN countries AS T4 ON T3.COUNTRY_ID = T4.COUNTRY_ID GROUP BY COUNTRY_NAME ORDER BY COUNTRY_NAME | nvbench |
CREATE TABLE table_28518 (
"No. in series" real,
"No. in season" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production code" text,
"U.S. viewers (million)" text
) | how many series have production code 8acx05 | SELECT "No. in series" FROM table_28518 WHERE "Production code" = '8ACX05' | wikisql |
CREATE TABLE table_76577 (
"Rider" text,
"Manufacturer" text,
"Laps" real,
"Time" text,
"Grid" real
) | What laps did Honda do with a time of +1:38.407? | SELECT "Laps" FROM table_76577 WHERE "Manufacturer" = 'honda' AND "Time" = '+1:38.407' | wikisql |
CREATE TABLE table_24126518_2 (
final_score VARCHAR,
location VARCHAR,
date VARCHAR
) | Name the final score for exhibition stadium for september 10 | SELECT final_score FROM table_24126518_2 WHERE location = "Exhibition Stadium" AND date = "September 10" | sql_create_context |
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
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 te... | 编码为94379213的患者的检验报告单对应的检验结果指标均异常有哪些?列出检验报告单号分别是什么? | SELECT jyjgzbb.BGDH FROM hz_info JOIN mzjzjlb JOIN jyjgzbb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jyjgzbb.jybgb_YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jyjgzbb.jybgb_JZLSH_MZJZJLB WHERE hz_info.RYBH = '94379213' AND NOT jyjgzbb.BGDH IN (SELECT jyjgzb... | css |
CREATE TABLE teaches (
ID VARCHAR
)
CREATE TABLE instructor (
ID VARCHAR,
dept_name VARCHAR
) | Find the names of all instructors in the Art department who have taught some course and the course_id. | SELECT name, course_id FROM instructor AS T1 JOIN teaches AS T2 ON T1.ID = T2.ID WHERE T1.dept_name = 'Art' | sql_create_context |
CREATE TABLE table_75881 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Game site" text,
"Record" text,
"Attendance" text
) | What is the earliest week that the Texans played at the Cleveland Browns Stadium? | SELECT MIN("Week") FROM table_75881 WHERE "Game site" = 'cleveland browns stadium' | wikisql |
CREATE TABLE table_203_804 (
id number,
"pos" text,
"no" number,
"driver" text,
"constructor" text,
"laps" number,
"time/retired" text,
"grid" number
) | who was the only driver to drive 33 laps according to this chart ? | SELECT "driver" FROM table_203_804 WHERE "laps" = 33 | squall |
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
) | Scatter plot to show avg(price) on x axis and manufacturer on y axis. | SELECT AVG(Price), Manufacturer FROM Products GROUP BY Manufacturer | nvbench |
CREATE TABLE party_events (
Event_ID int,
Event_Name text,
Party_ID int,
Member_in_charge_ID int
)
CREATE TABLE member (
Member_ID int,
Member_Name text,
Party_ID text,
In_office text
)
CREATE TABLE party (
Party_ID int,
Minister text,
Took_office text,
Left_office text... | How many parties of the time they took office, binning the left office into Weekday interval, and then split by the minister's name, and rank by the how many left office in descending. | SELECT Left_office, COUNT(Left_office) FROM party GROUP BY Minister ORDER BY COUNT(Left_office) DESC | nvbench |
CREATE TABLE table_8579 (
"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 record of the game on March 21? | SELECT "Record" FROM table_8579 WHERE "Date" = 'march 21' | wikisql |
CREATE TABLE table_8556 (
"Rank" real,
"Name" text,
"Team" text,
"Games" real,
"Assists" real
) | Who played over 37 games and had 202 assists? | SELECT "Name" FROM table_8556 WHERE "Games" > '37' AND "Assists" = '202' | wikisql |
CREATE TABLE table_40553 (
"Race" text,
"Pole position" text,
"Fastest lap" text,
"Most laps led" text,
"Winning driver" text,
"Winning team" text,
"Report" text
) | What is Race, when Winning Team is Chip Ganassi Racing, when Pole Position is Ryan Briscoe, and when Most Laps Led is Scott Dixon? | SELECT "Race" FROM table_40553 WHERE "Winning team" = 'chip ganassi racing' AND "Pole position" = 'ryan briscoe' AND "Most laps led" = 'scott dixon' | wikisql |
CREATE TABLE table_53430 (
"Name" text,
"League" real,
"FA Cup" real,
"League Cup" real,
"Total" real
) | What is the lowest number of goals scored in regular league games by Ehiogu where he scored 0 goals in the FA Cup and at least 1 goal in the League Cup? | SELECT MIN("League") FROM table_53430 WHERE "FA Cup" = '0' AND "Total" = '1' AND "Name" = 'ehiogu' AND "League Cup" > '0' | wikisql |
CREATE TABLE table_name_22 (
assist_pass VARCHAR,
location VARCHAR
) | What's Albufeira's assist/pass? | SELECT assist_pass FROM table_name_22 WHERE location = "albufeira" | sql_create_context |
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_hosts int
)
CREATE TABLE party_host (
Party_ID int,
Host_ID int,
Is_Main_in_Charge... | Create a pie chart showing the total number across nationality. | SELECT Nationality, COUNT(*) FROM host GROUP BY Nationality | nvbench |
CREATE TABLE table_name_62 (
college VARCHAR,
pick VARCHAR,
position VARCHAR
) | What school did the punter picked after 101 attend? | SELECT college FROM table_name_62 WHERE pick > 101 AND position = "punter" | sql_create_context |
CREATE TABLE table_name_58 (
lead VARCHAR,
others VARCHAR
) | I want the lead for others being 5% | SELECT lead FROM table_name_58 WHERE others = "5%" | sql_create_context |
CREATE TABLE table_name_86 (
engine_† VARCHAR,
chassis VARCHAR,
driver VARCHAR
) | What engine did David Coulthard have in his mp4-13 chassis? | SELECT engine_† FROM table_name_86 WHERE chassis = "mp4-13" AND driver = "david coulthard" | sql_create_context |
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
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... | 患者36091672号从02年2月9日到05年3月12日这段时间去过多少次医院就诊? | SELECT (SELECT COUNT(*) FROM hz_info JOIN mzjzjlb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX WHERE hz_info.RYBH = '36091672' AND mzjzjlb.JZKSRQ BETWEEN '2002-02-09' AND '2005-03-12') + (SELECT COUNT(*) FROM hz_info JOIN wdmzjzjlb ON hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND... | css |
CREATE TABLE table_12124 (
"Player" text,
"Height" real,
"Position" text,
"Year born (Age)" text,
"Current Club" text
) | What is the Year born (Age) for the player who is taller than 2.04 and currently plays for the Los Angeles Clippers? | SELECT "Year born (Age)" FROM table_12124 WHERE "Height" > '2.04' AND "Current Club" = 'los angeles clippers' | wikisql |
CREATE TABLE accounts (
account_id number,
customer_id number,
account_name text,
other_account_details text
)
CREATE TABLE customers_cards (
card_id number,
customer_id number,
card_type_code text,
card_number text,
date_valid_from time,
date_valid_to time,
other_card_detai... | Show the date valid from and the date valid to for the card with card number '4560596484842'. | SELECT date_valid_from, date_valid_to FROM customers_cards WHERE card_number = "4560596484842" | spider |
CREATE TABLE table_50445 (
"Scorer" text,
"Club" text,
"League goals" text,
"FA Cup goals" text,
"League Cup goals" text,
"Total" real
) | What is the number of league goals when Bill Dearden was the scorer and there was 0 league cup goals? | SELECT "League goals" FROM table_50445 WHERE "League Cup goals" = '0' AND "Scorer" = 'bill dearden' | wikisql |
CREATE TABLE table_33529 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | Which Away team had a score of 18.8 (116)? | SELECT "Away team" FROM table_33529 WHERE "Away team score" = '18.8 (116)' | wikisql |
CREATE TABLE Tags (
Id number,
TagName text,
Count number,
ExcerptPostId number,
WikiPostId number
)
CREATE TABLE PostFeedback (
Id number,
PostId number,
IsAnonymous boolean,
VoteTypeId number,
CreationDate time
)
CREATE TABLE VoteTypes (
Id number,
Name text
)
CREATE... | Average time between post creation and first vote. | SELECT STR_TO_TIME(CONCAT(YEAR(Posts.CreationDate), '-', MONTH(Posts.CreationDate), '-01'), '%Y-%m-%d %H:%M:%S') AS Mes, CAST(AVG(CAST((JULIANDAY(v.FirstVoteCreationDate) - JULIANDAY(Posts.CreationDate)) * 1440.0 AS INT)) AS FLOAT) / (60 * 24), AVG(CAST((JULIANDAY(v.FirstVoteCreationDate) - JULIANDAY(Posts.CreationDate... | sede |
CREATE TABLE table_name_89 (
location VARCHAR,
date VARCHAR,
television VARCHAR,
time VARCHAR
) | What is the location of the game that was televised on ESPNU at 7:15 pm on Tue., Nov. 27? | SELECT location FROM table_name_89 WHERE television = "espnu" AND time = "7:15 pm" AND date = "tue., nov. 27" | sql_create_context |
CREATE TABLE table_name_16 (
recorded VARCHAR,
translation VARCHAR
) | Name the recorded for translation of sleep my love, good night | SELECT recorded FROM table_name_16 WHERE translation = "sleep my love, good night" | sql_create_context |
CREATE TABLE table_55873 (
"Player" text,
"Position" text,
"School" text,
"Hometown" text,
"College" text
) | Which player is attending college at Virginia? | SELECT "Player" FROM table_55873 WHERE "College" = 'virginia' | wikisql |
CREATE TABLE table_name_35 (
february INTEGER,
opponent VARCHAR,
game VARCHAR
) | What is the February number of the game played against the St. Louis Blues with a game number less than 58? | SELECT AVG(february) FROM table_name_35 WHERE opponent = "st. louis blues" AND game < 58 | sql_create_context |
CREATE TABLE table_64095 (
"Wrestlers" text,
"Reign" text,
"Days held" text,
"Location" text,
"Event" text
) | Which location has 111 as the days held? | SELECT "Location" FROM table_64095 WHERE "Days held" = '111' | wikisql |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
... | give me the number of patients whose admission type is urgent and year of birth is less than 2052? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_type = "URGENT" AND demographic.dob_year < "2052" | mimicsql_data |
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... | 查查6747187的医疗机构,就诊记录里不是本地的患者是多少 | SELECT COUNT(qtb.PERSON_ID) FROM qtb WHERE qtb.MED_SER_ORG_NO = '6747187' AND qtb.REMOTE_SETTLE_FLG = '异地1' OR qtb.REMOTE_SETTLE_FLG = '异地2' UNION SELECT COUNT(gyb.PERSON_ID) FROM gyb WHERE gyb.MED_SER_ORG_NO = '6747187' AND gyb.REMOTE_SETTLE_FLG = '异地1' OR gyb.REMOTE_SETTLE_FLG = '异地2' UNION SELECT COUNT(zyb.PERSON_ID... | css |
CREATE TABLE table_203_682 (
id number,
"year" number,
"goalkeeper" text,
"defenders" text,
"midfielders" text,
"forwards" text
) | how long did jamie swanner play as goal keeper ? | SELECT COUNT("year") FROM table_203_682 WHERE "goalkeeper" = 'jamie swanner' | squall |
CREATE TABLE table_33359 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | What away team is playing at the Brunswick Street Oval Venue? | SELECT "Away team" FROM table_33359 WHERE "Venue" = 'brunswick street oval' | wikisql |
CREATE TABLE table_44898 (
"Team" text,
"Coach" text,
"Home Ground" text,
"Location" text,
"Founded" real
) | What was the location of the club where the home ground is wilfred taylor reserve? | SELECT "Location" FROM table_44898 WHERE "Home Ground" = 'wilfred taylor reserve' | wikisql |
CREATE TABLE ReviewTasks (
Id number,
ReviewTaskTypeId number,
CreationDate time,
DeletionDate time,
ReviewTaskStateId number,
PostId number,
SuggestedEditId number,
CompletedByReviewTaskId number
)
CREATE TABLE VoteTypes (
Id number,
Name text
)
CREATE TABLE Users (
Id num... | Hot questions by posting day of week/time. | SELECT (TIME_TO_STR(p.CreationDate, '%W') - 1) * 24 + TIME_TO_STR(p.CreationDate, '%h') AS "Hour of week", COUNT(h.Id) AS "Hot questions", COUNT(*) AS "All questions" FROM Posts AS p LEFT OUTER JOIN PostHistory AS h ON h.PostId = p.Id AND h.PostHistoryTypeId = 52 WHERE p.CreationDate >= '2019-03-01' GROUP BY TIME_TO_ST... | sede |
CREATE TABLE table_22192 (
"Year" real,
"Date" text,
"Type" text,
"Species" text,
"Author Species" text,
"Value" text,
"Afinsa" real,
"Scott" text,
"Mitchell" real,
"Yvert" text,
"Sta. & Gib." real,
"Order" text,
"Family" text
) | What are all values for Mitchell when the author species is Temminck & Schlegel, 1849? | SELECT "Mitchell" FROM table_22192 WHERE "Author Species" = 'Temminck & Schlegel, 1849' | wikisql |
CREATE TABLE table_71087 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Record" text,
"Stadium" text
) | What was the loss of the game when the record was 3 2? | SELECT "Loss" FROM table_71087 WHERE "Record" = '3–2' | wikisql |
CREATE TABLE procedures (
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
)
... | what is the admission type and procedure long title of the patient id 7273? | SELECT demographic.admission_type, procedures.long_title FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.subject_id = "7273" | mimicsql_data |
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... | provide the number of patients whose diagnosis icd9 code is 78321 and lab test abnormal status is abnormal. | 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.icd9_code = "78321" AND lab.flag = "abnormal" | mimicsql_data |
CREATE TABLE table_203_563 (
id number,
"#" number,
"judge" text,
"state" text,
"born/died" text,
"active" text,
"chief" text,
"senior" text,
"appointed by" text,
"reason for\ntermination" text
) | which judge was last appointed by president truman ? | SELECT "judge" FROM table_203_563 WHERE "appointed by" = 'truman' ORDER BY "#" DESC LIMIT 1 | squall |
CREATE TABLE customers (
customer_name VARCHAR,
customer_phone VARCHAR,
customer_email VARCHAR,
customer_id VARCHAR
)
CREATE TABLE customer_orders (
customer_id VARCHAR
) | What are the name, phone number and email address of the customer who made the largest number of orders? | SELECT T1.customer_name, T1.customer_phone, T1.customer_email FROM customers AS T1 JOIN customer_orders AS T2 ON T1.customer_id = T2.customer_id GROUP BY T2.customer_id ORDER BY COUNT(*) DESC LIMIT 1 | sql_create_context |
CREATE TABLE table_65081 (
"Actor" text,
"Character" text,
"Soap Opera" text,
"Years" text,
"Duration" text
) | what is the character with the duration of 11 years? | SELECT "Character" FROM table_65081 WHERE "Duration" = '11 years' | wikisql |
CREATE TABLE table_train_97 (
"id" int,
"pulmonary_disease" bool,
"systolic_blood_pressure_sbp" int,
"diabetic" string,
"psychiatric_disease" bool,
"hematologic_disease" bool,
"diastolic_blood_pressure_dbp" int,
"lung_disease" bool,
"NOUSE" float
) | significant or uncontrolled psychiatric disease | SELECT * FROM table_train_97 WHERE psychiatric_disease = 1 | criteria2sql |
CREATE TABLE table_name_45 (
to_par VARCHAR,
tournament VARCHAR
) | What is the to par when the tournament involved was the Transitions Championship? | SELECT to_par FROM table_name_45 WHERE tournament = "transitions championship" | sql_create_context |
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
)
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
) | For those records from the products and each product's manufacturer, give me the comparison about the sum of manufacturer over the founder , and group by attribute founder, and I want to sort in descending by the y axis please. | SELECT Founder, SUM(Manufacturer) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder ORDER BY SUM(Manufacturer) DESC | nvbench |
CREATE TABLE table_name_66 (
no_s_ VARCHAR,
school_club_team_country VARCHAR
) | What is the player number for the player from Centenary? | SELECT no_s_ FROM table_name_66 WHERE school_club_team_country = "centenary" | sql_create_context |
CREATE TABLE time_interval (
period text,
begin_time int,
end_time int
)
CREATE TABLE compartment_class (
compartment varchar,
class_type varchar
)
CREATE TABLE state (
state_code text,
state_name text,
country_name text
)
CREATE TABLE flight (
aircraft_code_sequence text,
air... | do you have the fare for traveling from OAK airport to OAKLAND downtown | SELECT DISTINCT ground_service.ground_fare FROM airport, city, ground_service WHERE airport.airport_code = 'OAK' AND city.city_name = 'OAKLAND' AND ground_service.airport_code = airport.airport_code AND ground_service.city_code = city.city_code | atis |
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
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... | what number of hours have it been since patient 68280 was admitted to the hospital? | SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', admissions.admittime)) FROM admissions WHERE admissions.subject_id = 68280 AND admissions.dischtime IS NULL | mimic_iii |
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text,
person_info_CSD text,
person_info_CSRQ time,
person_info_GJDM text,
person_info_GJMC text,
person_info_JGDM text,
person_info_JGMC text,
person_info_MZDM text,
person_info_MZMC text,
person_info_XBDM ... | 列出在2005-01-17到2018-07-17内患者许兰梦所有检验报告单中有哪些标本采集部位? | SELECT jybgb.BBCJBW FROM hz_info JOIN mzjzjlb JOIN jybgb 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 WHERE hz_info.person_info_XM = '许兰梦' AND jybgb.BGRQ BETWEEN '2005-01-17' AND '2018-07-17... | css |
CREATE TABLE table_name_84 (
date VARCHAR,
score VARCHAR
) | On what date was the score 121-113? | SELECT date FROM table_name_84 WHERE score = "121-113" | sql_create_context |
CREATE TABLE table_6783 (
"Institution" text,
"Location" text,
"Founded" real,
"Type" text,
"Enrollment" real,
"Nickname" text,
"Joined" text,
"Left" text,
"Current Conference" text
) | Where was the game played with a 2013 left and Royals nickname? | SELECT "Location" FROM table_6783 WHERE "Left" = '2013' AND "Nickname" = 'royals' | wikisql |
CREATE TABLE table_name_87 (
byes INTEGER,
wins VARCHAR,
against VARCHAR,
losses VARCHAR
) | Which Byes have an Against larger than 1235, and Losses smaller than 10, and Wins larger than 7? | SELECT MAX(byes) FROM table_name_87 WHERE against > 1235 AND losses < 10 AND wins > 7 | sql_create_context |
CREATE TABLE table_17525955_2 (
viewers__millions_ VARCHAR,
episode__number VARCHAR
) | How many viewers did Episode #5 have? | SELECT viewers__millions_ FROM table_17525955_2 WHERE episode__number = 5 | sql_create_context |
CREATE TABLE table_27784 (
"Position" real,
"Race number" text,
"Sail number" text,
"Yacht" text,
"State/country" text,
"Yacht type" text,
"LOA (Metres)" text,
"Skipper" text,
"Elapsed time d:hh:mm:ss" text
) | In what position did skipper Mark Richards place? | SELECT "Position" FROM table_27784 WHERE "Skipper" = 'Mark Richards' | wikisql |
CREATE TABLE time_zone (
time_zone_code text,
time_zone_name text,
hours_from_gmt int
)
CREATE TABLE flight_leg (
flight_id int,
leg_number int,
leg_flight int
)
CREATE TABLE airline (
airline_code varchar,
airline_name text,
note text
)
CREATE TABLE flight_stop (
flight_id in... | show me flights from BOSTON to SAN FRANCISCO arriving before 1300 | 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_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN FRANCISCO' AND flight.arrival_time <= 1300 AND flight.to_airport = AIRPORT_SERVICE_1.... | atis |
CREATE TABLE Accounts (
account_id INTEGER,
customer_id INTEGER,
account_name VARCHAR(50),
other_account_details VARCHAR(255)
)
CREATE TABLE Customers (
customer_id INTEGER,
customer_first_name VARCHAR(20),
customer_last_name VARCHAR(20),
customer_address VARCHAR(255),
customer_phon... | What are card ids, customer ids, card types, and card numbers for each customer card?, and order in descending by the names. | SELECT card_type_code, SUM(card_number) FROM Customers_Cards GROUP BY card_type_code ORDER BY card_type_code DESC | nvbench |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
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 t... | what is the number of patients whose ethnicity is asian and age is less than 47? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "ASIAN" AND demographic.age < "47" | mimicsql_data |
CREATE TABLE table_748 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Result" text,
"Candidates" text
) | What district did incumbent Ralph A. Gamble represent? | SELECT "District" FROM table_748 WHERE "Incumbent" = 'Ralph A. Gamble' | wikisql |
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 text,
JCZBJGDX text,
JCZBMC text,
JLDW text,
JYRQ time,
JYZBLSH text,
... | 患者何歌韵的免疫球蛋白M(标准)在2007-12-19到2017-04-22期间是怎样的 | SELECT * FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN mzjzjlb_jybgb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = mzjzjlb_jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jy... | css |
CREATE TABLE table_31886 (
"Tournament" text,
"2008" text,
"2009" text,
"2010" text,
"2011" text,
"2012" text
) | Tell me the 2011 with 2012 of 2r | SELECT "2011" FROM table_31886 WHERE "2012" = '2r' AND "2010" = '2r' AND "2009" = '2r' | 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... | 列出姓李的检测人负责的所有检测指标名称及其结果定量与结果定量单位的详情,主要针对84548610152这次医疗就诊 | SELECT jyjgzbb.JCZBMC, jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM jyjgzbb WHERE jyjgzbb.jybgb_JZLSH = '84548610152' AND jyjgzbb.JCRXM LIKE '李%' | css |
CREATE TABLE table_64245 (
"School" text,
"Location" text,
"Mascot" text,
"Enrollment" real,
"IHSAA Class" text,
"County" text,
"Year Joined" real,
"Previous Conference" text
) | where is Mascot of quakers? | SELECT "Location" FROM table_64245 WHERE "Mascot" = 'quakers' | wikisql |
CREATE TABLE mzjzjlb (
HXPLC number,
HZXM text,
JLSJ time,
JZJSSJ time,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
JZLSH text,
JZZDBM text,
JZZDSM text,
JZZTDM number,
JZZTMC text,
KH text,
KLX number,
MJZH text,
ML number,
MZZYZDZZBM text,
MZZYZDZZMC ... | 编号为94261760的病人从13年1月18日到2018年7月13日为止检测人为王锐利的所有检验结果指标记录的检验指标流水号码是多少? | SELECT jyjgzbb.JYZBLSH FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE hz... | css |
CREATE TABLE jybgb (
YLJGDM text,
YLJGDM_MZJZJLB text,
YLJGDM_ZYJZJLB text,
BGDH text,
BGRQ time,
JYLX number,
JZLSH text,
JZLSH_MZJZJLB text,
JZLSH_ZYJZJLB text,
JZLX number,
KSBM text,
KSMC text,
SQRGH text,
SQRXM text,
BGRGH text,
BGRXM text,
SHRGH ... | 在2001年6月25日到2009年3月18日这段时间医院编号为6114875的这个医院有多少科室在门诊就诊中给患者开出少于20张检验报告单啊? | SELECT COUNT(*) FROM (SELECT jybgb.KSBM FROM mzjzjlb JOIN jybgb ON mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE mzjzjlb.YLJGDM = '6114875' AND jybgb.BGRQ BETWEEN '2001-06-25' AND '2009-03-18' GROUP BY jybgb.KSBM HAVING COUNT(*) <= 20) AS T | css |
CREATE TABLE table_78663 (
"Date" text,
"Venue" text,
"Score" text,
"Result" text,
"Competition" text
) | What is the Date of the Fifa World Cup with a Score of 1-0? | SELECT "Date" FROM table_78663 WHERE "Score" = '1-0' AND "Competition" = 'fifa world cup' | wikisql |
CREATE TABLE course_prerequisite (
pre_course_id int,
course_id int
)
CREATE TABLE program_requirement (
program_id int,
category varchar,
min_credit int,
additional_req varchar
)
CREATE TABLE area (
course_id int,
area varchar
)
CREATE TABLE comment_instructor (
instructor_id int... | To fulfill the MDE requirement , what 's the easiest class to take ? | SELECT DISTINCT course.department, course.name, course.number, program_course.workload, program_course.workload FROM course, program_course WHERE program_course.category LIKE '%MDE%' AND program_course.course_id = course.course_id AND program_course.workload = (SELECT MIN(PROGRAM_COURSEalias1.workload) FROM program_cou... | advising |
CREATE TABLE table_name_95 (
capacity VARCHAR,
opened VARCHAR,
region VARCHAR
) | What capacity opened lessed than 1937 and is located in the region of champagne-ardenne? | SELECT capacity FROM table_name_95 WHERE opened < 1937 AND region = "champagne-ardenne" | sql_create_context |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.