context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE table_61887 (
"Round" text,
"Clubs remaining" real,
"Clubs involved" real,
"Winners from previous round" text,
"New entries this round" text
) | What are the clubs involved with 16 clubs remaining? | SELECT "Clubs involved" FROM table_61887 WHERE "Clubs remaining" = '16' | wikisql |
CREATE TABLE t_kc24 (
ACCOUNT_DASH_DATE time,
ACCOUNT_DASH_FLG number,
CASH_PAY number,
CIVIL_SUBSIDY number,
CKC102 number,
CLINIC_ID text,
CLINIC_SLT_DATE time,
COMP_ID text,
COM_ACC_PAY number,
COM_PAY number,
DATA_ID text,
ENT_ACC_PAY number,
ENT_PAY number,
F... | 在医院8860248患者孔子明入院诊断疾病名称不包含胃炎的是什么医疗就诊记录编号? | SELECT qtb.MED_CLINIC_ID FROM qtb WHERE qtb.PERSON_NM = '孔子明' AND qtb.MED_SER_ORG_NO = '8860248' AND NOT qtb.IN_DIAG_DIS_NM LIKE '%胃炎%' UNION SELECT gyb.MED_CLINIC_ID FROM gyb WHERE gyb.PERSON_NM = '孔子明' AND gyb.MED_SER_ORG_NO = '8860248' AND NOT gyb.IN_DIAG_DIS_NM LIKE '%胃炎%' UNION SELECT zyb.MED_CLINIC_ID FROM zyb WH... | css |
CREATE TABLE table_25460 (
"#" real,
"Date" text,
"Team" text,
"Score" text,
"Location Attendance" text,
"High Points" text,
"High Rebounds" text,
"High Assists" text,
"Record" text
) | Name the total number for score l 110-112 | SELECT COUNT("#") FROM table_25460 WHERE "Score" = 'L 110-112' | wikisql |
CREATE TABLE table_203_355 (
id number,
"year" number,
"total" number,
"romanians" text,
"hungarians" text,
"roma" text
) | which year is previous to the year that had 74.1 % in romanian population ? | SELECT "year" FROM table_203_355 WHERE "year" < (SELECT "year" FROM table_203_355 WHERE "romanians" = 74.1) ORDER BY "year" DESC LIMIT 1 | squall |
CREATE TABLE table_23146 (
"Player" text,
"Team" text,
"Matches" real,
"Overs" text,
"Wickets" real,
"Economy Rate" text,
"Average" text,
"Strike Rate" text,
"BBI" text,
"BBM" text
) | What is the BBM when the strike rate is 42.2? | SELECT "BBM" FROM table_23146 WHERE "Strike Rate" = '42.2' | wikisql |
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 text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
... | how many patients with percutaneous abdominal drainage were discharged for home health care? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.discharge_location = "HOME HEALTH CARE" AND procedures.long_title = "Percutaneous abdominal drainage" | mimicsql_data |
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,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 locations (
LOCATION_ID decimal(4,0... | For all employees who have the letters D or S in their first name, give me the comparison about the sum of salary over the job_id , and group by attribute job_id, and order y-axis in asc order. | SELECT JOB_ID, SUM(SALARY) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' GROUP BY JOB_ID ORDER BY SUM(SALARY) | nvbench |
CREATE TABLE table_31283 (
"Film Festival" text,
"Date of ceremony" text,
"Category" text,
"Participants/Recipients" text,
"Result" text
) | Which films participated in the 61st Berlin international film festival? | SELECT "Participants/Recipients" FROM table_31283 WHERE "Film Festival" = '61st Berlin International Film Festival' | wikisql |
CREATE TABLE table_72420 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Result" text,
"Candidates" text
) | In what district was John E. Miller the incumbent? | SELECT "District" FROM table_72420 WHERE "Incumbent" = 'John E. Miller' | wikisql |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob te... | how many of the patients were treated with nitroglycerin sl? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE prescriptions.drug = "Nitroglycerin SL" | mimicsql_data |
CREATE TABLE program_requirement (
program_id int,
category varchar,
min_credit int,
additional_req varchar
)
CREATE TABLE semester (
semester_id int,
semester varchar,
year int
)
CREATE TABLE area (
course_id int,
area varchar
)
CREATE TABLE offering_instructor (
offering_ins... | For this semester 's Intro Med Micro class , who is the instructor ? | SELECT DISTINCT instructor.name FROM instructor INNER JOIN offering_instructor ON offering_instructor.instructor_id = instructor.instructor_id INNER JOIN course_offering ON offering_instructor.offering_id = course_offering.offering_id INNER JOIN course ON course.course_id = course_offering.course_id INNER JOIN semester... | advising |
CREATE TABLE weather (
date TEXT,
max_temperature_f INTEGER,
mean_temperature_f INTEGER,
min_temperature_f INTEGER,
max_dew_point_f INTEGER,
mean_dew_point_f INTEGER,
min_dew_point_f INTEGER,
max_humidity INTEGER,
mean_humidity INTEGER,
min_humidity INTEGER,
max_sea_level_pre... | Show how many installation date from each installation date, list in desc by the Y-axis please. | SELECT installation_date, COUNT(installation_date) FROM station ORDER BY COUNT(installation_date) DESC | nvbench |
CREATE TABLE table_name_87 (
result VARCHAR,
week VARCHAR,
game_site VARCHAR
) | When the game was played at Mile High Stadium before week 9, what was the result? | SELECT result FROM table_name_87 WHERE week < 9 AND game_site = "mile high stadium" | sql_create_context |
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,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 (
DEPARTMENT_ID decimal... | For those employees who was hired before 2002-06-21, visualize a bar chart about the distribution of job_id and the average of salary , and group by attribute job_id, display in ascending by the x-axis. | SELECT JOB_ID, AVG(SALARY) FROM employees WHERE HIRE_DATE < '2002-06-21' GROUP BY JOB_ID ORDER BY JOB_ID | nvbench |
CREATE TABLE table_name_67 (
year INTEGER,
final_position___tour VARCHAR,
final_position___vuelta VARCHAR
) | What is the average year that has a final Tour position of 54 and a final Vuelta position over 55? | SELECT AVG(year) FROM table_name_67 WHERE final_position___tour = 54 AND final_position___vuelta > 55 | sql_create_context |
CREATE TABLE table_39465 (
"Name" text,
"Status" text,
"Population" real,
"District" text,
"Former local authority" text
) | What is the population of the Parish, Plumbland, that had a former local authority of Cockermouth Rural District? | SELECT COUNT("Population") FROM table_39465 WHERE "Former local authority" = 'cockermouth rural district' AND "Name" = 'plumbland' | wikisql |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE diagnoses (
... | count the number of patients whose ethnicity is asian and primary disease is pneumonia? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "ASIAN" AND demographic.diagnosis = "PNEUMONIA" | mimicsql_data |
CREATE TABLE table_15187735_5 (
episode VARCHAR,
segment_a VARCHAR
) | Kitchen knives is segment a of what episode? | SELECT episode FROM table_15187735_5 WHERE segment_a = "Kitchen Knives" | sql_create_context |
CREATE TABLE table_name_93 (
site VARCHAR,
superintendent VARCHAR
) | What is the site when the superintendent was James Sever? | SELECT site FROM table_name_93 WHERE superintendent = "james sever" | sql_create_context |
CREATE TABLE table_40761 (
"Date" text,
"Tournament" text,
"Surface" text,
"Partnering" text,
"Opponents in the final" text,
"Score" text
) | Which Opponents in the final have a Date of june 10, 1996? | SELECT "Opponents in the final" FROM table_40761 WHERE "Date" = 'june 10, 1996' | wikisql |
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABL... | what is patient 6536's difference in the patient's sao2 second measured on the first icu visit compared to the value first measured on the first icu visit? | SELECT (SELECT chartevents.valuenum FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 6536) AND NOT icustays.outtime IS NULL ORDER BY icustays.intime LIMIT 1) AND chartevents.itemi... | mimic_iii |
CREATE TABLE table_203_69 (
id number,
"representative" text,
"title" text,
"from" number,
"to" number,
"appointed by" text
) | what is the total number of representatives ? | SELECT COUNT("representative") FROM table_203_69 | squall |
CREATE TABLE table_11833 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
) | What is the High points with a Team with boston? | SELECT "High points" FROM table_11833 WHERE "Team" = 'boston' | wikisql |
CREATE TABLE author (
authorid int,
authorname varchar
)
CREATE TABLE paperfield (
fieldid int,
paperid int
)
CREATE TABLE paper (
paperid int,
title varchar,
venueid int,
year int,
numciting int,
numcitedby int,
journalid int
)
CREATE TABLE field (
fieldid int
)
CREA... | Papers that use the WebKB dataset | SELECT DISTINCT paper.paperid FROM dataset, paper, paperdataset WHERE dataset.datasetname = 'WebKB' AND paperdataset.datasetid = dataset.datasetid AND paper.paperid = paperdataset.paperid | scholar |
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid number,
... | when was the first time 1 ml vial : heparin sodium (porcine) 1000 unit/ml ij soln was prescribed to patient 005-77687 in 11/this year? | SELECT medication.drugstarttime FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '005-77687')) AND medication.drugname = '1 ml vial : heparin so... | eicu |
CREATE TABLE table_47388 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Decision" text,
"Attendance" real,
"Record" text,
"Points" real
) | What is Record, when Date is 'November 22'? | SELECT "Record" FROM table_47388 WHERE "Date" = 'november 22' | wikisql |
CREATE TABLE table_76459 (
"Place" text,
"Code" real,
"Area (km 2 )" real,
"Population" real,
"Most spoken language" text
) | What is the lowest area for cannonvale that speaks afrikaans? | SELECT MIN("Area (km 2 )") FROM table_76459 WHERE "Most spoken language" = 'afrikaans' AND "Place" = 'cannonvale' | wikisql |
CREATE TABLE table_38007 (
"Unit" text,
"Russian" text,
"Ratio" text,
"Metric value" text,
"Avoirdupois value" text
) | What Unit has a Ratio of 1/32? | SELECT "Unit" FROM table_38007 WHERE "Ratio" = '1/32' | wikisql |
CREATE TABLE table_203_803 (
id number,
"draw" number,
"country" text,
"language" text,
"artist" text,
"song" text,
"english translation" text,
"place" number,
"points" number
) | what is the number of points scored by finland ? | SELECT "points" FROM table_203_803 WHERE "country" = 'finland' | squall |
CREATE TABLE table_33007 (
"Region" text,
"Host" text,
"Venue" text,
"City" text,
"State" text
) | Where is the Mackey Arena located? | SELECT "City" FROM table_33007 WHERE "Venue" = 'mackey arena' | wikisql |
CREATE TABLE table_203_481 (
id number,
"n\u00b0" number,
"name" text,
"position" text,
"date of birth" text,
"nationality" text
) | which country has the most people ? | SELECT "nationality" FROM table_203_481 GROUP BY "nationality" ORDER BY COUNT("n\u00b0") DESC LIMIT 1 | squall |
CREATE TABLE table_40786 (
"Date" text,
"Result" text,
"Score" text,
"Brazil scorers" text,
"Competition" text
) | Who played on December 25, 1925? | SELECT "Competition" FROM table_40786 WHERE "Date" = 'december 25, 1925' | wikisql |
CREATE TABLE table_29050051_3 (
name VARCHAR,
previous_school VARCHAR
) | Who previously attended south kent school / brentwood hs? | SELECT name FROM table_29050051_3 WHERE previous_school = "South Kent School / Brentwood HS" | sql_create_context |
CREATE TABLE competition_record (
Competition_ID int,
Farm_ID int,
Rank int
)
CREATE TABLE city (
City_ID int,
Official_Name text,
Status text,
Area_km_2 real,
Population real,
Census_Ranking text
)
CREATE TABLE farm_competition (
Competition_ID int,
Year int,
Theme tex... | Give me a line chart about the number of competitions held in each year, and display x axis from high to low order. | SELECT Year, COUNT(Year) FROM city AS T1 JOIN farm_competition AS T2 ON T1.City_ID = T2.Host_city_ID ORDER BY Year DESC | nvbench |
CREATE TABLE table_1627 (
"Series" text,
"Title" text,
"Broadcasts (TV) 1" real,
"Episodes (TV+extra) 2" text,
"Directors" text,
"Aired in Japan 3" text,
"US Release Date" text
) | When 7 april 2001 to 29 september 2001 was aired in japan 2 how many titles were there? | SELECT COUNT("Title") FROM table_1627 WHERE "Aired in Japan 3" = '7 April 2001 to 29 September 2001' | wikisql |
CREATE TABLE table_name_71 (
gold INTEGER,
total VARCHAR,
bronze VARCHAR,
rank VARCHAR
) | What is the smallest number of gold of a country of rank 6, with 2 bronzes? | SELECT MIN(gold) FROM table_name_71 WHERE bronze = 2 AND rank = 6 AND total > 2 | sql_create_context |
CREATE TABLE table_name_29 (
artist VARCHAR,
finish VARCHAR
) | Which artist uses a finish of selective gold plating? | SELECT artist FROM table_name_29 WHERE finish = "selective gold plating" | sql_create_context |
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
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),
CO... | For all employees who have the letters D or S in their first name, give me the comparison about the sum of salary over the job_id , and group by attribute job_id. | SELECT JOB_ID, SUM(SALARY) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' GROUP BY JOB_ID | nvbench |
CREATE TABLE district (
District_ID int,
District_name text,
Headquartered_City text,
City_Population real,
City_Area real
)
CREATE TABLE store_product (
Store_ID int,
Product_ID int
)
CREATE TABLE store_district (
Store_ID int,
District_ID int
)
CREATE TABLE store (
Store_ID ... | Visualize a bar chart for what are the district names and city populations for all districts that between 200,000 and 2,000,000 residents?, show by the City_Population in ascending. | SELECT District_name, City_Population FROM district WHERE City_Population BETWEEN 200000 AND 2000000 ORDER BY City_Population | nvbench |
CREATE TABLE table_27734577_8 (
high_rebounds VARCHAR,
game VARCHAR
) | What are the high rebounds in the 45 game? | SELECT high_rebounds FROM table_27734577_8 WHERE game = 45 | sql_create_context |
CREATE TABLE table_name_92 (
round VARCHAR,
res VARCHAR,
event VARCHAR
) | In what round was the loss at ufc 118? | SELECT round FROM table_name_92 WHERE res = "loss" AND event = "ufc 118" | sql_create_context |
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE tr... | when did patient 3516 receive the first calculated total co2 lab test until 42 months ago? | SELECT labevents.charttime FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'calculated total co2') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 3516) AND DATETIME(labevents.charttime) <= DATETIME(CURRENT_TIM... | mimic_iii |
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
)
... | let me know the number of patients who had other open incisional hernia repair with graft or prosthesis and blood lab test. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE procedures.long_title = "Other open incisional hernia repair with graft or prosthesis" AND lab.fluid = "Blood" | mimicsql_data |
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 procedures (
... | calculate the number of patients on elective admission who had a lab test for lactate | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_type = "ELECTIVE" AND lab.label = "Lactate" | mimicsql_data |
CREATE TABLE table_name_52 (
year INTEGER,
rank VARCHAR
) | What Year has a Rank of 12.0 12? | SELECT AVG(year) FROM table_name_52 WHERE rank = "12.0 12" | sql_create_context |
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationDate time,
CloseReasonTypeId number,
CloseAsOffTopicReasonTypeId number,
DuplicateOfQuestionId number,
BelongsOnBaseHostAddress text
)
CREATE TABLE Badges (
Id number,
UserId number,
Name text,
... | Copy editor' and 'Strunk & White' badges progress. You need 500 edited posts to get 'Copy editor' badge and 80 edits to get 'Strunk & White' badge | SELECT PostId FROM PostHistory LEFT JOIN Posts AS Post ON PostHistory.PostId = Post.Id WHERE UserId = @user AND Post.OwnerUserId != @user GROUP BY PostId | sede |
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... | 找出在6199140这家医院住院期间的记录里,患者褚宏放出院时候的科室名里面有肿瘤科的住院记录 | SELECT * FROM person_info JOIN hz_info JOIN zyjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX WHERE person_info.XM = '褚宏放' AND hz_info.YLJGDM = '6199140' AND zyjzjlb.CYKSMC LIKE '%肿瘤科%' | css |
CREATE TABLE table_3839 (
"Season" text,
"Overall Record" text,
"SEC Record" text,
"Overall Attendance" real,
"Average Attendance" real,
"Rank Nationally" text
) | What was the overall record in the season where average attendance was 16720? | SELECT "Overall Record" FROM table_3839 WHERE "Average Attendance" = '16720' | wikisql |
CREATE TABLE Reservations (
Code INTEGER,
Room TEXT,
CheckIn TEXT,
CheckOut TEXT,
Rate REAL,
LastName TEXT,
FirstName TEXT,
Adults INTEGER,
Kids INTEGER
)
CREATE TABLE Rooms (
RoomId TEXT,
roomName TEXT,
beds INTEGER,
bedType TEXT,
maxOccupancy INTEGER,
baseP... | Find the number of rooms for each bed type Visualize by bar chart, and could you list by the bedType in desc? | SELECT bedType, COUNT(*) FROM Rooms GROUP BY bedType ORDER BY bedType DESC | nvbench |
CREATE TABLE table_51711 (
"Year" real,
"Entrant" text,
"Chassis" text,
"Engine" text,
"Points" real
) | How many points for maserati v12 engines in 1968? | SELECT COUNT("Points") FROM table_51711 WHERE "Engine" = 'maserati v12' AND "Year" = '1968' | 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 prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
... | tell me the age and birth date of patient john gartman. | SELECT demographic.age, demographic.dob FROM demographic WHERE demographic.name = "John Gartman" | mimicsql_data |
CREATE TABLE table_16446 (
"1973 Democratic initial primary" text,
"Manhattan" text,
"The Bronx" text,
"Brooklyn" text,
"Queens" text,
"Richmond [Staten Is.]" text,
"Total" real,
"%" text
) | What is the percentage for manhattan 45,901? | SELECT COUNT("%") FROM table_16446 WHERE "Manhattan" = '45,901' | wikisql |
CREATE TABLE table_75330 (
"Rank" real,
"Island's Name" text,
"Area (sqmi)" real,
"Area (km 2 )" real,
"Location" text,
"Population (2000)" text
) | What is the largest area in Alaska with a population of 39 and rank over 19? | SELECT MAX("Area (km 2 )") FROM table_75330 WHERE "Location" = 'alaska' AND "Population (2000)" = '39' AND "Rank" > '19' | wikisql |
CREATE TABLE university (
School_ID int,
School text,
Location text,
Founded real,
Affiliation text,
Enrollment real,
Nickname text,
Primary_conference text
)
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Per... | Give me the comparison about Team_ID over the All_Home , and group by attribute ACC_Home by a bar chart, and order bars in desc order. | SELECT All_Home, Team_ID FROM basketball_match GROUP BY ACC_Home, All_Home ORDER BY All_Home DESC | nvbench |
CREATE TABLE table_63884 (
"Driver" text,
"Navigator" text,
"Vehicle" text,
"Class" text,
"Capacity" real,
"Total Time" text,
"Margin" text
) | What is the navigator for James? | SELECT "Navigator" FROM table_63884 WHERE "Driver" = 'james' | wikisql |
CREATE TABLE table_1515346_2 (
country VARCHAR,
player VARCHAR
) | For which country does Keith Fergus play? | SELECT country FROM table_1515346_2 WHERE player = "Keith Fergus" | sql_create_context |
CREATE TABLE staff_roles (
role_code text,
role_description text
)
CREATE TABLE research_outcomes (
outcome_code text,
outcome_description text
)
CREATE TABLE organisations (
organisation_id number,
organisation_type text,
organisation_details text
)
CREATE TABLE research_staff (
staf... | What are the details of the project with no outcomes? | SELECT project_details FROM projects WHERE NOT project_id IN (SELECT project_id FROM project_outcomes) | spider |
CREATE TABLE table_22687 (
"Game" real,
"Date" text,
"Opponent" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location" text,
"Record" text
) | What were the high points for the game played at the MCI Center? | SELECT COUNT("High points") FROM table_22687 WHERE "Location" = 'MCI Center' | wikisql |
CREATE TABLE table_71453 (
"Call sign" text,
"Frequency MHz" real,
"City of license" text,
"ERP W" real,
"Class" text,
"FCC info" text
) | \What is the class of the station with the call sign w254ah? | SELECT "Class" FROM table_71453 WHERE "Call sign" = 'w254ah' | wikisql |
CREATE TABLE table_name_57 (
cycle INTEGER,
number_of_contestants VARCHAR,
premiere_date VARCHAR
) | What is the highest Cycle, when the Number of Constestants is 11, and when Premiere Date is September 3, 2012? | SELECT MAX(cycle) FROM table_name_57 WHERE number_of_contestants = "11" AND premiere_date = "september 3, 2012" | sql_create_context |
CREATE TABLE table_27480 (
"Rank" real,
"Rank w/o Hydropower" real,
"State" text,
"% Renewable" text,
"% Renewable w/o Hydro" text,
"Renewable electricity (GW\u00b7h)" real,
"Renewable electricity w/o Hydro (GW\u00b7h)" real,
"Total electricity (GW\u00b7h)" real
) | What was the state with the total electricity generated is 38380 gw-h? | SELECT "State" FROM table_27480 WHERE "Total electricity (GW\u00b7h)" = '38380' | wikisql |
CREATE TABLE restaurant (
id int,
name varchar,
food_type varchar,
city_name varchar,
rating "decimal
)
CREATE TABLE location (
restaurant_id int,
house_number int,
street_name varchar,
city_name varchar
)
CREATE TABLE geographic (
city_name varchar,
county varchar,
reg... | where are some restaurants good for arabic food in mountain view ? | SELECT location.house_number, restaurant.name FROM location, restaurant WHERE location.city_name = 'mountain view' AND restaurant.food_type = 'arabic' AND restaurant.id = location.restaurant_id AND restaurant.rating > 2.5 | restaurants |
CREATE TABLE table_7616 (
"Kansas State vs." text,
"Games played" text,
"Overall Record" text,
"Last 5 Meetings" text,
"Last 10 Meetings" text,
"Current Streak" text,
"Last Meeting" text
) | What kansas vs. that has w 2 as the current streak, and 31 as games played? | SELECT "Kansas State vs." FROM table_7616 WHERE "Current Streak" = 'w 2' AND "Games played" = '31' | wikisql |
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 marital status is single and ethnicity is american indian/alaska native? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.marital_status = "SINGLE" AND demographic.ethnicity = "AMERICAN INDIAN/ALASKA NATIVE" | mimicsql_data |
CREATE TABLE table_name_87 (
investing_dragon_s_ VARCHAR,
money_requested__£_ VARCHAR
) | What Investing Dragons had a request of 100,000? | SELECT investing_dragon_s_ FROM table_name_87 WHERE money_requested__£_ = "100,000" | sql_create_context |
CREATE TABLE jybgb (
BBCJBW text,
BBDM text,
BBMC text,
BBZT number,
BGDH text,
BGJGDM text,
BGJGMC text,
BGRGH text,
BGRQ time,
BGRXM text,
BGSJ time,
CJRQ time,
JSBBRQSJ time,
JSBBSJ time,
JYBBH text,
JYJGMC text,
JYJSGH text,
JYJSQM text,
JY... | 医疗机构8444341就诊人数里,住院天数超过30天的有多少 | SELECT COUNT(hz_info.RYBH) FROM hz_info JOIN wdmzjzjlb ON hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX WHERE wdmzjzjlb.YLJGDM = '8444341' AND DATEDIFF(wdmzjzjlb.CYSJ, wdmzjzjlb.RYSJ) > 30 UNION SELECT COUNT(hz_info.RYBH) FROM hz_info JOIN bdmzjzjlb ON hz_info.YLJGDM = ... | css |
CREATE TABLE table_38642 (
"Tie no" text,
"Home team" text,
"Score" text,
"Away team" text,
"Attendance" text
) | What was the date of the game that was played against the away team of York City? | SELECT "Attendance" FROM table_38642 WHERE "Away team" = 'york city' | wikisql |
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 treatment (
treat... | so whats the first weight of patient 033-32465 during the first hospital encounter? | SELECT patient.admissionweight FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '033-32465' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospitaladmittime LIMIT 1) AND NOT patient.admissionweight IS NULL ORDER BY p... | eicu |
CREATE TABLE broadcast (
channel_id number,
program_id number,
time_of_day text
)
CREATE TABLE program (
program_id number,
name text,
origin text,
launch number,
owner text
)
CREATE TABLE channel (
channel_id number,
name text,
owner text,
share_in_percent number,
... | Which channels are not owned by CCTV? Give me the channel names. | SELECT name FROM channel WHERE owner <> 'CCTV' | spider |
CREATE TABLE table_39193 (
"Round" text,
"Date" text,
"Opponent" text,
"Venue" text,
"Result" text,
"Attendance" real
) | Which Attendance has an Opponent of crawley town? | SELECT "Attendance" FROM table_39193 WHERE "Opponent" = 'crawley town' | wikisql |
CREATE TABLE table_79564 (
"Year" real,
"Competition Description" text,
"Location" text,
"Apparatus" text,
"Rank-Final" text,
"Score-Final" real,
"Rank-Qualifying" text,
"Score-Qualifying" real
) | What was her lowest final score with a qualifying score of 74.075? | SELECT MIN("Score-Final") FROM table_79564 WHERE "Score-Qualifying" = '74.075' | wikisql |
CREATE TABLE company (
Company_ID int,
Rank int,
Company text,
Headquarters text,
Main_Industry text,
Sales_billion real,
Profits_billion real,
Assets_billion real,
Market_Value real
)
CREATE TABLE station_company (
Station_ID int,
Company_ID int,
Rank_of_the_Year int
)
... | For each headquarter, what are the headquarter and how many companies are centered there Visualize by bar chart, and order names in descending order. | SELECT Headquarters, COUNT(*) FROM company GROUP BY Headquarters ORDER BY Headquarters DESC | nvbench |
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime t... | is patient 027-24468's heartrate measured at 2102-07-26 22:17:35 greater than measured at 2102-07-26 22:12:35? | SELECT (SELECT vitalperiodic.heartrate FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '027-24468')) AND NOT vitalperiodic.heartrate IS N... | eicu |
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... | 哪几次医疗记录中云云亭患者开出的药品均低于4528.81块钱?排列出医疗就诊编号分别是多少? | SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.t_kc21_PERSON_NM = '云云亭' AND NOT t_kc22.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT >= 4528.81) | css |
CREATE TABLE offering_instructor (
offering_instructor_id int,
offering_id int,
instructor_id int
)
CREATE TABLE program_course (
program_id int,
course_id int,
workload int,
category varchar
)
CREATE TABLE instructor (
instructor_id int,
name varchar,
uniqname varchar
)
CREAT... | What intelligent systems courses are prerequisites for 590 ? | SELECT DISTINCT COURSE_0.department, COURSE_0.name, COURSE_0.number FROM course AS COURSE_0 INNER JOIN course_prerequisite ON COURSE_0.course_id = course_prerequisite.pre_course_id INNER JOIN course AS COURSE_1 ON COURSE_1.course_id = course_prerequisite.course_id INNER JOIN area ON COURSE_0.course_id = area.course_id ... | advising |
CREATE TABLE table_6348 (
"Country" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) | What is the total silver when bronze is smaller than 0? | SELECT COUNT("Silver") FROM table_6348 WHERE "Bronze" < '0' | wikisql |
CREATE TABLE table_73024 (
"Japanese Title" text,
"Romaji Title" text,
"TV Station" text,
"Time Frame" text,
"Starring Actors" text,
"Theme Song(s)" text,
"Episodes" real,
"Average Ratings" text
) | Who were the starting actors in the time frame of tuesday 22:00~22:54 8 april 2008 to 17 june 2008? | SELECT "Starring Actors" FROM table_73024 WHERE "Time Frame" = 'Tuesday 22:00~22:54 8 April 2008 to 17 June 2008' | 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,
... | how many patients are staying at ward 490 until 2104? | SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE patient.wardid = 490 AND STRFTIME('%y', patient.unitadmittime) <= '2104' | eicu |
CREATE TABLE project_staff (
staff_id number,
project_id number,
role_code text,
date_from time,
date_to time,
other_details text
)
CREATE TABLE organisations (
organisation_id number,
organisation_type text,
organisation_details text
)
CREATE TABLE organisation_types (
organis... | How many documents can one grant have at most? List the grant id and number. | SELECT grant_id, COUNT(*) FROM documents GROUP BY grant_id ORDER BY COUNT(*) DESC LIMIT 1 | spider |
CREATE TABLE table_203_799 (
id number,
"year" number,
"date" text,
"title" text,
"format(s)" text,
"award description(s)" text,
"result(s)" text
) | what is the number of singles that went gold ? | SELECT COUNT("title") FROM table_203_799 WHERE "award description(s)" = 'gold' | squall |
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 text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
... | give me the number of patients whose primary disease is neoplasm of uncertain behavior of other lymphatic and hematopoietic tissues\bone marrow transplant and year of death is less than or equal to 2112? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "NEOPLASM OF UNCERTAIN BEHAVIOR OF OTHER LYMPHATIC AND HEMATOPOIETIC TISSUES\BONE MARROW TRANSPLANT" AND demographic.dod_year <= "2112.0" | 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... | give me the number of patients whose drug name is hydrocortisone oint 0.5%? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE prescriptions.drug = "Hydrocortisone Oint 0.5%" | mimicsql_data |
CREATE TABLE table_15557 (
"Year" real,
"Team" text,
"Chassis" text,
"Engine" text,
"Tyres" text,
"Points" real
) | What Chassis did Team BMS Scuderia Italia use with G Tyres and a Ferrari 037 3.5 v12 engine? | SELECT "Chassis" FROM table_15557 WHERE "Team" = 'bms scuderia italia' AND "Tyres" = 'g' AND "Engine" = 'ferrari 037 3.5 v12' | wikisql |
CREATE TABLE mzjzjlb (
YLJGDM text,
JZLSH text,
KH text,
KLX number,
MJZH text,
HZXM text,
NLS number,
NLY number,
ZSEBZ number,
JZZTDM number,
JZZTMC text,
JZJSSJ time,
TXBZ number,
ZZBZ number,
WDBZ number,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
... | 编号为22882643746的这个门诊的就诊日期是哪天 | SELECT JZKSRQ FROM mzjzjlb WHERE JZLSH = '22882643746' | css |
CREATE TABLE table_203_273 (
id number,
"name" text,
"japanese" text,
"distance\n(km)" number,
"connections" text,
"location" text
) | name only the stations that have connections to other lines . | SELECT "name" FROM table_203_273 WHERE NOT "connections" IS NULL | squall |
CREATE TABLE ReviewTaskStates (
Id number,
Name text,
Description text
)
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
RejectionReasonId number,
Comment text
)
CREATE TABLE Comments (
Id number,
PostId num... | Comments where Users can't spell my Alias. | SELECT C.Id, C.Text FROM dbo.Posts AS P JOIN dbo.Comments AS C ON P.Id = C.PostId JOIN dbo.Users AS U ON P.OwnerUserId = U.Id WHERE C.CreationDate >= '20180101' AND U.DisplayName != 'Lamu' AND C.Text LIKE '%@Lamu%' AND NOT EXISTS(SELECT 1 FROM dbo.Comments AS Csq JOIN dbo.Users AS Usq ON Csq.UserId = Usq.Id WHERE U.Dis... | sede |
CREATE TABLE table_name_34 (
tournament VARCHAR
) | What is the 2011 value of the paris masters, which had A in 2008, A in 2012, A in 2009? | SELECT 2011 FROM table_name_34 WHERE 2008 = "a" AND 2012 = "a" AND 2009 = "a" AND tournament = "paris masters" | sql_create_context |
CREATE TABLE table_61200 (
"7:00 am" text,
"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:00 pm" text,
"3:30 pm" text,
"4:00 pm" text,
"4:30 pm" text,
"5:00 pm" ... | What shows at 9:00 am that has a 3:30 pm of passions? | SELECT "9:00 am" FROM table_61200 WHERE "3:30 pm" = 'passions' | wikisql |
CREATE TABLE train (
Train_ID int,
Train_Num text,
Name text,
From text,
Arrival text,
Railway_ID int
)
CREATE TABLE railway (
Railway_ID int,
Railway text,
Builder text,
Built text,
Wheels text,
Location text,
ObjectNumber text
)
CREATE TABLE railway_manage (
R... | Show the countries that have managers of age above 50 or below 46, and count them by a bar chart | SELECT Country, COUNT(Country) FROM manager WHERE Age > 50 OR Age < 46 GROUP BY Country | nvbench |
CREATE TABLE table_name_21 (
games INTEGER,
rank VARCHAR
) | What is the number of Games for the player in Rank 3? | SELECT MAX(games) FROM table_name_21 WHERE rank = 3 | sql_create_context |
CREATE TABLE table_14481 (
"Player" text,
"Country" text,
"Year(s) won" text,
"Total" real,
"To par" real
) | What is the highest Total for Australia? | SELECT MAX("Total") FROM table_14481 WHERE "Country" = 'australia' | wikisql |
CREATE TABLE table_28967275_3 (
original_air_date VARCHAR,
episode__number VARCHAR
) | when 69 is the episode number what is the air date? | SELECT original_air_date FROM table_28967275_3 WHERE episode__number = 69 | sql_create_context |
CREATE TABLE time_zone (
time_zone_code text,
time_zone_name text,
hours_from_gmt int
)
CREATE TABLE flight_fare (
flight_id int,
fare_id int
)
CREATE TABLE food_service (
meal_code text,
meal_number int,
compartment text,
meal_description varchar
)
CREATE TABLE ground_service (
... | what flights go from PHILADELPHIA to SAN FRANCISCO with a stopover in DALLAS | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, airport_service AS AIRPORT_SERVICE_2, city AS CITY_0, city AS CITY_1, city AS CITY_2, flight, flight_stop WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN FRANCISCO' AND CIT... | atis |
CREATE TABLE table_18625 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Result" text,
"Candidates" text
) | What was the result in the Tennessee 6 district election? | SELECT "Result" FROM table_18625 WHERE "District" = 'Tennessee 6' | wikisql |
CREATE TABLE table_25511 (
"No. in series" real,
"No. in season" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text
) | What episode number in the series originally aired on April 27, 1999? | SELECT MAX("No. in series") FROM table_25511 WHERE "Original air date" = 'April 27, 1999' | 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 Customers (
customer_id INTEGER,
customer_first_name VARCHAR(20)... | What are the different card types, and how many transactions have been made with each Visualize by bar chart, I want to order in desc by the Y-axis. | SELECT card_type_code, COUNT(*) FROM Financial_Transactions AS T1 JOIN Customers_Cards AS T2 ON T1.card_id = T2.card_id GROUP BY T2.card_type_code ORDER BY COUNT(*) DESC | nvbench |
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto 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 admissions (
... | when has patient 25814 been prescribed medication for the first time since 11/2102 via ir route? | SELECT prescriptions.startdate FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 25814) AND prescriptions.route = 'ir' AND STRFTIME('%y-%m', prescriptions.startdate) >= '2102-11' ORDER BY prescriptions.startdate LIMIT 1 | mimic_iii |
CREATE TABLE table_name_9 (
country_region VARCHAR,
label VARCHAR
) | What is the country/region for the releases from Beat Records? | SELECT country_region FROM table_name_9 WHERE label = "beat records" | sql_create_context |
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost numbe... | what was the three most frequent specimen test performed until 2103? | SELECT t1.culturesite FROM (SELECT microlab.culturesite, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM microlab WHERE STRFTIME('%y', microlab.culturetakentime) <= '2103' GROUP BY microlab.culturesite) AS t1 WHERE t1.c1 <= 3 | eicu |
CREATE TABLE table_name_71 (
state VARCHAR,
status VARCHAR,
school VARCHAR
) | What state has colony as a status and shippensburg university as the school? | SELECT state FROM table_name_71 WHERE status = "colony" AND school = "shippensburg university" | sql_create_context |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.