context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE area (
course_id int,
area varchar
)
CREATE TABLE instructor (
instructor_id int,
name varchar,
uniqname varchar
)
CREATE TABLE jobs (
job_id int,
job_title varchar,
description varchar,
requirement varchar,
city varchar,
state varchar,
country varchar,
... | Do the upper-level classes all offer 9 credits ? | SELECT COUNT(*) = 0 FROM course, program_course WHERE course.credits <> 9 AND course.department = 'EECS' AND program_course.category LIKE '%ULCS%' AND program_course.course_id = course.course_id | advising |
CREATE TABLE paperfield (
fieldid int,
paperid int
)
CREATE TABLE paperkeyphrase (
paperid int,
keyphraseid int
)
CREATE TABLE journal (
journalid int,
journalname varchar
)
CREATE TABLE author (
authorid int,
authorname varchar
)
CREATE TABLE field (
fieldid int
)
CREATE TABLE ... | what keyphrases get most citations ? | SELECT DISTINCT COUNT(cite.citingpaperid), keyphrase.keyphrasename FROM cite, keyphrase, paperkeyphrase WHERE paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paperkeyphrase.paperid = cite.citedpaperid GROUP BY keyphrase.keyphrasename ORDER BY COUNT(cite.citingpaperid) DESC | scholar |
CREATE TABLE table_204_295 (
id number,
"model" text,
"origin" text,
"type" text,
"version" text,
"in service" number,
"notes" text
) | of which utility vehicle model do they have more than 50 in service ? | SELECT "model" FROM table_204_295 WHERE "in service" >= 50 | squall |
CREATE TABLE table_69984 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Record" text
) | What was the score that made the record 47-49? | SELECT "Score" FROM table_69984 WHERE "Record" = '47-49' | 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 ... | what was patient 96365's first procedure time of debrid opn fx-tibia/fib until 2 years ago? | SELECT procedures_icd.charttime FROM procedures_icd WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'debrid opn fx-tibia/fib') AND procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 96365) AND ... | mimic_iii |
CREATE TABLE table_56187 (
"Book title" text,
"Author" text,
"Edition/Publisher" text,
"Page count" text,
"Page size" text,
"Language" text
) | What language is the book Miss Macintosh, My Darling in? | SELECT "Language" FROM table_56187 WHERE "Book title" = 'miss macintosh, my darling' | wikisql |
CREATE TABLE table_204_161 (
id number,
"name" text,
"1968 cf\ndesignator" text,
"place of\nmanufacture" text,
"primary\nrole(s)" text,
"service\nperiod" text,
"#\nused" number
) | how long was the canadair sabre in service ? | SELECT "service\nperiod" - "service\nperiod" FROM table_204_161 WHERE "name" = 'canadair sabre' | squall |
CREATE TABLE table_15074 (
"Position" real,
"Artist" text,
"Song" text,
"Points" real,
"Place" text
) | Who had the smallest points in 3rd place but had a position greater than 8? | SELECT MIN("Points") FROM table_15074 WHERE "Place" = '3rd' AND "Position" > '8' | wikisql |
CREATE TABLE table_name_2 (
score VARCHAR,
attendance VARCHAR
) | What was the score of the game attended by 50,200? | SELECT score FROM table_name_2 WHERE attendance = "50,200" | sql_create_context |
CREATE TABLE table_name_15 (
original_title VARCHAR,
film_title_used_in_nomination VARCHAR
) | What is Original Title, when Film Title Used In Nomination is 'Monga'? | SELECT original_title FROM table_name_15 WHERE film_title_used_in_nomination = "monga" | sql_create_context |
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE Badges (
Id number,
UserId number,
Name text,
Date time,
Class number,
TagBased boolean
)
CREATE TABLE PostHistoryTypes (
Id number,
Name text
)
CREATE TABLE PostFeedback (
Id number,
PostId number,
IsAno... | apache-camel questions since Feb 2020. | SELECT Questions.Id AS "post_link", Questions.Title, Questions.AnswerCount, Questions.ViewCount, Questions.FavoriteCount, Questions.Score, Questions.LastActivityDate, Questions.CreationDate FROM Posts AS Questions INNER JOIN PostTags ON PostTags.PostId = Questions.Id INNER JOIN Tags ON Tags.Id = PostTags.TagId AND Tags... | 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
)
... | what is the number of patients whose drug route is tp and admission year is before 2167? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admityear < "2167" AND prescriptions.route = "TP" | mimicsql_data |
CREATE TABLE table_65617 (
"Name" text,
"Country" text,
"Status" text,
"Moving to" text,
"Transfer fee" text
) | Which country has Spence in the name section? | SELECT "Country" FROM table_65617 WHERE "Name" = 'spence' | wikisql |
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25),
EMAIL varchar(25),
PHONE_NUMBER varchar(20),
HIRE_DATE date,
JOB_ID varchar(10),
SALARY decimal(8,2),
COMMISSION_PCT decimal(2,2),
MANAGER_ID decimal(6,0),
DEPARTMENT_ID decimal(... | What are all the employee ids and the names of the countries in which they work Visualize by bar chart, and show total number in ascending order. | SELECT COUNTRY_NAME, SUM(EMPLOYEE_ID) FROM employees AS T1 JOIN departments AS T2 ON T1.DEPARTMENT_ID = T2.DEPARTMENT_ID JOIN locations AS T3 ON T2.LOCATION_ID = T3.LOCATION_ID JOIN countries AS T4 ON T3.COUNTRY_ID = T4.COUNTRY_ID GROUP BY COUNTRY_NAME ORDER BY SUM(EMPLOYEE_ID) | nvbench |
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE icustays (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
first_careunit text,
las... | what the first height of patient 20898 in this month. | 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 = 20898)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'admit ht'... | mimic_iii |
CREATE TABLE table_70298 (
"Place" text,
"Player" text,
"Country" text,
"Score" real,
"To par" text
) | What was the score for Leo Diegel? | SELECT "Score" FROM table_70298 WHERE "Player" = 'leo diegel' | wikisql |
CREATE TABLE table_59643 (
"Team" text,
"Driver" text,
"Class" text,
"Chassis" text,
"Engine" text,
"Rounds" text
) | What is the chassis of rahel frey's volkswagen engine? | SELECT "Chassis" FROM table_59643 WHERE "Engine" = 'volkswagen' AND "Driver" = 'rahel frey' | wikisql |
CREATE TABLE table_18364 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Result" text,
"Candidates" text
) | Phillip Landrum was first elected in 1952 from the ninth district of Georgia. | SELECT "District" FROM table_18364 WHERE "First elected" = '1952' | wikisql |
CREATE TABLE table_1955 (
"Player" text,
"Country" text,
"Year(s) won" text,
"R1" real,
"R2" real,
"R3" real,
"R4" real,
"Total" real,
"To par" text,
"Finish" text
) | What was the minimum score for r2? | SELECT MIN("R2") FROM table_1955 | wikisql |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
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 t... | what is the average age of patients who are of black/african american ethnicity and are aged 43 years or above? | SELECT AVG(demographic.age) FROM demographic WHERE demographic.ethnicity = "BLACK/AFRICAN AMERICAN" AND demographic.age >= "43" | mimicsql_data |
CREATE TABLE transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
eventtype text,
careunit text,
wardid number,
intime time,
outtime time
)
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE diagn... | what was the marital status of patient 19894 on their first hospital visit? | SELECT admissions.marital_status FROM admissions WHERE admissions.subject_id = 19894 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1 | mimic_iii |
CREATE TABLE table_51440 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Decision" text,
"Attendance" real,
"Record" text
) | What was the lowest attendance at a game when Pittsburgh was the home team? | SELECT MIN("Attendance") FROM table_51440 WHERE "Home" = 'pittsburgh' | wikisql |
CREATE TABLE table_62303 (
"Team 1" text,
"Agg." text,
"Team 2" text,
"1st leg" text,
"2nd leg" text
) | What was the 1st leg for Team 2, Leeds United? | SELECT "1st leg" FROM table_62303 WHERE "Team 2" = 'leeds united' | wikisql |
CREATE TABLE table_203_37 (
id number,
"#" number,
"title" text,
"producer(s)" text,
"performer(s)" text,
"length" text
) | what is the song after ova here ? | SELECT "title" FROM table_203_37 WHERE "#" = (SELECT "#" FROM table_203_37 WHERE "title" = '"ova here"') + 1 | squall |
CREATE TABLE table_55858 (
"Tournament" text,
"Winner" text,
"Runner-up" text,
"Score" text,
"Third Place" text
) | What was the score in the Tournament of Frankfurt? | SELECT "Score" FROM table_55858 WHERE "Tournament" = 'frankfurt' | wikisql |
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location t... | how many female patients are diagnosed with icd9 code 2948? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.gender = "F" AND diagnoses.icd9_code = "2948" | 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... | what is the drug route of the drug pneumococcal vac polyvalent? | SELECT prescriptions.route FROM prescriptions WHERE prescriptions.drug = "Pneumococcal Vac Polyvalent" | mimicsql_data |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescription... | mention the date of birth and death status of the patinet named francis baseler. | SELECT demographic.dob, demographic.expire_flag FROM demographic WHERE demographic.name = "Francis Baseler" | mimicsql_data |
CREATE TABLE paperdataset (
paperid int,
datasetid int
)
CREATE TABLE keyphrase (
keyphraseid int,
keyphrasename varchar
)
CREATE TABLE paperfield (
fieldid int,
paperid int
)
CREATE TABLE venue (
venueid int,
venuename varchar
)
CREATE TABLE cite (
citingpaperid int,
citedpa... | how many papers about program slicing ? | SELECT DISTINCT COUNT(DISTINCT paper.paperid) FROM keyphrase, paper, paperkeyphrase WHERE keyphrase.keyphrasename = 'program slicing' AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paper.paperid = paperkeyphrase.paperid | scholar |
CREATE TABLE exhibition (
Exhibition_ID int,
Year int,
Theme text,
Artist_ID int,
Ticket_Price real
)
CREATE TABLE exhibition_record (
Exhibition_ID int,
Date text,
Attendance int
)
CREATE TABLE artist (
Artist_ID int,
Name text,
Country text,
Year_Join int,
Age int... | how many exhibitions has each artist had?, and could you order Y in ascending order? | SELECT Name, COUNT(*) FROM exhibition AS T1 JOIN artist AS T2 ON T1.Artist_ID = T2.Artist_ID GROUP BY T1.Artist_ID ORDER BY COUNT(*) | nvbench |
CREATE TABLE table_name_41 (
result VARCHAR,
date VARCHAR
) | What was the result on October 29, 1989? | SELECT result FROM table_name_41 WHERE date = "october 29, 1989" | 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... | What days is ROMLING 450 going on ? | SELECT DISTINCT course_offering.friday, course_offering.monday, course_offering.saturday, course_offering.sunday, course_offering.thursday, course_offering.tuesday, course_offering.wednesday FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_i... | advising |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,... | what is the number of patients whose year of birth is less than 1850 and diagnoses short title is nutritional marasmus? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.dob_year < "1850" AND diagnoses.short_title = "Nutritional marasmus" | mimicsql_data |
CREATE TABLE airline (
airline_code varchar,
airline_name text,
note 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 in... | i need a flight from DENVER to PITTSBURGH on 7 7 that leaves in the afternoon | 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, date_day, days, flight WHERE (((flight.departure_time BETWEEN 1200 AND 1800) AND date_day.day_number = 7 AND date_day.month_number = 7 AND date_day.year = 1991 AND days.day_n... | atis |
CREATE TABLE table_2894 (
"No. in series" real,
"No. in season" real,
"Title" text,
"Directed by" text,
"Written by" text,
"U.S. viewers (million)" text,
"Original air date" text,
"Production code" real
) | What number was there 6.01 million u.s. drivers? | SELECT "No. in season" FROM table_2894 WHERE "U.S. viewers (million)" = '6.01' | wikisql |
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,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,
JO... | For all employees who have the letters D or S in their first name, a line chart shows the trend of department_id over hire_date , I want to show in asc by the HIRE_DATE. | SELECT HIRE_DATE, DEPARTMENT_ID FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' ORDER BY HIRE_DATE | nvbench |
CREATE TABLE table_28560 (
"Film Festival" text,
"Date of ceremony" text,
"Category" text,
"Participants/Recipients" text,
"Result" text
) | What film festival had the Best Male Actor? | SELECT "Film Festival" FROM table_28560 WHERE "Category" = 'Best Male Actor' | wikisql |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE diagnoses (
... | what is the number of patients whose primary disease is guillain barre syndrome and year of birth is less than 2076? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "GUILLAIN BARRE SYNDROME" AND demographic.dob_year < "2076" | mimicsql_data |
CREATE TABLE table_33781 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | What was the away team whose opponents scored 8.16 (64)? | SELECT "Away team" FROM table_33781 WHERE "Home team score" = '8.16 (64)' | wikisql |
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id num... | calculate the length of stay of patient 82159 during his first hospital stay. | SELECT STRFTIME('%j', admissions.dischtime) - STRFTIME('%j', admissions.admittime) FROM admissions WHERE admissions.subject_id = 82159 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1 | mimic_iii |
CREATE TABLE table_name_46 (
release_date INTEGER,
music_label VARCHAR,
country VARCHAR
) | What is the release date by Editions EG in the Netherlands? | SELECT AVG(release_date) FROM table_name_46 WHERE music_label = "editions eg" AND country = "netherlands" | sql_create_context |
CREATE TABLE table_76187 (
"Year" text,
"Host city" text,
"Champion" text,
"Runner-up" text,
"Final" text
) | What year was the International Cup that was won by Akron Goodyear Wingfoots and had Real Madrid as runner-up? | SELECT "Year" FROM table_76187 WHERE "Champion" = 'akron goodyear wingfoots' AND "Runner-up" = 'real madrid' | wikisql |
CREATE TABLE t_kc22 (
AMOUNT number,
CHA_ITEM_LEV number,
DATA_ID text,
DIRE_TYPE number,
DOSE_FORM text,
DOSE_UNIT text,
EACH_DOSAGE text,
EXP_OCC_DATE time,
FLX_MED_ORG_ID text,
FXBZ number,
HOSP_DOC_CD text,
HOSP_DOC_NM text,
MED_CLINIC_ID text,
MED_DIRE_CD tex... | 患者彭清舒最主要在哪家医院接受治疗,时间从08年1月14日到19年2月22日 | SELECT gwyjzb.MED_SER_ORG_NO FROM gwyjzb WHERE gwyjzb.PERSON_NM = '彭清舒' AND gwyjzb.IN_HOSP_DATE BETWEEN '2008-01-14' AND '2019-02-22' GROUP BY gwyjzb.MED_SER_ORG_NO ORDER BY COUNT(*) DESC LIMIT 1 UNION SELECT fgwyjzb.MED_SER_ORG_NO FROM fgwyjzb WHERE fgwyjzb.PERSON_NM = '彭清舒' AND fgwyjzb.IN_HOSP_DATE BETWEEN '2008-01-1... | css |
CREATE TABLE Subjects (
subject_id INTEGER,
subject_name VARCHAR(120)
)
CREATE TABLE Students (
student_id INTEGER,
date_of_registration DATETIME,
date_of_latest_logon DATETIME,
login_name VARCHAR(40),
password VARCHAR(10),
personal_name VARCHAR(40),
middle_name VARCHAR(40),
fam... | List the name and the number of enrolled student for each course in a bar chart, show by the X from low to high. | SELECT course_name, COUNT(*) FROM Courses AS T1 JOIN Student_Course_Enrolment AS T2 ON T1.course_id = T2.course_id GROUP BY T1.course_name ORDER BY course_name | nvbench |
CREATE TABLE Bookings_Services (
Order_ID INTEGER,
Product_ID INTEGER
)
CREATE TABLE Customers (
Customer_ID VARCHAR(100),
Address_ID INTEGER,
Customer_Name VARCHAR(255),
Customer_Phone VARCHAR(255),
Customer_Email_Address VARCHAR(255),
Other_Details VARCHAR(255)
)
CREATE TABLE Order_I... | List the actual delivery date for all the orders with quantity , 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_15404 (
"Year" real,
"Team" text,
"Chassis" text,
"Engine" text,
"Points" real
) | Which Engine has Points of 3? | SELECT "Engine" FROM table_15404 WHERE "Points" = '3' | wikisql |
CREATE TABLE member (
Member_ID int,
Member_Name text,
Party_ID text,
In_office text
)
CREATE TABLE party (
Party_ID int,
Minister text,
Took_office text,
Left_office text,
Region_ID int,
Party_name text
)
CREATE TABLE party_events (
Event_ID int,
Event_Name text,
P... | Show party names and the number of events for each party in a bar chart, I want to sort in asc by the Y. | SELECT Party_name, COUNT(*) FROM party_events AS T1 JOIN party AS T2 ON T1.Party_ID = T2.Party_ID GROUP BY T1.Party_ID ORDER BY COUNT(*) | nvbench |
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... | 检验报告单的编码为44927016411在住院就诊中的对应的患者是谁? | SELECT person_info.XM FROM person_info JOIN hz_info JOIN zyjzjlb JOIN jybgb JOIN hz_info_zyjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = hz_info_zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX AND hz_info_zyjzjlb.YLJGDM = jybgb.YLJGDM_ZYJZJLB AND zyjzjlb.JZLSH = jybgb.JZLSH_ZYJZ... | css |
CREATE TABLE table_name_48 (
player VARCHAR,
pick VARCHAR
) | What is Player, when Pick is '26'? | SELECT player FROM table_name_48 WHERE pick = 26 | sql_create_context |
CREATE TABLE table_25975 (
"Rank" real,
"Dismissals" real,
"Player" text,
"Caught" real,
"Stumped" real,
"Matches" real,
"Innings" real
) | Name the least dismissals for 4 rank | SELECT MAX("Dismissals") FROM table_25975 WHERE "Rank" = '4' | 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
) | Select the name of the products with a price less than or equal to $200, and count them by a bar chart, and rank by the y axis in ascending. | SELECT Name, COUNT(Name) FROM Products WHERE Price <= 200 GROUP BY Name ORDER BY COUNT(Name) | 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 is the most common reason that causes a fire? | SELECT stat_cause_descr FROM fires GROUP BY stat_cause_descr ORDER BY COUNT(*) DESC LIMIT 1 | uswildfires |
CREATE TABLE table_name_38 (
score VARCHAR,
away_team VARCHAR
) | What was the score for the Perth Wildcats as away team? | SELECT score FROM table_name_38 WHERE away_team = "perth wildcats" | sql_create_context |
CREATE TABLE table_34612 (
"Title" text,
"Season" text,
"Winner" text,
"Score" text,
"Runner-up" text,
"Venue" text,
"Attendance" text
) | What season has a runner-up of waseda, and a title of 47th? | SELECT "Season" FROM table_34612 WHERE "Runner-up" = 'waseda' AND "Title" = '47th' | wikisql |
CREATE TABLE Posts (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body text,
OwnerUserId number,
OwnerDisplayName text,
LastEditorUserId number,
LastEditorDisplayName text... | Worst Questions for a Given Year. | SELECT Id AS "post_link", Score, AnswerCount, ViewCount, FavoriteCount FROM Posts WHERE PostTypeId = 1 AND YEAR(CreationDate) = '##year##' AND Score <= 0 ORDER BY Score, AnswerCount | sede |
CREATE TABLE table_36900 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Attendance" text,
"Record" text
) | Loss of kendrick (11 8) had what record? | SELECT "Record" FROM table_36900 WHERE "Loss" = 'kendrick (11–8)' | wikisql |
CREATE TABLE table_61340 (
"Player" text,
"Country" text,
"Year(s) won" text,
"Total" real,
"To par" text,
"Finish" text
) | What is Bob Charles' To par? | SELECT "To par" FROM table_61340 WHERE "Player" = 'bob charles' | wikisql |
CREATE TABLE table_47667 (
"Res." text,
"Record" text,
"Opponent" text,
"Method" text,
"Round" text
) | What record has magomedkhan gamzatkhanov as the opponent, and submission as the method? | SELECT "Record" FROM table_47667 WHERE "Opponent" = 'magomedkhan gamzatkhanov' AND "Method" = 'submission' | wikisql |
CREATE TABLE table_29916 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
) | What was the high points when the team was Washington? | SELECT "High points" FROM table_29916 WHERE "Team" = 'Washington' | wikisql |
CREATE TABLE t_kc22 (
AMOUNT number,
CHA_ITEM_LEV number,
DATA_ID text,
DIRE_TYPE number,
DOSE_FORM text,
DOSE_UNIT text,
EACH_DOSAGE text,
EXP_OCC_DATE time,
FLX_MED_ORG_ID text,
FXBZ number,
HOSP_DOC_CD text,
HOSP_DOC_NM text,
MED_CLINIC_ID text,
MED_DIRE_CD tex... | 哪几家医院给患者00220409开出过药品4636? | SELECT qtb.MED_SER_ORG_NO FROM qtb WHERE qtb.PERSON_ID = '00220409' AND qtb.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.SOC_SRT_DIRE_CD = '4636') UNION SELECT gyb.MED_SER_ORG_NO FROM gyb WHERE gyb.PERSON_ID = '00220409' AND gyb.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t... | css |
CREATE TABLE table_8510 (
"White" text,
"Black" text,
"Year" real,
"Result" text,
"Moves" real,
"Tournament" text,
"Opening" text
) | What year has 14 moves and an opening of C54 Italian Game? | SELECT "Year" FROM table_8510 WHERE "Moves" = '14' AND "Opening" = 'c54 italian game' | wikisql |
CREATE TABLE table_35971 (
"Player" text,
"Touchdowns" real,
"Extra points" real,
"Field goals" real,
"Points" real
) | How many points did Stuart have when he had less than 1 touchdown? | SELECT SUM("Points") FROM table_35971 WHERE "Player" = 'stuart' AND "Touchdowns" < '1' | wikisql |
CREATE TABLE table_26041144_16 (
rank VARCHAR,
player VARCHAR
) | What is the ranktotal number if the Hashan Tillakaratne? | SELECT COUNT(rank) FROM table_26041144_16 WHERE player = "Hashan Tillakaratne" | sql_create_context |
CREATE TABLE table_23248940_7 (
location_attendance VARCHAR,
record VARCHAR
) | Name the location attendance for 10-14 | SELECT location_attendance FROM table_23248940_7 WHERE record = "10-14" | sql_create_context |
CREATE TABLE PostFeedback (
Id number,
PostId number,
IsAnonymous boolean,
VoteTypeId number,
CreationDate time
)
CREATE TABLE ReviewTaskStates (
Id number,
Name text,
Description text
)
CREATE TABLE PostsWithDeleted (
Id number,
PostTypeId number,
AcceptedAnswerId number,
... | Overall site activity per hour. | SELECT h.hours AS "hour", COUNT(postsCounter) AS "posts" FROM (SELECT TIME_TO_STR(CreationDate, '%h') AS active, 1 AS counter, 1 AS postsCounter, NULL AS commentsCounter, NULL AS editsCounter, NULL AS suggestedCounter FROM Votes WHERE VoteTypeId = 1 AND TIME_TO_STR(CreationDate, '%Y') >= 2013) AS a RIGHT JOIN (SELECT D... | sede |
CREATE TABLE table_33353 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | What was the score for the away team when the home team was richmond? | SELECT "Away team score" FROM table_33353 WHERE "Home team" = 'richmond' | wikisql |
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE procedures_icd (
row_id number,
subject_id nu... | what are the three most common prescribed medications? | SELECT t1.drug FROM (SELECT prescriptions.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM prescriptions GROUP BY prescriptions.drug) AS t1 WHERE t1.c1 <= 3 | mimic_iii |
CREATE TABLE table_204_855 (
id number,
"year" number,
"date" text,
"winner" text,
"result" text,
"loser" text,
"attendance" number,
"location" text
) | which date was attended by the most people ? | SELECT "date" FROM table_204_855 ORDER BY "attendance" DESC LIMIT 1 | squall |
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_typ... | how much was patient 808's body weight first measured since 09/2104? | 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 = 808)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'admit wt' A... | mimic_iii |
CREATE TABLE table_29161 (
"Chambering" text,
"P1 diameter (mm)" text,
"A external (cm 2 )" text,
"P max ( bar )" real,
"F bolt ( kgf )" real,
"F bolt" text
) | What is the f bolt for 11.35 p1 diameter (mm)? | SELECT "F bolt" FROM table_29161 WHERE "P1 diameter (mm)" = '11.35' | wikisql |
CREATE TABLE table_76530 (
"Show" text,
"Last Aired" real,
"Previous Network" text,
"Retitled as/Same" text,
"New/Returning/Same Network" text,
"Returning" text
) | What was the earliest aired show that's returning on September 13? | SELECT MIN("Last Aired") FROM table_76530 WHERE "Returning" = 'september 13' | wikisql |
CREATE TABLE employee (
employeeid number,
lastname text,
firstname text,
title text,
reportsto number,
birthdate time,
hiredate time,
address text,
city text,
state text,
country text,
postalcode text,
phone text,
fax text,
email text
)
CREATE TABLE playlist... | Find the average unit price of jazz tracks. | SELECT AVG(unitprice) FROM genre AS T1 JOIN track AS T2 ON T1.genreid = T2.genreid WHERE T1.name = "Jazz" | spider |
CREATE TABLE table_name_8 (
category VARCHAR,
established VARCHAR
) | Which is the category of the group was establishe in 1990? | SELECT category FROM table_name_8 WHERE established = 1990 | sql_create_context |
CREATE TABLE table_50320 (
"Round" real,
"Pick" real,
"Overall" real,
"Name" text,
"Position" text,
"College" text
) | What is the lowest round of bob caldwell, who has a pick greater than 7 and an overall larger than 162? | SELECT MIN("Round") FROM table_50320 WHERE "Pick" > '7' AND "Name" = 'bob caldwell' AND "Overall" > '162' | wikisql |
CREATE TABLE table_203_231 (
id number,
"season" text,
"tier" number,
"division" text,
"place" text
) | what year has no place indicated ? | SELECT "season" FROM table_203_231 WHERE "place" IS NULL | squall |
CREATE TABLE table_204_419 (
id number,
"year" text,
"tournament" text,
"venue" text,
"played" number,
"won" number,
"lost" number,
"tied" number,
"n/r" number,
"result" text
) | how many teams won only one game ? | SELECT COUNT(*) FROM table_204_419 WHERE "won" = 1 | squall |
CREATE TABLE table_32447 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | Which away team resulted in a 15.14 (104) score for the home team? | SELECT "Away team" FROM table_32447 WHERE "Home team score" = '15.14 (104)' | wikisql |
CREATE TABLE Tags (
Id number,
TagName text,
Count number,
ExcerptPostId number,
WikiPostId number
)
CREATE TABLE SuggestedEdits (
Id number,
PostId number,
CreationDate time,
ApprovalDate time,
RejectionDate time,
OwnerUserId number,
Comment text,
Text text,
Tit... | Answer Resonance & Importance to Impacted Users. The goal here is to measure the impact of an answer on the users who have viewed it - the idea being that the higher the percentage of viewers who have upvoted an answer, the more that answer resonated with the group of viewers, and the higher the percentage of viewers w... | SELECT a.Id AS answer_id, q.Id AS question_id, q.ViewCount, q.FavoriteCount, a.Score, a.OwnerUserId, (a.Score * 1000) / q.ViewCount AS resonance, (q.FavoriteCount * 1000) / q.ViewCount AS importance, CASE WHEN q.AcceptedAnswerId = a.Id THEN 'Accepted' ELSE '' END AS recognized FROM Posts AS a JOIN Posts AS q ON a.Paren... | sede |
CREATE TABLE table_12349 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Record" text
) | Who was the visitor when the record was 24 14 2? | SELECT "Visitor" FROM table_12349 WHERE "Record" = '24–14–2' | wikisql |
CREATE TABLE table_name_79 (
ship VARCHAR,
built VARCHAR
) | What ship was built in 2012? | SELECT ship FROM table_name_79 WHERE built = 2012 | sql_create_context |
CREATE TABLE Accounts (
account_id VARCHAR,
account_details VARCHAR
) | Show all account ids and account details. | SELECT account_id, account_details FROM Accounts | 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 jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,0)
)
CREATE TABLE locations (
LOCATIO... | For those employees who do not work in departments with managers that have ids between 100 and 200, a bar chart shows the distribution of email and salary . | SELECT EMAIL, SALARY FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) | nvbench |
CREATE TABLE Users (
Id number,
Reputation number,
CreationDate time,
DisplayName text,
LastAccessDate time,
WebsiteUrl text,
Location text,
AboutMe text,
Views number,
UpVotes number,
DownVotes number,
ProfileImageUrl text,
EmailHash text,
AccountId number
)
CRE... | All users that don't have down vote privileges and upvoted less than 10 times. | SELECT * FROM Users WHERE 125 > Reputation AND 10 < UpVotes | sede |
CREATE TABLE table_18809 (
"Rank by average" real,
"Competition finish" real,
"Couple" text,
"Total" real,
"Number of dances" real,
"Average" text
) | how many turns were completed to make a mean of 34.0 | SELECT COUNT("Number of dances") FROM table_18809 WHERE "Average" = '34.0' | wikisql |
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE ReviewTaskResultTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostFeedback (
Id number,
PostId number,
IsAnonymous boolean,
VoteTypeId number,
CreationDate time
)
CREATE T... | My median and average answer score at given date. Reports median and average answer score. The MedianAnswerScore2 is more precise version of median. | SELECT COUNT(Posts.Id) AS Answers, (SELECT MAX(Score) FROM (SELECT percent AS Score FROM Posts AS PU WHERE PostTypeId = 2 AND CommunityOwnedDate IS NULL AND PU.OwnerUserId = '##UserId##' ORDER BY Score LIMIT 50) AS t) AS MedianAnswerScore FROM Posts WHERE PostTypeId = 2 AND CommunityOwnedDate IS NULL AND OwnerUserId = ... | sede |
CREATE TABLE table_60857 (
"Rank" real,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) | What is the smallest number of gold medals a country with 1 bronze, and a total of 3 medals which is lower than rank 7? | SELECT MIN("Gold") FROM table_60857 WHERE "Bronze" = '1' AND "Total" = '3' AND "Rank" > '7' | wikisql |
CREATE TABLE table_66638 (
"Pick" real,
"Team" text,
"Player" text,
"Position" text,
"College" text
) | What is the average pick of the kansas city chiefs? | SELECT AVG("Pick") FROM table_66638 WHERE "Team" = 'kansas city chiefs' | wikisql |
CREATE TABLE table_64398 (
"Season" real,
"Series" text,
"Team" text,
"Races" text,
"Wins" text,
"Poles" text,
"F/Laps" text,
"Podiums" text,
"Points" text,
"Position" text
) | What Series has a season that is older than 2003 with a Podiums entry of 1 and a Points entry that is n/a? | SELECT "Series" FROM table_64398 WHERE "Season" < '2003' AND "Podiums" = '1' AND "Points" = 'n/a' | wikisql |
CREATE TABLE PersonFriend (
friend VARCHAR,
name VARCHAR
)
CREATE TABLE Person (
name VARCHAR,
gender VARCHAR
) | Find the female friends of Alice. | SELECT T2.friend FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.friend WHERE T2.name = 'Alice' AND T1.gender = 'female' | sql_create_context |
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,... | 从外地来医疗机构3091243就诊的人数总共有多少 | SELECT COUNT(DISTINCT PERSON_ID) FROM t_kc21 WHERE MED_SER_ORG_NO = '3091243' AND (REMOTE_SETTLE_FLG = '异地1' OR REMOTE_SETTLE_FLG = '异地2') | css |
CREATE TABLE table_name_25 (
to_par VARCHAR,
score VARCHAR
) | What is the To par of the Player with a Score of 71-69-68=208? | SELECT to_par FROM table_name_25 WHERE score = 71 - 69 - 68 = 208 | sql_create_context |
CREATE TABLE person_info (
RYBH text,
XBDM number,
XBMC text,
XM text,
CSRQ time,
CSD text,
MZDM text,
MZMC text,
GJDM text,
GJMC text,
JGDM text,
JGMC text,
XLDM text,
XLMC text,
ZYLBDM text,
ZYMC text
)
CREATE TABLE jybgb (
YLJGDM text,
YLJGDM_M... | 检验报告单64706172687的报告人工号是什么?报告人姓名叫什么? | SELECT BGRGH, BGRXM FROM jybgb WHERE BGDH = '64706172687' | css |
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 allergy (
allergy... | had patient 006-254182 been prescribed in 06/last year proventil,ventolin, prednisone 20 mg po tabs, or vancomycin hcl 1000 mg iv solr? | SELECT COUNT(*) > 0 FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-254182')) AND medication.drugname IN ('proventil,ventolin', 'prednison... | eicu |
CREATE TABLE program (
program_id int,
name varchar,
college varchar,
introduction varchar
)
CREATE TABLE comment_instructor (
instructor_id int,
student_id int,
score int,
comment_text varchar
)
CREATE TABLE offering_instructor (
offering_instructor_id int,
offering_id int,
... | What upper-level DESCI courses are scheduled for this Spring ? | SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, program_course, semester WHERE course.course_id = course_offering.course_id AND course.department = 'DESCI' AND program_course.category LIKE '%ULCS%' AND program_course.course_id = course.course_id AND semester.semester = 'Sprin... | advising |
CREATE TABLE table_7465 (
"Ep No" text,
"Prod Code" text,
"Original Air Date" text,
"Episode Title" text,
"Ratings" text
) | What is the production code fore the episode titled, life's no fun anymore? | SELECT "Prod Code" FROM table_7465 WHERE "Episode Title" = 'life''s no fun anymore' | wikisql |
CREATE TABLE table_2225 (
"Year" real,
"Fowler" real,
"Stanier, 3 cylinder" real,
"Stanier, 2 cylinder" real,
"Fairburn" real,
"BR Standard" real,
"Total" real
) | when fairburn is bigger than 54.0, how many years? | SELECT COUNT("Year") FROM table_2225 WHERE "Fairburn" > '54.0' | wikisql |
CREATE TABLE mzjzjlb (
HXPLC number,
HZXM text,
JLSJ time,
JZJSSJ time,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
JZLSH text,
JZZDBM text,
JZZDSM text,
JZZTDM number,
JZZTMC text,
KH text,
KLX number,
MJZH text,
ML number,
MZZYZDZZBM text,
MZZYZDZZMC ... | 孙和煦病患在号码是4311972的医院门诊中所诊断的名称含有脑血管病的门诊就诊记录列出来? | SELECT * FROM person_info JOIN hz_info JOIN mzjzjlb 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 WHERE person_info.XM = '孙和煦' AND hz_info.YLJGDM = '4311972' AND mzjzjlb.JZZDSM LIKE '%脑血管病%' | css |
CREATE TABLE band (
id VARCHAR
)
CREATE TABLE vocals (
bandmate VARCHAR
) | Which vocal type has the band mate with first name 'Marianne' played the most? | SELECT TYPE FROM vocals AS T1 JOIN band AS T2 ON T1.bandmate = T2.id WHERE firstname = "Marianne" GROUP BY TYPE ORDER BY COUNT(*) DESC LIMIT 1 | sql_create_context |
CREATE TABLE table_name_96 (
points INTEGER,
class VARCHAR,
wins VARCHAR
) | What is the average number of points for a team in the 250cc class with fewer than 0 wins? | SELECT AVG(points) FROM table_name_96 WHERE class = "250cc" AND wins < 0 | sql_create_context |
CREATE TABLE code_description (
code varchar,
description text
)
CREATE TABLE restriction (
restriction_code text,
advance_purchase int,
stopovers text,
saturday_stay_required text,
minimum_stay int,
maximum_stay int,
application text,
no_discounts text
)
CREATE TABLE time_inte... | what are the flights from LAS VEGAS to ONTARIO | 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 = 'LAS VEGAS' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'ONTA... | atis |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.