context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE table_name_49 (
surface VARCHAR,
championship VARCHAR
) | What is Surface, when Championship is Australian Open? | SELECT surface FROM table_name_49 WHERE championship = "australian open" | sql_create_context |
CREATE TABLE table_61285 (
"Round" real,
"Date" text,
"Grand Prix" text,
"Circuit" text,
"Pole Position" text,
"Fastest Lap" text,
"Race Winner" text
) | What was the fastest lap for Grand Prix dutch tt? | SELECT "Fastest Lap" FROM table_61285 WHERE "Grand Prix" = 'dutch tt' | wikisql |
CREATE TABLE table_29414946_3 (
manner_of_departure VARCHAR,
outgoing_manager VARCHAR
) | How many times did Silas leave as a team manager? | SELECT COUNT(manner_of_departure) FROM table_29414946_3 WHERE outgoing_manager = "Silas" | sql_create_context |
CREATE TABLE candidate (
Candidate_ID int,
People_ID int,
Poll_Source text,
Date text,
Support_rate real,
Consider_rate real,
Oppose_rate real,
Unsure_rate real
)
CREATE TABLE people (
People_ID int,
Sex text,
Name text,
Date_of_Birth text,
Height real,
Weight re... | Count the number of people of each sex who have a weight higher than 85, order y axis from low to high order. | SELECT Sex, COUNT(*) FROM people WHERE Weight > 85 GROUP BY Sex ORDER BY COUNT(*) | nvbench |
CREATE TABLE table_name_48 (
country VARCHAR,
place VARCHAR,
player VARCHAR
) | What country has the t7 place, and player Peter Oosterhuis? | SELECT country FROM table_name_48 WHERE place = "t7" AND player = "peter oosterhuis" | sql_create_context |
CREATE TABLE table_32512 (
"Total tenure rank" real,
"Uninterrupted rank" real,
"Name" text,
"State represented" text,
"Total tenure time" text,
"Uninterrupted time" text
) | What is the total tenure rank of the person with an uninterrupted time of 49 years, 349 days? | SELECT "Total tenure rank" FROM table_32512 WHERE "Uninterrupted time" = '49 years, 349 days' | wikisql |
CREATE TABLE t_kc21 (
MED_CLINIC_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
COMP_ID text,
PERSON_ID text,
PERSON_NM text,
IDENTITY_CARD text,
SOC_SRT_CARD text,
PERSON_SEX number,
PERSON_AGE number,
IN_HOSP_DATE time,
OUT_HOSP_DATE time,
DIFF_PLACE_FLG numb... | 这个医疗就诊15040416444入院时诊断的编号是什么?疾病名称是什么? | SELECT IN_DIAG_DIS_CD, IN_DIAG_DIS_NM FROM t_kc21 WHERE MED_CLINIC_ID = '15040416444' | css |
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... | How many votes do I receive per answer?. On average, how many upvotes do I receive for each answer I give? | WITH VotesOnPosts AS (SELECT v.Id AS VoteId, p.Id AS PostId, p.PostTypeId AS PostTypeId, p.OwnerUserId AS UserId, vt.Name AS VoteTypeName FROM Votes AS v INNER JOIN Posts AS p ON v.PostId = p.Id INNER JOIN VoteTypes AS vt ON v.VoteTypeId = vt.Id), Answers AS (SELECT OwnerUserId AS UserId, Id AS PostId FROM Posts WHERE ... | sede |
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... | Next semester , what classes will Dr. James Grotberg teach ? | SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, instructor, offering_instructor, semester WHERE course.course_id = course_offering.course_id AND instructor.name LIKE '%James Grotberg%' AND offering_instructor.instructor_id = instructor.instructor_id AND offering_instructor.of... | advising |
CREATE TABLE table_204_712 (
id number,
"rank" number,
"athlete" text,
"nationality" text,
"time" text,
"notes" text
) | which athlete had the fastest time for the 20km ? | SELECT "athlete" FROM table_204_712 ORDER BY "time" LIMIT 1 | squall |
CREATE TABLE table_50574 (
"Place" text,
"Downhill" real,
"Competitor" text,
"1st run" text,
"2nd run" text,
"Points" text
) | Who is the competitor with a downhill of more than 55, and 1st DQ run? | SELECT "Competitor" FROM table_50574 WHERE "Downhill" > '55' AND "1st run" = 'dq' | wikisql |
CREATE TABLE teachers (
LastName TEXT,
FirstName TEXT,
Classroom INTEGER
)
CREATE TABLE list (
LastName TEXT,
FirstName TEXT,
Grade INTEGER,
Classroom INTEGER
) | Scatter plot to show classroom on x axis and grade on y axis. | SELECT Classroom, Grade FROM list | nvbench |
CREATE TABLE table_name_66 (
away_team VARCHAR,
home_team VARCHAR
) | What is footscray's away team score? | SELECT away_team AS score FROM table_name_66 WHERE home_team = "footscray" | sql_create_context |
CREATE TABLE table_27690037_2 (
kickoff VARCHAR,
game_site VARCHAR
) | Name the kickoff for rheinstadion | SELECT kickoff FROM table_27690037_2 WHERE game_site = "Rheinstadion" | sql_create_context |
CREATE TABLE table_63142 (
"Elector" text,
"Nationality" text,
"Faction" text,
"Elevated" text,
"Elevator" text
) | What's the elevator of Jacques D'euse? | SELECT "Elevator" FROM table_63142 WHERE "Elector" = 'jacques d''euse' | wikisql |
CREATE TABLE Rating (
rID int,
mID int,
stars int,
ratingDate date
)
CREATE TABLE Movie (
mID int,
title text,
year int,
director text
)
CREATE TABLE Reviewer (
rID int,
name text
) | For each director, return the director's name together with the highest rating among all of their movies and ignore movies whose director is NULL Could you plot the result with a bar chart?, and I want to list x-axis in ascending order. | SELECT director, MAX(T1.stars) FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID WHERE director <> "null" GROUP BY director ORDER BY director | nvbench |
CREATE TABLE PostHistory (
Id number,
PostHistoryTypeId number,
PostId number,
RevisionGUID other,
CreationDate time,
UserId number,
UserDisplayName text,
Comment text,
Text text,
ContentLicense text
)
CREATE TABLE Tags (
Id number,
TagName text,
Count number,
Ex... | Votes: Biggest downvoters among top users. | SELECT Id AS "user_link", Reputation, UpVotes, DownVotes, ROUND(CAST(100 * DownVotes AS FLOAT) / (UpVotes + DownVotes), 1) AS "%_of_downvotes" FROM Users WHERE Reputation > 3000 AND DownVotes > 0 ORDER BY 'downvotes' DESC | sede |
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
CREATE TABLE zyjzjlb_jybgb (
YLJGDM_ZYJZJLB text,
BGDH number,
YLJGDM number
)
CREATE TABLE zyjzjlb (
CYBQDM text,
CYBQMC text,
CYCWH text,
CYKSDM text,
CYKSMC text,
CYSJ time,
CYZTDM number,
... | 在2010年5月30日到2014年3月23日内患者08033471有多少检测结果指标记录的检验人为88248924的检测指标流水号? | 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 table_64893 (
"Size" text,
"Density" text,
"Tracks" real,
"Coercivity" text,
"Unformatted capacity per side" text
) | What is the unformatted capacity per side if the size is 8in? | SELECT "Unformatted capacity per side" FROM table_64893 WHERE "Size" = '8in' | 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, a scatter chart shows the correlation between price and revenue , and group by attribute headquarter. | SELECT Price, Revenue FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter | nvbench |
CREATE TABLE table_12995 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Attendance" text
) | Who was the game played against on October 9, 1966? | SELECT "Opponent" FROM table_12995 WHERE "Date" = 'october 9, 1966' | wikisql |
CREATE TABLE table_train_254 (
"id" int,
"gender" string,
"systolic_blood_pressure_sbp" int,
"heart_disease" bool,
"hgba1c" float,
"renal_disease" bool,
"creatinine_clearance_cl" float,
"diastolic_blood_pressure_dbp" int,
"diabetes" bool,
"hypertension" bool,
"fasting_glucose... | renal insufficiency ( serum creatinine > 1.5 mg / dl for male ; > 1.2 mg / dl for female ) | SELECT * FROM table_train_254 WHERE renal_disease = 1 OR ((creatinine_clearance_cl > 1.5 AND gender = 'male') OR (creatinine_clearance_cl > 1.5 AND gender = 'female')) | criteria2sql |
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... | Return a bar chart about the distribution of All_Games and All_Games_Percent , I want to display total number in descending order. | SELECT All_Games, All_Games_Percent FROM basketball_match ORDER BY All_Games_Percent DESC | nvbench |
CREATE TABLE table_16329 (
"Pick #" real,
"CFL Team" text,
"Player" text,
"Position" text,
"College" text
) | What is the earliest pick listed in the table. | SELECT MIN("Pick #") FROM table_16329 | wikisql |
CREATE TABLE table_71521 (
"Team" text,
"Car(s)" text,
"Driver(s)" text,
"Primary Sponsor(s)" text,
"Owner(s)" text,
"Crew Chief" text,
"Rounds" real
) | Who is the Driver on Bob Keselowski's team? | SELECT "Driver(s)" FROM table_71521 WHERE "Owner(s)" = 'bob keselowski' | wikisql |
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_ty... | tell me the three most frequent diagnoses? | SELECT d_icd_diagnoses.short_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.icd9_code IN (SELECT t1.icd9_code FROM (SELECT diagnoses_icd.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM diagnoses_icd GROUP BY diagnoses_icd.icd9_code) AS t1 WHERE t1.c1 <= 3) | mimic_iii |
CREATE TABLE table_5521 (
"Position" real,
"Album title" text,
"Artist" text,
"Sales" real,
"Peak" text
) | What was the position for albums made by elbow with under 424,000 sales? | SELECT AVG("Position") FROM table_5521 WHERE "Sales" < '424,000' AND "Artist" = 'elbow' | wikisql |
CREATE TABLE table_22249 (
"Team Name" text,
"Schools" text,
"Sports" text,
"Host" text,
"Nickname(s)" text,
"Colors" text,
"Enrollment (2013/14)" real
) | What is the nickname of the team whose 2013/2014 enrollment is 436? | SELECT "Nickname(s)" FROM table_22249 WHERE "Enrollment (2013/14)" = '436' | wikisql |
CREATE TABLE table_name_32 (
last_10_meetings VARCHAR,
last_meeting VARCHAR
) | What is the last 10 meetings that have 11/26/1988 as the lasr meeting? | SELECT last_10_meetings FROM table_name_32 WHERE last_meeting = "11/26/1988" | sql_create_context |
CREATE TABLE table_50260 (
"Tournament" text,
"2002" text,
"2003" text,
"2004" text,
"2005" text,
"2006" text,
"2007" text,
"2008" text,
"2009" text,
"2010" text,
"2011" text,
"2012" text
) | What tournament has a 2008 value of A, q1 in 2005, and 1r in 2004? | SELECT "Tournament" FROM table_50260 WHERE "2008" = 'a' AND "2005" = 'q1' AND "2004" = '1r' | wikisql |
CREATE TABLE table_name_89 (
total INTEGER,
nation VARCHAR,
bronze VARCHAR
) | How many totals have brazil as the nation, and a bronze less than 2? | SELECT SUM(total) FROM table_name_89 WHERE nation = "brazil" AND bronze < 2 | 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... | how many male patients were admitted to the hospital before year 2139? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.gender = "M" AND demographic.admityear < "2139" | mimicsql_data |
CREATE TABLE table_203_667 (
id number,
"year" number,
"driver" text,
"co-driver" text,
"car" text,
"notes" text
) | chipper adams and justin beyendeza have how mnay wins ? | SELECT COUNT(*) FROM table_203_667 WHERE "driver" = 'chipper adams' AND "co-driver" = 'justin beyendeza' | squall |
CREATE TABLE table_23767 (
"No. in series" real,
"No. in season" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production code" text
) | How many different production codes does the episode directed by Dominic Polcino have? | SELECT COUNT("Production code") FROM table_23767 WHERE "Directed by" = 'Dominic Polcino' | wikisql |
CREATE TABLE table_60016 (
"Name" text,
"Region" text,
"Programming" text,
"Type" text,
"Encryption" text
) | What is the region for tv vtv? | SELECT "Region" FROM table_60016 WHERE "Name" = 'tv vtv' | wikisql |
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost numb... | when did patient 83038 get for the first time a lab test in this month? | SELECT labevents.charttime FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 83038) AND DATETIME(labevents.charttime, 'start of month') = DATETIME(CURRENT_TIME(), 'start of month', '-0 month') ORDER BY labevents.charttime LIMIT 1 | mimic_iii |
CREATE TABLE table_17192 (
"DVD Name" text,
"Released" text,
"Audio" text,
"Aspect Ratio" text,
"Duration" text,
"Number of Episodes" real,
"Num of Discs" real
) | What is the name of the DVD where the number of discs is greater than 2.0 | SELECT "DVD Name" FROM table_17192 WHERE "Num of Discs" > '2.0' | wikisql |
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 ... | how much does patient 30733's arterial bp [diastolic] differ between last measured on the last icu visit compared to the first value measured on the last icu visit? | 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 = 30733) AND NOT icustays.outtime IS NULL ORDER BY icustays.intime DESC LIMIT 1) AND chartevents... | mimic_iii |
CREATE TABLE table_name_97 (
nba_draft VARCHAR,
hometown VARCHAR
) | What is the NBA draft result of the player from Washington, DC? | SELECT nba_draft FROM table_name_97 WHERE hometown = "washington, dc" | sql_create_context |
CREATE TABLE table_2941963_1 (
country VARCHAR,
remittances_2008 VARCHAR
) | how many countries have remittances in 2008 of 9.07? | SELECT COUNT(country) FROM table_2941963_1 WHERE remittances_2008 = "9.07" | 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 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 was hired before 2002-06-21, give me the comparison about the sum of employee_id over the hire_date bin hire_date by weekday by a bar chart. | SELECT HIRE_DATE, SUM(EMPLOYEE_ID) FROM employees WHERE HIRE_DATE < '2002-06-21' | nvbench |
CREATE TABLE PostTags (
PostId number,
TagId number
)
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE Users (
Id number,
Reputation number,
CreationDate time,
... | Top SO users In Arizona. | SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation, Location FROM Users WHERE Reputation >= (SELECT Reputation FROM Users WHERE Id = 5285908) AND (UPPER(Location) LIKE '% AZ%' OR UPPER(Location) LIKE '% ARIZONA%') ORDER BY Reputation | sede |
CREATE TABLE table_50144 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"TV Time" text,
"Attendance" text
) | What is Result, when Opponent is Cincinnati Bengals? | SELECT "Result" FROM table_50144 WHERE "Opponent" = 'cincinnati bengals' | wikisql |
CREATE TABLE icustays (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
first_careunit text,
last_careunit text,
first_wardid number,
last_wardid number,
intime time,
outtime time
)
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm... | had patient 18866 got a diagnosis since 1 year ago? | SELECT COUNT(*) > 0 FROM diagnoses_icd WHERE diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 18866) AND DATETIME(diagnoses_icd.charttime) >= DATETIME(CURRENT_TIME(), '-1 year') | mimic_iii |
CREATE TABLE table_72993 (
"Year" real,
"Date (Opening)" text,
"Date (Closing)" text,
"Opening Film" text,
"Number of Screening" text,
"Award-Winning Film" text
) | Which award-winning film has a closing date of September 4? | SELECT "Award-Winning Film" FROM table_72993 WHERE "Date (Closing)" = 'September 4' | wikisql |
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 patients admitted to emergency were treated with abacavir sulfate? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admission_type = "EMERGENCY" AND prescriptions.drug = "Abacavir Sulfate" | mimicsql_data |
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... | 在门诊诊断出得了疾病N61.918的病号的他们的叶酸数值的平均值以及最值都是多少? | SELECT AVG(jyjgzbb.JCZBJGDL), MIN(jyjgzbb.JCZBJGDL), MAX(jyjgzbb.JCZBJGDL) FROM zzmzjzjlb JOIN jybgb JOIN jyjgzbb ON zzmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND zzmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE zzmzjzjlb.JZZDBM = 'N61.918' AND jyjgzbb.JCZBMC = '... | css |
CREATE TABLE table_21646 (
"Team" text,
"Head coach" text,
"Team captain" text,
"Venue" text,
"Capacity" real,
"Kitmaker" text,
"Shirt sponsor" text,
"Club Chairman" text
) | Erdo an Ar ca is the head coach at what venue? | SELECT "Venue" FROM table_21646 WHERE "Head coach" = 'Erdoğan Arıca' | wikisql |
CREATE TABLE month (
month_number int,
month_name text
)
CREATE TABLE flight_fare (
flight_id int,
fare_id int
)
CREATE TABLE time_zone (
time_zone_code text,
time_zone_name text,
hours_from_gmt int
)
CREATE TABLE state (
state_code text,
state_name text,
country_name text
)
... | i need a flight from BOSTON to PITTSBURGH | 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 = 'BOSTON' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'PITTSBU... | atis |
CREATE TABLE table_name_44 (
press VARCHAR
) | Who is the 92.5 with the press 282.5? | SELECT 925 FROM table_name_44 WHERE press = "282.5" | sql_create_context |
CREATE TABLE table_60841 (
"Tie no" text,
"Home team" text,
"Score" text,
"Away team" text,
"Date" text
) | On what date was the away team Bournemouth? | SELECT "Date" FROM table_60841 WHERE "Away team" = 'bournemouth' | wikisql |
CREATE TABLE table_name_1 (
attendance VARCHAR,
opponent VARCHAR,
date VARCHAR
) | What is Attendance, when Opponent is Montreal Alouettes, and when Date is Oct 4? | SELECT attendance FROM table_name_1 WHERE opponent = "montreal alouettes" AND date = "oct 4" | sql_create_context |
CREATE TABLE table_204_218 (
id number,
"name" text,
"faith" text,
"type" text,
"gov" text,
"opened" number,
"intake" number,
"dcsf number" number,
"ofsted number" number,
"web" text,
"coordinates" text
) | which was opened first ? | SELECT "name" FROM table_204_218 ORDER BY "opened" LIMIT 1 | squall |
CREATE TABLE mzjzjlb (
YLJGDM text,
JZLSH text,
KH text,
KLX number,
MJZH text,
HZXM text,
NLS number,
NLY number,
ZSEBZ number,
JZZTDM number,
JZZTMC text,
JZJSSJ time,
TXBZ number,
ZZBZ number,
WDBZ number,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
... | 从2000年12月26日到2006年5月18日这段时间内,病人74743913所有检验结果指标记录中的检测方法列一下 | (SELECT jyjgzbb.JCFF 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_i... | css |
CREATE TABLE table_2169966_1 (
wins VARCHAR,
starts VARCHAR
) | How many wins does he get when he starts at 10? | SELECT wins FROM table_2169966_1 WHERE starts = 10 | sql_create_context |
CREATE TABLE table_70061 (
"Rank" real,
"Circuit" text,
"Headquarters" text,
"Screens" real,
"Sites" real
) | what is the lowest number of sites when the headquarters are in columbus, ga and the rank is smaller than 4? | SELECT MIN("Sites") FROM table_70061 WHERE "Headquarters" = 'columbus, ga' AND "Rank" < '4' | wikisql |
CREATE TABLE table_name_60 (
gnu_linux VARCHAR,
haiku VARCHAR,
client VARCHAR
) | Which GNU/Linux had no haiku and a client of airdc++? | SELECT gnu_linux FROM table_name_60 WHERE haiku = "no" AND client = "airdc++" | sql_create_context |
CREATE TABLE AssignedTo (
Scientist int,
Project char(4)
)
CREATE TABLE Projects (
Code Char(4),
Name Char(50),
Hours int
)
CREATE TABLE Scientists (
SSN int,
Name Char(30)
) | What are the naems of all the projects, and how many scientists were assigned to each of them, rank x axis in descending order. | SELECT Name, COUNT(*) FROM Projects AS T1 JOIN AssignedTo AS T2 ON T1.Code = T2.Project GROUP BY T1.Name ORDER BY Name DESC | nvbench |
CREATE TABLE election (
Election_ID int,
Counties_Represented text,
District int,
Delegate text,
Party int,
First_Elected real,
Committee text
)
CREATE TABLE party (
Party_ID int,
Year real,
Party text,
Governor text,
Lieutenant_Governor text,
Comptroller text,
A... | Show me population by county name in a histogram, rank bar in asc order. | SELECT County_name, Population FROM county ORDER BY County_name | nvbench |
CREATE TABLE table_67446 (
"Date" text,
"Opponent" text,
"Score" text,
"Attendance" real,
"Record" text
) | What is the date of the game with a 17-31 record? | SELECT "Date" FROM table_67446 WHERE "Record" = '17-31' | wikisql |
CREATE TABLE table_61768 (
"Outcome" text,
"Date" real,
"Championship" text,
"Surface" text,
"Opponent" text,
"Score" text
) | What was the surface later than 1979, for the Melbourne Indoor, Australia, and the score was 2 6, 6 2, 6 2? | SELECT "Surface" FROM table_61768 WHERE "Date" > '1979' AND "Championship" = 'melbourne indoor, australia' AND "Score" = '2–6, 6–2, 6–2' | wikisql |
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE d_labitems (
row_id... | calculate patient 93104's length of stay of the last hospital stay that occurred. | SELECT STRFTIME('%j', admissions.dischtime) - STRFTIME('%j', admissions.admittime) FROM admissions WHERE admissions.subject_id = 93104 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime DESC LIMIT 1 | mimic_iii |
CREATE TABLE table_204_321 (
id number,
"community" text,
"currency" text,
"region" text,
"target date" number,
"notes" text
) | how many currency does the region of africa have | SELECT COUNT(DISTINCT "currency") FROM table_204_321 WHERE "region" = 'africa' | squall |
CREATE TABLE record (
ID int,
Result text,
Swimmer_ID int,
Event_ID int
)
CREATE TABLE swimmer (
ID int,
name text,
Nationality text,
meter_100 real,
meter_200 text,
meter_300 text,
meter_400 text,
meter_500 text,
meter_600 text,
meter_700 text,
Time text
)
... | Draw a bar chart about the distribution of Nationality and the average of ID , and group by attribute Nationality, and list in desc by the y axis. | SELECT Nationality, AVG(ID) FROM swimmer GROUP BY Nationality ORDER BY AVG(ID) DESC | nvbench |
CREATE TABLE table_name_99 (
general_classification VARCHAR,
stage VARCHAR
) | What is the general classification of stage 3 | SELECT general_classification FROM table_name_99 WHERE stage = "3" | sql_create_context |
CREATE TABLE table_name_34 (
density___km²_ VARCHAR,
hanzi VARCHAR
) | What is the density of ? | SELECT density___km²_ FROM table_name_34 WHERE hanzi = "昌黎县" | sql_create_context |
CREATE TABLE table_27771406_1 (
club VARCHAR,
tests VARCHAR
) | The player for what club had 2 tests? | SELECT club FROM table_27771406_1 WHERE tests = 2 | sql_create_context |
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,
... | 把2015年4月19日到2016年11月1日期间患者姜新蕾在5035211的医疗机构一共开了多少西药查看一下 | SELECT COUNT(*) FROM gwyjzb JOIN t_kc22 ON gwyjzb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gwyjzb.PERSON_NM = '姜新蕾' AND t_kc22.STA_DATE BETWEEN '2015-04-19' AND '2016-11-01' AND gwyjzb.MED_SER_ORG_NO = '5035211' AND t_kc22.MED_INV_ITEM_TYPE = '西药费' UNION SELECT COUNT(*) FROM fgwyjzb JOIN t_kc22 ON fgwyjzb.MED_CLINIC_... | css |
CREATE TABLE icustays (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
first_careunit text,
last_careunit text,
first_wardid number,
last_wardid number,
intime time,
outtime time
)
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
sh... | when was the first time that patient 52598 was prescribed with epinephrine until 01/2104? | SELECT prescriptions.startdate FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 52598) AND prescriptions.drug = 'epinephrine' AND STRFTIME('%y-%m', prescriptions.startdate) <= '2104-01' ORDER BY prescriptions.startdate LIMIT 1 | mimic_iii |
CREATE TABLE table_29619494_2 (
season VARCHAR,
sake_tuyas VARCHAR
) | What season did the Sake Tuyas come in 1st place? | SELECT season FROM table_29619494_2 WHERE sake_tuyas = "1st" | sql_create_context |
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... | Count of Tags relevant to Taxonomist. Returns the number of tags that would be eligible for awarding Taxonomist if it could be awarded multiple times | SELECT COUNT(*) AS Tag_Count FROM Tags AS t WHERE t.Count >= 50 | sede |
CREATE TABLE table_76999 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Kickoff Time" text,
"Attendance" text
) | What was the result of the game played on November 23, 2003? | SELECT "Result" FROM table_76999 WHERE "Date" = 'november 23, 2003' | wikisql |
CREATE TABLE table_name_88 (
airdate VARCHAR,
share VARCHAR,
rank VARCHAR
) | What is the Airdate of the episode that ranked #29 and had a share greater than 10? | SELECT airdate FROM table_name_88 WHERE share = 10 AND rank = "#29" | sql_create_context |
CREATE TABLE table_name_89 (
run_1 VARCHAR,
athletes VARCHAR
) | What is Run 1, when Athletes is 'Theo Kitt & Friedrich Kuhn'? | SELECT run_1 FROM table_name_89 WHERE athletes = "theo kitt & friedrich kuhn" | sql_create_context |
CREATE TABLE table_39661 (
"Number" real,
"Result" text,
"Date" text,
"Score" text,
"Opponent" text,
"Record" text
) | What's the record of game number 23? | SELECT "Record" FROM table_39661 WHERE "Number" = '23' | wikisql |
CREATE TABLE table_666 (
"Year" real,
"Finish position" text,
"1st day" text,
"2nd day" text,
"3rd day" text,
"4th Day" text
) | what's the 3rd day with 4th day being rowed-over | SELECT "3rd day" FROM table_666 WHERE "4th Day" = 'rowed-over' | wikisql |
CREATE TABLE t_kc22 (
MED_EXP_DET_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
MED_CLINIC_ID text,
MED_EXP_BILL_ID text,
SOC_SRT_DIRE_CD text,
SOC_SRT_DIRE_NM text,
DIRE_TYPE number,
CHA_ITEM_LEV number,
MED_INV_ITEM_TYPE text,
MED_DIRE_CD text,
MED_DIRE_NM text,... | 在8814772号医院就诊的患者出院时查出的疾病编码,患上不同疾病的患者们的平均年龄是多少岁啊? | SELECT OUT_DIAG_DIS_CD, AVG(PERSON_AGE) FROM t_kc21 WHERE MED_SER_ORG_NO = '8814772' GROUP BY OUT_DIAG_DIS_CD | css |
CREATE TABLE ReviewTasks (
Id number,
ReviewTaskTypeId number,
CreationDate time,
DeletionDate time,
ReviewTaskStateId number,
PostId number,
SuggestedEditId number,
CompletedByReviewTaskId number
)
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Bod... | Questions which were bumped by community user many times. | SELECT RANK() OVER (ORDER BY COUNT(ph.Id) DESC) AS "rank", COUNT(ph.Id) AS "count", ph.PostId AS "post_link", 'site://posts/' + CAST(ph.PostId AS TEXT) + '/revisions' AS "revision_history" FROM PostHistory AS ph WHERE ph.PostHistoryTypeId = 50 GROUP BY ph.PostId ORDER BY COUNT(ph.Id) DESC | sede |
CREATE TABLE table_23129 (
"Pick #" real,
"Player" text,
"Position" text,
"Nationality" text,
"NHL team" text,
"College/junior/club team" text
) | What's the smallest pick number of a player playing in Minnesota North Stars? | SELECT MIN("Pick #") FROM table_23129 WHERE "NHL team" = 'Minnesota North Stars' | wikisql |
CREATE TABLE table_8033 (
"Date" text,
"H/A/N" text,
"Opponent" text,
"Score" text,
"Record" text
) | What was the score for the game with a record of 11-22 and a H/A/N of A? | SELECT "Score" FROM table_8033 WHERE "H/A/N" = 'a' AND "Record" = '11-22' | wikisql |
CREATE TABLE table_42305 (
"Aces" real,
"Player" text,
"Opponent" text,
"Year" real,
"Event" text,
"Sets" real,
"Result" text
) | what year was the memphis event? | SELECT SUM("Year") FROM table_42305 WHERE "Event" = 'memphis' | wikisql |
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime... | what are the top five most frequent microbiology tests for patients who have been given anticoagulant administration - thrombin inhibitor since 2104 that were followed within 2 months? | SELECT t3.culturesite FROM (SELECT t2.culturesite, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, treatment.treatmenttime FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'anticoagulant administration - thrombin inhi... | eicu |
CREATE TABLE track (
trackid number,
name text,
albumid number,
mediatypeid number,
genreid number,
composer text,
milliseconds number,
bytes number,
unitprice number
)
CREATE TABLE album (
albumid number,
title text,
artistid number
)
CREATE TABLE customer (
custom... | Please show the employee first names and ids of employees who serve at least 10 customers. | SELECT T1.firstname, T1.supportrepid FROM customer AS T1 JOIN employee AS T2 ON T1.supportrepid = T2.employeeid GROUP BY T1.supportrepid HAVING COUNT(*) >= 10 | spider |
CREATE TABLE table_63005 (
"Pick" real,
"Team" text,
"Player" text,
"Position" text,
"College" text
) | What is the team of the player from ohio state? | SELECT "Team" FROM table_63005 WHERE "College" = 'ohio state' | 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, find founder and the average of price , and group by attribute founder, and visualize them by a bar chart. | SELECT Founder, AVG(Price) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder | nvbench |
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE charte... | the arterial bp [diastolic] of patient 8116 last measured on the current icu visit is greater than it was second to last measured on the current icu visit? | 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 = 8116) AND icustays.outtime IS NULL) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_it... | mimic_iii |
CREATE TABLE submission (
Submission_ID int,
Scores real,
Author text,
College text
)
CREATE TABLE Acceptance (
Submission_ID int,
Workshop_ID int,
Result text
)
CREATE TABLE workshop (
Workshop_ID int,
Date text,
Venue text,
Name text
) | Visualize a bar chart for how many workshops did each author submit to? Return the author name and the number of workshops, and could you order names in desc order? | SELECT Author, COUNT(DISTINCT T1.Workshop_ID) FROM Acceptance AS T1 JOIN submission AS T2 ON T1.Submission_ID = T2.Submission_ID ORDER BY Author DESC | nvbench |
CREATE TABLE Customers (
customer_id INTEGER,
customer_first_name VARCHAR(20),
customer_last_name VARCHAR(20),
customer_address VARCHAR(255),
customer_phone VARCHAR(255),
customer_email VARCHAR(255),
other_customer_details VARCHAR(255)
)
CREATE TABLE Financial_Transactions (
transaction... | Show me a bar chart for what are the different transaction types, and how many transactions of each have taken place?, list by the bar in ascending. | SELECT transaction_type, COUNT(*) FROM Financial_Transactions GROUP BY transaction_type ORDER BY transaction_type | nvbench |
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
systemicsystolic number,
systemicdiastolic number,
systemicmean number,
observationtime time
)
CREATE TABLE patient (
uniquep... | has patient 010-40802 received a failure to wean diagnosis since 6 years ago. | SELECT COUNT(*) > 0 FROM diagnosis WHERE diagnosis.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '010-40802')) AND diagnosis.diagnosisname = 'failure to wean' AND DATETIME(di... | eicu |
CREATE TABLE table_name_40 (
date VARCHAR,
decision VARCHAR,
home VARCHAR
) | What is the date when Joseph is the decision and San Jose is the home team? | SELECT date FROM table_name_40 WHERE decision = "joseph" AND home = "san jose" | sql_create_context |
CREATE TABLE table_23248910_10 (
high_points VARCHAR,
date VARCHAR
) | List high points from the April 7 game. | SELECT high_points FROM table_23248910_10 WHERE date = "April 7" | sql_create_context |
CREATE TABLE Payments (
Payment_ID INTEGER,
Settlement_ID INTEGER,
Payment_Method_Code VARCHAR(255),
Date_Payment_Made DATE,
Amount_Payment INTEGER
)
CREATE TABLE Customers (
Customer_ID INTEGER,
Customer_Details VARCHAR(255)
)
CREATE TABLE Claims (
Claim_ID INTEGER,
Policy_ID INTE... | Sum the amount for all the payments processed with Visa by each year using a bar chart, and rank by the y-axis in asc. | SELECT Date_Payment_Made, SUM(Amount_Payment) FROM Payments WHERE Payment_Method_Code = 'Visa' ORDER BY SUM(Amount_Payment) | nvbench |
CREATE TABLE table_name_61 (
release_date VARCHAR,
subtitles VARCHAR,
publisher VARCHAR
) | What is the release date that has english as the subtitles, and magna pacific as the publisher? | SELECT release_date FROM table_name_61 WHERE subtitles = "english" AND publisher = "magna pacific" | sql_create_context |
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,
... | what is the drug type and drug route of drug code pheny100l? | SELECT prescriptions.drug_type, prescriptions.route FROM prescriptions WHERE prescriptions.formulary_drug_cd = "PHENY100L" | mimicsql_data |
CREATE TABLE table_7547 (
"Team" text,
"Match" real,
"Points" real,
"Draw" real,
"Lost" real
) | What is the Match with Points that are 24? | SELECT "Match" FROM table_7547 WHERE "Points" = '24' | wikisql |
CREATE TABLE table_38208 (
"Character Name" text,
"Voice Actor (Japanese)" text,
"Voice Actor (English 1997 / Saban)" text,
"Voice Actor (English 1998 / Pioneer)" text,
"Voice Actor (English 2006 / FUNimation)" text
) | what voice acter played tien | SELECT "Voice Actor (Japanese)" FROM table_38208 WHERE "Character Name" = 'tien' | wikisql |
CREATE TABLE table_27173 (
"Player" text,
"Minutes" real,
"Field Goals" real,
"Rebounds" real,
"Assists" real,
"Steals" real,
"Blocks" real,
"Points" real
) | How many steals did Tamika Williams have? | SELECT "Steals" FROM table_27173 WHERE "Player" = 'Tamika Williams' | wikisql |
CREATE TABLE Bookings (
Booking_ID INTEGER,
Customer_ID INTEGER,
Workshop_Group_ID VARCHAR(100),
Status_Code CHAR(15),
Store_ID INTEGER,
Order_Date DATETIME,
Planned_Delivery_Date DATETIME,
Actual_Delivery_Date DATETIME,
Other_Order_Details VARCHAR(255)
)
CREATE TABLE Ref_Payment_Me... | What are the actual delivery dates of orders with quantity 1, and count them by a line chart | SELECT Actual_Delivery_Date, COUNT(Actual_Delivery_Date) FROM Customer_Orders AS T1 JOIN Order_Items AS T2 ON T1.Order_ID = T2.Order_ID WHERE T2.Order_Quantity = 1 GROUP BY Actual_Delivery_Date | nvbench |
CREATE TABLE table_40362 (
"Round" text,
"Opposition" text,
"First leg" text,
"Second leg" text,
"Aggregate score" text
) | What was the aggregate score for the game against Dynamo Dresden? | SELECT "Aggregate score" FROM table_40362 WHERE "Opposition" = 'dynamo dresden' | wikisql |
CREATE TABLE table_11775 (
"Class" real,
"State" text,
"Name" text,
"Party" text,
"First took office" real,
"Born" real
) | What party is class 1 in wisconsin? | SELECT "Party" FROM table_11775 WHERE "Class" = '1' AND "State" = 'wisconsin' | wikisql |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.