context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE table_name_54 (
Id VARCHAR
) | Which 1988 has a 1985 of 2r? | SELECT 1988 FROM table_name_54 WHERE 1985 = "2r" | sql_create_context |
CREATE TABLE table_204_302 (
id number,
"rank" number,
"nation" text,
"gold" number,
"silver" number,
"bronze" number,
"total" number
) | how many total medals were there all together ? | SELECT SUM("total") FROM table_204_302 | squall |
CREATE TABLE table_name_9 (
played INTEGER,
against VARCHAR,
drawn VARCHAR
) | What is the average Played when the against is 51, and the drawn is more than 1? | SELECT AVG(played) FROM table_name_9 WHERE against = 51 AND drawn > 1 | sql_create_context |
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 who did not have any job in the past, visualize a bar chart about the distribution of job_id and the average of manager_id , and group by attribute job_id, and display Y-axis in asc order. | SELECT JOB_ID, AVG(MANAGER_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) GROUP BY JOB_ID ORDER BY AVG(MANAGER_ID) | nvbench |
CREATE TABLE people (
People_ID int,
Sex text,
Name text,
Date_of_Birth text,
Height real,
Weight real
)
CREATE TABLE candidate (
Candidate_ID int,
People_ID int,
Poll_Source text,
Date text,
Support_rate real,
Consider_rate real,
Oppose_rate real,
Unsure_rate re... | Visualize a pie chart about the proportion of Sex and the sum of Weight. | SELECT Sex, SUM(Weight) FROM people GROUP BY Sex | nvbench |
CREATE TABLE PostLinks (
Id number,
CreationDate time,
PostId number,
RelatedPostId number,
LinkTypeId number
)
CREATE TABLE PostHistory (
Id number,
PostHistoryTypeId number,
PostId number,
RevisionGUID other,
CreationDate time,
UserId number,
UserDisplayName text,
... | Closed ReOpened After LastEdit By Owner After Closed. | SELECT p.LastEditDate, p.ClosedDate, CASE WHEN p.LastEditDate >= p.ClosedDate THEN 'Counted' ELSE 'Ignored' END AS Diff, p.Id AS "post_link" FROM Posts AS p, PostHistory AS ph WHERE p.LastEditorUserId = p.OwnerUserId AND p.Id = ph.PostId AND ph.PostHistoryTypeId = 11 ORDER BY 3 | sede |
CREATE TABLE mzjzjlb_jybgb (
YLJGDM_MZJZJLB text,
BGDH number,
YLJGDM number
)
CREATE TABLE jyjgzbb (
BGDH text,
BGRQ time,
CKZFWDX text,
CKZFWSX number,
CKZFWXX number,
JCFF text,
JCRGH text,
JCRXM text,
JCXMMC text,
JCZBDM text,
JCZBJGDL number,
JCZBJGDW te... | 列举出在06年8月30日到2008年5月14日内蒋锐锋病患所有检验报告单的审核日期时间是那几天? | SELECT jybgb.SHSJ FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN mzjzjlb_jybgb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = mzjzjlb_jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND mzjzjl... | css |
CREATE TABLE table_73354 (
"Year" real,
"Starts" real,
"Wins" real,
"Top 10" real,
"Poles" real,
"Avg. Start" text,
"Avg. Finish" text,
"Winnings" text,
"Position" text,
"Team(s)" text
) | What racing team/s had the 92nd position? | SELECT "Team(s)" FROM table_73354 WHERE "Position" = '92nd' | wikisql |
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... | what was the top four diagnosis that had the highest four 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_68 (
road_team VARCHAR,
result VARCHAR
) | For the game ending in a final result of 99-90, who was the Road Team? | SELECT road_team FROM table_name_68 WHERE result = "99-90" | sql_create_context |
CREATE TABLE student_record (
student_id int,
course_id int,
semester int,
grade varchar,
how varchar,
transfer_source varchar,
earn_credit varchar,
repeat_term varchar,
test_id varchar
)
CREATE TABLE ta (
campus_job_id int,
student_id int,
location varchar
)
CREATE TAB... | Next semester , how many lecture sections of AOSS 584 are offered ? | SELECT COUNT(*) FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND course.department = 'AOSS' AND course.number = 584 AND semester.semester = 'FA' AND semester.semester_id = course_offering.semester AND semester.year = 2016 | advising |
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 prescriptions (
subject_id text,
hadm_id... | How many patients with admission location as transfer from hosp/extram had the procedure titled as incision of vessel abdominal arteries? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_location = "TRANSFER FROM HOSP/EXTRAM" AND procedures.long_title = "Incision of vessel, abdominal arteries" | mimicsql_data |
CREATE TABLE player (
player_id TEXT,
birth_year NUMERIC,
birth_month NUMERIC,
birth_day NUMERIC,
birth_country TEXT,
birth_state TEXT,
birth_city TEXT,
death_year NUMERIC,
death_month NUMERIC,
death_day NUMERIC,
death_country TEXT,
death_state TEXT,
death_city TEXT,
... | Show me the frequency of the weekdays (binning year into weekdays interval) that the team Boston Red Stockings won in the postseasons with a bar chart, I want to order by the Y in descending. | SELECT year, COUNT(year) FROM postseason AS T1 JOIN team AS T2 ON T1.team_id_winner = T2.team_id_br WHERE T2.name = 'Boston Red Stockings' ORDER BY COUNT(year) DESC | nvbench |
CREATE TABLE table_62360 (
"Year" real,
"Single" text,
"CHR chart peak" real,
"Album" text,
"Composer(s)" text
) | Which composer had a CHR chart peak at #2? | SELECT "Composer(s)" FROM table_62360 WHERE "CHR chart peak" = '2' | wikisql |
CREATE TABLE table_20743 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Ground" text,
"Crowd" real,
"Date" text,
"Time" text
) | When the home team scored 7.8 (50), how many away team scores were recorded? | SELECT COUNT("Away team score") FROM table_20743 WHERE "Home team score" = '7.8 (50)' | wikisql |
CREATE TABLE table_12418 (
"Shooter" text,
"Event" text,
"Rank points" text,
"Score points" text,
"Total" text
) | What were the rank points when the score was 7 and the total was 15? | SELECT "Rank points" FROM table_12418 WHERE "Total" = '15' AND "Score points" = '7' | wikisql |
CREATE TABLE table_name_65 (
attendance INTEGER,
result VARCHAR
) | What is the combined attendance of all games that had a result of w 35-14? | SELECT SUM(attendance) FROM table_name_65 WHERE result = "w 35-14" | sql_create_context |
CREATE TABLE table_16864968_9 (
opponent VARCHAR,
location VARCHAR
) | Nam the opponent for prudential center | SELECT opponent FROM table_16864968_9 WHERE location = "Prudential Center" | sql_create_context |
CREATE TABLE channel (
channel_id number,
name text,
owner text,
share_in_percent number,
rating_in_percent number
)
CREATE TABLE broadcast_share (
channel_id number,
program_id number,
date text,
share_in_percent number
)
CREATE TABLE broadcast (
channel_id number,
program... | List all program origins in the alphabetical order. | SELECT origin FROM program ORDER BY origin | spider |
CREATE TABLE table_60312 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Record" text
) | What is the home team on March 7? | SELECT "Home" FROM table_60312 WHERE "Date" = 'march 7' | wikisql |
CREATE TABLE table_22108 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Results" text,
"Candidates" text
) | In which district is the first elected 2000? | SELECT "District" FROM table_22108 WHERE "First elected" = '2000' | wikisql |
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod... | how much does diagnostics of peritoneal abscess cost? | 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 = 'peritoneal abscess')) | 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, give me the comparison about the sum of price over the name , and group by attribute name. | SELECT T1.Name, T1.Price FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name | nvbench |
CREATE TABLE table_name_49 (
name VARCHAR,
works_number VARCHAR
) | Who is the name with a works number of 809? | SELECT name FROM table_name_49 WHERE works_number = "809" | sql_create_context |
CREATE TABLE table_train_43 (
"id" int,
"anemia" bool,
"cystinuria" bool,
"hyperoxaluria" bool,
"acute_gout_attack" bool,
"NOUSE" float
) | known oxalate renal stone | SELECT * FROM table_train_43 WHERE hyperoxaluria = 1 | criteria2sql |
CREATE TABLE table_28243691_1 (
enrollment INTEGER,
institution VARCHAR
) | What was the highest number of students in attendance for the university of north texas? | SELECT MAX(enrollment) FROM table_28243691_1 WHERE institution = "University of North Texas" | sql_create_context |
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 intakeoutput (
in... | whats the last height of patient 022-100453? | SELECT patient.admissionheight FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '022-100453') AND NOT patient.admissionheight IS NULL ORDER BY patient.unitadmittime DESC LIMIT 1 | eicu |
CREATE TABLE table_name_95 (
winner VARCHAR
) | What was the amount of the 1st prize when paul azinger (9) was the winner? | SELECT AVG(1 AS st_prize___) AS $__ FROM table_name_95 WHERE winner = "paul azinger (9)" | sql_create_context |
CREATE TABLE table_name_82 (
place VARCHAR,
country VARCHAR,
player VARCHAR
) | Where did Calvin Peete of the United States place? | SELECT place FROM table_name_82 WHERE country = "united states" AND player = "calvin peete" | sql_create_context |
CREATE TABLE table_54961 (
"State" text,
"Interview" real,
"Swimsuit" real,
"Evening gown" real,
"Average" real
) | What is the sum of the interview scores from North Dakota that have averages less than 8.697, evening gown scores less than 8.73, and swimsuit scores greater than 8.41? | SELECT SUM("Interview") FROM table_54961 WHERE "Average" < '8.697' AND "Evening gown" < '8.73' AND "State" = 'north dakota' AND "Swimsuit" > '8.41' | 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 jybgb (
BBCJBW text,
BBDM tex... | 哪些是俞以轩患者的检验报告单对应的检验结果指标均正常以及列出检验报告单号是多少? | SELECT jybgb.BGDH FROM person_info JOIN hz_info JOIN wdmzjzjlb JOIN jybgb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX AND wdmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND wdmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE person_info.XM = '俞... | css |
CREATE TABLE table_47538 (
"Rider" text,
"Bike" text,
"Laps" real,
"Time" text,
"Grid" real
) | What is the total time that it took for the driver to finish 14 laps? | SELECT "Time" FROM table_47538 WHERE "Laps" = '14' | wikisql |
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,
... | whats the sex of patient 027-56767? | SELECT DISTINCT patient.gender FROM patient WHERE patient.uniquepid = '027-56767' | eicu |
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 number of patients were admitted in emergency under procedure icd9 code 403? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_type = "EMERGENCY" AND procedures.icd9_code = "403" | mimicsql_data |
CREATE TABLE procedures (
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
)
... | calculate the number of patients with stomach ulcer nos who had a lab test for blood gas | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.short_title = "Stomach ulcer NOS" AND lab."CATEGORY" = "Blood Gas" | mimicsql_data |
CREATE TABLE student (
student_id int,
lastname varchar,
firstname varchar,
program_id int,
declare_major varchar,
total_credit int,
total_gpa float,
entered_as varchar,
admit_term int,
predicted_graduation_semester int,
degree varchar,
minor varchar,
internship varch... | Last time Prof. Kathleen Tipler taught 531 did she set an exam ? | SELECT DISTINCT course_offering.has_final_exam FROM course_offering INNER JOIN course 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.instructor_id WHER... | advising |
CREATE TABLE table_204_452 (
id number,
"number" text,
"south or west terminus" text,
"north or east terminus" text,
"length (mi)" number,
"length (km)" number,
"formed" text,
"deleted" text,
"notes" text
) | what is the number of miles that number sr-3 has ? | SELECT "length (mi)" FROM table_204_452 WHERE "number" = 'sr-3' | squall |
CREATE TABLE airport_service (
city_code varchar,
airport_code varchar,
miles_distant int,
direction varchar,
minutes_distant int
)
CREATE TABLE code_description (
code varchar,
description text
)
CREATE TABLE airport (
airport_code varchar,
airport_name text,
airport_location ... | what 's the last flight from HOUSTON to DALLAS | 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 = 'HOUSTON' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'DALLA... | atis |
CREATE TABLE table_name_11 (
opponent VARCHAR,
date VARCHAR
) | Which opponent plays on September 19? | SELECT opponent FROM table_name_11 WHERE date = "september 19" | sql_create_context |
CREATE TABLE ta (
campus_job_id int,
student_id int,
location 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,
instructor_id int
)
CR... | Are 300 -level classes offered in Fall term or Winter term ? | SELECT DISTINCT course.department, course.name, course.number, semester.semester FROM course, course_offering, semester WHERE ((semester.semester = 'FA' AND semester.year = 2016) OR (semester.semester = 'WN' AND semester.year = 2017)) AND course.course_id = course_offering.course_id AND course.department = 'EECS' AND c... | advising |
CREATE TABLE table_73115 (
"Song" text,
"Porsgrunn" real,
"Bergen" real,
"Bod\u00f8" real,
"Stavanger" real,
"\u00c5lesund" real,
"Elverum" real,
"Troms\u00f8" real,
"Fredrikstad" real,
"Trondheim" real,
"Oslo" real,
"Total" real
) | What is the lowest total? | SELECT MIN("Total") FROM table_73115 | wikisql |
CREATE TABLE table_name_81 (
reserved_for___sc___st__none_ VARCHAR,
constituency_number VARCHAR
) | What is the Reserved for (SC / ST /None) when the constituency number is 203? | SELECT reserved_for___sc___st__none_ FROM table_name_81 WHERE constituency_number = "203" | sql_create_context |
CREATE TABLE supplier_addresses (
supplier_id number,
address_id number,
date_from time,
date_to time
)
CREATE TABLE departments (
department_id number,
dept_store_id number,
department_name text
)
CREATE TABLE customers (
customer_id number,
payment_method_code text,
customer_... | Return the product type, name, and price for products supplied by supplier 3. | SELECT T2.product_type_code, T2.product_name, T2.product_price FROM product_suppliers AS T1 JOIN products AS T2 ON T1.product_id = T2.product_id WHERE T1.supplier_id = 3 | spider |
CREATE TABLE table_name_35 (
chief_judge VARCHAR,
reason_for_termination VARCHAR
) | Tell me the chief judge which has reason for termination of retirement | SELECT chief_judge FROM table_name_35 WHERE reason_for_termination = "retirement" | sql_create_context |
CREATE TABLE table_65500 (
"Artist" text,
"Record label" text,
"Released" text,
"Chart peak" real,
"Number of times certified platinum" text
) | Which Artist has a Record label of vertigo? | SELECT "Artist" FROM table_65500 WHERE "Record label" = 'vertigo' | 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 diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions... | count the number of patients whose discharge location is short term hospital and lab test fluid is cerebrospinal fluid (csf)? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.discharge_location = "SHORT TERM HOSPITAL" AND lab.fluid = "Cerebrospinal Fluid (CSF)" | mimicsql_data |
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
... | what was the last time that patient 17694 was diagnosed with 31-32 comp wks gestation? | SELECT diagnoses_icd.charttime FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = '31-32 comp wks gestation') AND diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 17694) ORDER BY d... | mimic_iii |
CREATE TABLE table_11542215_3 (
total VARCHAR,
floor_exercise VARCHAR
) | What is the total score when the score for floor exercise was 9.287? | SELECT total FROM table_11542215_3 WHERE floor_exercise = "9.287" | sql_create_context |
CREATE TABLE station_company (
Station_ID int,
Company_ID int,
Rank_of_the_Year int
)
CREATE TABLE gas_station (
Station_ID int,
Open_Year int,
Location text,
Manager_Name text,
Vice_Manager_Name text,
Representative_Name text
)
CREATE TABLE company (
Company_ID int,
Rank i... | What are the main indstries and total market value for each industry. Visualize by bar chart. | SELECT Main_Industry, SUM(Market_Value) FROM company GROUP BY Main_Industry | nvbench |
CREATE TABLE table_26605 (
"Week" real,
"Date" text,
"Opponent" text,
"Location" text,
"Final Score" text,
"Attendance" real,
"Record" text
) | Name the total number of opponent for october 3 | SELECT COUNT("Opponent") FROM table_26605 WHERE "Date" = 'October 3' | wikisql |
CREATE TABLE table_21162 (
"Municipality" text,
"Income Class" text,
"District" text,
"Population (2010)" real,
"Area (km\u00b2)" real
) | what is the municipality where the area is 73? | SELECT "Municipality" FROM table_21162 WHERE "Area (km\u00b2)" = '73' | wikisql |
CREATE TABLE captain (
Captain_ID int,
Name text,
Ship_ID int,
age text,
Class text,
Rank text
)
CREATE TABLE Ship (
Ship_ID int,
Name text,
Type text,
Built_Year real,
Class text,
Flag text
) | How many captains with younger than 50 are in each rank, and sort in desc by the bar. | SELECT Rank, COUNT(*) FROM captain WHERE age < 50 GROUP BY Rank ORDER BY Rank DESC | nvbench |
CREATE TABLE table_name_86 (
points VARCHAR,
points_for VARCHAR
) | when points for was points for what was the points? | SELECT points FROM table_name_86 WHERE points_for = "points for" | sql_create_context |
CREATE TABLE table_27932399_1 (
release_date INTEGER,
catalogue_number VARCHAR
) | What is the release date of catalogue number DW023? | SELECT MAX(release_date) FROM table_27932399_1 WHERE catalogue_number = "DW023" | sql_create_context |
CREATE TABLE table_13126 (
"7:30 am" text,
"8:00 am" text,
"9:00 am" text,
"11:00 am" text,
"noon" text,
"12:30 pm" text,
"1:00 pm" text,
"1:30 pm" text,
"2:00 pm" text,
"3:30 pm" text,
"4:00 pm" text,
"4:30 pm" text,
"5:00 pm" text,
"6:30 pm" text
) | What is 4:00 pm, when 12:30 pm is 'Sunset Beach'? | SELECT "4:00 pm" FROM table_13126 WHERE "12:30 pm" = 'sunset beach' | wikisql |
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,... | Just list the first name of the employee and show the location id of the corresponding department using a bar chart, and show y-axis in asc order. | SELECT FIRST_NAME, LOCATION_ID FROM employees AS T1 JOIN departments AS T2 ON T1.DEPARTMENT_ID = T2.DEPARTMENT_ID WHERE T1.EMPLOYEE_ID = T2.MANAGER_ID ORDER BY LOCATION_ID | nvbench |
CREATE TABLE table_49364 (
"Rider" text,
"Manufacturer" text,
"Laps" real,
"Time" text,
"Grid" real
) | What is the total number of Grid, when Rider is Aleix Espargaro? | SELECT COUNT("Grid") FROM table_49364 WHERE "Rider" = 'aleix espargaro' | wikisql |
CREATE TABLE table_name_67 (
pick INTEGER,
position VARCHAR,
player VARCHAR
) | What was the lowest pick for the RHP position and player Mike Biko? | SELECT MIN(pick) FROM table_name_67 WHERE position = "rhp" AND player = "mike biko" | sql_create_context |
CREATE TABLE table_54019 (
"Airing date" text,
"English title (Chinese title)" text,
"Number of episodes" real,
"Genre" text,
"Official website" text
) | What is the airing date for costume comedy that has 20 episodes? | SELECT "Airing date" FROM table_54019 WHERE "Number of episodes" = '20' AND "Genre" = 'costume comedy' | wikisql |
CREATE TABLE table_74738 (
"Municipality" text,
"Inhabitants" real,
"Mayor" text,
"Party" text,
"Election" real
) | How many elections had more than 36,599 inhabitants when Mayor was giovanni manildo? | SELECT COUNT("Election") FROM table_74738 WHERE "Inhabitants" > '36,599' AND "Mayor" = 'giovanni manildo' | wikisql |
CREATE TABLE table_9520 (
"Name" text,
"Nationality" text,
"Position [F ]" text,
"Date from [G ]" text,
"Date to [H ]" text,
"Appearances" real,
"Goals" real,
"Club source [I ]" text
) | What is Club Source [I ], when Name is 'Andrew McCombie Category:Articles With hCards'? | SELECT "Club source [I ]" FROM table_9520 WHERE "Name" = 'andrew mccombie category:articles with hcards' | wikisql |
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_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
... | count the number of patients whom iso-osmotic dextrose was prescribed within 2 months after they had been diagnosed with gstr/ddnts nos w/o hmrhg since 2105. | SELECT COUNT(DISTINCT t1.subject_id) 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 d_icd_diagnoses.short_title = 'gstr/ddnts nos w/o... | mimic_iii |
CREATE TABLE table_2062148_4 (
weight__kg_ INTEGER
) | Name the most weight | SELECT MAX(weight__kg_) FROM table_2062148_4 | sql_create_context |
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate time,
drug text,
dose_val_rx text,
dose_unit_rx text,
route text
)
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
d... | when was patient 15968 first measured a arterial bp [diastolic]? | SELECT chartevents.charttime 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 = 15968)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'arterial... | mimic_iii |
CREATE TABLE table_name_3 (
year INTEGER,
result VARCHAR,
extra VARCHAR
) | Result of 1st, and an Extra of 4 x 400 m relay is in what lowest year? | SELECT MIN(year) FROM table_name_3 WHERE result = "1st" AND extra = "4 x 400 m relay" | sql_create_context |
CREATE TABLE table_74602 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | Who is the away side when the crowd is over 18,000 with collingwood at home? | SELECT "Away team" FROM table_74602 WHERE "Crowd" > '18,000' AND "Home team" = 'collingwood' | wikisql |
CREATE TABLE table_name_23 (
score VARCHAR,
tournament VARCHAR
) | What is the score of the Tournament named danny thomas memphis classic? | SELECT score FROM table_name_23 WHERE tournament = "danny thomas memphis classic" | sql_create_context |
CREATE TABLE table_17753 (
"Clinical Status" text,
"Compound Name" text,
"Trademark" text,
"Marine Organism \u03b1" text,
"Chemical Class" text,
"Molecular Target" text,
"Clinical Trials \u03b2" text,
"Disease Area" text
) | What is the compound name listed where marine organism is worm | SELECT "Compound Name" FROM table_17753 WHERE "Marine Organism \u03b1" = 'Worm' | wikisql |
CREATE TABLE TagSynonyms (
Id number,
SourceTagName text,
TargetTagName text,
CreationDate time,
OwnerUserId number,
AutoRenameCount number,
LastAutoRename time,
Score number,
ApprovedByUserId number,
ApprovalDate time
)
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
... | Top Scoring Answers by Year. | WITH yPosts AS (SELECT *, YEAR(CreationDate) AS yeer FROM Posts WHERE PostTypeId = 2), bestScores AS (SELECT yeer, MAX(Score) AS score FROM YPOSTS GROUP BY yeer) SELECT Id AS "post_link", yeer AS year, Score FROM yPosts AS YP WHERE Score = (SELECT Score FROM bestScores WHERE yeer = YP.yeer) ORDER BY yeer DESC | sede |
CREATE TABLE table_1081459_1 (
introduced INTEGER,
region VARCHAR
) | What is the minimum introduced value for the Departmental region? | SELECT MIN(introduced) FROM table_1081459_1 WHERE region = "Departmental" | sql_create_context |
CREATE TABLE perpetrator (
Perpetrator_ID int,
People_ID int,
Date text,
Year real,
Location text,
Country text,
Killed int,
Injured int
)
CREATE TABLE people (
People_ID int,
Name text,
Height real,
Weight real,
"Home Town" text
) | Visualize a bar chart for what are the countries of perpetrators? Show each country and the corresponding number of perpetrators there. | SELECT Country, COUNT(*) FROM perpetrator GROUP BY Country | nvbench |
CREATE TABLE dual_carrier (
main_airline varchar,
low_flight_number int,
high_flight_number int,
dual_airline varchar,
service_name text
)
CREATE TABLE equipment_sequence (
aircraft_code_sequence varchar,
aircraft_code varchar
)
CREATE TABLE compartment_class (
compartment varchar,
... | show me the ground transportation schedule in PHILADELPHIA in the morning on wednesday | SELECT DISTINCT ground_service.transport_type FROM city, ground_service WHERE city.city_name = 'PHILADELPHIA' AND ground_service.city_code = city.city_code | atis |
CREATE TABLE table_1697190_1 (
earnings___ INTEGER,
money_list_rank VARCHAR
) | Name the most earnings for money list rank being 143 | SELECT MAX(earnings___) AS $__ FROM table_1697190_1 WHERE money_list_rank = 143 | sql_create_context |
CREATE TABLE table_42364 (
"City" text,
"Country" text,
"IATA" text,
"ICAO" text,
"Airport" text
) | Which country has an IATA of EVN? | SELECT "Country" FROM table_42364 WHERE "IATA" = 'evn' | wikisql |
CREATE TABLE table_23238 (
"Rank" real,
"Couple" text,
"Judges" real,
"Public" real,
"Total" real,
"Vote percentage" text,
"Result" text
) | How many different total points does the couple ranked at number 5 have? | SELECT COUNT("Total") FROM table_23238 WHERE "Rank" = '5' | wikisql |
CREATE TABLE table_27610 (
"Season" real,
"Series" text,
"Team" text,
"Races" real,
"Wins" real,
"Poles" real,
"F/Laps" real,
"Podiums" real,
"Points" text,
"Position" text
) | What was the recorded flaps of HBR Motorsport team? | SELECT "F/Laps" FROM table_27610 WHERE "Team" = 'HBR Motorsport' | wikisql |
CREATE TABLE table_name_39 (
can_yayınları VARCHAR,
güzelçamlı’nin_kayıp_panteri VARCHAR
) | Which Can Yay nlar has a G zel aml nin Kay p Panteri of evreci peri? | SELECT can_yayınları FROM table_name_39 WHERE güzelçamlı’nin_kayıp_panteri = "çevreci peri" | sql_create_context |
CREATE TABLE table_61500 (
"Tournament" text,
"2001" text,
"2002" text,
"2003" text,
"2004" text,
"2005" text,
"2006" text,
"2007" text,
"2008" text,
"2009" text,
"2010" text,
"2011" text,
"2012" text,
"2013" text
) | What's the 2007 result when 2003 is a? | SELECT "2007" FROM table_61500 WHERE "2003" = 'a' | wikisql |
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
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 prescriptions (
row_id numbe... | has patient 18223 had surgery on the first hospital encounter? | SELECT COUNT(*) > 0 FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 18223 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1) | mimic_iii |
CREATE TABLE table_64042 (
"Name" text,
"Pre-Season" real,
"A-League" real,
"Finals" real,
"Total" real
) | Which Finals have a Pre-Season larger than 0? | SELECT MIN("Finals") FROM table_64042 WHERE "Pre-Season" > '0' | wikisql |
CREATE TABLE table_22204 (
"Song title" text,
"Artist" text,
"Decade" text,
"Genre" text,
"Single / Pack name" text,
"Release date" text,
"Family Friendly" text,
"Additional Rock Band 3 Features" text
) | What is the artist of the song 'sugarbaby'? | SELECT "Artist" FROM table_22204 WHERE "Song title" = 'Sugarbaby' | wikisql |
CREATE TABLE table_4194 (
"No. in series" real,
"No. in season" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production code" real
) | Who wrote episode 23 of the season? | SELECT "Written by" FROM table_4194 WHERE "No. in season" = '23' | wikisql |
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TA... | since 04/2104 patient 013-33898 had been prescribed labetalol? | 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 = '013-33898')) AND medication.drugname = 'labetalol' AND STRFTIME('%y-%m', m... | eicu |
CREATE TABLE table_name_20 (
date VARCHAR,
game INTEGER
) | What date was there a game larger than 17? | SELECT date FROM table_name_20 WHERE game > 17 | sql_create_context |
CREATE TABLE table_49303 (
"Position" real,
"Team" text,
"Played" real,
"Wins" real,
"Draws" real,
"Losses" real,
"Scored" real,
"Conceded" real,
"Points" real
) | Which Losses has Scored of 9, and Points larger than 8? | SELECT AVG("Losses") FROM table_49303 WHERE "Scored" = '9' AND "Points" > '8' | wikisql |
CREATE TABLE table_29538735_1 (
_percentage_electricity_reduction VARCHAR,
£_saved VARCHAR
) | When 337,000 is saved what is the percentage of electricity reduction? | SELECT _percentage_electricity_reduction FROM table_29538735_1 WHERE £_saved = "£337,000" | sql_create_context |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
... | what is the number of patients whose gender is m and admission year is less than 2155? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.gender = "M" AND demographic.admityear < "2155" | mimicsql_data |
CREATE TABLE table_41114 (
"Round" real,
"Race name" text,
"Circuit" text,
"City/State" text,
"Date" text,
"Winner(s)" text,
"Team" text
) | What is the name of the race from round 1? | SELECT "Race name" FROM table_41114 WHERE "Round" = '1' | wikisql |
CREATE TABLE table_name_90 (
assists VARCHAR,
opponent VARCHAR,
team VARCHAR,
competition VARCHAR,
total_gs VARCHAR
) | How many assists were in the k-league competition, which has more than 20 total Gs, the pohang steelers team, and chunnam dragons as the opponent? | SELECT assists FROM table_name_90 WHERE competition = "k-league" AND total_gs > 20 AND team = "pohang steelers" AND opponent = "chunnam dragons" | sql_create_context |
CREATE TABLE table_203_634 (
id number,
"date" text,
"venue" text,
"score" text,
"victor" text,
"comments" text,
"match reports" text
) | how many matches have been won by wales ? | SELECT COUNT(*) FROM table_203_634 WHERE "victor" = 'wales' | squall |
CREATE TABLE table_name_19 (
wins INTEGER,
draws INTEGER
) | How many wins happened when there were fewer than 2 draws? | SELECT SUM(wins) FROM table_name_19 WHERE draws < 2 | sql_create_context |
CREATE TABLE table_17326036_6 (
score VARCHAR,
high_rebounds VARCHAR
) | What was the score of the game when the high rebounds Jeff Foster (10)? | SELECT score FROM table_17326036_6 WHERE high_rebounds = "Jeff Foster (10)" | sql_create_context |
CREATE TABLE player (
pID VARCHAR,
pName VARCHAR
)
CREATE TABLE tryout (
cName VARCHAR,
pID VARCHAR
) | Which colleges do the tryout players whose name starts with letter D go to? | SELECT T1.cName FROM tryout AS T1 JOIN player AS T2 ON T1.pID = T2.pID WHERE T2.pName LIKE 'D%' | sql_create_context |
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... | 看看哪些检查病人鲁雅丽之前已经做了 | SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.PERSON_NM = '鲁雅丽' AND t_kc22.MED_INV_ITEM_TYPE = '检查费' | css |
CREATE TABLE table_23575917_7 (
first_broadcast VARCHAR,
episode VARCHAR
) | If the episode is 6x03, what is the first broadcast total number? | SELECT COUNT(first_broadcast) FROM table_23575917_7 WHERE episode = "6x03" | sql_create_context |
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
systemics... | whats the first height of patient 015-76260 during their first hospital encounter? | SELECT patient.admissionheight FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '015-76260' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospitaladmittime LIMIT 1) AND NOT patient.admissionheight IS NULL ORDER BY p... | eicu |
CREATE TABLE table_name_99 (
competition VARCHAR,
notes VARCHAR
) | In which competition(s) did Ilju t enko jump 1.90 m? | SELECT competition FROM table_name_99 WHERE notes = "1.90 m" | sql_create_context |
CREATE TABLE table_name_6 (
player VARCHAR,
country VARCHAR,
score VARCHAR
) | What is Player, when Country is United States, and when Score is 73-76-72-66=287? | SELECT player FROM table_name_6 WHERE country = "united states" AND score = 73 - 76 - 72 - 66 = 287 | sql_create_context |
CREATE TABLE table_203_197 (
id number,
"#" number,
"title" text,
"artist" text,
"highest pos. reached" number,
"weeks at no. 1" text
) | how many songs in the table only reached position number 2 ? | SELECT COUNT("title") FROM table_203_197 WHERE "highest pos. reached" = 2 | squall |
CREATE TABLE table_20911 (
"No. in series" text,
"No. in season" text,
"Title" text,
"Directed by" text,
"Written by" text,
"Original airdate" text,
"Production code" text
) | What is the production code for episode 15 in season 3? | SELECT "Production code" FROM table_20911 WHERE "No. in season" = '15' | wikisql |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.