context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE table_22824 (
"Team #1" text,
"Agg. score" text,
"Team #2" text,
"1st leg" text,
"2nd leg" text
) | What's the 2nd leg result in the round where Panionios is team #2? | SELECT "2nd leg" FROM table_22824 WHERE "Team #2" = 'Panionios' | 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
)
... | what is drug type and drug route of drug code soln2? | SELECT prescriptions.drug_type, prescriptions.route FROM prescriptions WHERE prescriptions.formulary_drug_cd = "SOLN2" | mimicsql_data |
CREATE TABLE table_63664 (
"Restaurant Name" text,
"Original Name" text,
"Location" text,
"Chef" text,
"Designer" text,
"Still Open?" text
) | what is the location when the designer is glen peloso and the restaurant is joe boo's cookoos? | SELECT "Location" FROM table_63664 WHERE "Designer" = 'glen peloso' AND "Restaurant Name" = 'joe boo''s cookoos' | wikisql |
CREATE TABLE Reservations (
Code INTEGER,
Room TEXT,
CheckIn TEXT,
CheckOut TEXT,
Rate REAL,
LastName TEXT,
FirstName TEXT,
Adults INTEGER,
Kids INTEGER
)
CREATE TABLE Rooms (
RoomId TEXT,
roomName TEXT,
beds INTEGER,
bedType TEXT,
maxOccupancy INTEGER,
baseP... | Find the number of rooms for each bed type Visualize by bar chart, and I want to show in descending by the y axis. | SELECT bedType, COUNT(*) FROM Rooms GROUP BY bedType ORDER BY COUNT(*) DESC | nvbench |
CREATE TABLE table_70593 (
"Year" real,
"Entrant" text,
"Chassis" text,
"Engine" text,
"Points" real
) | Which entrant scored less than 8 points and used a Maserati chassis? | SELECT "Entrant" FROM table_70593 WHERE "Points" < '8' AND "Chassis" = 'maserati' | wikisql |
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
CREATE TABLE wdmzjzjlb (
HXPLC number,
HZXM text,
JLSJ time,
JZJSSJ time,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
JZLSH number,
JZZDBM text,
JZZDSM text,
JZZTDM number,
JZZTMC text,
K... | 门诊81008457398是在哪一天结束就诊呢 | SELECT wdmzjzjlb.JZJSSJ FROM wdmzjzjlb WHERE wdmzjzjlb.JZLSH = '81008457398' UNION SELECT bdmzjzjlb.JZJSSJ FROM bdmzjzjlb WHERE bdmzjzjlb.JZLSH = '81008457398' | css |
CREATE TABLE table_name_54 (
zone INTEGER,
stations VARCHAR,
platforms VARCHAR
) | Name the average zone for waddon railway station and has more than 2 platforms | SELECT AVG(zone) FROM table_name_54 WHERE stations = "waddon railway station" AND platforms > 2 | 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 (
... | what is average age of patients whose insurance is government and days of hospital stay is 1? | SELECT AVG(demographic.age) FROM demographic WHERE demographic.insurance = "Government" AND demographic.days_stay = "1" | mimicsql_data |
CREATE TABLE table_name_22 (
location VARCHAR,
time VARCHAR
) | What is the Location when the time was 11:55? | SELECT location FROM table_name_22 WHERE time = "11:55" | 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... | 哪些人在05077547937的医疗就诊中申请检验报告单是超过2份的?列出这些申请人的工号,还有姓名也列出来 | SELECT jybgb.SQRGH, jybgb.SQRXM FROM jybgb WHERE jybgb.JZLSH = '05077547937' GROUP BY jybgb.SQRGH HAVING COUNT(*) > 2 | css |
CREATE TABLE table_25353861_5 (
rebounds VARCHAR,
player VARCHAR
) | How many rebounds did Tammy Sutton-Brown have? | SELECT rebounds FROM table_25353861_5 WHERE player = "Tammy Sutton-Brown" | 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... | 门诊诊断病患吴嘉祥为急性胃肠炎的检测指标101818的结果定量是多少和单位是多少? | SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW 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 = jy... | css |
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
)
... | What is the admission location and diagnosis short title of Dominga Garvin? | SELECT demographic.admission_location, diagnoses.short_title FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.name = "Dominga Garvin" | mimicsql_data |
CREATE TABLE vocals (
songid VARCHAR
)
CREATE TABLE songs (
title VARCHAR,
songid VARCHAR
) | Find all the songs that do not have a lead vocal. | SELECT DISTINCT title FROM vocals AS t1 JOIN songs AS t2 ON t1.songid = t2.songid EXCEPT SELECT t2.title FROM vocals AS t1 JOIN songs AS t2 ON t1.songid = t2.songid WHERE TYPE = "lead" | sql_create_context |
CREATE TABLE table_62376 (
"1999/ 00" text,
"2000/ 01" text,
"2001/ 02" text,
"2002/ 03" text,
"2003/ 04" text,
"2004/ 05" text,
"2005/ 06" text,
"2006/ 07" text,
"2007/ 08" text,
"2008/ 09" text,
"2009/ 10" text,
"2010/ 11" text,
"2011/ 12" text,
"2012/ 13" text
... | Which 2010/ 11 has a 2011/ 12 of former non-ranking tournaments? | SELECT "2010/ 11" FROM table_62376 WHERE "2011/ 12" = 'former non-ranking tournaments' | wikisql |
CREATE TABLE table_36358 (
"Virtue" text,
"Latin" text,
"Gloss" text,
"(Vice)" text,
"(Latin)" text
) | Which virtue is acedia(Latin)? | SELECT "Virtue" FROM table_36358 WHERE "(Latin)" = 'acedia' | wikisql |
CREATE TABLE table_name_20 (
home_team VARCHAR,
venue VARCHAR
) | What was the home team's score at Corio Oval? | SELECT home_team AS score FROM table_name_20 WHERE venue = "corio oval" | sql_create_context |
CREATE TABLE table_5157 (
"Driver" text,
"Team" text,
"Laps" real,
"Time/Retired" text,
"Grid" real,
"Points" real
) | Which Grid has a Driver of cristiano da matta, and Points smaller than 33? | SELECT SUM("Grid") FROM table_5157 WHERE "Driver" = 'cristiano da matta' AND "Points" < '33' | 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... | 从2006年9月3日起,截止到2007年5月5日,7452450这个医院有多少科室涉及的医疗费总额超过5876.89元 | SELECT COUNT(*) FROM (SELECT t_kc21.MED_ORG_DEPT_CD FROM t_kc21 JOIN t_kc24 ON t_kc21.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE t_kc21.MED_SER_ORG_NO = '7452450' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2006-09-03' AND '2007-05-05' GROUP BY t_kc21.MED_ORG_DEPT_CD HAVING SUM(t_kc24.MED_AMOUT) > 5876.89) AS T | css |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
... | How many married patients have left internal jugular vein thrombosis left arm edema as their primary disease? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.marital_status = "MARRIED" AND demographic.diagnosis = "LEFT INTERNAL JUGULAR VEIN THROMBOSIS;LEFT ARM EDEMA" | mimicsql_data |
CREATE TABLE PostLinks (
Id number,
CreationDate time,
PostId number,
RelatedPostId number,
LinkTypeId number
)
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE SuggestedEdits (
Id number,
PostId number,
CreationDate time,
ApprovalDa... | Emacs users in Frederick, MD. | SELECT * FROM Users WHERE Location LIKE '%Frederick, MD%' ORDER BY Reputation DESC | sede |
CREATE TABLE table_71853 (
"Matches" real,
"Innings" real,
"Not Out" real,
"High Score" text,
"Runs" real,
"Average" real
) | What is the match total for a score over 299 and under 412 innings? | SELECT SUM("Matches") FROM table_71853 WHERE "High Score" = '299' AND "Innings" < '412' | wikisql |
CREATE TABLE table_203_323 (
id number,
"city" text,
"country" text,
"airport" text,
"begin" number,
"end" number
) | which two destinations were available for less than one year ? | SELECT "city" FROM table_203_323 WHERE "end" - "begin" < 1 | squall |
CREATE TABLE table_71438 (
"Election" text,
"1st Member" text,
"1st Party" text,
"2nd Member" text,
"2nd Party" text
) | What is the 1st party with Charles Isaac Elton as the 2nd member? | SELECT "1st Party" FROM table_71438 WHERE "2nd Member" = 'charles isaac elton' | wikisql |
CREATE TABLE table_11121 (
"Year" real,
"Tournament" text,
"Venue" text,
"Result" text,
"Extra" text
) | What year is the event in athens, greece? | SELECT MAX("Year") FROM table_11121 WHERE "Venue" = 'athens, greece' | wikisql |
CREATE TABLE table_70957 (
"Parties and voter communities" text,
"% 2006" real,
"seats 2006" real,
"% 2001" real,
"seats 2001" real
) | When seats for 2001 is greater than 15 and % 2001 is greater than 100, what is the % 2006? | SELECT AVG("% 2006") FROM table_70957 WHERE "seats 2001" > '15' AND "% 2001" > '100' | wikisql |
CREATE TABLE table_name_61 (
round VARCHAR,
tournament VARCHAR
) | What is Round, when Tournament is 'Paris'? | SELECT round FROM table_name_61 WHERE tournament = "paris" | sql_create_context |
CREATE TABLE PostTags (
PostId number,
TagId number
)
CREATE TABLE ReviewTaskStates (
Id number,
Name text,
Description text
)
CREATE TABLE Tags (
Id number,
TagName text,
Count number,
ExcerptPostId number,
WikiPostId number
)
CREATE TABLE SuggestedEdits (
Id number,
... | Who Answers My Questions? (Tutorial). | SELECT a.Id AS "post_link", a.Score, au.Id AS "user_link" FROM Posts AS p JOIN Posts AS a ON p.Id = a.ParentId JOIN Users AS au ON a.OwnerUserId = au.Id WHERE p.PostTypeId = 1 AND p.OwnerUserId = '##UserId##' ORDER BY a.Score DESC | sede |
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
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),
CO... | For all employees who have the letters D or S in their first name, draw a bar chart about the distribution of job_id and the sum of employee_id , and group by attribute job_id, and order total number from low to high order please. | SELECT JOB_ID, SUM(EMPLOYEE_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' GROUP BY JOB_ID ORDER BY SUM(EMPLOYEE_ID) | nvbench |
CREATE TABLE table_11545282_10 (
no VARCHAR,
school_club_team VARCHAR
) | What number does the player from Ohio play with? | SELECT no FROM table_11545282_10 WHERE school_club_team = "Ohio" | sql_create_context |
CREATE TABLE table_13951 (
"Date" text,
"Tournament" text,
"Surface" text,
"Opponent in the final" text,
"Score" text
) | what is the date for the tournament jou -l s-tours? | SELECT "Date" FROM table_13951 WHERE "Tournament" = 'joué-lès-tours' | wikisql |
CREATE TABLE table_2150 (
"Shekhina:" text,
"Reason" text,
"Mind" text,
"Intelligence" text,
"Thought" text,
"Understanding" text
) | What is the intelligence os the one that has s , 'thought'? | SELECT "Intelligence" FROM table_2150 WHERE "Thought" = '思 sī, "thought' | wikisql |
CREATE TABLE table_name_78 (
points INTEGER,
goals VARCHAR,
assists VARCHAR,
games VARCHAR
) | If the goals scored were below 6, 11 games were played, and there were 7 assists, what's the sum of points with games meeting these criteria? | SELECT SUM(points) FROM table_name_78 WHERE assists = 7 AND games = 11 AND goals < 6 | sql_create_context |
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,
... | 列出在医院5644576中患者张曼蔓不包含口腔的就诊科室名称所有门诊就诊记录的流水号是什么? | SELECT mzjzjlb.JZLSH FROM person_info JOIN hz_info JOIN mzjzjlb JOIN person_info_hz_info ON person_info.RYBH = person_info_hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND person_info_hz_info.KH = hz_info.KH AND person_info_hz_info.KLX = hz_info.KLX AND pers... | css |
CREATE TABLE table_name_12 (
rider VARCHAR,
speed VARCHAR,
time VARCHAR
) | What Rider had a Speed of 108.347mph and Time of 1:02.40.93? | SELECT rider FROM table_name_12 WHERE speed = "108.347mph" AND time = "1:02.40.93" | 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),
... | For all employees who have the letters D or S in their first name, give me the comparison about the sum of salary over the hire_date bin hire_date by weekday. | SELECT HIRE_DATE, SUM(SALARY) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' | nvbench |
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's the first time patient 1902's heart rate was measured or taken today? | SELECT chartevents.charttime 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 = 1902)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'heart rat... | mimic_iii |
CREATE TABLE job_history (
EMPLOYEE_ID decimal(6,0),
START_DATE date,
END_DATE date,
JOB_ID varchar(10),
DEPARTMENT_ID decimal(4,0)
)
CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
LOCATION_ID decimal(4,0)
)
CREATE TABLE... | For those employees who did not have any job in the past, draw a bar chart about the distribution of hire_date and the sum of salary bin hire_date by time, order from low to high by the Y. | SELECT HIRE_DATE, SUM(SALARY) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) ORDER BY SUM(SALARY) | nvbench |
CREATE TABLE table_name_26 (
SLM INTEGER,
built INTEGER
) | What locomotive built after 1895 has the highest SLM number? | SELECT MAX(SLM) AS number FROM table_name_26 WHERE built > 1895 | sql_create_context |
CREATE TABLE table_name_21 (
round VARCHAR,
opponent VARCHAR
) | What is the round when the match was against sergis kyratzis? | SELECT round FROM table_name_21 WHERE opponent = "sergis kyratzis" | sql_create_context |
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... | Draw a bar chart about the distribution of ACC_Road and the sum of School_ID , and group by attribute ACC_Road, show from low to high by the bar please. | SELECT ACC_Road, SUM(School_ID) FROM basketball_match GROUP BY ACC_Road ORDER BY ACC_Road | nvbench |
CREATE TABLE table_name_23 (
time_of_broadcast VARCHAR,
days_of_the_week VARCHAR,
picture_format VARCHAR,
hours VARCHAR
) | Name the Time of broadcast has a Picture format of 4:3, and Hours of 20:30, and Days of the week of monday, wednesday, friday? | SELECT time_of_broadcast FROM table_name_23 WHERE picture_format = "4:3" AND hours = "20:30" AND days_of_the_week = "monday, wednesday, friday" | 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_... | a FIRST class flight on AA to SAN FRANCISCO on tuesday in the next week | SELECT DISTINCT flight.flight_id FROM airport_service, city, date_day AS DATE_DAY_0, date_day AS DATE_DAY_1, days AS DAYS_0, days AS DAYS_1, fare, fare_basis AS FARE_BASIS_0, fare_basis AS FARE_BASIS_1, flight, flight_fare WHERE ((DATE_DAY_0.day_number = 22 AND DATE_DAY_0.month_number = 3 AND DATE_DAY_0.year = 1991 AND... | atis |
CREATE TABLE table_203_245 (
id number,
"year" number,
"competition" text,
"venue" text,
"position" text,
"event" text,
"notes" text
) | how many total international races did german silva place in the top 3 spots ? | SELECT COUNT("competition") FROM table_203_245 WHERE "position" <= 3 | squall |
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... | Vote comments on user posts. | SELECT *, 'http://stackoverflow.com/questions/' + QuestionId + '/#comment' + CommentId + '_' + QuestionId AS Url FROM (SELECT COALESCE(Q.Title, Posts.Title) AS Question, Comments.UserDisplayName AS Commenter, Text AS Comment, Posts.OwnerDisplayName AS Poster, PostTypes.Name AS "post_type", Posts.CreationDate, CAST(Comm... | sede |
CREATE TABLE table_name_54 (
rank_by_average INTEGER,
total VARCHAR,
place VARCHAR
) | Which Rank by average is the lowest one that has a Total of 425, and a Place larger than 1? | SELECT MIN(rank_by_average) FROM table_name_54 WHERE total = 425 AND place > 1 | sql_create_context |
CREATE TABLE table_name_40 (
termini VARCHAR,
population_area VARCHAR
) | What termini does the route with a population Area of aguilares have? | SELECT termini FROM table_name_40 WHERE population_area = "aguilares" | sql_create_context |
CREATE TABLE mzjzjlb_jybgb (
YLJGDM_MZJZJLB text,
BGDH number,
YLJGDM number
)
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... | 列出哪些人在医疗就诊70939777652中申请超过12份检验报告单?申请人工号和姓名各是什么? | SELECT jybgb.SQRGH, jybgb.SQRXM FROM jybgb WHERE jybgb.JZLSH = '70939777652' GROUP BY jybgb.SQRGH HAVING COUNT(*) > 12 | css |
CREATE TABLE table_204_311 (
id number,
"rank" number,
"nation" text,
"gold" number,
"silver" number,
"bronze" number,
"total" number
) | what is the total number of bronze medals won by france ? | SELECT "bronze" FROM table_204_311 WHERE "nation" = 'france' | squall |
CREATE TABLE table_55461 (
"Year" real,
"Player" text,
"Position" text,
"College/Country" text,
"WNBA Team" text
) | Regarding players before 2000, what is the USC player's position? | SELECT "Position" FROM table_55461 WHERE "Year" < '2000' AND "College/Country" = 'usc' | wikisql |
CREATE TABLE table_203_420 (
id number,
"#" number,
"stadium" text,
"capacity" number,
"city" text,
"home team" text
) | how many stadiums have a capacity between 6000 and 8000 ? | SELECT COUNT("stadium") FROM table_203_420 WHERE "capacity" >= 6000 AND "capacity" <= 8000 | squall |
CREATE TABLE days (
days_code varchar,
day_name varchar
)
CREATE TABLE fare_basis (
fare_basis_code text,
booking_class text,
class_type text,
premium text,
economy text,
discounted text,
night text,
season text,
basis_days text
)
CREATE TABLE equipment_sequence (
aircr... | i need to fly from NASHVILLE to TACOMA first thing in the morning what is there | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE ((CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'NASHVILLE' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'TA... | atis |
CREATE TABLE table_29135051_3 (
broadcast_date VARCHAR,
guest_s_ VARCHAR
) | when was the episode on which barbara windsor and heston blumenthal guest starred broadcasted | SELECT broadcast_date FROM table_29135051_3 WHERE guest_s_ = "Barbara Windsor and Heston Blumenthal" | sql_create_context |
CREATE TABLE table_71618 (
"Year" real,
"Entrant" text,
"Chassis" text,
"Engine" text,
"Points" real
) | What is the year with a kurtis kraft 500a chassis? | SELECT SUM("Year") FROM table_71618 WHERE "Chassis" = 'kurtis kraft 500a' | wikisql |
CREATE TABLE table_2544694_3 (
indonesia_super_series_2008 VARCHAR
) | Which series occurred when the 7800 was 5040.00? | SELECT indonesia_super_series_2008 FROM table_2544694_3 WHERE 780000 = "5040.00" | sql_create_context |
CREATE TABLE ta (
campus_job_id int,
student_id int,
location varchar
)
CREATE TABLE course_prerequisite (
pre_course_id int,
course_id int
)
CREATE TABLE jobs (
job_id int,
job_title varchar,
description varchar,
requirement varchar,
city varchar,
state varchar,
countr... | Which Thermodynamics and Kinetics courses are worth 9 credits ? | SELECT DISTINCT department, name, number FROM course WHERE (description LIKE '%Thermodynamics and Kinetics%' OR name LIKE '%Thermodynamics and Kinetics%') AND credits = 9 | advising |
CREATE TABLE table_name_12 (
tally VARCHAR,
opposition VARCHAR,
total VARCHAR
) | What is the tally when the opposition is Derry, and total is 14? | SELECT tally FROM table_name_12 WHERE opposition = "derry" AND total = 14 | sql_create_context |
CREATE TABLE table_71198 (
"Res." text,
"Record" text,
"Opponent" text,
"Method" text,
"Event" text,
"Round" real,
"Time" text,
"Location" text
) | Which opponent has a Time of 1:34? | SELECT "Opponent" FROM table_71198 WHERE "Time" = '1:34' | wikisql |
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... | TOP 50 users from Michigan. Lists the top 50 users (ranked by reputation) that are located in Calicut/Kozhikode, Kerala, India according to their profile information.
Thanks to http://data.stackexchange.com/stackoverflow/qe/1157/top-100-users-from-greece | SELECT Id, DisplayName, Reputation, WebsiteUrl, Location FROM Users WHERE Location LIKE '%Michigan%' ORDER BY Reputation DESC LIMIT 150 | sede |
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,... | give me the number of patients who had endoscopic excision or destruction of lesion or tissue of stomach and were hospitalized for more than 13 days. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.days_stay > "13" AND procedures.short_title = "Endosc destr stomach les" | mimicsql_data |
CREATE TABLE table_25080 (
"Year" real,
"Network" text,
"Race caller" text,
"s Host" text,
"s Analyst" text,
"Reporters" text,
"Trophy presentation" text
) | Who is the race caller when jim mckay and al michaels were s hosts in the year 1987? | SELECT "Race caller" FROM table_25080 WHERE "s Host" = 'Jim McKay and Al Michaels' AND "Year" = '1987' | wikisql |
CREATE TABLE department (
dept_name VARCHAR
) | list names of all departments ordered by their names. | SELECT dept_name FROM department ORDER BY dept_name | sql_create_context |
CREATE TABLE table_name_79 (
grid VARCHAR,
time_retired VARCHAR
) | what is the grid when the time/retired is +27.112? | SELECT grid FROM table_name_79 WHERE time_retired = "+27.112" | sql_create_context |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE intakeoutput (
intakeoutputid numb... | among the patients of age 40s a year before, what was the top three most frequent procedure? | SELECT t1.treatmentname FROM (SELECT treatment.treatmentname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.age BETWEEN 40 AND 49) AND DATETIME(treatment.treatmenttime, 'start of year') = DATETIME(CURRENT... | eicu |
CREATE TABLE table_39669 (
"Date" text,
"Time" text,
"Visitor" text,
"Score" text,
"Home" text,
"Location/Attendance" text,
"Record" text
) | Who was the visitor at the pittsburgh penguins at 7:00 pm that had a record of 0-2-2? | SELECT "Visitor" FROM table_39669 WHERE "Home" = 'pittsburgh penguins' AND "Time" = '7:00 pm' AND "Record" = '0-2-2' | wikisql |
CREATE TABLE table_name_8 (
result VARCHAR,
date VARCHAR
) | What was the score of the game on November 22? | SELECT result FROM table_name_8 WHERE date = "november 22" | sql_create_context |
CREATE TABLE table_203_629 (
id number,
"year" number,
"title" text,
"lead vocalist" text,
"aria chart position" number,
"album" text
) | who was the lead vocalist in sweat it out ? | SELECT "lead vocalist" FROM table_203_629 WHERE "title" = '"sweat it out"' | squall |
CREATE TABLE table_name_94 (
partner VARCHAR,
opponents_in_the_final VARCHAR
) | Who was the partner that played against Serena Williams Venus Williams? | SELECT partner FROM table_name_94 WHERE opponents_in_the_final = "serena williams venus williams" | sql_create_context |
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
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,... | 在13-09-23到19-11-29内,患者17320230所有检验报告单的审核日期时间给列出来 | SELECT jybgb.SHSJ 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.RYBH = '17320230' AND jybgb.BGRQ BETWEEN '2013-09-23' AND '2019-11-29' UNION... | css |
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 one is easier EECS 532 or EECS 481 ? | SELECT DISTINCT course.number FROM course INNER JOIN program_course ON program_course.course_id = course.course_id WHERE (course.number = 532 OR course.number = 481) AND program_course.workload = (SELECT MIN(PROGRAM_COURSEalias1.workload) FROM program_course AS PROGRAM_COURSEalias1 INNER JOIN course AS COURSEalias1 ON ... | advising |
CREATE TABLE table_name_3 (
episode_title VARCHAR,
prod_code VARCHAR
) | What was the title of the episode with a production code of 1gowo04? | SELECT episode_title FROM table_name_3 WHERE prod_code = "1gowo04" | sql_create_context |
CREATE TABLE table_name_83 (
opening VARCHAR,
result VARCHAR,
white VARCHAR,
moves VARCHAR
) | What's the opening when white is Anand with fewer than 61 moves for a result of ? | SELECT opening FROM table_name_83 WHERE white = "anand" AND moves < 61 AND result = "½–½" | sql_create_context |
CREATE TABLE Residents_Services (
resident_id INTEGER,
service_id INTEGER,
date_moved_in DATETIME,
property_id INTEGER,
date_requested DATETIME,
date_provided DATETIME,
other_details VARCHAR(255)
)
CREATE TABLE Timed_Locations_of_Things (
thing_id INTEGER,
Date_and_Time DATETIME,
... | List the number of items by the details of the organization that owns it using a bar chart, rank in ascending by the organization_details. | SELECT organization_details, COUNT(organization_details) FROM Things AS T1 JOIN Organizations AS T2 ON T1.organization_id = T2.organization_id GROUP BY organization_details ORDER BY organization_details | nvbench |
CREATE TABLE stock (
shop_id number,
device_id number,
quantity number
)
CREATE TABLE device (
device_id number,
device text,
carrier text,
package_version text,
applications text,
software_platform text
)
CREATE TABLE shop (
shop_id number,
shop_name text,
location tex... | What is the name of the shop that has the most different kinds of devices in stock? | SELECT T2.shop_name FROM stock AS T1 JOIN shop AS T2 ON T1.shop_id = T2.shop_id GROUP BY T1.shop_id ORDER BY COUNT(*) DESC LIMIT 1 | spider |
CREATE TABLE table_4985 (
"Res." text,
"Record" text,
"Opponent" text,
"Method" text,
"Event" text,
"Round" real,
"Time" text,
"Location" text
) | Who did he fight in Rumble of the Kings 6? | SELECT "Opponent" FROM table_4985 WHERE "Event" = 'rumble of the kings 6' | 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... | get me the number of patients born before 2107 who have coronary artery primary disease. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "CORONARY ARTERY DISEASE" AND demographic.dob_year < "2107" | mimicsql_data |
CREATE TABLE table_name_65 (
film_title_used_in_nomination VARCHAR,
original_title VARCHAR
) | What is the film title used for nomination with the original title sedamdeset i dva dana? | SELECT film_title_used_in_nomination FROM table_name_65 WHERE original_title = "sedamdeset i dva dana" | sql_create_context |
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
InputTitle text,
MarkdownInputGuidance text,
MarkdownPostOwnerGuidance text,
MarkdownPrivilegedUserGuidance text,
MarkdownConcensusDescription text,
CreationDate time,
CreationModeratorId number,
ApprovalDa... | Top 10 Users from. | SELECT Id, DisplayName, Reputation FROM Users ORDER BY Reputation DESC LIMIT 10 | sede |
CREATE TABLE table_2140071_10 (
season VARCHAR,
premier_date VARCHAR
) | Name the season for august 16, 2010 | SELECT season FROM table_2140071_10 WHERE premier_date = "August 16, 2010" | sql_create_context |
CREATE TABLE table_name_13 (
played INTEGER,
lost VARCHAR,
drawn VARCHAR
) | What Played has a Lost smaller than 3, and a Drawn smaller than 0? | SELECT AVG(played) FROM table_name_13 WHERE lost < 3 AND drawn < 0 | sql_create_context |
CREATE TABLE table_9516 (
"Party" text,
"Leader" text,
"Seats" text,
"% of seats" text,
"First Pref votes" text,
"% FPv" text
) | What is the First Pref Votes for the % FPv of 0.06? | SELECT "First Pref votes" FROM table_9516 WHERE "% FPv" = '0.06' | wikisql |
CREATE TABLE table_77106 (
"Tournament" text,
"1989" text,
"1990" text,
"1991" text,
"1992" text,
"1993" text,
"1994" text,
"1995" text,
"1996" text,
"1997" text,
"1998" text,
"1999" text,
"2000" text,
"2001" text,
"2002" text,
"2003" text,
"Career SR"... | What was the value in 1989 with QF in 1997 and A in 1993? | SELECT "1989" FROM table_77106 WHERE "1997" = 'qf' AND "1993" = 'a' | wikisql |
CREATE TABLE program_course (
program_id int,
course_id int,
workload int,
category varchar
)
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,
tes... | How difficult on average are the PreMajor classes ? | SELECT AVG(workload) FROM program_course WHERE category LIKE '%PreMajor%' | advising |
CREATE TABLE Customers (
customer_id INTEGER,
payment_method VARCHAR(15),
customer_name VARCHAR(80),
date_became_customer DATETIME,
other_customer_details VARCHAR(255)
)
CREATE TABLE Customer_Orders (
order_id INTEGER,
customer_id INTEGER,
order_status VARCHAR(15),
order_date DATETI... | How many orders in each day? Return a bar chart to show. | SELECT order_date, COUNT(order_date) FROM Customers AS t1 JOIN Customer_Orders AS t2 ON t1.customer_id = t2.customer_id WHERE order_status = "Delivered" | nvbench |
CREATE TABLE table_name_45 (
time INTEGER,
athlete VARCHAR
) | What is the athlete muna lee lowest time? | SELECT MIN(time) FROM table_name_45 WHERE athlete = "muna lee" | sql_create_context |
CREATE TABLE table_name_93 (
combined VARCHAR,
overall VARCHAR,
slalom VARCHAR
) | What is the combined of 2 overalls and 5 slaloms? | SELECT combined FROM table_name_93 WHERE overall = "2" AND slalom = "5" | sql_create_context |
CREATE TABLE job_history (
EMPLOYEE_ID decimal(6,0),
START_DATE date,
END_DATE date,
JOB_ID varchar(10),
DEPARTMENT_ID decimal(4,0)
)
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0... | For those employees who was hired before 2002-06-21, visualize a line chart about the change of department_id over hire_date , and could you list in descending by the X-axis? | SELECT HIRE_DATE, DEPARTMENT_ID FROM employees WHERE HIRE_DATE < '2002-06-21' ORDER BY HIRE_DATE DESC | nvbench |
CREATE TABLE table_name_40 (
alternate_title_translation VARCHAR,
series_premiere VARCHAR
) | What is the alternate title/translation of the series that premiered on December 12, 2006? | SELECT alternate_title_translation FROM table_name_40 WHERE series_premiere = "december 12, 2006" | sql_create_context |
CREATE TABLE table_28964 (
"Detailed Family Information" text,
"From" real,
"To" real,
"Anchor" real,
"Orientation" text,
"Conserved in Mus Musculus" text,
"Matrix Sim" text,
"Sequence" text,
"Occurrence" real
) | What occurence has 0.925 listed as the matrix sim? | SELECT MAX("Occurrence") FROM table_28964 WHERE "Matrix Sim" = '0.925' | wikisql |
CREATE TABLE table_63273 (
"Rank" real,
"Heat" real,
"Lane" real,
"Name" text,
"Nationality" text,
"Time" text
) | When the nationality is united states, and the time is 58.06, and the heat is larger than 5 what is the lowest rank? | SELECT MIN("Rank") FROM table_63273 WHERE "Nationality" = 'united states' AND "Time" = '58.06' AND "Heat" > '5' | wikisql |
CREATE TABLE table_21535453_1 (
source VARCHAR,
terry_mcauliffe VARCHAR,
dates_administered VARCHAR
) | What was the source of the poll that gave McAuliffe 30% on June 8? | SELECT source FROM table_21535453_1 WHERE terry_mcauliffe = "30%" AND dates_administered = "June 8" | sql_create_context |
CREATE TABLE table_54539 (
"Pick #" real,
"Player" text,
"Nationality" text,
"Position" text,
"League from" text
) | What nationality is Steven Anthony? | SELECT "Nationality" FROM table_54539 WHERE "Player" = 'steven anthony' | wikisql |
CREATE TABLE table_27316 (
"Region" text,
"Preschool (0\u20135 years)" text,
"Primary (6\u201313 years)" text,
"Secondary (14\u201317 years)" text,
"Tertiary (18\u201324 years)" text
) | What is the enrollment ratio in preschool in the region where the enrollment ratio in primary is 93.10? | SELECT "Preschool (0\u20135 years)" FROM table_27316 WHERE "Primary (6\u201313 years)" = '93.10' | wikisql |
CREATE TABLE gsi (
course_offering_id int,
student_id int
)
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 requirement (... | Are there any classes about Elementary African Languages ? | SELECT DISTINCT department, name, number FROM course WHERE (description LIKE '%Elementary African Languages%' OR name LIKE '%Elementary African Languages%') AND department = 'EECS' | advising |
CREATE TABLE table_38331 (
"Year" text,
"Coach" text,
"Crew" text,
"Record" text,
"Win %" real
) | Which year's crew is varsity 8+ when the record is 7-3? | SELECT "Year" FROM table_38331 WHERE "Crew" = 'varsity 8+' AND "Record" = '7-3' | wikisql |
CREATE TABLE table_name_37 (
visitor VARCHAR,
date VARCHAR
) | What visitor has February 11 as the date? | SELECT visitor FROM table_name_37 WHERE date = "february 11" | sql_create_context |
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate time,
drug text,
dose_val_rx text,
dose_unit_rx text,
route text
... | what is the total bill for patient 52898's hospital stay in their current hospital encounter? | SELECT SUM(cost.cost) FROM cost WHERE cost.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 52898 AND admissions.dischtime IS NULL) | mimic_iii |
CREATE TABLE products (
product_id VARCHAR
)
CREATE TABLE Order_items (
product_id VARCHAR
) | How many products were not included in any order? | SELECT COUNT(*) FROM products WHERE NOT product_id IN (SELECT product_id FROM Order_items) | sql_create_context |
CREATE TABLE table_12062 (
"Driver" text,
"Constructor" text,
"Laps" real,
"Time/Retired" text,
"Grid" real
) | what is the most laps with a grid of 20? | SELECT MAX("Laps") FROM table_12062 WHERE "Grid" = '20' | wikisql |
CREATE TABLE days (
days_code varchar,
day_name varchar
)
CREATE TABLE flight_stop (
flight_id int,
stop_number int,
stop_days text,
stop_airport text,
arrival_time int,
arrival_airline text,
arrival_flight_number int,
departure_time int,
departure_airline text,
departur... | what is the lowest fare UA charges between BOSTON and SAN FRANCISCO | SELECT DISTINCT fare.fare_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, fare, flight, flight_fare WHERE (CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'BOSTON' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city... | atis |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.