context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE table_name_51 (
gdp_2012_millions_of_euro VARCHAR,
population_in_millions VARCHAR,
gdp__nominal__per_capita_2012_euro VARCHAR
) | What is GDP 2012 Millions of Euro, when Population in Millions is less than 1.3, and when GDP (Nominal) Per Capita 2012 Euro is 20,700(p)? | SELECT gdp_2012_millions_of_euro FROM table_name_51 WHERE population_in_millions < 1.3 AND gdp__nominal__per_capita_2012_euro = "20,700(p)" | sql_create_context |
CREATE TABLE table_6340 (
"Name" text,
"Circuit" text,
"Date" text,
"Winning driver" text,
"Winning constructor" text,
"Report" text
) | Who is Winning driver on 18 may? | SELECT "Winning driver" FROM table_6340 WHERE "Date" = '18 may' | wikisql |
CREATE TABLE airport (
airport_code varchar,
airport_name text,
airport_location text,
state_code varchar,
country_name varchar,
time_zone_code varchar,
minimum_connect_time int
)
CREATE TABLE code_description (
code varchar,
description text
)
CREATE TABLE airline (
airline_co... | find me the cheapest one way fare i can get from BOSTON to DENVER | 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 table_train_214 (
"id" int,
"gender" string,
"lead_ecg" bool,
"systolic_blood_pressure_sbp" int,
"qt_interval" bool,
"urine_dipstick_protein" int,
"stroke" bool,
"transient_ischemic_attack" bool,
"qtc" int,
"long_qt_syndrome" bool,
"cardiovascular_disease" bool,
... | mean triplicate 12 _ lead ecg demonstrating qt interval ( corrected ) ( qtc ) > 450 msec in male and > 470 msec in female at the screening visit | SELECT * FROM table_train_214 WHERE lead_ecg = 1 OR (qt_interval = 1 OR (gender = 'male' AND qtc > 450) OR (gender = 'female' AND qtc > 470)) | criteria2sql |
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
CREATE TABLE zyjzjlb (
CYBQDM text,
CYBQMC text,
CYCWH text,
CYKSDM text,
CYKSMC text,
CYSJ time,
CYZTDM number,
HZXM text,
JZKSDM text,
JZKSMC text,
JZLSH text,
KH text,
KLX number,... | 之前患者47277233发生过哪些异常情况 | SELECT * 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_info.RYBH = '... | css |
CREATE TABLE table_name_67 (
class VARCHAR,
pos VARCHAR,
year VARCHAR
) | Name the class for 4th position with year before 2006 | SELECT class FROM table_name_67 WHERE pos = "4th" AND year < 2006 | sql_create_context |
CREATE TABLE table_203_784 (
id number,
"no. in\nseries" number,
"no. in\nseason" number,
"performer" text,
"appearance" text,
"air date" text
) | how many performers appeared on the air date 21 january 2011 ? | SELECT COUNT("performer") FROM table_203_784 WHERE "air date" = '21 january 2011' | squall |
CREATE TABLE table_30058355_7 (
fri_26_aug VARCHAR,
wed_24_aug VARCHAR
) | What is every entry for Friday August 26 when the entry for Wednesday August 24 is 23' 52.67 94.807mph? | SELECT fri_26_aug FROM table_30058355_7 WHERE wed_24_aug = "23' 52.67 94.807mph" | sql_create_context |
CREATE TABLE table_57166 (
"Round" real,
"Grand Prix" text,
"Date" text,
"Location" text,
"Pole Position" text,
"Fastest Lap" text,
"Winning Driver" text,
"Winning Constructor" text,
"Report" text
) | Who is the winner constructor with driver riccardo patrese? | SELECT "Winning Constructor" FROM table_57166 WHERE "Winning Driver" = 'riccardo patrese' | wikisql |
CREATE TABLE table_name_66 (
interview INTEGER,
swimsuit VARCHAR,
average VARCHAR
) | What was the highest Interview score from a contestant who had a swimsuit score of 8.857 and an Average score over 9.097? | SELECT MAX(interview) FROM table_name_66 WHERE swimsuit = 8.857 AND average > 9.097 | sql_create_context |
CREATE TABLE PostsWithDeleted (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body text,
OwnerUserId number,
OwnerDisplayName text,
LastEditorUserId number,
LastEditorDispl... | Number of users authored at least one post. | SELECT COUNT(DISTINCT OwnerUserId) FROM Posts | sede |
CREATE TABLE table_name_21 (
ties INTEGER,
games_played VARCHAR,
wins VARCHAR,
goals_against VARCHAR
) | For teams with fewer than 5 wins, goals against over 37, and fewer than 8 games played, what is the average number of ties? | SELECT AVG(ties) FROM table_name_21 WHERE wins < 5 AND goals_against > 37 AND games_played < 8 | sql_create_context |
CREATE TABLE table_46722 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
) | What team has a Record of 50 28? | SELECT "Team" FROM table_46722 WHERE "Record" = '50–28' | wikisql |
CREATE TABLE table_58810 (
"Tie no" text,
"Home team" text,
"Score" text,
"Away team" text,
"Date" text
) | Who was the away team on 30 January 1988, when the home team was Everton? | SELECT "Away team" FROM table_58810 WHERE "Home team" = 'everton' AND "Date" = '30 january 1988' | wikisql |
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_type text,
admission_location text,
d... | what is the price of a diagnosis for uterine leiomyoma nos? | SELECT DISTINCT cost.cost FROM cost WHERE cost.event_type = 'diagnoses_icd' AND cost.event_id IN (SELECT diagnoses_icd.row_id FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'uterine leiomyoma nos')) | mimic_iii |
CREATE TABLE table_12369913_1 (
result VARCHAR,
original_title VARCHAR
) | How many results are there with the original title of ani ohev otach roza ( )? | SELECT COUNT(result) FROM table_12369913_1 WHERE original_title = "Ani Ohev Otach Roza (אני אוהב אותך רוזה)" | sql_create_context |
CREATE TABLE table_63986 (
"Team #1" text,
"Agg." text,
"Team #2" text,
"1st leg" text,
"2nd leg" text
) | What was the first leg score of the matchup with a 2nd leg of 80-70? | SELECT "1st leg" FROM table_63986 WHERE "2nd leg" = '80-70' | wikisql |
CREATE TABLE table_name_35 (
report VARCHAR,
away_team VARCHAR
) | What's the report about townsville crocodiles as an away team? | SELECT report FROM table_name_35 WHERE away_team = "townsville crocodiles" | sql_create_context |
CREATE TABLE table_2897457_2 (
pick__number VARCHAR,
player VARCHAR
) | How many draft picks is player byron dafoe? | SELECT COUNT(pick__number) FROM table_2897457_2 WHERE player = "Byron Dafoe" | sql_create_context |
CREATE TABLE record (
ID int,
Result text,
Swimmer_ID int,
Event_ID int
)
CREATE TABLE event (
ID int,
Name text,
Stadium_ID int,
Year text
)
CREATE TABLE stadium (
ID int,
name text,
Capacity int,
City text,
Country text,
Opening_year int
)
CREATE TABLE swimme... | Find the names of stadiums that some Australian swimmers have been to, and count them by a pie chart | SELECT T4.Name, COUNT(T4.Name) FROM swimmer AS t1 JOIN record AS t2 ON t1.ID = t2.Swimmer_ID JOIN event AS t3 ON t2.Event_ID = t3.ID JOIN stadium AS t4 ON t4.ID = t3.Stadium_ID WHERE t1.Nationality = 'Australia' GROUP BY T4.Name | nvbench |
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
... | tell me the top three diagnosis that has the highest two year mortality rate? | SELECT d_icd_diagnoses.short_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.icd9_code IN (SELECT t4.icd9_code FROM (SELECT t3.icd9_code, DENSE_RANK() OVER (ORDER BY t3.c1 DESC) AS c2 FROM (SELECT t2.icd9_code, 100 - SUM(CASE WHEN patients.dod IS NULL THEN 1 WHEN STRFTIME('%j', patients.dod) - STRFTIME('%j', t2.chartt... | mimic_iii |
CREATE TABLE table_name_5 (
tournament VARCHAR,
location VARCHAR
) | What tournament was located in Colorado? | SELECT tournament FROM table_name_5 WHERE location = "colorado" | sql_create_context |
CREATE TABLE table_41898 (
"Ballarat FL" text,
"Wins" real,
"Byes" real,
"Losses" real,
"Draws" real,
"Against" real
) | What is the smallest losses when the wins are 5 and the against less than 1852? | SELECT MIN("Losses") FROM table_41898 WHERE "Wins" = '5' AND "Against" < '1852' | wikisql |
CREATE TABLE table_5335 (
"Specification" text,
"Gender" text,
"Junior High School (12\u201315 yrs)" text,
"Senior High School (15\u201318 yrs)" text,
"University students and Adults (18yrs+)" text
) | What value for university students and adult goes with male gender for minimum weight? | SELECT "University students and Adults (18yrs+)" FROM table_5335 WHERE "Gender" = 'male' AND "Specification" = 'minimum weight' | 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... | Of all the teachers , which one teaches PEDDENT 599 ? | SELECT DISTINCT instructor.name FROM course, course_offering, instructor, offering_instructor WHERE course.course_id = course_offering.course_id AND course.department = 'PEDDENT' AND course.number = 599 AND offering_instructor.instructor_id = instructor.instructor_id AND offering_instructor.offering_id = course_offerin... | advising |
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 patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE d... | how much is the cost of a drug called dorzolamide 2% ophth. soln.? | SELECT DISTINCT cost.cost FROM cost WHERE cost.event_type = 'prescriptions' AND cost.event_id IN (SELECT prescriptions.row_id FROM prescriptions WHERE prescriptions.drug = 'dorzolamide 2% ophth. soln.') | mimic_iii |
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
eventtype text,
careunit text,
war... | since 6 years ago, how many times patient 80119 had visited the hospital? | SELECT COUNT(DISTINCT admissions.hadm_id) FROM admissions WHERE admissions.subject_id = 80119 AND DATETIME(admissions.admittime) >= DATETIME(CURRENT_TIME(), '-6 year') | mimic_iii |
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... | Name the 3 -credit courses . | SELECT DISTINCT name, number FROM course WHERE credits = 3 AND department = 'EECS' | advising |
CREATE TABLE appointment (
Physician VARCHAR
)
CREATE TABLE physician (
name VARCHAR,
EmployeeID VARCHAR
) | List the name of physicians who took some appointment. | SELECT T2.name FROM appointment AS T1 JOIN physician AS T2 ON T1.Physician = T2.EmployeeID | sql_create_context |
CREATE TABLE Student (
StuID VARCHAR,
age INTEGER
) | Show all student ids who are older than 20. | SELECT StuID FROM Student WHERE age > 20 | sql_create_context |
CREATE TABLE gsi (
course_offering_id int,
student_id int
)
CREATE TABLE requirement (
requirement_id int,
requirement varchar,
college varchar
)
CREATE TABLE offering_instructor (
offering_instructor_id int,
offering_id int,
instructor_id int
)
CREATE TABLE instructor (
instructo... | Could I take class HHCR 710 as Core ? | SELECT COUNT(*) > 0 FROM course, program, program_course WHERE course.department = 'HHCR' AND course.number = 710 AND program_course.category LIKE '%Core%' AND program_course.course_id = course.course_id AND program.name LIKE '%CS-LSA%' AND program.program_id = program_course.program_id | advising |
CREATE TABLE locations (
LOCATION_ID decimal(4,0),
STREET_ADDRESS varchar(40),
POSTAL_CODE varchar(12),
CITY varchar(30),
STATE_PROVINCE varchar(25),
COUNTRY_ID varchar(2)
)
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE T... | For those employees who do not work in departments with managers that have ids between 100 and 200, show me about the distribution of email and salary in a bar chart, list in asc by the x-axis. | SELECT EMAIL, SALARY FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY EMAIL | nvbench |
CREATE TABLE table_name_43 (
body VARCHAR,
year VARCHAR
) | What body participated in 1973? | SELECT body FROM table_name_43 WHERE year = "1973" | sql_create_context |
CREATE TABLE table_name_3 (
country VARCHAR,
iata VARCHAR
) | Which country has an IATA of JFK? | SELECT country FROM table_name_3 WHERE iata = "jfk" | sql_create_context |
CREATE TABLE Person (
job VARCHAR,
age INTEGER,
gender VARCHAR
) | What is average age of male for different job title? | SELECT AVG(age), job FROM Person WHERE gender = 'male' GROUP BY job | sql_create_context |
CREATE TABLE table_204_756 (
id number,
"year" number,
"team" text,
"games" number,
"combined tackles" number,
"tackles" number,
"assisted tackles" number,
"sacks" number,
"forced fumbles" number,
"fumble recoveries" number,
"fumble return yards" number,
"interceptions" n... | how many years did he play in less than 16 games ? | SELECT COUNT("year") FROM table_204_756 WHERE "games" < 16 | squall |
CREATE TABLE ta (
campus_job_id int,
student_id int,
location varchar
)
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 varch... | Is 510 taken by undergrads ? | SELECT DISTINCT advisory_requirement, enforced_requirement, name FROM course WHERE department = 'EECS' AND number = 510 | advising |
CREATE TABLE table_name_63 (
score VARCHAR,
partnering VARCHAR
) | which Score has a Partnering of dmitry tursunov? | SELECT score FROM table_name_63 WHERE partnering = "dmitry tursunov" | sql_create_context |
CREATE TABLE hz_info (
KH text,
KLX number,
YLJGDM text,
RYBH text
)
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 t... | 从06年1月17日至12年11月19日期间内为28372470患者检测促肾上腺皮质激素的医务人员姓名和工号分别什么? | (SELECT jyjgzbb.JCRGH, jyjgzbb.JCRXM 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... | css |
CREATE TABLE table_15835 (
"Year" real,
"Entrant" text,
"Chassis" text,
"Engine" text,
"Points" text
) | What year did Elf Team Tyrrell have 34 points? | SELECT AVG("Year") FROM table_15835 WHERE "Entrant" = 'elf team tyrrell' AND "Points" = '34' | 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... | calculate the maximum age of unmarried patients who have gangrene primary disease. | SELECT MAX(demographic.age) FROM demographic WHERE demographic.marital_status = "SINGLE" AND demographic.diagnosis = "GANGRENE" | mimicsql_data |
CREATE TABLE College (
cName varchar(20),
state varchar(2),
enr numeric(5,0)
)
CREATE TABLE Tryout (
pID numeric(5,0),
cName varchar(20),
pPos varchar(8),
decision varchar(3)
)
CREATE TABLE Player (
pID numeric(5,0),
pName varchar(20),
yCard varchar(3),
HS numeric(5,0)
) | How many students participated in tryouts for each college by descennding count. Show a pie chart. | SELECT cName, COUNT(*) FROM Tryout GROUP BY cName ORDER BY COUNT(*) DESC | nvbench |
CREATE TABLE table_name_54 (
byes INTEGER,
benalla_dfl VARCHAR,
wins VARCHAR
) | What are the average byes of Bonnie Doon having more than 16 wins? | SELECT AVG(byes) FROM table_name_54 WHERE benalla_dfl = "bonnie doon" AND wins > 16 | sql_create_context |
CREATE TABLE Circulation_History (
document_id INTEGER,
draft_number INTEGER,
copy_number INTEGER,
employee_id INTEGER
)
CREATE TABLE Roles (
role_code CHAR(15),
role_description VARCHAR(255)
)
CREATE TABLE Documents_Mailed (
document_id INTEGER,
mailed_to_address_id INTEGER,
maili... | Give me the trend of how many receipt date by receipt date, and could you show in asc by the receipt_date? | SELECT receipt_date, COUNT(receipt_date) FROM Documents ORDER BY receipt_date | nvbench |
CREATE TABLE table_42620 (
"Name" text,
"Position" text,
"Number" real,
"School/Club Team" text,
"Season" text,
"Acquisition via" text
) | How did the School/Club Team of Manuel Luis Quezon acquire their Forward? | SELECT "Acquisition via" FROM table_42620 WHERE "Position" = 'forward' AND "School/Club Team" = 'manuel luis quezon' | wikisql |
CREATE TABLE table_49221 (
"Round" real,
"Pick" text,
"Player" text,
"Position" text,
"School/Club Team" text
) | What is the WR player? | SELECT "Player" FROM table_49221 WHERE "Position" = 'wr' | wikisql |
CREATE TABLE table_name_15 (
attendance VARCHAR,
date VARCHAR
) | Name the attendance on april 17 | SELECT attendance FROM table_name_15 WHERE date = "april 17" | sql_create_context |
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_type text,
a... | what are the three most common procedures that followed within 2 months for patients who were given a contrast arteriogram-leg? | SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT t3.icd9_code FROM (SELECT t2.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, procedures_icd.charttime FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admi... | mimic_iii |
CREATE TABLE program_requirement (
program_id int,
category varchar,
min_credit int,
additional_req varchar
)
CREATE TABLE student (
student_id int,
lastname varchar,
firstname varchar,
program_id int,
declare_major varchar,
total_credit int,
total_gpa float,
entered_as ... | What are the courses offered this semester ? | SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND course.department = 'EECS' AND semester.semester = 'WN' AND semester.semester_id = course_offering.semester AND semester.year = 2016 ORDER BY course.department | advising |
CREATE TABLE fare_basis (
fare_basis_code text,
booking_class text,
class_type text,
premium text,
economy text,
discounted text,
night text,
season text,
basis_days text
)
CREATE TABLE flight_leg (
flight_id int,
leg_number int,
leg_flight int
)
CREATE TABLE aircraft (... | show flights from PITTSBURGH into SAN FRANCISCO | 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 = 'PITTSBURGH' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN... | atis |
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 patients whose age is less than 81 and days of hospital stay is greater than 29? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.age < "81" AND demographic.days_stay > "29" | mimicsql_data |
CREATE TABLE table_47031 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High assists" text,
"Location Attendance" text,
"Record" text
) | What is the record of game 26 with beno udrih (4) as the highest assists? | SELECT "Record" FROM table_47031 WHERE "High assists" = 'beno udrih (4)' AND "Game" = '26' | wikisql |
CREATE TABLE head (
head_ID int,
name text,
born_state text,
age real
)
CREATE TABLE management (
department_ID int,
head_ID int,
temporary_acting text
)
CREATE TABLE department (
Department_ID int,
Name text,
Creation text,
Ranking int,
Budget_in_Billions real,
Num... | I want to see trend of the average of budget in billions by creation | SELECT Creation, AVG(Budget_in_Billions) FROM department | nvbench |
CREATE TABLE table_name_92 (
winner VARCHAR,
finalist VARCHAR
) | Who was the winner against finalist Lina Krasnoroutskaya? | SELECT winner FROM table_name_92 WHERE finalist = "lina krasnoroutskaya" | sql_create_context |
CREATE TABLE fgwyjzb (
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,
... | 患者华安然开出的药品在哪几次医疗记录中均超过1404.19元?他的医疗就诊编号都是多少啊? | SELECT gwyjzb.MED_CLINIC_ID FROM gwyjzb WHERE gwyjzb.PERSON_NM = '华安然' AND NOT gwyjzb.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT <= 1404.19) UNION SELECT fgwyjzb.MED_CLINIC_ID FROM fgwyjzb WHERE fgwyjzb.PERSON_NM = '华安然' AND NOT fgwyjzb.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FR... | css |
CREATE TABLE table_48509 (
"Tournament" text,
"1993" text,
"1994" text,
"1995" text,
"1996" text,
"1997" text,
"1998" text,
"1999" text,
"2000" text,
"2001" text,
"2002" text,
"2003" text,
"2004" text,
"2005" text,
"2006" text,
"2007" text,
"Career WR"... | What is 2000, when 1996 is 'A', when 1997 is 'A', and when 2007 is 'A'? | SELECT "2000" FROM table_48509 WHERE "1996" = 'a' AND "1997" = 'a' AND "2007" = 'a' | wikisql |
CREATE TABLE table_59095 (
"Player" text,
"Country" text,
"Year(s) won" text,
"Total" real,
"To par" text,
"Finish" text
) | What is the maximum total when the To par is +3? | SELECT MAX("Total") FROM table_59095 WHERE "To par" = '+3' | wikisql |
CREATE TABLE table_name_62 (
venue VARCHAR,
away_team VARCHAR
) | Where did Geelong play as the away team? | SELECT venue FROM table_name_62 WHERE away_team = "geelong" | sql_create_context |
CREATE TABLE table_34997 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Decision" text,
"Attendance" text,
"Record" text
) | What date has ny islanders as the visitor? | SELECT "Date" FROM table_34997 WHERE "Visitor" = 'ny islanders' | wikisql |
CREATE TABLE table_48512 (
"Year" real,
"Award" text,
"Nominated Work" text,
"Category" text,
"Result" text
) | Before the year 2012, what award was given to the artist in the category of revelaci n pop del a o? | SELECT "Award" FROM table_48512 WHERE "Year" < '2012' AND "Category" = 'revelación pop del año' | wikisql |
CREATE TABLE table_53603 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Attendance" real,
"Record" text
) | What is the average attendance on april 24? | SELECT AVG("Attendance") FROM table_53603 WHERE "Date" = 'april 24' | wikisql |
CREATE TABLE architect (
id text,
name text,
nationality text,
gender text
)
CREATE TABLE bridge (
architect_id int,
id int,
name text,
location text,
length_meters real,
length_feet real
)
CREATE TABLE mill (
architect_id int,
id int,
location text,
name text,
... | What are the ids and names of the architects who built at least 3 bridges , and rank y-axis in desc order. | SELECT T1.name, T1.id FROM architect AS T1 JOIN bridge AS T2 ON T1.id = T2.architect_id ORDER BY T1.id DESC | nvbench |
CREATE TABLE table_name_2 (
d_46_√ VARCHAR,
d_43_√ VARCHAR
) | What is the D 46 with a D 43 with r 3? | SELECT d_46_√ FROM table_name_2 WHERE d_43_√ = "r 3" | sql_create_context |
CREATE TABLE table_name_93 (
loses INTEGER,
points VARCHAR,
points_against VARCHAR,
club VARCHAR
) | What are the highest losses that have points agaisnt less than 956, high park demons as the club, and points less than 16? | SELECT MAX(loses) FROM table_name_93 WHERE points_against < 956 AND club = "high park demons" AND points < 16 | sql_create_context |
CREATE TABLE table_63443 (
"Rank" real,
"Rowers" text,
"Country" text,
"Time" text,
"Notes" text
) | What rank was the team from Australia? | SELECT COUNT("Rank") FROM table_63443 WHERE "Country" = 'australia' | wikisql |
CREATE TABLE table_71700 (
"Name" text,
"Years" text,
"Gender" text,
"Area" text,
"Authority" text,
"Decile" real,
"Roll" real
) | Name the sum of roll for morrinsville school | SELECT SUM("Roll") FROM table_71700 WHERE "Name" = 'morrinsville school' | wikisql |
CREATE TABLE Customers_Cards (
card_id INTEGER,
customer_id INTEGER,
card_type_code VARCHAR(15),
card_number VARCHAR(80),
date_valid_from DATETIME,
date_valid_to DATETIME,
other_card_details VARCHAR(255)
)
CREATE TABLE Accounts (
account_id INTEGER,
customer_id INTEGER,
account_... | Draw a bar chart of transaction type versus the total number, and rank from low to high by the names. | SELECT transaction_type, COUNT(*) FROM Financial_Transactions GROUP BY transaction_type ORDER BY transaction_type | nvbench |
CREATE TABLE section (
course_id varchar(8),
sec_id varchar(8),
semester varchar(6),
year numeric(4,0),
building varchar(15),
room_number varchar(7),
time_slot_id varchar(4)
)
CREATE TABLE takes (
ID varchar(5),
course_id varchar(8),
sec_id varchar(8),
semester varchar(6),
... | How many courses are provided in each year? Visualize with a group line chart grouping by semester, I want to order X from in desc order. | SELECT year, COUNT(*) FROM section GROUP BY semester ORDER BY year DESC | nvbench |
CREATE TABLE All_Documents (
Document_ID INTEGER,
Date_Stored DATETIME,
Document_Type_Code CHAR(15),
Document_Name CHAR(255),
Document_Description CHAR(255),
Other_Details VARCHAR(255)
)
CREATE TABLE Document_Locations (
Document_ID INTEGER,
Location_Code CHAR(15),
Date_in_Location_... | Show all role codes and the number of employees in each role by a bar chart. | SELECT Role_Code, COUNT(*) FROM Employees GROUP BY Role_Code | nvbench |
CREATE TABLE table_25751 (
"Position" real,
"Driver" text,
"Points" real,
"Starts" real,
"Wins" real,
"Top 5s" real,
"Top 10s" real,
"Winnings ($)" real
) | How many starts are there? | SELECT MIN("Starts") FROM table_25751 | wikisql |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE demographic (... | give me the number of patients who had single internal mammary-coronary artery bypass. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE procedures.short_title = "1 int mam-cor art bypass" | mimicsql_data |
CREATE TABLE mzb (
CLINIC_ID 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,
INSU_TYPE text,
IN... | 在09年2月17到日2015年11月4日内这段时间,医疗机构3153321的统筹金额消耗最多的29个科室都有哪些? | SELECT qtb.MED_ORG_DEPT_CD, qtb.MED_ORG_DEPT_NM FROM qtb JOIN t_kc24 ON qtb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE qtb.MED_SER_ORG_NO = '3153321' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2009-02-17' AND '2015-11-04' GROUP BY qtb.MED_ORG_DEPT_CD ORDER BY SUM(t_kc24.OVE_PAY) DESC LIMIT 29 UNION SELECT gyb.MED_ORG_DEPT_CD,... | css |
CREATE TABLE table_53324 (
"Unit" text,
"Reactor Type" text,
"Net Capacity" text,
"Gross Capacity" text,
"Construction Start" text,
"Grid Connection" text,
"Commercial Operation" text,
"Status" text
) | What is the gross capacity of the unit that started commercial operation on August 28, 1987? | SELECT "Gross Capacity" FROM table_53324 WHERE "Commercial Operation" = 'august 28, 1987' | wikisql |
CREATE TABLE table_72485 (
"N" real,
"P" text,
"Name" text,
"EU" text,
"Country" text,
"Age" real,
"Type" text,
"Moving from" text,
"Transfer window" text,
"Ends" text,
"Transfer fee" text,
"Source" text
) | What is the type of the player whose transfer fee was 20m? | SELECT "Type" FROM table_72485 WHERE "Transfer fee" = '€20M' | wikisql |
CREATE TABLE table_11157122_5 (
yards VARCHAR,
attempts VARCHAR
) | How many yards did the player with 87 attempts rush? | SELECT yards FROM table_11157122_5 WHERE attempts = 87 | sql_create_context |
CREATE TABLE table_75986 (
"Outcome" text,
"Year" real,
"Championship" text,
"Surface" text,
"Partner" text,
"Opponents" text,
"Score" text
) | Which Score has smaller than 1994, and a Partner of elizabeth sayers smylie? | SELECT "Score" FROM table_75986 WHERE "Year" < '1994' AND "Partner" = 'elizabeth sayers smylie' | wikisql |
CREATE TABLE table_20819 (
"Pick #" real,
"CFL Team" text,
"Player" text,
"Position" text,
"College" text
) | How many players named Jeff Brown were drafted | SELECT COUNT("Position") FROM table_20819 WHERE "Player" = 'Jeff Brown' | wikisql |
CREATE TABLE Tryout (
pID numeric(5,0),
cName varchar(20),
pPos varchar(8),
decision varchar(3)
)
CREATE TABLE Player (
pID numeric(5,0),
pName varchar(20),
yCard varchar(3),
HS numeric(5,0)
)
CREATE TABLE College (
cName varchar(20),
state varchar(2),
enr numeric(5,0)
) | Find cName and enr , and visualize them by a bar chart. | SELECT cName, enr FROM College ORDER BY enr | nvbench |
CREATE TABLE table_train_165 (
"id" int,
"gender" string,
"hemoglobin_a1c_hba1c" float,
"visual_impairment" bool,
"blood_glucose" int,
"body_mass_index_bmi" float,
"a1c" float,
"age" float,
"NOUSE" float
) | must have a bmi equal to or greater than 30 | SELECT * FROM table_train_165 WHERE body_mass_index_bmi >= 30 | criteria2sql |
CREATE TABLE table_42631 (
"Rank" real,
"Song title" text,
"Composer(s)" text,
"Performer(s)" text,
"Year" real
) | Who sang the song composed by Mariah Carey and Walter Afanasieff? | SELECT "Performer(s)" FROM table_42631 WHERE "Composer(s)" = 'mariah carey and walter afanasieff' | wikisql |
CREATE TABLE table_dev_26 (
"id" int,
"gender" string,
"hemoglobin_a1c_hba1c" float,
"dyslipidemia" bool,
"body_weight" float,
"hba1c" float,
"body_mass_index_bmi" float,
"hypertension" bool,
"NOUSE" float
) | hba1c > 7 % and not to exceed 10.5 % . | SELECT * FROM table_dev_26 WHERE hba1c > 7 AND hemoglobin_a1c_hba1c < 10.5 | criteria2sql |
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetake... | what's patient 011-53628's minimum value of alkaline phos. in 03/this year? | SELECT MIN(lab.labresult) FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '011-53628')) AND lab.labname = 'alkaline phos.' AND DATETIME(lab.labresulttime, 's... | eicu |
CREATE TABLE table_37959 (
"Date" text,
"Time" text,
"Score" text,
"Set 1" text,
"Set 2" text,
"Set 3" text,
"Total" text
) | Which Total has a Score of 1 3, and a Set 1 of 29 31? | SELECT "Total" FROM table_37959 WHERE "Score" = '1–3' AND "Set 1" = '29–31' | 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... | what is language of subject name charles deshay? | SELECT demographic.language FROM demographic WHERE demographic.name = "Charles Deshay" | mimicsql_data |
CREATE TABLE t_kc21_t_kc24 (
MED_CLINIC_ID text,
MED_SAFE_PAY_ID number
)
CREATE TABLE t_kc21 (
CLINIC_ID text,
CLINIC_TYPE text,
COMP_ID text,
DATA_ID text,
DIFF_PLACE_FLG number,
FERTILITY_STS number,
FLX_MED_ORG_ID text,
HOSP_LEV number,
HOSP_STS number,
IDENTITY_CARD... | 药品603623-l患者花淑华在哪几家医院被开出过? | SELECT t_kc21.MED_SER_ORG_NO FROM t_kc21 WHERE t_kc21.PERSON_NM = '花淑华' AND t_kc21.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.SOC_SRT_DIRE_CD = '603623-l') | css |
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
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,
insuranc... | what was the top five most frequent drugs prescribed to patients in the same month after the diagnosis of ac kidny fail, tubr necr? | SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE ... | mimic_iii |
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 name and manufacturer , and group by attribute founder, and visualize them by a bar chart. | SELECT T1.Name, T1.Manufacturer FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder, T1.Name | nvbench |
CREATE TABLE table_66764 (
"Rank" real,
"Year" real,
"Name" text,
"Moving from" text,
"Moving to" text
) | The player with a rank of 9, made a move from what football club? | SELECT "Moving from" FROM table_66764 WHERE "Rank" = '9' | wikisql |
CREATE TABLE table_261941_1 (
founded VARCHAR,
type VARCHAR
) | When was the private/baptist school founded? | SELECT founded FROM table_261941_1 WHERE type = "Private/Baptist" | sql_create_context |
CREATE TABLE table_name_1 (
location VARCHAR,
opponent VARCHAR
) | Where was the location where justin robbins fought against billy kidd? | SELECT location FROM table_name_1 WHERE opponent = "billy kidd" | sql_create_context |
CREATE TABLE table_160510_1 (
capital VARCHAR,
hanja VARCHAR
) | The hanja is for what capital? | SELECT capital FROM table_160510_1 WHERE hanja = "尙州" | sql_create_context |
CREATE TABLE table_76384 (
"Res." text,
"Record" text,
"Opponent" text,
"Method" text,
"Event" text,
"Round" text,
"Location" text
) | Where was the fight located that lasted 1 round against luiz claudio das dores? | SELECT "Location" FROM table_76384 WHERE "Round" = '1' AND "Opponent" = 'luiz claudio das dores' | wikisql |
CREATE TABLE table_62241 (
"Rank" text,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) | What is the nation when bronze is less than 7, gold is larger than 0, total is larger than 7, and silver is smaller than 3? | SELECT "Nation" FROM table_62241 WHERE "Bronze" < '7' AND "Gold" > '0' AND "Total" > '7' AND "Silver" < '3' | wikisql |
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,
END_DATE date,
JOB_ID varchar(10),
DEPARTMENT_ID decimal(4,0)
)
CREATE TABLE departments (
DEP... | For all employees who have the letters D or S in their first name, give me the comparison about the average of manager_id over the job_id , and group by attribute job_id. | SELECT JOB_ID, AVG(MANAGER_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' GROUP BY JOB_ID | nvbench |
CREATE TABLE table_name_24 (
event VARCHAR,
opponent VARCHAR,
res VARCHAR,
round VARCHAR
) | Which event is a win by an opponent of Nicolas Smith, with the round marked n/a? | SELECT event FROM table_name_24 WHERE res = "win" AND round = "n/a" AND opponent = "nicolas smith" | sql_create_context |
CREATE TABLE table_name_64 (
byes INTEGER,
against VARCHAR,
wins VARCHAR,
benalla_dfl VARCHAR
) | What is the highest value for Byes, when Wins is less than 16, when Benalla DFL is 'Swanpool', and when Against is less than 2177? | SELECT MAX(byes) FROM table_name_64 WHERE wins < 16 AND benalla_dfl = "swanpool" AND against < 2177 | sql_create_context |
CREATE TABLE table_42628 (
"Position" real,
"Team" text,
"Points" real,
"Played" real,
"Drawn" real,
"Lost" real,
"Against" real,
"Difference" text
) | Which average against has a lost less than 1? | SELECT AVG("Against") FROM table_42628 WHERE "Lost" < '1' | wikisql |
CREATE TABLE table_27755603_11 (
game VARCHAR,
team VARCHAR
) | What numbered game did they play chicago? | SELECT game FROM table_27755603_11 WHERE team = "Chicago" | sql_create_context |
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid number,
wardid number,
admissionheight number,
admissionweight number,
dischargeweight number,
hospitaladmittime time,
... | how many times do patient 002-62783 get a magnesium test until 2103? | SELECT COUNT(*) FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '002-62783')) AND lab.labname = 'magnesium' AND STRFTIME('%y', lab.labresulttime) <= '2103' | eicu |
CREATE TABLE table_43268 (
"Date" text,
"Label" text,
"Format" text,
"Country" text,
"Catalog" text
) | What is the Catalog with a Format of lp, a Country of us, a Label of sundazed, and a Date of 2006? | SELECT "Catalog" FROM table_43268 WHERE "Format" = 'lp' AND "Country" = 'us' AND "Label" = 'sundazed' AND "Date" = '2006' | wikisql |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.