context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE table_name_26 (
year VARCHAR,
release_type VARCHAR,
released_as VARCHAR
) | What year was Ethereal 77, which has a CD album release type? | SELECT year FROM table_name_26 WHERE release_type = "cd album" AND released_as = "ethereal 77" | sql_create_context |
CREATE TABLE table_50070 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"Record" text,
"Streak" text
) | Which Team has a Record of 17 8? | SELECT "Team" FROM table_50070 WHERE "Record" = '17–8' | wikisql |
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
... | what is the number of patients in ward 12 in 2105? | SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT transfers.hadm_id FROM transfers WHERE transfers.wardid = 12 AND STRFTIME('%y', transfers.intime) = '2105') | mimic_iii |
CREATE TABLE table_59807 (
"Player" text,
"Country" text,
"Year(s) won" text,
"Total" real,
"To par" real
) | Which Player has a To par of 12, and a Country of fiji? | SELECT "Player" FROM table_59807 WHERE "To par" = '12' AND "Country" = 'fiji' | wikisql |
CREATE TABLE paperfield (
fieldid int,
paperid int
)
CREATE TABLE paperdataset (
paperid int,
datasetid int
)
CREATE TABLE paper (
paperid int,
title varchar,
venueid int,
year int,
numciting int,
numcitedby int,
journalid int
)
CREATE TABLE writes (
paperid int,
a... | papers on semantic spaces appeared at arxiv last year | SELECT DISTINCT paper.paperid FROM keyphrase, paper, paperkeyphrase, venue WHERE keyphrase.keyphrasename = 'semantic spaces' AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paper.paperid = paperkeyphrase.paperid AND paper.year = 2015 AND venue.venueid = paper.venueid AND venue.venuename = 'arxiv' | scholar |
CREATE TABLE table_name_55 (
trofeo_fast_team VARCHAR,
young_rider_classification VARCHAR,
stage VARCHAR
) | Name trofeo fast team with young rider classification of francesco casagrande and stage of 10 | SELECT trofeo_fast_team FROM table_name_55 WHERE young_rider_classification = "francesco casagrande" AND stage = "10" | sql_create_context |
CREATE TABLE mzjzjlb (
HXPLC number,
HZXM text,
JLSJ time,
JZJSSJ time,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
JZLSH text,
JZZDBM text,
JZZDSM text,
JZZTDM number,
JZZTMC text,
KH text,
KLX number,
MJZH text,
ML number,
MZZYZDZZBM text,
MZZYZDZZMC ... | 在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 PostLinks (
Id number,
CreationDate time,
PostId number,
RelatedPostId number,
LinkTypeId number
)
CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId number
)
CREATE TABLE PostHistoryTypes (
Id number,
Name text
)
CREATE T... | Answers with the most bounty points.. | SELECT CURRENT_TIMESTAMP() | sede |
CREATE TABLE actor (
Actor_ID int,
Name text,
Musical_ID int,
Character text,
Duration text,
age int
)
CREATE TABLE musical (
Musical_ID int,
Name text,
Year int,
Award text,
Category text,
Nominee text,
Result text
) | Return a histogram on how many actors have appeared in each musical? | SELECT T2.Name, COUNT(*) FROM actor AS T1 JOIN musical AS T2 ON T1.Musical_ID = T2.Musical_ID GROUP BY T1.Musical_ID | nvbench |
CREATE TABLE table_36681 (
"Name" text,
"Number" text,
"Namesake" text,
"Albedo feature name" text,
"Area" text,
"Current map" text
) | What is the current map designation of the feature for which derain crater was the namesake? | SELECT "Current map" FROM table_36681 WHERE "Namesake" = 'derain crater' | wikisql |
CREATE TABLE table_48616 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Attendance" text
) | What Week falls on September 4, 1994? | SELECT AVG("Week") FROM table_48616 WHERE "Date" = 'september 4, 1994' | wikisql |
CREATE TABLE table_31077 (
"Week of" text,
"Tournament" text,
"Champion" text,
"Runner-up" text,
"Semifinalists" text,
"Quarterfinalists" text
) | Who were the quarter-finalists in the event where the champion was Terry Moor 3-6, 7-6, 6-2? | SELECT "Quarterfinalists" FROM table_31077 WHERE "Champion" = 'Terry Moor 3-6, 7-6, 6-2' | wikisql |
CREATE TABLE table_68667 (
"Year" real,
"Team" text,
"Co-Drivers" text,
"Class" text,
"Laps" real,
"Pos." text,
"Class Pos." text
) | Name the team for co-drivers of david brabham mario andretti | SELECT "Team" FROM table_68667 WHERE "Co-Drivers" = 'david brabham mario andretti' | wikisql |
CREATE TABLE table_45000 (
"Rank" real,
"Name" text,
"Team" text,
"Games" real,
"Points" real
) | What is the total number of games that has Juan Carlos Navarro and more than 266 points? | SELECT SUM("Games") FROM table_45000 WHERE "Points" > '266' AND "Name" = 'juan carlos navarro' | wikisql |
CREATE TABLE instructor (
instructor_id int,
name varchar,
uniqname varchar
)
CREATE TABLE course_tags_count (
course_id int,
clear_grading int,
pop_quiz int,
group_projects int,
inspirational int,
long_lectures int,
extra_credit int,
few_tests int,
good_feedback int,
... | Are there any Fall or Winter classes available for the 200 -level ? | SELECT DISTINCT course.department, course.name, course.number, semester.semester FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND course.department = 'EECS' AND course.number BETWEEN 200 AND 200 + 100 AND semester.semester IN ('FA', 'WN') AND semester.semester_id = course_of... | advising |
CREATE TABLE table_57315 (
"Year" real,
"Competition" text,
"Date" text,
"Location" text,
"Score" text,
"Result" text
) | What day did they record a score of 1-2 in 1994? | SELECT "Date" FROM table_57315 WHERE "Score" = '1-2' AND "Year" = '1994' | wikisql |
CREATE TABLE person_info (
CSD text,
CSRQ time,
GJDM text,
GJMC text,
JGDM text,
JGMC text,
MZDM text,
MZMC text,
RYBH text,
XBDM number,
XBMC text,
XLDM text,
XLMC text,
XM text,
ZYLBDM text,
ZYMC text
)
CREATE TABLE fzzmzjzjlb (
HXPLC number,
HZ... | 这个名叫的冯晓霜的患者被门诊诊断为妊娠合并精神障碍,看一下他总蛋白的检测结果定量及其单位 | SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM person_info JOIN hz_info JOIN zzmzjzjlb JOIN jybgb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = zzmzjzjlb.YLJGDM AND hz_info.KH = zzmzjzjlb.KH AND hz_info.KLX = zzmzjzjlb.KLX AND zzmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND zzmzjzjlb.JZLSH = jybgb.JZ... | css |
CREATE TABLE table_79685 (
"Call sign" text,
"Frequency MHz" real,
"City of license" text,
"ERP W" real,
"Class" text,
"FCC info" text
) | What is the total frequency mhz of the kgrj call sign, which has an erp w greater than 21,500? | SELECT COUNT("Frequency MHz") FROM table_79685 WHERE "Call sign" = 'kgrj' AND "ERP W" > '21,500' | wikisql |
CREATE TABLE documents_with_expenses (
document_id number,
budget_type_code text,
document_details text
)
CREATE TABLE projects (
project_id number,
project_details text
)
CREATE TABLE ref_document_types (
document_type_code text,
document_type_name text,
document_type_description text... | What are the type come, name, and description of the document that has either the name 'Noel CV' or 'King Book'? | SELECT document_type_code, document_name, document_description FROM documents WHERE document_name = 'Noel CV' OR document_name = 'King Book' | spider |
CREATE TABLE checkin (
cid int,
business_id varchar,
count int,
day varchar
)
CREATE TABLE user (
uid int,
user_id varchar,
name varchar
)
CREATE TABLE review (
rid int,
business_id varchar,
user_id varchar,
rating float,
text longtext,
year int,
month varchar
)... | List all user ids with name Michelle | SELECT user_id FROM user WHERE name = 'Michelle' | yelp |
CREATE TABLE airport_service (
city_code varchar,
airport_code varchar,
miles_distant int,
direction varchar,
minutes_distant int
)
CREATE TABLE airline (
airline_code varchar,
airline_name text,
note text
)
CREATE TABLE time_interval (
period text,
begin_time int,
end_time... | please give me the cheapest flight from DENVER 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, fare, flight, flight_fare WHERE (CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'DENVER' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.... | atis |
CREATE TABLE table_17365 (
"Country" text,
"Preliminaries" text,
"Interview" text,
"Swimsuit" text,
"Evening Gown" text,
"Average" text
) | what's the evening gown with swimsuit being 9.134 | SELECT "Evening Gown" FROM table_17365 WHERE "Swimsuit" = '9.134' | wikisql |
CREATE TABLE financial_transactions (
transaction_id number,
account_id number,
invoice_number number,
transaction_type text,
transaction_date time,
transaction_amount number,
transaction_comment text,
other_transaction_details text
)
CREATE TABLE order_items (
order_item_id number,... | Show all product colors. | SELECT DISTINCT product_color FROM products | spider |
CREATE TABLE table_58060 (
"Species" text,
"Strain" text,
"Type" text,
"Base Pairs" text,
"Genes" text
) | Which strain has 1,312 genes? | SELECT "Strain" FROM table_58060 WHERE "Genes" = '1,312' | wikisql |
CREATE TABLE table_name_19 (
attendance INTEGER,
date VARCHAR,
week VARCHAR
) | What's the lowest attendance for October 13, 1968, and is larger than week 5? | SELECT MIN(attendance) FROM table_name_19 WHERE date = "october 13, 1968" AND week > 5 | 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 demographic ... | give me the admission type and death status of subject id 16438. | SELECT demographic.admission_type, demographic.expire_flag FROM demographic WHERE demographic.subject_id = "16438" | mimicsql_data |
CREATE TABLE table_7655 (
"Club" text,
"League" text,
"Sport" text,
"Venue" text,
"Established" real
) | What is the highest Established for the kuntz stadium? | SELECT MAX("Established") FROM table_7655 WHERE "Venue" = 'kuntz stadium' | wikisql |
CREATE TABLE table_name_44 (
venue VARCHAR,
date VARCHAR
) | What is Venue, when Date is '14/12/1996'? | SELECT venue FROM table_name_44 WHERE date = "14/12/1996" | sql_create_context |
CREATE TABLE table_1714 (
"Source" text,
"Dates administered" text,
"Democrat: Christine Gregoire" text,
"Republican: Dino Rossi" text,
"Lead Margin" text
) | How many polls show a result where democrat Christine Gregoire was polling at 50% and had a lead margin of 2? | SELECT COUNT("Source") FROM table_1714 WHERE "Democrat: Christine Gregoire" = '50%' AND "Lead Margin" = '2' | wikisql |
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, visualize the relationship between manufacturer and code . | SELECT T1.Manufacturer, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code | nvbench |
CREATE TABLE table_221315_3 (
max_mach VARCHAR,
max_speed__mph_ VARCHAR
) | What was the max mach when the maximum speed was 3887? | SELECT max_mach FROM table_221315_3 WHERE max_speed__mph_ = 3887 | sql_create_context |
CREATE TABLE table_name_50 (
visitor VARCHAR,
decision VARCHAR,
date VARCHAR
) | Who is the visiting team when Dipietro received a decision on October 27? | SELECT visitor FROM table_name_50 WHERE decision = "dipietro" AND date = "october 27" | sql_create_context |
CREATE TABLE table_23198 (
"Name" text,
"Nation" text,
"Position" text,
"FA Cup Apps" real,
"FA Cup Goals" real,
"Total Apps" real,
"Total Goals" real
) | Name the total number of position for don clegg | SELECT COUNT("Position") FROM table_23198 WHERE "Name" = 'Don Clegg' | wikisql |
CREATE TABLE table_73611 (
"County" text,
"Kerry%" text,
"Kerry#" real,
"Bush%" text,
"Bush#" real,
"Others%" text,
"Others#" real
) | What percentage of the votes were for others in the county where 462 people voted that way? | SELECT "Others%" FROM table_73611 WHERE "Others#" = '462' | wikisql |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
C... | what is minimum age of patients whose gender is m and discharge location is long term care hospital? | SELECT MIN(demographic.age) FROM demographic WHERE demographic.gender = "M" AND demographic.discharge_location = "LONG TERM CARE HOSPITAL" | mimicsql_data |
CREATE TABLE table_name_24 (
home_team VARCHAR,
away_team VARCHAR
) | Who was the Away team at Hawthorn? | SELECT home_team FROM table_name_24 WHERE away_team = "hawthorn" | sql_create_context |
CREATE TABLE SuggestedEdits (
Id number,
PostId number,
CreationDate time,
ApprovalDate time,
RejectionDate time,
OwnerUserId number,
Comment text,
Text text,
Title text,
Tags text,
RevisionGUID other
)
CREATE TABLE Users (
Id number,
Reputation number,
CreationD... | Questions per day by week per tag. | WITH questions_by_week AS (SELECT CAST(DATEADD(week, DATEDIFF(week, GETDATE(), CreationDate), GETDATE()) AS DATE) AS Week, COUNT(*) AS post_count FROM Posts AS p WHERE PostTypeId = 1 AND Tags LIKE '%##tag##%' GROUP BY DATEDIFF(week, GETDATE(), CreationDate)) SELECT p.Week, CAST(post_count AS FLOAT) / 7 AS questions_per... | sede |
CREATE TABLE table_29692554_2 (
eliminated VARCHAR,
time VARCHAR
) | What number was the person eliminated at 22:50? | SELECT eliminated FROM table_29692554_2 WHERE time = "22:50" | sql_create_context |
CREATE TABLE table_name_71 (
venue VARCHAR,
away_team VARCHAR
) | Where did the away team have round 2? | SELECT venue FROM table_name_71 WHERE away_team = "round 2" | sql_create_context |
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
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 varch... | For those employees who do not work in departments with managers that have ids between 100 and 200, give me the comparison about manager_id over the job_id , sort from high to low by the bars. | SELECT JOB_ID, MANAGER_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY JOB_ID DESC | nvbench |
CREATE TABLE Circulation_History (
employee_name VARCHAR
)
CREATE TABLE Employees (
employee_name VARCHAR
) | List the employees who have not showed up in any circulation history of documents. List the employee's name. | SELECT employee_name FROM Employees EXCEPT SELECT Employees.employee_name FROM Employees JOIN Circulation_History ON Circulation_History.employee_id = Employees.employee_id | sql_create_context |
CREATE TABLE product_characteristics (
product_id VARCHAR,
characteristic_id VARCHAR
)
CREATE TABLE products (
product_id VARCHAR
)
CREATE TABLE CHARACTERISTICS (
characteristic_name VARCHAR,
characteristic_id VARCHAR
) | What are characteristic names used at least twice across all products? | SELECT t3.characteristic_name FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN CHARACTERISTICS AS t3 ON t2.characteristic_id = t3.characteristic_id GROUP BY t3.characteristic_name HAVING COUNT(*) >= 2 | sql_create_context |
CREATE TABLE table_name_43 (
total VARCHAR,
mls_cup VARCHAR,
us_open_cup VARCHAR
) | What is the total where there are 4 MLS Cups and more US Open Cups than 1? | SELECT COUNT(total) FROM table_name_43 WHERE mls_cup = 4 AND us_open_cup > 1 | sql_create_context |
CREATE TABLE table_14574130_3 (
circuit VARCHAR,
gt3_winner VARCHAR
) | Name the circuit for gt3 alex mortimer bradley ellis | SELECT circuit FROM table_14574130_3 WHERE gt3_winner = "Alex Mortimer Bradley Ellis" | sql_create_context |
CREATE TABLE table_2518850_4 (
high_school_name VARCHAR,
prefecture VARCHAR
) | Which high school is located in Kyoto? | SELECT high_school_name FROM table_2518850_4 WHERE prefecture = "Kyoto" | sql_create_context |
CREATE TABLE table_name_29 (
home VARCHAR,
visitor VARCHAR
) | Name the home with toronto visiting | SELECT home FROM table_name_29 WHERE visitor = "toronto" | sql_create_context |
CREATE TABLE table_2387461_1 (
assists_per_game VARCHAR,
tournament VARCHAR
) | How many assists per game in the tournament 2010 fiba world championship? | SELECT assists_per_game FROM table_2387461_1 WHERE tournament = "2010 FIBA World Championship" | sql_create_context |
CREATE TABLE table_204_602 (
id number,
"name" text,
"position" text,
"height" text,
"weight" number,
"date of birth" text,
"current/last known team" text
) | which player is taller , brown or olmeda ? | SELECT "name" FROM table_204_602 WHERE "name" IN ('bobby brown', 'jose olmeda') ORDER BY "height" DESC LIMIT 1 | squall |
CREATE TABLE table_14671 (
"Team" text,
"Manager" text,
"Captain" text,
"Kit manufacturer" text,
"Shirt sponsor" text
) | Which team has the team captain Jon Newsome? | SELECT "Team" FROM table_14671 WHERE "Captain" = 'jon newsome' | wikisql |
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,0)
)
CREATE TABLE job_history (
EMPLOYEE_ID decimal(6,0),
START_DATE date... | For those employees who was hired before 2002-06-21, a bar chart shows the distribution of hire_date and the average of salary bin hire_date by time. | SELECT HIRE_DATE, AVG(SALARY) FROM employees WHERE HIRE_DATE < '2002-06-21' | nvbench |
CREATE TABLE table_name_83 (
three VARCHAR,
date VARCHAR,
seven VARCHAR,
four VARCHAR,
five VARCHAR
) | Name the three for william prewett for four and five being richard ellis with seven being nicholas king on 5 november 1693 | SELECT three FROM table_name_83 WHERE four = "william prewett" AND five = "richard ellis" AND seven = "nicholas king" AND date = "5 november 1693" | sql_create_context |
CREATE TABLE table_71067 (
"Stage" text,
"Date" text,
"Course" text,
"Distance" text,
"Winner" text,
"Race Leader" text
) | Which date has a Race Leader of hermann buse ( ger ), and a Stage of 5? | SELECT "Date" FROM table_71067 WHERE "Race Leader" = 'hermann buse ( ger )' AND "Stage" = '5' | wikisql |
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 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, draw a scatter chart about the correlation between employee_id and salary . | SELECT EMPLOYEE_ID, SALARY FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 | nvbench |
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABL... | how many times does patient 19981 during the last year go to the icu? | SELECT COUNT(DISTINCT icustays.icustay_id) FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 19981) AND DATETIME(icustays.intime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') | mimic_iii |
CREATE TABLE table_79981 (
"Date" text,
"Winning Team" text,
"Score" text,
"Winning Pitcher" text,
"Losing Pitcher" text,
"Attendance" real,
"Location" text
) | Which location has a date of may 21? | SELECT "Location" FROM table_79981 WHERE "Date" = 'may 21' | wikisql |
CREATE TABLE table_23886 (
"Club" text,
"Played" text,
"Won" text,
"Drawn" text,
"Lost" text,
"Points for" text,
"Points against" text,
"Points difference" text,
"Bonus Points" text,
"Points" text
) | How many points differ from 134? | SELECT "Points difference" FROM table_23886 WHERE "Points for" = '134' | wikisql |
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... | Among the upper-level courses are any taught by Yanay Israeli ? | SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN offering_instructor ON offering_instructor.offering_id = course_offering.offering_id INNER JOIN instructor ON offering_instructor.instructor_id = instructor.ins... | advising |
CREATE TABLE Attribute_Definitions (
attribute_id INTEGER,
attribute_name VARCHAR(30),
attribute_data_type VARCHAR(10)
)
CREATE TABLE Catalog_Contents (
catalog_entry_id INTEGER,
catalog_level_number INTEGER,
parent_entry_id INTEGER,
previous_entry_id INTEGER,
next_entry_id INTEGER,
... | Pie. which catalog contents has price above 700 dollars? Show their catalog entry names and capacities. | SELECT catalog_entry_name, capacity FROM Catalog_Contents WHERE price_in_dollars > 700 | nvbench |
CREATE TABLE VoteTypes (
Id number,
Name text
)
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,
TargetRepChange number
)
CREATE TABLE Badges (
Id number,
UserId number,
Name t... | Users with at least one post. | SELECT COUNT(u.Id) AS "users_with_a_post" FROM Users AS u WHERE EXISTS(SELECT p.Id FROM Posts AS p WHERE p.OwnerUserId = u.Id) | 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 procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
... | count the number of patients whose ethnicity is white and drug route is both eyes? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.ethnicity = "WHITE" AND prescriptions.route = "BOTH EYES" | mimicsql_data |
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location t... | get the number of black/haitian ethnic background patients who were admitted before 2125. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "BLACK/HAITIAN" AND demographic.admityear < "2125" | mimicsql_data |
CREATE TABLE table_name_5 (
to_par VARCHAR,
score VARCHAR
) | What's the to par for the score of 68-74-71-77=290? | SELECT to_par FROM table_name_5 WHERE score = 68 - 74 - 71 - 77 = 290 | sql_create_context |
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... | 以前患者褚学义有哪些门诊诊断记录啊? | SELECT mzjzjlb.JZZDBM, mzjzjlb.JZZDSM FROM hz_info JOIN mzjzjlb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX WHERE hz_info.person_info_XM = '褚学义' | css |
CREATE TABLE university (
School_ID int,
School text,
Location text,
Founded real,
Affiliation text,
Enrollment real,
Nickname text,
Primary_conference text
)
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Per... | A bar chart shows the distribution of ACC_Regular_Season and All_Games_Percent , rank All_Games_Percent in ascending order please. | SELECT ACC_Regular_Season, All_Games_Percent FROM basketball_match ORDER BY All_Games_Percent | nvbench |
CREATE TABLE fires (
fire_year number,
discovery_date number,
discovery_doy number,
discovery_time text,
stat_cause_code number,
stat_cause_descr text,
cont_date text,
cont_doy text,
cont_time text,
fire_size number,
fire_size_class text,
latitude number,
longitude nu... | What are the most common causes of the wildfires? | SELECT stat_cause_descr FROM fires GROUP BY stat_cause_descr ORDER BY COUNT(*) DESC LIMIT 1 | uswildfires |
CREATE TABLE table_train_88 (
"id" int,
"mini_mental_state_examination_mmse" int,
"mild_cognitive_impairment" bool,
"body_weight" float,
"renal_disease" bool,
"memantine" bool,
"rivastigmine" bool,
"lewy_body_dementia" bool,
"NOUSE" float
) | weigh between 45 kg and 120 kg inclusive. | SELECT * FROM table_train_88 WHERE body_weight >= 45 AND body_weight <= 120 | criteria2sql |
CREATE TABLE table_30236 (
"Round" text,
"Clubs remaining" real,
"Clubs involved" real,
"Winners from previous round" text,
"New entries this round" text,
"Leagues entering at this round" text
) | How many clubs were remaining in the preliminary round? | SELECT "Clubs remaining" FROM table_30236 WHERE "Round" = 'Preliminary round' | wikisql |
CREATE TABLE zyjzjlb (
YLJGDM text,
JZLSH text,
MZJZLSH text,
KH text,
KLX number,
HZXM text,
WDBZ number,
RYDJSJ time,
RYTJDM number,
RYTJMC text,
JZKSDM text,
JZKSMC text,
RZBQDM text,
RZBQMC text,
RYCWH text,
CYKSDM text,
CYKSMC text,
CYBQDM tex... | 病人14585277536号在中医诊断时的编号与名称分别是什么? | SELECT MZZYZDZZBM, MZZYZDZZMC FROM mzjzjlb WHERE JZLSH = '14585277536' | css |
CREATE TABLE table_name_93 (
loss VARCHAR,
date VARCHAR
) | Who lost on August 27? | SELECT loss FROM table_name_93 WHERE date = "august 27" | sql_create_context |
CREATE TABLE table_54576 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | Which venue has a Home team score of 9.12 (66)? | SELECT "Venue" FROM table_54576 WHERE "Home team score" = '9.12 (66)' | wikisql |
CREATE TABLE table_name_12 (
tournament VARCHAR
) | what is the tournament with the performance in 2010 and 2011 is 1r? | SELECT tournament FROM table_name_12 WHERE 2010 = "1r" AND 2011 = "1r" | sql_create_context |
CREATE TABLE table_27543 (
"Authority" text,
"Rate or precept" text,
"Budget limit (\u00a3m)" text,
"Budget plans (\u00a3m)" text,
"Rate limit (p)" text,
"Rate change (%)" text,
"Desired rate (p)" text,
"Desired rate change (%)" text
) | What is the rate limit when the desired rate change (%) is +40.4? | SELECT "Rate limit (p)" FROM table_27543 WHERE "Desired rate change (%)" = '+40.4' | wikisql |
CREATE TABLE table_62952 (
"Team" text,
"Tries for" real,
"Tries against" real,
"Try diff" text,
"Points for" real,
"Points against" real,
"Points diff" text
) | Which Tries for has Points against smaller than 124, and Points for smaller than 241, and Tries against smaller than 11? | SELECT MAX("Tries for") FROM table_62952 WHERE "Points against" < '124' AND "Points for" < '241' AND "Tries against" < '11' | wikisql |
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,... | what was the last height of patient 017-16041 since 06/2102. | SELECT patient.admissionheight FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '017-16041') AND NOT patient.admissionheight IS NULL AND STRFTIME('%y-%m', patient.unitadmittime) >= '2102-06' ORDER BY patient.unitadmittime DESC LIMIT... | eicu |
CREATE TABLE table_name_83 (
record VARCHAR,
date VARCHAR
) | What is the record for May 31? | SELECT record FROM table_name_83 WHERE date = "may 31" | sql_create_context |
CREATE TABLE state (
state_code text,
state_name text,
country_name text
)
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... | list last wednesday flight from OAKLAND to SALT LAKE CITY | SELECT DISTINCT flight_id FROM flight WHERE (((flight_days IN (SELECT DAYSalias1.days_code FROM days AS DAYSalias1 WHERE DAYSalias1.day_name IN (SELECT DATE_DAYalias1.day_name FROM date_day AS DATE_DAYalias1 WHERE DATE_DAYalias1.day_number = 23 AND DATE_DAYalias1.month_number = 4 AND DATE_DAYalias1.year = 1991)) AND to... | atis |
CREATE TABLE table_name_76 (
winner VARCHAR,
stage VARCHAR
) | Who was the winner of stage 12? | SELECT winner FROM table_name_76 WHERE stage = "12" | sql_create_context |
CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
LOCATION_ID decimal(4,0)
)
CREATE TABLE locations (
LOCATION_ID decimal(4,0),
STREET_ADDRESS varchar(40),
POSTAL_CODE varchar(12),
CITY varchar(30),
STATE_PROVINCE varchar(25... | For those employees who do not work in departments with managers that have ids between 100 and 200, show me about the distribution of last_name and salary in a bar chart, and could you order in descending by the bar please? | SELECT LAST_NAME, SALARY FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY LAST_NAME DESC | nvbench |
CREATE TABLE table_14276 (
"Game" real,
"Date" text,
"Opponent" text,
"Score" text,
"Location" text,
"Record" text
) | Which game had a 9-7 record? | SELECT "Game" FROM table_14276 WHERE "Record" = '9-7' | wikisql |
CREATE TABLE table_79442 (
"Tie no" text,
"Home team" text,
"Score" text,
"Away team" text,
"Date" text
) | What's the score when the Wolverhampton Wanderers played at home? | SELECT "Score" FROM table_79442 WHERE "Home team" = 'wolverhampton wanderers' | 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,... | 看一下药物的单价和医疗费的详细开销记录67814982614中记录的药物数量相乘能不能得到药的总价 | SELECT (SELECT QTY * UNIVALENT FROM t_kc22 WHERE MED_EXP_DET_ID = '67814982614') = (SELECT AMOUNT FROM t_kc22 WHERE MED_EXP_DET_ID = '67814982614') | css |
CREATE TABLE table_27914076_1 (
frequency VARCHAR,
branding VARCHAR
) | Name the frequency for 103.7 energy fm dipolog* | SELECT frequency FROM table_27914076_1 WHERE branding = "103.7 Energy FM Dipolog*" | sql_create_context |
CREATE TABLE table_52387 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Record" text
) | Who was the home team at the game that had a score of 2 2? | SELECT "Home" FROM table_52387 WHERE "Score" = '2 – 2' | wikisql |
CREATE TABLE publication_keyword (
kid int,
pid int
)
CREATE TABLE publication (
abstract varchar,
cid int,
citation_num int,
jid int,
pid int,
reference_num int,
title varchar,
year int
)
CREATE TABLE domain_author (
aid int,
did int
)
CREATE TABLE cite (
cited in... | return me the paper after 2000 in Databases area with more than 200 citations . | SELECT publication.title FROM domain, domain_publication, publication WHERE domain.did = domain_publication.did AND domain.name = 'Databases' AND publication.citation_num > 200 AND publication.pid = domain_publication.pid AND publication.year > 2000 | academic |
CREATE TABLE table_204_968 (
id number,
"squad #" number,
"position" text,
"player" text,
"transferred to" text,
"fee" text,
"date" text
) | lau nim yat and giovane alves de silva where both transferred to which team ? | SELECT "transferred to" FROM table_204_968 WHERE "player" = 'lau nim yat' | squall |
CREATE TABLE table_26209210_2 (
Ends INTEGER,
w VARCHAR
) | What is the lowest ends won when w is 8? | SELECT MIN(Ends) AS won FROM table_26209210_2 WHERE w = 8 | sql_create_context |
CREATE TABLE table_72074 (
"Player" text,
"No." text,
"Nationality" text,
"Position" text,
"Years in Toronto" text,
"School/Club Team" text
) | What are the total amount of numbers on the Toronto team in 2005-06? | SELECT COUNT("No.") FROM table_72074 WHERE "Years in Toronto" = '2005-06' | wikisql |
CREATE TABLE time_interval (
period text,
begin_time int,
end_time int
)
CREATE TABLE city (
city_code varchar,
city_name varchar,
state_code varchar,
country_name varchar,
time_zone_code varchar
)
CREATE TABLE flight_leg (
flight_id int,
leg_number int,
leg_flight int
)
C... | please find the cheapest fare from BOSTON to 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 |
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE prescription... | is the heart rate of patient 30763 last measured on the last intensive care unit visit less than the value second to last measured on the last intensive care unit 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 = 30763) AND NOT icustays.outtime IS NULL ORDER BY icustays.intime DESC LIMIT 1) AND chartevents... | mimic_iii |
CREATE TABLE table_name_17 (
date VARCHAR,
location VARCHAR
) | When was the incident in Pol-E Khomri? | SELECT date FROM table_name_17 WHERE location = "pol-e khomri" | sql_create_context |
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
h... | what is the total dose of per iv flush: upper arm r 18 gauge that patient 007-2498 received on the first icu visit? | SELECT SUM(intakeoutput.cellvaluenumeric) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '007-2498') AND NOT patient.unitdischargetime IS ... | eicu |
CREATE TABLE table_47335 (
"Date" text,
"Home" text,
"Score" text,
"Away" text,
"Attendance" real
) | What is the home team of the match on 21 September 2008 with an attendance less than 2248 and a 2:0 score? | SELECT "Home" FROM table_47335 WHERE "Attendance" < '2248' AND "Score" = '2:0' AND "Date" = '21 september 2008' | wikisql |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
C... | give the number of patients whose insurance is self pay and diagnosis long title is antineoplastic and immunosuppressive drugs causing adverse effects in therapeutic use. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.insurance = "Self Pay" AND diagnoses.long_title = "Antineoplastic and immunosuppressive drugs causing adverse effects in therapeutic use" | mimicsql_data |
CREATE TABLE table_13642023_2 (
circuit VARCHAR,
rnd VARCHAR,
gtu_winning_team VARCHAR
) | On what circuit was the GTU winning team #59 Brumos Porsche - Audi in round 5? | SELECT circuit FROM table_13642023_2 WHERE rnd = 5 AND gtu_winning_team = "#59 Brumos Porsche - Audi" | sql_create_context |
CREATE TABLE affected_region (
region_id number,
storm_id number,
number_city_affected number
)
CREATE TABLE region (
region_id number,
region_code text,
region_name text
)
CREATE TABLE storm (
storm_id number,
name text,
dates_active text,
max_speed number,
damage_millions... | Return the names of the regions affected by storms that had a death count of at least 10. | SELECT T2.region_name FROM affected_region AS T1 JOIN region AS T2 ON T1.region_id = T2.region_id JOIN storm AS T3 ON T1.storm_id = T3.storm_id WHERE T3.number_deaths >= 10 | spider |
CREATE TABLE table_53190 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | What is the home team score with Fitzroy as away team? | SELECT "Home team score" FROM table_53190 WHERE "Away team" = 'fitzroy' | wikisql |
CREATE TABLE table_26416704_2 (
district INTEGER,
incumbent VARCHAR
) | What is the highest numbred district that has brian w. thomas as an incumbent? | SELECT MAX(district) FROM table_26416704_2 WHERE incumbent = "Brian W. Thomas" | sql_create_context |
CREATE TABLE table_17012578_37 (
Ends VARCHAR,
pa VARCHAR
) | How many values are in the ends won cell corresponding to a PA of 39? | SELECT COUNT(Ends) AS won FROM table_17012578_37 WHERE pa = 39 | sql_create_context |
CREATE TABLE table_11397 (
"State" text,
"Interview" real,
"Swimsuit" real,
"Evening Gown" real,
"Average" real
) | What is the mean evening gown number when the average is 8.686? | SELECT AVG("Evening Gown") FROM table_11397 WHERE "Average" = '8.686' | wikisql |
CREATE TABLE table_27833186_1 (
distance__miles_ VARCHAR,
horse_name VARCHAR
) | What was the distance (in miles) of the championship were the winning horse was Koona? | SELECT distance__miles_ FROM table_27833186_1 WHERE horse_name = "Koona" | sql_create_context |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.