context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE table_18461045_1 (
kentucky VARCHAR,
illinois VARCHAR
) | What was the little league team from Kentucky when the little league team from Illinois was Rock Falls LL Rock Falls? | SELECT kentucky FROM table_18461045_1 WHERE illinois = "Rock Falls LL Rock Falls" | sql_create_context |
CREATE TABLE table_2226817_12 (
no_in_series VARCHAR,
directed_by VARCHAR
) | how many episodes has been directed by Mark K. Samuels ? | SELECT COUNT(no_in_series) FROM table_2226817_12 WHERE directed_by = "Mark K. Samuels" | sql_create_context |
CREATE TABLE table_3026 (
"Conference" text,
"Regular Season Winner" text,
"Conference Player of the Year" text,
"Conference Tournament" text,
"Tournament Venue (City)" text,
"Tournament Winner" text
) | What is the tournament called for the Big Sky Conference? | SELECT "Conference Tournament" FROM table_3026 WHERE "Conference" = 'Big Sky Conference' | wikisql |
CREATE TABLE table_name_66 (
to_par VARCHAR,
player VARCHAR
) | What is the To par when Lanny Wadkins is the player? | SELECT to_par FROM table_name_66 WHERE player = "lanny wadkins" | sql_create_context |
CREATE TABLE table_7896 (
"Total" real,
"Score" text,
"Winning Team" text,
"Losing Team" text,
"Venue" text,
"Date" text
) | Which Score has a Losing Team of sydney roosters, and a Total of 88? | SELECT "Score" FROM table_7896 WHERE "Losing Team" = 'sydney roosters' AND "Total" = '88' | wikisql |
CREATE TABLE CLASS (
CLASS_CODE varchar(5),
CRS_CODE varchar(10),
CLASS_SECTION varchar(2),
CLASS_TIME varchar(20),
CLASS_ROOM varchar(8),
PROF_NUM int
)
CREATE TABLE DEPARTMENT (
DEPT_CODE varchar(10),
DEPT_NAME varchar(30),
SCHOOL_CODE varchar(8),
EMP_NUM int,
DEPT_ADDRESS... | Find the number of students who took some course and got A or C and group by last name in a pie chart. | SELECT STU_LNAME, COUNT(STU_LNAME) FROM STUDENT AS T1 JOIN ENROLL AS T2 ON T1.STU_NUM = T2.STU_NUM WHERE T2.ENROLL_GRADE = 'C' OR T2.ENROLL_GRADE = 'A' GROUP BY STU_LNAME | nvbench |
CREATE TABLE Student_Tests_Taken (
registration_id INTEGER,
date_test_taken DATETIME,
test_result VARCHAR(255)
)
CREATE TABLE Courses (
course_id INTEGER,
author_id INTEGER,
subject_id INTEGER,
course_name VARCHAR(120),
course_description VARCHAR(255)
)
CREATE TABLE Course_Authors_and_... | A line chart for finding the number of the enrollment date for all the tests that have 'Pass' result, and could you order x axis from high to low order please? | SELECT date_of_enrolment, COUNT(date_of_enrolment) FROM Student_Course_Enrolment AS T1 JOIN Student_Tests_Taken AS T2 ON T1.registration_id = T2.registration_id WHERE T2.test_result = "Pass" GROUP BY date_of_enrolment ORDER BY date_of_enrolment DESC | nvbench |
CREATE TABLE swimmer (
id VARCHAR,
nationality VARCHAR
)
CREATE TABLE record (
swimmer_id VARCHAR,
event_id VARCHAR
)
CREATE TABLE event (
id VARCHAR,
stadium_id VARCHAR
)
CREATE TABLE stadium (
name VARCHAR,
id VARCHAR
) | Find the names of stadiums that some Australian swimmers have been to. | SELECT 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' | sql_create_context |
CREATE TABLE table_name_74 (
gpu_model VARCHAR,
l3_cache VARCHAR
) | What is the GPU model when the L3 cache is standard power? | SELECT gpu_model FROM table_name_74 WHERE l3_cache = "standard power" | sql_create_context |
CREATE TABLE table_22496344_1 (
_number VARCHAR,
high_school VARCHAR
) | What is the # for worthing high school? | SELECT COUNT(_number) FROM table_22496344_1 WHERE high_school = "Worthing" | sql_create_context |
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid n... | what is the number of patients admitted to hospital during the last year? | SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE DATETIME(admissions.admittime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') | mimic_iii |
CREATE TABLE table_11063 (
"Name" text,
"Bodyweight" real,
"Snatch" real,
"Clean & jerk" real,
"Total (kg)" real
) | Which name had a bodyweight bigger than 89.64, a total (kg) bigger than 310, a clean and jerk less than 207.5, and a snatch that is bigger than 165? | SELECT "Name" FROM table_11063 WHERE "Bodyweight" > '89.64' AND "Total (kg)" > '310' AND "Clean & jerk" < '207.5' AND "Snatch" > '165' | wikisql |
CREATE TABLE table_name_57 (
tournament VARCHAR
) | Which 1997's accompanying 1991 was a when the tournament was the australian open? | SELECT 1997 FROM table_name_57 WHERE 1991 = "a" AND tournament = "australian open" | sql_create_context |
CREATE TABLE driver (
Driver_ID int,
Name text,
Party text,
Home_city text,
Age int
)
CREATE TABLE school_bus (
School_ID int,
Driver_ID int,
Years_Working int,
If_full_time bool
)
CREATE TABLE school (
School_ID int,
Grade text,
School text,
Location text,
Type... | Compare the average age of drivers from the same home city with a bar chart, display bars in ascending order please. | SELECT Home_city, AVG(Age) FROM driver GROUP BY Home_city ORDER BY Home_city | nvbench |
CREATE TABLE table_name_13 (
wkts VARCHAR,
econ VARCHAR
) | Tell me the wkts for econ of 4.23 | SELECT wkts FROM table_name_13 WHERE econ = "4.23" | sql_create_context |
CREATE TABLE table_2503102_1 (
engine VARCHAR,
team VARCHAR
) | What engine doe the Ed Carpenter Racing team use? | SELECT engine FROM table_2503102_1 WHERE team = "Ed Carpenter Racing" | sql_create_context |
CREATE TABLE table_67269 (
"Title" text,
"Studio" text,
"Role" text,
"Leading lady" text,
"Director" text
) | Who directed the movie when John Wayne played the role of John Travers? | SELECT "Director" FROM table_67269 WHERE "Role" = 'john travers' | wikisql |
CREATE TABLE table_28743 (
"Season" real,
"Series" text,
"Team" text,
"Races" real,
"Wins" real,
"F/Laps" real,
"Podiums" real,
"Points" real,
"Position" text
) | How many teams were at 10 points? | SELECT COUNT("Team") FROM table_28743 WHERE "Points" = '10' | wikisql |
CREATE TABLE table_13915 (
"Year(s)" text,
"Selection show" text,
"Venue" text,
"National final main host" text,
"National final co host" text,
"Semi final/heat host" text
) | What is the name of the national final co host when David Jacobs was the National final main host, and the selection show was a song for europe in 1966? | SELECT "National final co host" FROM table_13915 WHERE "National final main host" = 'david jacobs' AND "Selection show" = 'a song for europe' AND "Year(s)" = '1966' | wikisql |
CREATE TABLE zyb (
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... | 自2001年月22日起,截止到2007年5月26日,查一下0233380医疗机构处理异地就诊的次数 | SELECT COUNT(*) FROM qtb WHERE qtb.MED_SER_ORG_NO = '0233380' AND qtb.IN_HOSP_DATE BETWEEN '2001-01-22' AND '2007-05-26' AND qtb.REMOTE_SETTLE_FLG = '异地1' OR qtb.REMOTE_SETTLE_FLG = '异地2' UNION SELECT COUNT(*) FROM gyb WHERE gyb.MED_SER_ORG_NO = '0233380' AND gyb.IN_HOSP_DATE BETWEEN '2001-01-22' AND '2007-05-26' AND g... | css |
CREATE TABLE table_32929 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Attendance" real
) | What was the result of the match on December 1, 1963? | SELECT "Result" FROM table_32929 WHERE "Date" = 'december 1, 1963' | wikisql |
CREATE TABLE table_51247 (
"Team" text,
"Games Played" real,
"Wins" real,
"Losses" real,
"Ties" real,
"Goals For" real,
"Goals Against" real
) | What has the lowest number of wins with GA smaller than 39, more than 2 losses, and ties greater than 0? | SELECT MIN("Wins") FROM table_51247 WHERE "Goals Against" < '39' AND "Losses" > '2' AND "Ties" > '0' | wikisql |
CREATE TABLE table_500 (
"Season" text,
"Competition" text,
"Round" text,
"Club" text,
"1st leg" text,
"2nd leg" text,
"Aggregate" text
) | What is the 1st leg when club is a.c. libertas? | SELECT "1st leg" FROM table_500 WHERE "Club" = 'A.C. Libertas' | wikisql |
CREATE TABLE table_17546 (
"No. in series" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production code" real
) | What is the original air date for the episode 'a pig in a poke'? | SELECT "Original air date" FROM table_17546 WHERE "Title" = 'A Pig in a Poke' | wikisql |
CREATE TABLE made_by (
id int,
msid int,
pid int
)
CREATE TABLE written_by (
id int,
msid int,
wid int
)
CREATE TABLE tv_series (
sid int,
title text,
release_year int,
num_of_seasons int,
num_of_episodes int,
title_aka text,
budget text
)
CREATE TABLE producer (
... | Who was the director of the movie Joy from 2015 ? | SELECT director.name FROM directed_by, director, movie WHERE director.did = directed_by.did AND movie.mid = directed_by.msid AND movie.release_year = 2015 AND movie.title = 'Joy' | imdb |
CREATE TABLE table_27279050_3 (
country VARCHAR,
last_current_driver_s__3_november_2013 VARCHAR
) | What is the country when last/current driver(s) 3 november 2013 is daniel abt ( 2012 )? | SELECT country FROM table_27279050_3 WHERE last_current_driver_s__3_november_2013 = "Daniel Abt ( 2012 )" | sql_create_context |
CREATE TABLE table_2422 (
"Political parties" text,
"% 2006" text,
"Seats 2006" real,
"% 2001" text,
"Seats 2001" real,
"% 1997" text
) | How many seats were there in 2001 when there were 11 seats in 2006? | SELECT MIN("Seats 2001") FROM table_2422 WHERE "Seats 2006" = '11' | wikisql |
CREATE TABLE table_38559 (
"Name" text,
"Street address" text,
"Years as tallest" text,
"Height feet / m" text,
"Floors" real
) | What were the years that the building at 200 sw harrison was considered to be the tallest building? | SELECT "Years as tallest" FROM table_38559 WHERE "Street address" = '200 sw harrison' | wikisql |
CREATE TABLE table_64139 (
"Club" text,
"Active" text,
"Wins" real,
"Losses" real,
"Draws" real,
"Percentage wins" text,
"Flags" real
) | What are the losses of Warrnambool with a draw less than 19? | SELECT AVG("Losses") FROM table_64139 WHERE "Club" = 'warrnambool' AND "Draws" < '19' | wikisql |
CREATE TABLE course_prerequisite (
pre_course_id int,
course_id int
)
CREATE TABLE area (
course_id int,
area varchar
)
CREATE TABLE offering_instructor (
offering_instructor_id int,
offering_id int,
instructor_id int
)
CREATE TABLE student (
student_id int,
lastname varchar,
... | Are there any courses which require taking RESTORA 746 first ? | SELECT DISTINCT COURSE_1.department, COURSE_1.name, COURSE_1.number FROM course AS COURSE_0, course AS COURSE_1, course_prerequisite WHERE COURSE_0.course_id = course_prerequisite.pre_course_id AND COURSE_0.department = 'RESTORA' AND COURSE_0.number = 746 AND COURSE_1.course_id = course_prerequisite.course_id | advising |
CREATE TABLE table_204_174 (
id number,
"rank" number,
"name" text,
"nationality" text,
"result" number,
"notes" text
) | who had the next best time after dusmetova . | SELECT "name" FROM table_204_174 WHERE "result" < (SELECT "result" FROM table_204_174 WHERE "name" = 'liliya dusmetova') ORDER BY "result" DESC LIMIT 1 | squall |
CREATE TABLE table_name_45 (
award VARCHAR,
category VARCHAR,
result VARCHAR,
year VARCHAR,
work VARCHAR
) | Which Award has a Year smaller than 2004, and a Work of the clone, and a Result of won, and a Category of favourite actress? | SELECT award FROM table_name_45 WHERE year < 2004 AND work = "the clone" AND result = "won" AND category = "favourite actress" | sql_create_context |
CREATE TABLE county (
County_Id int,
County_name text,
Population real,
Zip_code text
)
CREATE TABLE party (
Party_ID int,
Year real,
Party text,
Governor text,
Lieutenant_Governor text,
Comptroller text,
Attorney_General text,
US_Senate text
)
CREATE TABLE election (
... | Find the parties associated with the delegates from district 1 or 2. Who served as comptrollers of the parties, and count them by a bar chart | SELECT Comptroller, COUNT(Comptroller) FROM election AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID WHERE T1.District = 1 OR T1.District = 2 GROUP BY Comptroller | nvbench |
CREATE TABLE table_11665 (
"Driver" text,
"Constructor" text,
"Laps" real,
"Time/Retired" text,
"Grid" real
) | What's the Time/Retired of Ivan Capelli? | SELECT "Time/Retired" FROM table_11665 WHERE "Driver" = 'ivan capelli' | wikisql |
CREATE TABLE table_28283535_4 (
rating VARCHAR,
episode VARCHAR
) | What is the rating of episode 1.04? | SELECT rating FROM table_28283535_4 WHERE episode = "1.04" | sql_create_context |
CREATE TABLE table_name_39 (
record VARCHAR,
team VARCHAR
) | What is the boston celtics' record? | SELECT record FROM table_name_39 WHERE team = "boston celtics" | sql_create_context |
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 was the drug prescribed to patient 65309 in 10/last year for the last time? | SELECT prescriptions.drug FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 65309) AND DATETIME(prescriptions.startdate, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') AND STRFTIME('%m', prescriptions.startdate) = '10' ORD... | mimic_iii |
CREATE TABLE table_name_16 (
time VARCHAR,
rank VARCHAR
) | Rank of 6 has what time? | SELECT time FROM table_name_16 WHERE rank = 6 | sql_create_context |
CREATE TABLE table_53728 (
"Player" text,
"Car." real,
"Yards" text,
"Avg." text,
"TD's" real,
"Long" text
) | How many carries for jeff smoker? | SELECT SUM("Car.") FROM table_53728 WHERE "Player" = 'jeff smoker' | wikisql |
CREATE TABLE table_13012165_1 (
maryland VARCHAR,
new_jersey VARCHAR
) | Who played in Maryland the same year that New Jersey hosted Somerset Hills LL Bernardsville? | SELECT maryland FROM table_13012165_1 WHERE new_jersey = "Somerset Hills LL Bernardsville" | sql_create_context |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id t... | what is the number of patients with diagnoses icd9 code 41031 who had ascitic lab fluid test? | 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.icd9_code = "41031" AND lab.fluid = "Ascites" | mimicsql_data |
CREATE TABLE table_19908 (
"Series Ep." text,
"Episode" real,
"Segment A" text,
"Segment B" text,
"Segment C" text,
"Segment D" text
) | What episode number is the episode with a segment on thinning shears? | SELECT MIN("Episode") FROM table_19908 WHERE "Segment A" = 'Thinning Shears' | wikisql |
CREATE TABLE table_name_54 (
home_team VARCHAR
) | What was Collingwood's score as the home team? | SELECT home_team AS score FROM table_name_54 WHERE home_team = "collingwood" | sql_create_context |
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
a... | until 2 years ago, what is the five most frequent drugs, prescribed to the patients of age 20s after the diagnosis of leukocytosis within 2 months? | SELECT t3.drugname FROM (SELECT t2.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'leukocytosis' AND DATETIME(diagnosis.diagnosistime... | eicu |
CREATE TABLE table_71520 (
"Team" text,
"Car(s)" text,
"Driver(s)" text,
"Primary Sponsor(s)" text,
"Owner(s)" text,
"Crew Chief" text,
"Rounds" real
) | What is the Primary Sponsor for the team owned by Randy Humphrey? | SELECT "Primary Sponsor(s)" FROM table_71520 WHERE "Owner(s)" = 'randy humphrey' | wikisql |
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location t... | how many patients stayed in hospital for more than 1 day and were diagnosed with icd9 code 99859? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.days_stay > "1" AND diagnoses.icd9_code = "99859" | mimicsql_data |
CREATE TABLE table_21069 (
"Team #1" text,
"Points" text,
"Team #2" text,
"1st leg" text,
"2nd leg" text
) | For team Atl tico Nacional, what were the points? | SELECT "Points" FROM table_21069 WHERE "Team #2" = 'Atlético Nacional' | wikisql |
CREATE TABLE table_1341930_40 (
incumbent VARCHAR,
first_elected VARCHAR
) | Name the incumbent for first elected 1956 | SELECT incumbent FROM table_1341930_40 WHERE first_elected = 1956 | sql_create_context |
CREATE TABLE hz_info (
KH text,
KLX number,
YLJGDM text,
RYBH text
)
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,... | 检验结果指标记录46273136551的范围下限和上限分别是多少?参考值范围有多大? | SELECT CKZFWDX, CKZFWXX, CKZFWSX FROM jyjgzbb WHERE JYZBLSH = '46273136551' | css |
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... | 排出对于王志尚病人就医记录中医疗费总额不少于5598.78元的入院诊断疾病序号是什么和名称叫什么? | SELECT qtb.IN_DIAG_DIS_CD, qtb.IN_DIAG_DIS_NM FROM qtb WHERE qtb.PERSON_NM = '王志尚' AND qtb.MED_CLINIC_ID IN (SELECT t_kc24.MED_CLINIC_ID FROM t_kc24 WHERE t_kc24.MED_AMOUT >= 5598.78) UNION SELECT gyb.IN_DIAG_DIS_CD, gyb.IN_DIAG_DIS_NM FROM gyb WHERE gyb.PERSON_NM = '王志尚' AND gyb.MED_CLINIC_ID IN (SELECT t_kc24.MED_CLI... | css |
CREATE TABLE table_name_95 (
record VARCHAR,
date VARCHAR
) | What was the record on july 24? | SELECT record FROM table_name_95 WHERE date = "july 24" | sql_create_context |
CREATE TABLE table_261954_1 (
joined INTEGER
) | What is the least value of joined? | SELECT MIN(joined) FROM table_261954_1 | sql_create_context |
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
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
)... | during this year, what was the top three most commonly prescribed drugs to patients after they were diagnosed with angina pectoris nec/nos during the same hospital visit? | SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime, admissions.hadm_id 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_... | mimic_iii |
CREATE TABLE table_name_55 (
score VARCHAR,
home VARCHAR
) | What was the score of the game with the Etobicoke Kangaroos as the home team? | SELECT score FROM table_name_55 WHERE home = "etobicoke kangaroos" | sql_create_context |
CREATE TABLE table_32991 (
"Pick #" real,
"NFL Team" text,
"Player" text,
"Position" text,
"College" text
) | What is Van Waiters position? | SELECT "Position" FROM table_32991 WHERE "Player" = 'van waiters' | wikisql |
CREATE TABLE table_33108 (
"Week" real,
"Kickoff" text,
"Date" text,
"Opponent" text,
"Result" text,
"Record" text,
"Game Site" text,
"NFL.com Recap" text
) | What is the kickoff that has a NFL.com recap, is played before week 17, and is played at arrowhead stadium? | SELECT "Kickoff" FROM table_33108 WHERE "NFL.com Recap" = 'recap' AND "Week" < '17' AND "Game Site" = 'arrowhead stadium' | wikisql |
CREATE TABLE table_204_637 (
id number,
"type" text,
"gauge" text,
"railway" text,
"works no." text,
"year" text,
"builder" text
) | builder that has the most experience | SELECT "builder" FROM table_204_637 GROUP BY "builder" ORDER BY COUNT(*) DESC LIMIT 1 | squall |
CREATE TABLE table_13252 (
"Year" real,
"Champion" text,
"City" text,
"LLWS" text,
"Record" text
) | What is the record of the champion in 2008? | SELECT "Record" FROM table_13252 WHERE "Year" = '2008' | wikisql |
CREATE TABLE table_44745 (
"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 lowest Game, when Date is 'April 12'? | SELECT MIN("Game") FROM table_44745 WHERE "Date" = 'april 12' | wikisql |
CREATE TABLE table_57250 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | How many spectators were present when the away team scored 10.12 (72)? | SELECT COUNT("Crowd") FROM table_57250 WHERE "Away team score" = '10.12 (72)' | wikisql |
CREATE TABLE table_203_34 (
id number,
"season" text,
"appearance" number,
"interchange" number,
"tries" number,
"goals" number,
"f/g" number,
"points" number
) | what year did the bulldogs make the greatest number of tries | SELECT "season" FROM table_203_34 ORDER BY "tries" DESC LIMIT 1 | squall |
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,
... | what were the five most commonly ordered procedures for patients with brain tumor who had previously been diagnosed within 2 months until 2104? | SELECT t3.treatmentname FROM (SELECT t2.treatmentname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'brain tumor' AND STRFTIME('%y', diagnosi... | eicu |
CREATE TABLE table_44611 (
"Outcome" text,
"Date" text,
"Championship" text,
"Surface" text,
"Opponent" text,
"Score" text
) | What is Score, when Opponent is Natalia Rizhonkova? | SELECT "Score" FROM table_44611 WHERE "Opponent" = 'natalia rizhonkova' | wikisql |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
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... | how many male patients had the drug code lipid250i? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.gender = "M" AND prescriptions.formulary_drug_cd = "LIPID250I" | mimicsql_data |
CREATE TABLE table_name_12 (
region VARCHAR
) | What is the average value for 1970, when the Region is East Europe (7 Economies), and when 2000 has a value greater than 2? | SELECT AVG(1970) FROM table_name_12 WHERE region = "east europe (7 economies)" AND 2000 > 2 | sql_create_context |
CREATE TABLE table_21489362_2 (
rr4_pts VARCHAR,
total_pts VARCHAR
) | When 70 is the total points what is the rr4 points? | SELECT rr4_pts FROM table_21489362_2 WHERE total_pts = 70 | sql_create_context |
CREATE TABLE train (
Train_ID int,
Name text,
Time text,
Service text
)
CREATE TABLE station (
Station_ID int,
Name text,
Annual_entry_exit real,
Annual_interchanges real,
Total_Passengers real,
Location text,
Main_Services text,
Number_of_Platforms int
)
CREATE TABLE t... | Show the total number of passengers of each location in a bar chart, and display in asc by the x-axis. | SELECT Location, SUM(Total_Passengers) FROM station GROUP BY Location ORDER BY Location | nvbench |
CREATE TABLE PostLinks (
Id number,
CreationDate time,
PostId number,
RelatedPostId number,
LinkTypeId number
)
CREATE TABLE PostNotices (
Id number,
PostId number,
PostNoticeTypeId number,
CreationDate time,
DeletionDate time,
ExpiryDate time,
Body text,
OwnerUserId... | N questions with the shortest title on a given site. | SELECT Id AS "post_link", LENGTH(Title) AS "no._of_characters" FROM Posts WHERE PostTypeId = 1 ORDER BY 'no._of_characters' LIMIT 100 | sede |
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 diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
... | when did patient 20000 receive the first anion gap test since 166 months ago? | SELECT labevents.charttime FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'anion gap') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 20000) AND DATETIME(labevents.charttime) >= DATETIME(CURRENT_TIME(), '-166... | mimic_iii |
CREATE TABLE College (
cName varchar(20),
state varchar(2),
enr numeric(5,0)
)
CREATE TABLE Player (
pID numeric(5,0),
pName varchar(20),
yCard varchar(3),
HS numeric(5,0)
)
CREATE TABLE Tryout (
pID numeric(5,0),
cName varchar(20),
pPos varchar(8),
decision varchar(3)
) | What is minimum hours of the students playing in different position Plot them as bar chart, and could you sort by the y axis in descending? | SELECT pPos, MIN(T2.HS) FROM Tryout AS T1 JOIN Player AS T2 ON T1.pID = T2.pID GROUP BY pPos ORDER BY MIN(T2.HS) DESC | nvbench |
CREATE TABLE hz_info (
KH text,
KLX number,
YLJGDM text,
RYBH text
)
CREATE TABLE jyjgzbb (
JYZBLSH text,
YLJGDM text,
BGDH text,
BGRQ time,
JYRQ time,
JCRGH text,
JCRXM text,
SHRGH text,
SHRXM text,
JCXMMC text,
JCZBDM text,
JCFF text,
JCZBMC text,
... | 40747707754开出了几份检验报告单是在哪个门诊就得诊 | SELECT COUNT(*) FROM jybgb WHERE JZLSH = '40747707754' | css |
CREATE TABLE table_name_34 (
team_1 VARCHAR
) | Which first leg had Galatasaray as Team 1? | SELECT 1 AS st_leg FROM table_name_34 WHERE team_1 = "galatasaray" | sql_create_context |
CREATE TABLE SportsInfo (
StuID INTEGER,
SportName VARCHAR(32),
HoursPerWeek INTEGER,
GamesPlayed INTEGER,
OnScholarship VARCHAR(1)
)
CREATE TABLE Student (
StuID INTEGER,
LName VARCHAR(12),
Fname VARCHAR(12),
Age INTEGER,
Sex VARCHAR(1),
Major INTEGER,
Advisor INTEGER,
... | Show last names for all student who are on scholarship, and count them by a bar chart, and could you sort in descending by the y-axis? | SELECT LName, COUNT(LName) FROM SportsInfo AS T1 JOIN Student AS T2 ON T1.StuID = T2.StuID WHERE T1.OnScholarship = 'Y' GROUP BY LName ORDER BY COUNT(LName) DESC | nvbench |
CREATE TABLE Student (
age VARCHAR
) | Show all ages and corresponding number of students. | SELECT age, COUNT(*) FROM Student GROUP BY age | sql_create_context |
CREATE TABLE table_name_20 (
attendance VARCHAR,
opponents VARCHAR,
h___a VARCHAR
) | What was the Attendance when Lincoln City was the Opponents with H/A of A? | SELECT COUNT(attendance) FROM table_name_20 WHERE opponents = "lincoln city" AND h___a = "a" | sql_create_context |
CREATE TABLE table_1341663_19 (
first_elected INTEGER
) | What year was the earliest first elected? | SELECT MIN(first_elected) FROM table_1341663_19 | sql_create_context |
CREATE TABLE table_69379 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Attendance" text
) | What opponent has a loss of Trachsel (10-11)? | SELECT "Opponent" FROM table_69379 WHERE "Loss" = 'trachsel (10-11)' | wikisql |
CREATE TABLE table_name_22 (
president VARCHAR,
date VARCHAR,
year VARCHAR,
location VARCHAR,
type VARCHAR
) | What is the President with a Location of justus lipsius building, brussels, and a Type with scheduled, and a Year larger than 2011, and a Date with 18 19 october? | SELECT president FROM table_name_22 WHERE location = "justus lipsius building, brussels" AND type = "scheduled" AND year > 2011 AND date = "18–19 october" | sql_create_context |
CREATE TABLE operate_company (
id int,
name text,
Type text,
Principal_activities text,
Incorporated_in text,
Group_Equity_Shareholding real
)
CREATE TABLE airport (
id int,
City text,
Country text,
IATA text,
ICAO text,
name text
)
CREATE TABLE flight (
id int,
... | Give the proportion of what are the ids and names of the companies that operated more than one flight? | SELECT T1.name, T1.id FROM operate_company AS T1 JOIN flight AS t2 ON T1.id = T2.company_id | nvbench |
CREATE TABLE table_47454 (
"Election" text,
"Candidate" text,
"Number of votes" text,
"Share of votes" text,
"Outcome of election" text
) | What is the share of votes in the 2000 (2nd) election? | SELECT "Share of votes" FROM table_47454 WHERE "Election" = '2000 (2nd)' | wikisql |
CREATE TABLE races (
raceId INTEGER,
year INTEGER,
round INTEGER,
circuitId INTEGER,
name TEXT,
date TEXT,
time TEXT,
url TEXT
)
CREATE TABLE constructors (
constructorId INTEGER,
constructorRef TEXT,
name TEXT,
nationality TEXT,
url TEXT
)
CREATE TABLE lapTimes (
... | Find the id and location of circuits that belong to France or Belgium Plot them as bar chart, could you sort in descending by the Y? | SELECT location, circuitId FROM circuits WHERE country = "France" OR country = "Belgium" ORDER BY circuitId DESC | nvbench |
CREATE TABLE table_52345 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | What did the home team score at Western Oval? | SELECT "Home team score" FROM table_52345 WHERE "Venue" = 'western oval' | wikisql |
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_type text,
admission_location text,
discharge_location text,
insurance text,
language text,
marital_status text,
ethnicity text,
age number
)
CREATE ... | what is the average number of patients diagnosed with diseases of lips monthly until 2104? | SELECT AVG(t1.c1) FROM (SELECT COUNT(DISTINCT diagnoses_icd.hadm_id) AS c1 FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'diseases of lips') AND STRFTIME('%y', diagnoses_icd.charttime) <= '2104' GROUP BY STRFTIME('%y-%m', di... | mimic_iii |
CREATE TABLE table_29471 (
"Team" text,
"Head coach" text,
"Team captain" text,
"Kit maker" text,
"Shirt sponsor" text,
"Past Season" text
) | Which team has Ali Daei as head coach? | SELECT "Team" FROM table_29471 WHERE "Head coach" = 'Ali Daei' | wikisql |
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 month (
month_number int,
month_name text
)
CREATE TABLE days (
days_code varchar,
day_name varchar
)
... | show me the afternoon flights from WASHINGTON to BOSTON | 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 = 'WASHINGTON' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BO... | atis |
CREATE TABLE table_53861 (
"Date" text,
"Venue" text,
"Score" text,
"Result" text,
"Competition" text
) | What is the competition that had a 2-2 result? | SELECT "Competition" FROM table_53861 WHERE "Result" = '2-2' | wikisql |
CREATE TABLE table_name_61 (
crowd INTEGER,
venue VARCHAR
) | What was the smallest crowd at junction oval? | SELECT MIN(crowd) FROM table_name_61 WHERE venue = "junction oval" | sql_create_context |
CREATE TABLE t_kc21 (
MED_CLINIC_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
COMP_ID text,
PERSON_ID text,
PERSON_NM text,
IDENTITY_CARD text,
SOC_SRT_CARD text,
PERSON_SEX number,
PERSON_AGE number,
IN_HOSP_DATE time,
OUT_HOSP_DATE time,
DIFF_PLACE_FLG numb... | 自2000-10-19到2016-12-23,这家医院4040000非科室慢病科负责的所有医疗就诊记录有哪些 | (SELECT * FROM t_kc21 WHERE MED_SER_ORG_NO = '4040000' AND IN_HOSP_DATE BETWEEN '2000-10-19' AND '2016-12-23') EXCEPT (SELECT * FROM t_kc21 WHERE MED_SER_ORG_NO = '4040000' AND IN_HOSP_DATE BETWEEN '2000-10-19' AND '2016-12-23' AND MED_ORG_DEPT_NM = '慢病科') | css |
CREATE TABLE table_71241 (
"Name" text,
"Street address" text,
"Years as tallest" text,
"Height ft (m)" text,
"Floors" text,
"Architect" text
) | How many years as tallest building was Independence Hall? | SELECT "Years as tallest" FROM table_71241 WHERE "Name" = 'independence hall' | 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 hz_info (
KH text,
KLX number... | 门诊中医诊断在住院就诊22762045493中的编号是多少? | SELECT zyjzjlb.MZZYZDZZBM FROM zyjzjlb WHERE zyjzjlb.JZLSH = '22762045493' | css |
CREATE TABLE table_18353 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Result" text,
"Candidates" text
) | How many times was the candidates paul tsongas (d) 60.6% paul w. cronin (r) 39.4%? | SELECT COUNT("Incumbent") FROM table_18353 WHERE "Candidates" = 'Paul Tsongas (D) 60.6% Paul W. Cronin (R) 39.4%' | wikisql |
CREATE TABLE table_26124171_1 (
points VARCHAR,
team VARCHAR
) | How many points were scored on pole services? | SELECT points FROM table_26124171_1 WHERE team = "Pole Services" | sql_create_context |
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 inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
... | let's count the number of times patient 27703 had been prescribed memantine in 2105. | SELECT COUNT(*) FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 27703) AND prescriptions.drug = 'memantine' AND STRFTIME('%y', prescriptions.startdate) = '2105' | mimic_iii |
CREATE TABLE table_31698 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Attendance" real
) | Tell me the date that has a week larger than 3 and a result of w 28-27 | SELECT "Date" FROM table_31698 WHERE "Week" > '3' AND "Result" = 'w 28-27' | wikisql |
CREATE TABLE department (
dept_name varchar(20),
building varchar(15),
budget numeric(12,2)
)
CREATE TABLE takes (
ID varchar(5),
course_id varchar(8),
sec_id varchar(8),
semester varchar(6),
year numeric(4,0),
grade varchar(2)
)
CREATE TABLE teaches (
ID varchar(5),
course... | What is the sum of credit value of courses with more than one prerequisite for each title? Return a bar chart, sort Y from low to high order please. | SELECT title, SUM(credits) FROM course AS T1 JOIN prereq AS T2 ON T1.course_id = T2.course_id GROUP BY title ORDER BY SUM(credits) | nvbench |
CREATE TABLE table_19312 (
"Model" text,
"Year" text,
"Die Size (mm 2 ) [1]" text,
"Config core [2]" text,
"MTriangles/s [1]" real,
"MPixel/s [1]" real,
"Bus width ( bit )" text,
"DirectX" text,
"OpenGL" text,
"OpenGL ES" text,
"GFLOPS(@ 200MHz)" text,
"Frequency" real
) | Which models can perform flops(@ 200mhz) is 3.2 | SELECT "Model" FROM table_19312 WHERE "GFLOPS(@ 200MHz)" = '3.2' | wikisql |
CREATE TABLE table_47303 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
) | What player had the high assists when the Score was l 107 112 (ot)? | SELECT "High assists" FROM table_47303 WHERE "Score" = 'l 107–112 (ot)' | wikisql |
CREATE TABLE table_51358 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | Which Crowd has an Away team of st kilda? | SELECT "Crowd" FROM table_51358 WHERE "Away team" = 'st kilda' | wikisql |
CREATE TABLE dual_carrier (
main_airline varchar,
low_flight_number int,
high_flight_number int,
dual_airline varchar,
service_name text
)
CREATE TABLE restriction (
restriction_code text,
advance_purchase int,
stopovers text,
saturday_stay_required text,
minimum_stay int,
m... | what is the last flight from SAN FRANCISCO to DALLAS FORT WORTH | 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 WHERE ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'DALLAS' AND CITY_2.city_code = AIR... | atis |
CREATE TABLE table_12043148_2 (
bristol_ VARCHAR,
_n_som VARCHAR,
somerset VARCHAR
) | what is the bristol & n. som where the somerset is ashcott and shapwick? | SELECT bristol_ & _n_som FROM table_12043148_2 WHERE somerset = "Ashcott and Shapwick" | sql_create_context |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.