context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE date_day (
month_number int,
day_number int,
year int,
day_name varchar
)
CREATE TABLE code_description (
code varchar,
description text
)
CREATE TABLE equipment_sequence (
aircraft_code_sequence varchar,
aircraft_code varchar
)
CREATE TABLE state (
state_code text,
... | i need to fly from BOSTON to BALTIMORE please give me the times of your flights in the morning before 800 o'clock | 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 = 'BALTIMORE' AND flight.departure_time < 800 AND flight.to_airport = AIRPORT_SERVICE_1.airp... | atis |
CREATE TABLE person_info_hz_info (
RYBH text,
KH number,
KLX number,
YLJGDM number
)
CREATE TABLE jyjgzbb (
BGDH text,
BGRQ time,
CKZFWDX text,
CKZFWSX number,
CKZFWXX number,
JCFF text,
JCRGH text,
JCRXM text,
JCXMMC text,
JCZBDM text,
JCZBJGDL number,
J... | 从二0一六年十二月八日到二0二0年十二月二十九日,患者79918177的所有检验结果指标记录中的检测方法共有多少种,给全部列出来 | SELECT jyjgzbb.JCFF FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN person_info_hz_info JOIN person_info 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... | css |
CREATE TABLE reservations (
code number,
room text,
checkin text,
checkout text,
rate number,
lastname text,
firstname text,
adults number,
kids number
)
CREATE TABLE rooms (
roomid text,
roomname text,
beds number,
bedtype text,
maxoccupancy number,
basepric... | What is the average minimum and price of the rooms for each different decor. | SELECT decor, AVG(baseprice), MIN(baseprice) FROM rooms GROUP BY decor | spider |
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
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... | For those employees whose salary is in the range of 8000 and 12000 and commission is not null or department number does not equal to 40, find job_id and the amount of job_id , and group by attribute job_id, and visualize them by a bar chart, and I want to list x axis in asc order please. | SELECT JOB_ID, COUNT(JOB_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 GROUP BY JOB_ID ORDER BY JOB_ID | nvbench |
CREATE TABLE table_38148 (
"Position" text,
"Number" real,
"Name" text,
"Height" text,
"Weight" real,
"Class" text,
"Hometown" text,
"Games\u2191" real
) | How many games were played by the player at FB? | SELECT COUNT("Games\u2191") FROM table_38148 WHERE "Position" = 'fb' | wikisql |
CREATE TABLE table_8716 (
"Year" real,
"Competition" text,
"Venue" text,
"Position" text,
"Event" text
) | Which Year has a Position of 4th? | SELECT SUM("Year") FROM table_8716 WHERE "Position" = '4th' | wikisql |
CREATE TABLE table_32714 (
"Team" text,
"Bowl" text,
"Season coach" text,
"Interim head coach" text,
"Result" text,
"2008 head coach" text
) | What was the result in 2008 under head coach Mike Sherman? | SELECT "Result" FROM table_32714 WHERE "2008 head coach" = 'mike sherman' | 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... | 给患者42593363在医疗就诊67404927173中做检验的科室有哪些?编码是什么 | SELECT jybgb.JYKSBM, jybgb.JYKSMC FROM jybgb WHERE jybgb.JZLSH = '67404927173' | css |
CREATE TABLE table_name_27 (
december VARCHAR,
score VARCHAR
) | Score of 8 - 1 happened on what day in December? | SELECT december FROM table_name_27 WHERE score = "8 - 1" | sql_create_context |
CREATE TABLE table_name_80 (
points INTEGER,
chassis VARCHAR,
entrant VARCHAR
) | Name the sum of points for chassis of maserati 250f and entrant of officine alfieri maserati | SELECT SUM(points) FROM table_name_80 WHERE chassis = "maserati 250f" AND entrant = "officine alfieri maserati" | sql_create_context |
CREATE TABLE semester (
semester_id int,
semester varchar,
year int
)
CREATE TABLE requirement (
requirement_id int,
requirement varchar,
college varchar
)
CREATE TABLE instructor (
instructor_id int,
name varchar,
uniqname varchar
)
CREATE TABLE course_prerequisite (
pre_cour... | What is the Spring and Summer schedule for upper-level electives ? | SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester INNER JOIN program_course ON program_course.course_id = course.course_id WHERE course.department = '... | advising |
CREATE TABLE table_name_63 (
winner VARCHAR,
city VARCHAR
) | What is the Winner of the Event in Nuevo Vallarta? | SELECT winner FROM table_name_63 WHERE city = "nuevo vallarta" | sql_create_context |
CREATE TABLE t_kc21 (
CLINIC_ID text,
CLINIC_TYPE text,
COMP_ID text,
DATA_ID text,
DIFF_PLACE_FLG number,
FERTILITY_STS number,
FLX_MED_ORG_ID text,
HOSP_LEV number,
HOSP_STS number,
IDENTITY_CARD text,
INPT_AREA_BED text,
INSURED_IDENTITY number,
INSURED_STS text,
... | 医疗就诊23242162253中蒙脱石散是三目录类别里面的哪个类型 | SELECT t_kc22.DIRE_TYPE FROM t_kc22 JOIN t_kc21_t_kc22 JOIN t_kc21 ON t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID AND t_kc21_t_kc22.MED_CLINIC_ID = t_kc21.MED_CLINIC_ID WHERE t_kc21.MED_CLINIC_ID = '23242162253' AND t_kc22.SOC_SRT_DIRE_NM = '蒙脱石散' | css |
CREATE TABLE table_name_11 (
pasadena VARCHAR,
tujunga VARCHAR
) | What is the figure for Pasadena when Tujunga is 36? | SELECT pasadena FROM table_name_11 WHERE tujunga = "36" | sql_create_context |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
... | provide the number of patients whose ethnicity is white - russian and drug name is glucagon? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.ethnicity = "WHITE - RUSSIAN" AND prescriptions.drug = "Glucagon" | mimicsql_data |
CREATE TABLE table_13981938_1 (
wine_style VARCHAR,
grand_cru VARCHAR
) | what's the wine style with grand cru being roman e-conti | SELECT wine_style FROM table_13981938_1 WHERE grand_cru = "Romanée-Conti" | sql_create_context |
CREATE TABLE table_41864 (
"Peel" text,
"Wins" real,
"Byes" real,
"Losses" real,
"Draws" real,
"Against" real
) | What is the largest Against with a Byes larger than 0? | SELECT MAX("Against") FROM table_41864 WHERE "Byes" > '0' | wikisql |
CREATE TABLE table_36695 (
"Game" text,
"Date" text,
"Home Team" text,
"Result" text,
"Road Team" text,
"TV Time" text
) | Which was the home team for game 3? | SELECT "Home Team" FROM table_36695 WHERE "Game" = 'game 3' | wikisql |
CREATE TABLE table_60738 (
"Outcome" text,
"Date" text,
"Tournament" text,
"Surface" text,
"Partner" text,
"Opponents in the final" text,
"Score in the final" text
) | What are the Opponents at the Schenectady, U.S. Tournament? | SELECT "Opponents in the final" FROM table_60738 WHERE "Tournament" = 'schenectady, u.s.' | wikisql |
CREATE TABLE table_18328569_1 (
new_entries_this_round VARCHAR,
round VARCHAR
) | How many new entries started in the quarter finals? | SELECT new_entries_this_round FROM table_18328569_1 WHERE round = "Quarter finals" | sql_create_context |
CREATE TABLE table_72557 (
"Rank" text,
"Common" text,
"Population" real,
"Area (km 2 )" text,
"Density (inhabitants/km 2 )" text,
"Altitude (mslm)" real
) | Which common has an area (km2) of 38.38? | SELECT "Common" FROM table_72557 WHERE "Area (km 2 )" = '38.38' | 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
)
... | count the number of patients whose year of birth is less than 2167 and drug route is inhalation? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.dob_year < "2167" AND prescriptions.route = "INHALATION" | mimicsql_data |
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 jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,0)
)
CREATE TABLE locations (
LOCAT... | For those employees who do not work in departments with managers that have ids between 100 and 200, draw a bar chart about the distribution of phone_number and manager_id , sort by the y-axis in ascending. | SELECT PHONE_NUMBER, MANAGER_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY MANAGER_ID | nvbench |
CREATE TABLE mission (
Mission_ID int,
Ship_ID int,
Code text,
Launched_Year int,
Location text,
Speed_knots int,
Fate text
)
CREATE TABLE ship (
Ship_ID int,
Name text,
Type text,
Nationality text,
Tonnage int
) | Return a bar chart showing the total number of each ship type, and I want to display X in descending order. | SELECT Type, COUNT(Type) FROM ship GROUP BY Type ORDER BY Type DESC | nvbench |
CREATE TABLE table_39705 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Attendance" text,
"Record" text
) | What was the loss of the game when the record was 32 34? | SELECT "Loss" FROM table_39705 WHERE "Record" = '32–34' | wikisql |
CREATE TABLE tourist_attraction_features (
tourist_attraction_id number,
feature_id number
)
CREATE TABLE visits (
visit_id number,
tourist_attraction_id number,
tourist_id number,
visit_date time,
visit_details text
)
CREATE TABLE visitors (
tourist_id number,
tourist_details text... | Show the names and ids of tourist attractions that are visited at least two times. | SELECT T1.name, T2.tourist_attraction_id FROM tourist_attractions AS T1 JOIN visits AS T2 ON T1.tourist_attraction_id = T2.tourist_attraction_id GROUP BY T2.tourist_attraction_id HAVING COUNT(*) >= 2 | spider |
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 ... | 在09年7月5日到17年7月6日这段时间,患者卫逸明一共有多少检验报告单,把这些检验报告单的标本采集部位列出来 | (SELECT jybgb.BBCJBW FROM person_info JOIN hz_info JOIN mzjzjlb JOIN 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 = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE person_info.XM = '卫逸明' AND j... | css |
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 demographic (... | count the number of married patients who underwent dx ultrasound heart. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.marital_status = "MARRIED" AND procedures.short_title = "Dx ultrasound-heart" | mimicsql_data |
CREATE TABLE table_204_980 (
id number,
"name" text,
"type" text,
"elevation\n(ground station)" number,
"elevation\n(mountain station)" number,
"slope length" number,
"capacity\n(persons/hour)" number,
"construction year" number
) | which one has the most elevation -lrb- mountain station -rrb- on the chart | SELECT "name" FROM table_204_980 ORDER BY "elevation\n(mountain station)" DESC LIMIT 1 | squall |
CREATE TABLE table_1566848_6 (
pictorials VARCHAR,
interview_subject VARCHAR
) | Name the pictorials when the interview subject is steve jobs | SELECT pictorials FROM table_1566848_6 WHERE interview_subject = "Steve Jobs" | sql_create_context |
CREATE TABLE table_1198 (
"Series Ep." text,
"Episode" real,
"Netflix" text,
"Segment A" text,
"Segment B" text,
"Segment C" text,
"Segment D" text
) | Name the number of series episode for s piston | SELECT COUNT("Series Ep.") FROM table_1198 WHERE "Segment A" = 's Piston' | wikisql |
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
CREATE TABLE locations (
LOCATION_ID decimal(4,0),
STREET_ADDRESS varchar(40),
POSTAL_CODE varchar(12),
CITY ... | For those employees who did not have any job in the past, show me about the distribution of hire_date and the average of salary bin hire_date by time in a bar chart, could you order by the Y in descending? | SELECT HIRE_DATE, AVG(SALARY) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) ORDER BY AVG(SALARY) DESC | nvbench |
CREATE TABLE table_name_13 (
tournaments INTEGER,
pro_debut VARCHAR
) | What is the highest Tournaments, when Pro Debut is 'July 2002'? | SELECT MAX(tournaments) FROM table_name_13 WHERE pro_debut = "july 2002" | sql_create_context |
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationDate time,
CloseReasonTypeId number,
CloseAsOffTopicReasonTypeId number,
DuplicateOfQuestionId number,
BelongsOnBaseHostAddress text
)
CREATE TABLE Posts (
Id number,
PostTypeId number,
Accepted... | Users who have python + ios tags under age of 20. | SELECT DISTINCT (DisplayName), Location, CONCAT(AboutMe, WebsiteUrl), Reputation, CONCAT('http://stackoverflow.com/users/', Users.Id) FROM Users INNER JOIN Posts ON Posts.OwnerUserId = Users.Id INNER JOIN PostTags ON (Posts.Id = PostTags.PostId) WHERE PostTags.TagId IN (SELECT Id FROM Tags WHERE TagName = 'ios') AND Us... | sede |
CREATE TABLE table_58750 (
"South West DFL" text,
"Wins" real,
"Byes" real,
"Losses" real,
"Draws" real,
"Against" real
) | What is the lowest against that has less than 9 wins, and draws smaller than 0? | SELECT MIN("Against") FROM table_58750 WHERE "Wins" < '9' AND "Draws" < '0' | wikisql |
CREATE TABLE movie (
mid int,
title text,
release_year int,
title_aka text,
budget text
)
CREATE TABLE cast (
id int,
msid int,
aid int,
role text
)
CREATE TABLE copyright (
id int,
msid int,
cid int
)
CREATE TABLE tags (
id int,
msid int,
kid int
)
CREATE... | What year is the movie ' Dead Poets Society ' from ? | SELECT release_year FROM movie WHERE title = 'Dead Poets Society' | imdb |
CREATE TABLE paperdataset (
paperid int,
datasetid int
)
CREATE TABLE dataset (
datasetid int,
datasetname varchar
)
CREATE TABLE writes (
paperid int,
authorid int
)
CREATE TABLE author (
authorid int,
authorname varchar
)
CREATE TABLE paperfield (
fieldid int,
paperid int
)... | Papers on ImageNet | SELECT DISTINCT paper.paperid FROM dataset, paper, paperdataset WHERE dataset.datasetname = 'ImageNet' AND paperdataset.datasetid = dataset.datasetid AND paper.paperid = paperdataset.paperid | scholar |
CREATE TABLE gwyjzb (
CLINIC_ID text,
CLINIC_TYPE text,
COMP_ID text,
DATA_ID text,
DIFF_PLACE_FLG number,
FERTILITY_STS number,
FLX_MED_ORG_ID text,
HOSP_LEV number,
HOSP_STS number,
IDENTITY_CARD text,
INPT_AREA_BED text,
INSURED_IDENTITY number,
INSURED_STS text,
... | 未就业人员医疗就诊的医疗费总额达到720.31元以上的就诊记录在2010年9月9日到2020年9月29日的医疗机构2009184内有多少个? | SELECT COUNT(*) FROM gwyjzb WHERE gwyjzb.MED_SER_ORG_NO = '2009184' AND gwyjzb.IN_HOSP_DATE BETWEEN '2010-09-09' AND '2020-09-29' AND gwyjzb.INSURED_STS = '未就业' AND gwyjzb.MED_AMOUT >= 720.31 UNION SELECT COUNT(*) FROM fgwyjzb WHERE fgwyjzb.MED_SER_ORG_NO = '2009184' AND fgwyjzb.IN_HOSP_DATE BETWEEN '2010-09-09' AND '2... | css |
CREATE TABLE Staff (
staff_id INTEGER,
staff_address_id INTEGER,
nickname VARCHAR(80),
first_name VARCHAR(80),
middle_name VARCHAR(80),
last_name VARCHAR(80),
date_of_birth DATETIME,
date_joined_staff DATETIME,
date_left_staff DATETIME
)
CREATE TABLE Lessons (
lesson_id INTEGER,... | For each customer status code, how many customers are classified that way. Visualize by bar chart. | SELECT customer_status_code, COUNT(*) FROM Customers GROUP BY customer_status_code | 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, find name and manufacturer , and group by attribute name, and visualize them by a bar chart, sort Manufacturer in descending order. | SELECT T1.Name, T1.Manufacturer FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name, T1.Name ORDER BY T1.Manufacturer DESC | nvbench |
CREATE TABLE table_name_91 (
constructor VARCHAR,
chassis VARCHAR,
driver VARCHAR
) | Who is the constructor for driver Niki Lauda and a chassis of mp4/1c? | SELECT constructor FROM table_name_91 WHERE chassis = "mp4/1c" AND driver = "niki lauda" | sql_create_context |
CREATE TABLE table_17565 (
"Stage" text,
"Winner" text,
"General classification" text,
"Points classification" text,
"Mountains classification" text,
"Young rider classification" text,
"Intergiro classification" text,
"Trofeo Fast Team" text
) | Who's the leader in the general classification in stage 1a? | SELECT "General classification" FROM table_17565 WHERE "Stage" = '1a' | wikisql |
CREATE TABLE Accounts (
account_id INTEGER,
customer_id INTEGER,
account_name VARCHAR(50),
other_account_details VARCHAR(255)
)
CREATE TABLE Customers_Cards (
card_id INTEGER,
customer_id INTEGER,
card_type_code VARCHAR(15),
card_number VARCHAR(80),
date_valid_from DATETIME,
dat... | What are card ids, customer ids, card types, and card numbers for each customer card? | SELECT card_type_code, SUM(card_number) FROM Customers_Cards GROUP BY card_type_code | nvbench |
CREATE TABLE table_name_49 (
overall INTEGER,
school_club_team VARCHAR,
round VARCHAR
) | What is the average overall rank of all players drafted from Duke after round 9? | SELECT AVG(overall) FROM table_name_49 WHERE school_club_team = "duke" AND round > 9 | sql_create_context |
CREATE TABLE table_19209 (
"Name" text,
"2011 Census" real,
"2006 Census" real,
"% change" text,
"Land area (km\u00b2)" text,
"Density (pop/km\u00b2)" text,
"Population rank" real
) | Where was there a change of 6.5%? | SELECT "Name" FROM table_19209 WHERE "% change" = '6.5' | wikisql |
CREATE TABLE table_5252 (
"Name" text,
"Nationality" text,
"Position" text,
"Tenure Began" real,
"Term Ending" real
) | Position of member, and a Nationality of india is what sum of term ending? | SELECT SUM("Term Ending") FROM table_5252 WHERE "Position" = 'member' AND "Nationality" = 'india' | wikisql |
CREATE TABLE table_7638 (
"Rank" real,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) | What is the lowest silver for France with a rank less than 5 and a total larger than 19? | SELECT MIN("Silver") FROM table_7638 WHERE "Rank" < '5' AND "Nation" = 'france' AND "Total" > '19' | wikisql |
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefined boolean,
PostNoticeDurationId number
)
CREATE TABLE Posts (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
Deletio... | Dear Duplicates: Highest Scoring Closed as Duplicate Questions. | SELECT p.Id AS "post_link", p.Score FROM Posts AS p INNER JOIN PostLinks AS l ON p.Id = l.PostId AND l.LinkTypeId = 3 ORDER BY p.Score DESC | 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 diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
C... | among patients diagnosed with icd9 code 57450, how many of them had abnormal delta lab test results? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.icd9_code = "57450" AND lab.flag = "delta" | mimicsql_data |
CREATE TABLE table_name_21 (
venue VARCHAR,
score VARCHAR,
date VARCHAR
) | Where did the competition take place at on August 3, 2005 with a score of 5-0? | SELECT venue FROM table_name_21 WHERE score = "5-0" AND date = "august 3, 2005" | sql_create_context |
CREATE TABLE table_23346303_5 (
player VARCHAR,
field_goals VARCHAR
) | If the field goals is 26, what are the players names? | SELECT player FROM table_23346303_5 WHERE field_goals = 26 | sql_create_context |
CREATE TABLE table_76198 (
"Name" text,
"Year of release" text,
"Developer" text,
"Publisher" text,
"Original platforms" text
) | Which developer has a year of cancelled releases? | SELECT "Developer" FROM table_76198 WHERE "Year of release" = 'cancelled' | wikisql |
CREATE TABLE table_name_39 (
home_team VARCHAR,
venue VARCHAR
) | What is the home team at windy hill? | SELECT home_team FROM table_name_39 WHERE venue = "windy hill" | sql_create_context |
CREATE TABLE course_offering (
offering_id int,
course_id int,
semester int,
section_number int,
start_time time,
end_time time,
monday varchar,
tuesday varchar,
wednesday varchar,
thursday varchar,
friday varchar,
saturday varchar,
sunday varchar,
has_final_proje... | Do you know the prerequisites for MEDADM 807 and 515 ? | SELECT DISTINCT COURSE_0.department, COURSE_0.name, COURSE_0.number FROM course AS COURSE_0, course AS COURSE_1, course_prerequisite WHERE (COURSE_1.number = 807 OR COURSE_1.number = 515) AND COURSE_0.course_id = course_prerequisite.pre_course_id AND COURSE_1.course_id = course_prerequisite.course_id AND COURSE_1.depar... | advising |
CREATE TABLE table_33542 (
"Rank" real,
"Name" text,
"Population ( 2011 Census )" real,
"Percent of national population" text,
"% growth (2006\u201311)" text,
"Land area (km\u00b2)" real,
"Population density (/km 2 )" real,
"House of Commons seats" real,
"House of Commons seats (%)" ... | What was the highest rank of an area with a population density larger than 5.7 and a 2006 2011 percentage growth of 5.7%? | SELECT MAX("Rank") FROM table_33542 WHERE "Population density (/km 2 )" > '5.7' AND "% growth (2006\u201311)" = '5.7%' | wikisql |
CREATE TABLE table_66807 (
"Year" real,
"Tournament" text,
"Venue" text,
"Result" text,
"Extra" text
) | Which venue has 1st as the result? | SELECT "Venue" FROM table_66807 WHERE "Result" = '1st' | wikisql |
CREATE TABLE table_53074 (
"Building" text,
"Height" text,
"Floors" real,
"Year" text,
"Status" text
) | For the Year 2013 what building(s) had more than 15 Floors? | SELECT "Building" FROM table_53074 WHERE "Floors" > '15' AND "Year" = '2013' | wikisql |
CREATE TABLE table_74071 (
"Player" text,
"Team" text,
"Matches" real,
"Runs" real,
"Average" text,
"Strike rate" text,
"Highest Score" text,
"100s" real,
"50s" real
) | If the team is Gloucestershire, what is the average? | SELECT "Average" FROM table_74071 WHERE "Team" = 'Gloucestershire' | wikisql |
CREATE TABLE t_kc21 (
CLINIC_ID text,
CLINIC_TYPE text,
COMP_ID text,
DATA_ID text,
DIFF_PLACE_FLG number,
FERTILITY_STS number,
FLX_MED_ORG_ID text,
HOSP_LEV number,
HOSP_STS number,
IDENTITY_CARD text,
INPT_AREA_BED text,
INSURED_IDENTITY number,
INSURED_STS text,
... | 患者范翔飞医保的统筹基金总共被花了多少,时间是从00年6月23日到12年10月12日 | SELECT SUM(t_kc24.OVE_PAY) FROM t_kc21 JOIN t_kc24 ON t_kc21.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE t_kc21.PERSON_NM = '范翔飞' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2000-06-23' AND '2012-10-12' | css |
CREATE TABLE table_9391 (
"Team" text,
"First NHL season" text,
"Last NHL season" text,
"Seasons completed" real,
"Playoff appearances" real,
"Series won" real,
"Finals appearances" real,
"Division titles" real,
"Conference titles" real,
"Stanley Cup Championships" real
) | How many division titles does the team with 23 playoff appearances and more than 1 conference titles have? | SELECT SUM("Division titles") FROM table_9391 WHERE "Playoff appearances" = '23' AND "Conference titles" > '1' | wikisql |
CREATE TABLE table_name_31 (
passengers INTEGER,
airport VARCHAR
) | How many Passengers that have an Airport in indonesia, denpasar? | SELECT AVG(passengers) FROM table_name_31 WHERE airport = "indonesia, denpasar" | sql_create_context |
CREATE TABLE ReviewTaskResultTypes (
Id number,
Name text,
Description text
)
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
InputTitle text,
MarkdownInputGuidance text,
MarkdownPostOwnerGuidance text,
MarkdownPrivilegedUserGuidance text,
MarkdownConce... | View to Vote Ratio per User. | SELECT P.Title, P.ViewCount, P.Score, CONCAT(P.ViewCount / NULLIF(P.Score, 0), ':1') AS Ratio FROM Posts AS P WHERE P.OwnerUserId = '##UserId##' AND P.PostTypeId = 1 | sede |
CREATE TABLE table_24021 (
"Week" real,
"Player" text,
"Team" text,
"Opponent" text,
"Carries" real,
"Yards" real,
"Average" text,
"Touchdowns" real
) | Which team did the player have who had 27 total carries? | SELECT "Team" FROM table_24021 WHERE "Carries" = '27' | wikisql |
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CRE... | does patient 031-24513 have the result of his or her microbiology test until 10/2105? | SELECT COUNT(*) > 0 FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-24513')) AND STRFTIME('%y-%m', microlab.culturetakentime) <= '2105-10' | eicu |
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefined boolean,
PostNoticeDurationId number
)
CREATE TABLE ReviewTasks (
Id number,
ReviewTaskTypeId number,
CreationDate time,
DeletionDate time,
ReviewTaskStateId numb... | rajkot's developers above 500 reputation. | SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation FROM Users WHERE (LOWER(Location) LIKE '%kolkata%' OR UPPER(Location) LIKE '%KOLKATA%' OR Location LIKE '%Kolkata%') AND Reputation >= 500 ORDER BY Reputation DESC | sede |
CREATE TABLE table_31671 (
"Year" text,
"Broadcast date" text,
"BBC One total viewing" text,
"BBC One Rank" text,
"BBC Two total viewing" text,
"BBC Two Rank" text
) | What was the rank of BBC 2 in 2005? | SELECT "BBC Two Rank" FROM table_31671 WHERE "Year" = '2005' | wikisql |
CREATE TABLE table_name_36 (
d_46 VARCHAR,
d_42 VARCHAR
) | Name the D 46 which has D 42 of r 14 | SELECT d_46 FROM table_name_36 WHERE d_42 = "r 14" | sql_create_context |
CREATE TABLE diagnoses (
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 procedures (
... | give me the number of patients whose discharge location is rehab/distinct part hosp and admission year is less than 2115? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.discharge_location = "REHAB/DISTINCT PART HOSP" AND demographic.admityear < "2115" | mimicsql_data |
CREATE TABLE table_11485 (
"Track" real,
"Title" text,
"Translation" text,
"Composer" text,
"Recorded" text
) | Which title has tracks smaller than 7 with translation of an island? | SELECT "Title" FROM table_11485 WHERE "Track" < '7' AND "Translation" = 'an island' | wikisql |
CREATE TABLE Affiliated_With (
Physician INTEGER,
Department INTEGER,
PrimaryAffiliation BOOLEAN
)
CREATE TABLE Undergoes (
Patient INTEGER,
Procedures INTEGER,
Stay INTEGER,
DateUndergoes DATETIME,
Physician INTEGER,
AssistingNurse INTEGER
)
CREATE TABLE Procedures (
Code INTE... | A bar chart for listing the number of the name of physicians who took some appointment, list from low to high by the bars please. | SELECT Name, COUNT(Name) FROM Appointment AS T1 JOIN Physician AS T2 ON T1.Physician = T2.EmployeeID GROUP BY Name ORDER BY Name | nvbench |
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 number of patients with mesenteric ischemia primary disease who died in or before 2164? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "MESENTERIC ISCHEMIA" AND demographic.dod_year <= "2164.0" | mimicsql_data |
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... | report the number of patients with the diagnoses of pure hyperglyceridemia who are younger than 30 years of age. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.age < "30" AND diagnoses.long_title = "Pure hyperglyceridemia" | mimicsql_data |
CREATE TABLE table_52470 (
"Productions" text,
"Rose" text,
"Louise" text,
"Dainty June" text,
"Herbie" text,
"Director" text
) | Who was Dainty June when Tammy Blanchard was Louise? | SELECT "Dainty June" FROM table_52470 WHERE "Louise" = 'tammy blanchard' | wikisql |
CREATE TABLE table_name_2 (
points INTEGER,
chassis VARCHAR
) | What is the average points for the chassis LOLA LC88? | SELECT AVG(points) FROM table_name_2 WHERE chassis = "lola lc88" | sql_create_context |
CREATE TABLE table_8342 (
"Game" real,
"Date" text,
"Opponent" text,
"Score" text,
"Location" text,
"Record" text
) | Where was the game that was larger than 30 and scored 106-111 | SELECT "Location" FROM table_8342 WHERE "Game" > '30' AND "Score" = '106-111' | wikisql |
CREATE TABLE table_74723 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | What was the size of the largest crowd that Essendon played in front of as the away team? | SELECT MAX("Crowd") FROM table_74723 WHERE "Away team" = 'essendon' | wikisql |
CREATE TABLE table_12929 (
"Player" text,
"Country" text,
"Year(s) won" text,
"Total" real,
"To par" real
) | Which Year(s) won with a To par of 12? | SELECT "Year(s) won" FROM table_12929 WHERE "To par" = '12' | wikisql |
CREATE TABLE table_45877 (
"Region" text,
"Host" text,
"Venue" text,
"City" text,
"State" text
) | Which city is in Georgia? | SELECT "City" FROM table_45877 WHERE "State" = 'georgia' | wikisql |
CREATE TABLE table_34468 (
"Outcome" text,
"Date" text,
"Championship" text,
"Surface" text,
"Opponent in the final" text,
"Score in the final" text
) | Which championship had an oppenent of mario an i in the final? | SELECT "Championship" FROM table_34468 WHERE "Opponent in the final" = 'mario ančić' | wikisql |
CREATE TABLE locations (
location_id number,
location_name text,
address text,
other_details text
)
CREATE TABLE features (
feature_id number,
feature_details text
)
CREATE TABLE ref_attraction_types (
attraction_type_code text,
attraction_type_description text
)
CREATE TABLE tourist_... | What are the visit date and details of the visitor whose detail is 'Vincent'? | SELECT T2.visit_date, T2.visit_details FROM visitors AS T1 JOIN visits AS T2 ON T1.tourist_id = T2.tourist_id WHERE T1.tourist_details = "Vincent" | spider |
CREATE TABLE table_name_62 (
played INTEGER,
drawn INTEGER
) | What is the largest played when the drawn is less than 1? | SELECT MAX(played) FROM table_name_62 WHERE drawn < 1 | sql_create_context |
CREATE TABLE table_29111 (
"Series #" real,
"Season #" real,
"Title" text,
"Director" text,
"Writer" text,
"Original Airdate" text
) | Who wrote 'the word'? | SELECT "Writer" FROM table_29111 WHERE "Title" = 'The Word' | wikisql |
CREATE TABLE program (
program_id int,
name varchar,
college varchar,
introduction varchar
)
CREATE TABLE student (
student_id int,
lastname varchar,
firstname varchar,
program_id int,
declare_major varchar,
total_credit int,
total_gpa float,
entered_as varchar,
admi... | The Fall 2005 CMBIOL 995 classes are taught by how many professors ? | SELECT COUNT(DISTINCT instructor.instructor_id) FROM course, course_offering, instructor, offering_instructor, semester WHERE course.course_id = course_offering.course_id AND course.department = 'CMBIOL' AND course.number = 995 AND offering_instructor.instructor_id = instructor.instructor_id AND offering_instructor.off... | advising |
CREATE TABLE table_30179 (
"Proceed to Quarter-final" text,
"Match points" text,
"Aggregate score" text,
"Points margin" real,
"Eliminated from competition" text
) | When brive proceeded to quarter final what were the match points? | SELECT "Match points" FROM table_30179 WHERE "Proceed to Quarter-final" = 'Brive' | wikisql |
CREATE TABLE table_21 (
"Equivalent NATO Rank Code" text,
"Rank in Spanish" text,
"Rank in English" text,
"Commonwealth equivalent" text,
"US Air Force equivalent" text
) | If you're a major general in the US air force then what ranking will you receive in the commonwealth's air force? | SELECT "Commonwealth equivalent" FROM table_21 WHERE "US Air Force equivalent" = 'Major General' | wikisql |
CREATE TABLE table_14918 (
"Season" text,
"Series" text,
"Races" text,
"Wins" text,
"Podiums" text,
"Points" text,
"Final Placing" text
) | Which Race has the Toyota Racing Series New Zealand and 0 wins? | SELECT "Races" FROM table_14918 WHERE "Series" = 'toyota racing series new zealand' AND "Wins" = '0' | wikisql |
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost numbe... | count the number of patients who had a plastic surgery consultation procedure performed two or more times this year. | SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, COUNT(*) AS c1 FROM patient WHERE patient.patientunitstayid = (SELECT treatment.patientunitstayid FROM treatment WHERE treatment.treatmentname = 'plastic surgery consultation' AND DATETIME(treatment.treatmenttime, 'start of year') = DATETIME(CURRENT_TI... | eicu |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
... | give me the number of patients whose drug name is oxycodone-acetaminophen? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE prescriptions.drug = "Oxycodone-Acetaminophen" | mimicsql_data |
CREATE TABLE table_11815 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | Where did Essendon play as the away team? | SELECT "Venue" FROM table_11815 WHERE "Away team" = 'essendon' | 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... | 从一0年一月三十一日到一五年五月二日,患者24294276在哪家医院就诊的次数最多 | SELECT t_kc21.MED_SER_ORG_NO FROM t_kc21 WHERE t_kc21.PERSON_ID = '24294276' AND t_kc21.IN_HOSP_DATE BETWEEN '2010-01-31' AND '2015-05-02' GROUP BY t_kc21.MED_SER_ORG_NO ORDER BY COUNT(*) DESC LIMIT 1 | css |
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 products with a price between 60 and 120, give me the comparison about manufacturer over the name , sort by the y-axis in ascending please. | SELECT Name, Manufacturer FROM Products WHERE Price BETWEEN 60 AND 120 ORDER BY Manufacturer | nvbench |
CREATE TABLE table_name_46 (
car_no VARCHAR,
team VARCHAR,
driver VARCHAR
) | What is the car number for Jeff Simmons on the Rahal Letterman team? | SELECT car_no FROM table_name_46 WHERE team = "rahal letterman" AND driver = "jeff simmons" | sql_create_context |
CREATE TABLE table_42076 (
"Category" text,
"Frequency" text,
"White" text,
"Brown" text,
"Black" text,
"Amerindian" text,
"Yellow" text,
"Total" text,
"difference between White and Black" real
) | Which Category in Black has a Brown of 6,54%? | SELECT "Black" FROM table_42076 WHERE "Brown" = '6,54%' | wikisql |
CREATE TABLE table_name_59 (
rank VARCHAR,
gross VARCHAR
) | WHAT IS THE RANK WITH A GROSS OF $96,773,200? | SELECT COUNT(rank) FROM table_name_59 WHERE gross = "$96,773,200" | sql_create_context |
CREATE TABLE table_9166 (
"Season" text,
"Games" real,
"Lost" real,
"Points" real,
"Pct %" real,
"Goals For" real,
"Goals Against" real,
"Standing" text
) | How many Goals for were recorded when there was a percentage smaller than 0.519 and points greater than 65? | SELECT COUNT("Goals For") FROM table_9166 WHERE "Pct %" < '0.519' AND "Points" > '65' | wikisql |
CREATE TABLE PostTags (
PostId number,
TagId number
)
CREATE TABLE PostsWithDeleted (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body text,
OwnerUserId number,
OwnerDis... | Recent questions with a score of 5 or more.. List of recent questions on a site with score of 5 or more, capped at 500 | SELECT 'post_link' = Id, Score, CAST(TIME_TO_STR(CreationDate, '%d %b %Y') AS TEXT(11)) AS Date FROM Posts WHERE PostTypeId = 1 AND Score >= 5 AND ClosedDate IS NULL ORDER BY CreationDate DESC LIMIT 500 | sede |
CREATE TABLE table_60648 (
"Date" text,
"Opponent" text,
"Score" text,
"Decision" text,
"Attendance" real,
"Record" text
) | WHAT IS THE HIGHEST ATTENDANCE FOR THE PHOENIX COYOTES? | SELECT MAX("Attendance") FROM table_60648 WHERE "Opponent" = 'phoenix coyotes' | wikisql |
CREATE TABLE table_name_68 (
outcome VARCHAR,
date VARCHAR
) | What outcome has September 23, 2013 as the date? | SELECT outcome FROM table_name_68 WHERE date = "september 23, 2013" | sql_create_context |
CREATE TABLE table_72156 (
"No." real,
"Date" text,
"Tournament" text,
"Winning score" text,
"To par" text,
"Margin of victory" text,
"Runner(s)-up" text
) | Where is the margin of victory dated mar 28, 2004? | SELECT "Margin of victory" FROM table_72156 WHERE "Date" = 'Mar 28, 2004' | wikisql |
CREATE TABLE table_68742 (
"Region served" text,
"City" text,
"Channels ( Analog / Digital )" text,
"First air date" text,
"ERP (Analog/ Digital)" text,
"HAAT (Analog/ Digital) 1" text,
"Transmitter Location" text
) | What channels first aired on 31 December 1990 in the Southern Downs region? | SELECT "Channels ( Analog / Digital )" FROM table_68742 WHERE "First air date" = '31 december 1990' AND "Region served" = 'southern downs' | wikisql |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.