context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE table_5055 (
"Game" text,
"Date" text,
"Home Team" text,
"Result" text,
"Road Team" text
) | On what date was Portland on the road for Game 2? | SELECT "Date" FROM table_5055 WHERE "Road Team" = 'portland' AND "Game" = 'game 2' | wikisql |
CREATE TABLE hz_info_mzjzjlb (
JZLSH number,
YLJGDM number,
mzjzjlb_id number
)
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,
... | 44952998423的门诊结束就诊的日期是哪天 | SELECT mzjzjlb.JZJSSJ FROM mzjzjlb WHERE mzjzjlb.JZLSH = '44952998423' | css |
CREATE TABLE requirement (
requirement_id int,
requirement varchar,
college varchar
)
CREATE TABLE comment_instructor (
instructor_id int,
student_id int,
score int,
comment_text varchar
)
CREATE TABLE student_record (
student_id int,
course_id int,
semester int,
grade varc... | What is on the list of the Spring MKT upper-level classes ? | SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, program_course, semester WHERE course.course_id = course_offering.course_id AND course.department = 'MKT' AND program_course.category LIKE '%ULCS%' AND program_course.course_id = course.course_id AND semester.semester = 'Spring'... | advising |
CREATE TABLE table_18004 (
"Year" real,
"Dates" text,
"Champion" text,
"Score" real,
"To par" text,
"Margin of victory" text,
"Purse ( $ )" real,
"Winners share ($)" real
) | What year is Jiyai Shin the champion? | SELECT COUNT("Year") FROM table_18004 WHERE "Champion" = 'Jiyai Shin' | wikisql |
CREATE TABLE table_53593 (
"Date" text,
"Tournament" text,
"Round" text,
"Ground" text,
"Opponent" text,
"Score 1" text
) | Which opponent had round 1? | SELECT "Opponent" FROM table_53593 WHERE "Round" = '1' | wikisql |
CREATE TABLE table_name_27 (
bronze VARCHAR,
year VARCHAR
) | How many bronze medals were won in 1998? | SELECT bronze FROM table_name_27 WHERE year = "1998" | sql_create_context |
CREATE TABLE table_77725 (
"Driver" text,
"Car #" real,
"Make" text,
"Points" real,
"Laps" real,
"Winnings" text
) | What were the winnings for the Chevrolet with a number larger than 29 and scored 102 points? | SELECT "Winnings" FROM table_77725 WHERE "Make" = 'chevrolet' AND "Car #" > '29' AND "Points" = '102' | 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 diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
C... | what is the icu stay id and drug code of subject id 65652? | SELECT prescriptions.icustay_id, prescriptions.formulary_drug_cd FROM prescriptions WHERE prescriptions.subject_id = "65652" | mimicsql_data |
CREATE TABLE table_11629 (
"Tournament" text,
"2007" text,
"2008" text,
"2009" text,
"2010" text,
"2011" text,
"2012" text,
"Career Win\u2013Loss" text
) | What was the 2010 result for a 2008 result of LQ and 2011 result of 2R? | SELECT "2010" FROM table_11629 WHERE "2008" = 'lq' AND "2011" = '2r' | 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 jyjgzbb (
BGDH text,
BGRQ tim... | 查查胸腹水白蛋白(白蛋白)数值的平均值以及最值,是针对门诊诊断为疾病C89.828的患者的 | SELECT AVG(jyjgzbb.JCZBJGDL), MIN(jyjgzbb.JCZBJGDL), MAX(jyjgzbb.JCZBJGDL) FROM mzjzjlb JOIN jyjgzbb ON mzjzjlb.YLJGDM = jyjgzbb.jybgb_YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jyjgzbb.jybgb_JZLSH_MZJZJLB WHERE mzjzjlb.JZZDBM = 'C89.828' AND jyjgzbb.JCZBMC = '胸腹水白蛋白(白蛋白)' | css |
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 people have had microbiological tests in their urine, voided specimen in 2105? | SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE patient.patientunitstayid IN (SELECT microlab.patientunitstayid FROM microlab WHERE microlab.culturesite = 'urine, voided specimen' AND STRFTIME('%y', microlab.culturetakentime) = '2105') | eicu |
CREATE TABLE song (
song_name VARCHAR,
f_id VARCHAR
)
CREATE TABLE files (
f_id VARCHAR,
duration VARCHAR
) | List the names of all songs that have 4 minute duration or are in English. | SELECT T2.song_name FROM files AS T1 JOIN song AS T2 ON T1.f_id = T2.f_id WHERE T1.duration LIKE "4:%" UNION SELECT song_name FROM song WHERE languages = "english" | sql_create_context |
CREATE TABLE flight_leg (
flight_id int,
leg_number int,
leg_flight int
)
CREATE TABLE state (
state_code text,
state_name text,
country_name text
)
CREATE TABLE city (
city_code varchar,
city_name varchar,
state_code varchar,
country_name varchar,
time_zone_code varchar
)
... | show me the flights from SAN FRANCISCO to NEWARK that leave after 2300 | 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_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'NEWARK' AND flight.departure_time > 2300 AND flight.to_airport = AIRPORT_SERVICE_1.airpor... | atis |
CREATE TABLE table_59381 (
"Week 2" text,
"Week 3" text,
"Week 4" text,
"Week 5" text,
"Week 6" text,
"Week 7" text
) | What is week 5 when week 2 is 36.80, and week 4 is 39.75? | SELECT "Week 5" FROM table_59381 WHERE "Week 2" = '36.80' AND "Week 4" = '39.75' | wikisql |
CREATE TABLE table_37171 (
"Club" text,
"Played" text,
"Drawn" text,
"Lost" text,
"Points for" text,
"Points against" text,
"Tries for" text,
"Tries against" text,
"Try bonus" text,
"Losing bonus" text,
"Points" text
) | What club has tries for in the category tries for? | SELECT "Club" FROM table_37171 WHERE "Tries for" = 'tries for' | wikisql |
CREATE TABLE table_30328 (
"Year Location" text,
"Mens Singles" text,
"Womens Singles" text,
"Mens Doubles" text,
"Womens Doubles" text
) | Who was the womens double winner when the womens singles winner was Ding Ning? | SELECT "Womens Doubles" FROM table_30328 WHERE "Womens Singles" = 'Ding Ning' | wikisql |
CREATE TABLE table_11570261_6 (
cuts_made VARCHAR
) | How many times did Tiger get second in the year where there were 11 cuts? | SELECT MAX(2 AS nd) FROM table_11570261_6 WHERE cuts_made = "11" | sql_create_context |
CREATE TABLE event (
ID int,
Name text,
Stadium_ID int,
Year text
)
CREATE TABLE swimmer (
ID int,
name text,
Nationality text,
meter_100 real,
meter_200 text,
meter_300 text,
meter_400 text,
meter_500 text,
meter_600 text,
meter_700 text,
Time text
)
CREATE... | Return a bar chart about the distribution of meter_600 and meter_100 , and could you order by the x-axis from high to low please? | SELECT meter_600, meter_100 FROM swimmer ORDER BY meter_600 DESC | nvbench |
CREATE TABLE table_name_40 (
lost VARCHAR,
try_bonus VARCHAR,
points_against VARCHAR
) | What is the lost when the try bonus is 5, and points against is 298? | SELECT lost FROM table_name_40 WHERE try_bonus = "5" AND points_against = "298" | sql_create_context |
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE d_labitems (
row_id numbe... | how many days have passed since patient 19428 had a d 12.5 w intake for the last time on the current intensive care unit visit? | SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', inputevents_cv.charttime)) FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 19428) AND icustays.outtime IS NULL) ... | mimic_iii |
CREATE TABLE table_45758 (
"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 TEAM FOR DECEMBER 30? | SELECT "Team" FROM table_45758 WHERE "Date" = 'december 30' | wikisql |
CREATE TABLE table_17593 (
"Season" text,
"Serbian League Belgrade" text,
"Serbian League East" text,
"Serbian League Vojvodina" text,
"Serbian League West" text
) | What team was promoted in the Serbian League East in the same season when Kolubara was promoted in the Serbian League Belgrade? | SELECT "Serbian League East" FROM table_17593 WHERE "Serbian League Belgrade" = 'Kolubara' | wikisql |
CREATE TABLE table_2102714_1 (
archive VARCHAR,
run_time VARCHAR
) | What is he archive for the episode with a run time of 24:05? | SELECT archive FROM table_2102714_1 WHERE run_time = "24:05" | sql_create_context |
CREATE TABLE table_66228 (
"!Event" real,
"Round" text,
"Surface" text,
"Winner" text,
"Opponent" text,
"Result" text
) | How many events did clay win? | SELECT COUNT("!Event") FROM table_66228 WHERE "Winner" = 'clay' | wikisql |
CREATE TABLE table_17456 (
"Pick #" real,
"Player" text,
"Position" text,
"Nationality" text,
"NHL team" text,
"College/junior/club team" text
) | How many teams did Bob Peppler play for? | SELECT COUNT("NHL team") FROM table_17456 WHERE "Player" = 'Bob Peppler' | wikisql |
CREATE TABLE table_22076 (
"Position" real,
"Club" text,
"Games played" real,
"Wins" real,
"Draws" real,
"Loses" real,
"Goals scored" real,
"Goals conceded" real,
"Points" real
) | HOw many points where there when the number of goals scored was 47? | SELECT MAX("Points") FROM table_22076 WHERE "Goals scored" = '47' | wikisql |
CREATE TABLE table_40581 (
"Spoofed Title" text,
"Actual Title" text,
"Writer" text,
"Artist" text,
"Issue" real,
"Date" text
) | What is the Writer with a Date that is january 1975? | SELECT "Writer" FROM table_40581 WHERE "Date" = 'january 1975' | wikisql |
CREATE TABLE table_47310 (
"Year" text,
"Indians admitted" real,
"Pakistanis admitted" real,
"Sri Lankans admitted" real,
"Bangladeshis admitted" real,
"Nepalis admitted" real
) | What was the most Nepalis admitted when the number of Sri Lankans was more than 5,520, Bangladeshis was more than 2,715, and Pakistanis more than 139,574? | SELECT MAX("Nepalis admitted") FROM table_47310 WHERE "Sri Lankans admitted" > '5,520' AND "Bangladeshis admitted" > '2,715' AND "Pakistanis admitted" > '139,574' | wikisql |
CREATE TABLE table_16136 (
"Sepal length" text,
"Sepal width" text,
"Petal length" text,
"Petal width" text,
"Species" text
) | Name the number of species with sepal width of 3.4 and sepal length of 5.4 | SELECT COUNT("Species") FROM table_16136 WHERE "Sepal width" = '3.4' AND "Sepal length" = '5.4' | wikisql |
CREATE TABLE Fault_Log (
fault_log_entry_id INTEGER,
asset_id INTEGER,
recorded_by_staff_id INTEGER,
fault_log_entry_datetime DATETIME,
fault_description VARCHAR(255),
other_fault_details VARCHAR(255)
)
CREATE TABLE Skills_Required_To_Fix (
part_fault_id INTEGER,
skill_id INTEGER
)
CRE... | List the number of enginners and group by last name in a bar chart, and order bar in descending order. | SELECT last_name, COUNT(last_name) FROM Maintenance_Engineers AS T1 JOIN Engineer_Skills AS T2 ON T1.engineer_id = T2.engineer_id JOIN Skills AS T3 ON T2.skill_id = T3.skill_id GROUP BY last_name ORDER BY last_name DESC | nvbench |
CREATE TABLE Allergy_type (
allergytype VARCHAR
) | How many different allergy types exist? | SELECT COUNT(DISTINCT allergytype) FROM Allergy_type | sql_create_context |
CREATE TABLE table_name_6 (
attendance INTEGER,
away VARCHAR
) | What was the average attendance when marathon was the away team? | SELECT AVG(attendance) FROM table_name_6 WHERE away = "marathon" | sql_create_context |
CREATE TABLE table_53800 (
"Conference" text,
"Division" text,
"Appearances" real,
"Wins" real,
"Losses" real
) | How many losses did the division who appeared less than 16 times have? | SELECT "Losses" FROM table_53800 WHERE "Appearances" < '16' | wikisql |
CREATE TABLE table_1658 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
) | What was the location and the crowd attendance on December 9? | SELECT "Location Attendance" FROM table_1658 WHERE "Date" = 'December 9' | wikisql |
CREATE TABLE table_name_46 (
title VARCHAR,
artist VARCHAR,
cat__number VARCHAR
) | What is the title of the record with an artist of Tangorodrim, category number FSR006? | SELECT title FROM table_name_46 WHERE artist = "tangorodrim" AND cat__number = "fsr006" | sql_create_context |
CREATE TABLE party_host (
Party_ID int,
Host_ID int,
Is_Main_in_Charge bool
)
CREATE TABLE host (
Host_ID int,
Name text,
Nationality text,
Age text
)
CREATE TABLE party (
Party_ID int,
Party_Theme text,
Location text,
First_year text,
Last_year text,
Number_of_host... | Bar chart x axis nationality y axis the total number, rank in desc by the x axis. | SELECT Nationality, COUNT(*) FROM host GROUP BY Nationality ORDER BY Nationality DESC | nvbench |
CREATE TABLE table_name_40 (
result VARCHAR,
record VARCHAR,
game VARCHAR,
streak VARCHAR
) | Which Result has a Game smaller than 37, and a Streak of lost 1, and a Record of 4-9? | SELECT result FROM table_name_40 WHERE game < 37 AND streak = "lost 1" AND record = "4-9" | sql_create_context |
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
sy... | when was the first microbiology test of patient 031-23724,? | SELECT microlab.culturetakentime FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-23724')) ORDER BY microlab.culturetakentime LIMIT 1 | eicu |
CREATE TABLE Users (
Id number,
Reputation number,
CreationDate time,
DisplayName text,
LastAccessDate time,
WebsiteUrl text,
Location text,
AboutMe text,
Views number,
UpVotes number,
DownVotes number,
ProfileImageUrl text,
EmailHash text,
AccountId number
)
CRE... | find users with about me text like. | SELECT Id AS "user_link", Reputation, CreationDate, LastAccessDate FROM Users WHERE AboutMe LIKE '%##text##%' | sede |
CREATE TABLE table_19870086_24 (
rank VARCHAR,
player VARCHAR
) | what is the rank of adam gilchrist | SELECT COUNT(rank) FROM table_19870086_24 WHERE player = "Adam Gilchrist" | sql_create_context |
CREATE TABLE table_20545 (
"No. in series" real,
"No. in season" real,
"Title" text,
"Directed by" text,
"Written By" text,
"Originalairdate" text,
"TV Broadcast" text
) | Which title was No. 4 in season? | SELECT "Title" FROM table_20545 WHERE "No. in season" = '4' | wikisql |
CREATE TABLE table_61653 (
"Tournament" text,
"2005" text,
"2006" text,
"2007" text,
"2008" text,
"2009" text,
"2010" text,
"2011" text,
"2012" text
) | WHAT IS THE 2011 WITH 2007 AT A AND2 008 AT 3R? | SELECT "2011" FROM table_61653 WHERE "2007" = 'a' AND "2008" = '3r' | wikisql |
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... | 患者42705253主要去哪家医院,在2016-09-13到2017-01-15这一年里? | SELECT qtb.MED_SER_ORG_NO FROM qtb WHERE qtb.PERSON_ID = '42705253' AND qtb.IN_HOSP_DATE BETWEEN '2016-09-13' AND '2017-01-15' GROUP BY qtb.MED_SER_ORG_NO ORDER BY COUNT(*) DESC LIMIT 1 UNION SELECT gyb.MED_SER_ORG_NO FROM gyb WHERE gyb.PERSON_ID = '42705253' AND gyb.IN_HOSP_DATE BETWEEN '2016-09-13' AND '2017-01-15' G... | css |
CREATE TABLE table_11654169_1 (
area_in_1000km²__1930_ VARCHAR,
voivodeship_separate_city VARCHAR
) | List all areas within 1000 km in the city of Lubelskie? | SELECT area_in_1000km²__1930_ FROM table_11654169_1 WHERE voivodeship_separate_city = "lubelskie" | sql_create_context |
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,0)
)
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,... | For those employees who do not work in departments with managers that have ids between 100 and 200, find last_name and employee_id , and visualize them by a bar chart. | SELECT LAST_NAME, EMPLOYEE_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) | nvbench |
CREATE TABLE PostHistory (
Id number,
PostHistoryTypeId number,
PostId number,
RevisionGUID other,
CreationDate time,
UserId number,
UserDisplayName text,
Comment text,
Text text,
ContentLicense text
)
CREATE TABLE ReviewTasks (
Id number,
ReviewTaskTypeId number,
Cr... | Closed questions on which you COMMENTED (and whether they were edited after close). | SELECT Id AS "post_link", Score, ViewCount AS "views", OwnerUserId AS "asker", CreationDate AS "asked", ClosedDate AS "closed", LastEditDate AS "edited", CASE WHEN LastEditDate > ClosedDate THEN 'yes' ELSE 'no' END AS "edited_after_close?" FROM Posts WHERE NOT ClosedDate IS NULL AND Id IN (SELECT DISTINCT PostId FROM C... | sede |
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... | Give me a histogram for what is the first name and GPA of every student that has a GPA lower than average?, could you rank by the y-axis from high to low? | SELECT STU_FNAME, SUM(STU_GPA) FROM STUDENT WHERE STU_GPA < (SELECT AVG(STU_GPA) FROM STUDENT) GROUP BY STU_FNAME ORDER BY SUM(STU_GPA) DESC | nvbench |
CREATE TABLE table_203_61 (
id number,
"rank" number,
"nation" text,
"gold" number,
"silver" number,
"bronze" number,
"total" number
) | the total number of medals won by south africa was how many ? | SELECT "total" FROM table_203_61 WHERE "nation" = 'south africa' | squall |
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... | 从06年7月29日至14年1月26日之间患者陈怡宁所有检验结果指标记录中的仪器名称都叫什么?编号都是什么? | SELECT jyjgzbb.YQBH, jyjgzbb.YQMC FROM person_info JOIN hz_info JOIN txmzjzjlb JOIN jybgb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = txmzjzjlb.YLJGDM AND hz_info.KH = txmzjzjlb.KH AND hz_info.KLX = txmzjzjlb.KLX AND txmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND txmzjzjlb.JZLSH = jybgb.JZLSH_MZJZ... | css |
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... | Show me about the correlation between School_ID and ACC_Percent , and group by attribute All_Road in a scatter chart. | SELECT School_ID, ACC_Percent FROM basketball_match GROUP BY All_Road | nvbench |
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Percent text,
ACC_Home text,
ACC_Road text,
All_Games text,
All_Games_Percent int,
All_Home text,
All_Road text,
All_Neutral text
)
CREATE TABLE university (
Scho... | Visualize a bar chart about the distribution of ACC_Road and Team_ID , and group by attribute All_Home, list ACC_Road in ascending order please. | SELECT ACC_Road, Team_ID FROM basketball_match GROUP BY All_Home, ACC_Road ORDER BY ACC_Road | nvbench |
CREATE TABLE table_name_19 (
silver INTEGER,
nation VARCHAR,
total VARCHAR,
rank VARCHAR
) | What is the sum of Silver when the total is less than 6, the rank is 6 and the Bulgaria is the nation? | SELECT SUM(silver) FROM table_name_19 WHERE total < "6" AND rank = "6" AND nation = "bulgaria" | sql_create_context |
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 lab (
subject_id text,
hadm_id text,
... | what is primary disease and procedure icd9 code of subject id 18077? | SELECT demographic.diagnosis, procedures.icd9_code FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.subject_id = "18077" | mimicsql_data |
CREATE TABLE table_3563 (
"Season" real,
"Series" text,
"Team" text,
"Races" real,
"Wins" real,
"Poles" real,
"F/Laps" real,
"Podiums" real,
"Points" real,
"Position" text
) | how many seasons did he race in team Carlin? | SELECT COUNT("Podiums") FROM table_3563 WHERE "Team" = 'Carlin' | wikisql |
CREATE TABLE table_53835 (
"Year" text,
"Winner" text,
"Jockey" text,
"Trainer" text,
"Owner" text,
"Distance" text,
"Time" text,
"Purse" text
) | Who is the owner of the Raglan Road winner? | SELECT "Owner" FROM table_53835 WHERE "Winner" = 'raglan road' | wikisql |
CREATE TABLE Student (
StuID INTEGER,
LName VARCHAR(12),
Fname VARCHAR(12),
Age INTEGER,
Sex VARCHAR(1),
Major INTEGER,
Advisor INTEGER,
city_code VARCHAR(3)
)
CREATE TABLE Has_Allergy (
StuID INTEGER,
Allergy VARCHAR(20)
)
CREATE TABLE Allergy_Type (
Allergy VARCHAR(20),
... | A bar chart about what are the average ages for male and female students?, and could you rank by the bars in desc? | SELECT Sex, AVG(Age) FROM Student GROUP BY Sex ORDER BY Sex DESC | nvbench |
CREATE TABLE table_name_18 (
code__iata_icao_ VARCHAR,
rank VARCHAR
) | What is the code for rank 10? | SELECT code__iata_icao_ FROM table_name_18 WHERE rank = 10 | sql_create_context |
CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId number
)
CREATE TABLE Users (
Id number,
Reputation number,
CreationDate time,
DisplayName text,
LastAccessDate time,
WebsiteUrl text,
Location text,
AboutMe text,
Views number,
... | Images linked rather than displayed. | SELECT p.Id, p.Body FROM Posts AS p WHERE p.Body LIKE '%http://%.jpg%' AND (NOT p.Body LIKE '%]: http://%' AND NOT p.Body LIKE '%<img src=%') | sede |
CREATE TABLE table_24208 (
"Order" real,
"Couple" text,
"Karen" text,
"Nicky" text,
"Jason" text,
"Ruthie" text,
"Robin" text,
"Total" text,
"Scoreboard" text,
"Song" text,
"Public Vote %" text,
"Result" text
) | Name the jason for public vote being 19.20% | SELECT "Jason" FROM table_24208 WHERE "Public Vote %" = '19.20%' | wikisql |
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
)
... | give me the number of patients whose ethnicity is black/cape verdean and age is less than 89? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "BLACK/CAPE VERDEAN" AND demographic.age < "89" | mimicsql_data |
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... | 在哪几次医疗记录中给病患秦娟丽开出的药品均超过8902.92元?列出所有医疗就诊序列号都是什么? | SELECT qtb.MED_CLINIC_ID FROM qtb WHERE qtb.PERSON_NM = '秦娟丽' AND NOT qtb.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT <= 8902.92) UNION SELECT gyb.MED_CLINIC_ID FROM gyb WHERE gyb.PERSON_NM = '秦娟丽' AND NOT gyb.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUN... | css |
CREATE TABLE table_10757 (
"Year" real,
"Location" text,
"Champion" text,
"Second" text,
"Third" text
) | In Winterberg, who was 3rd the year that Monique Riekewald was 2nd? | SELECT "Third" FROM table_10757 WHERE "Location" = 'winterberg' AND "Second" = 'monique riekewald' | wikisql |
CREATE TABLE airports (
city VARCHAR
) | List the cities which have more than one airport and number of airports. | SELECT city, COUNT(*) FROM airports GROUP BY city HAVING COUNT(*) > 1 | sql_create_context |
CREATE TABLE table_72258 (
"Year" real,
"Premier One" text,
"Premier Two" text,
"Bristol & Somerset" text,
"Glos & Wilts" text,
"Bristol & N. Som" text,
"Somerset" text,
"Gloucestershire" text,
"Wiltshire" text
) | what is the bristol & n. som where the somerset is ashcott and shapwick? | SELECT "Bristol & N. Som" FROM table_72258 WHERE "Somerset" = 'Ashcott and Shapwick' | wikisql |
CREATE TABLE table_19160 (
"Year" real,
"1st District" text,
"2nd District" text,
"3rd District" text,
"4th District" text,
"5th District" text
) | What is the last year that Howard A. Wassum was in the 5th district? | SELECT MAX("Year") FROM table_19160 WHERE "5th District" = 'Howard A. Wassum' | wikisql |
CREATE TABLE table_name_69 (
margin_of_victory VARCHAR,
date VARCHAR
) | What was the margin of victory on Mar 18, 1979? | SELECT margin_of_victory FROM table_name_69 WHERE date = "mar 18, 1979" | sql_create_context |
CREATE TABLE HOTELS (
price_range INTEGER,
star_rating_code VARCHAR,
pets_allowed_yn VARCHAR
) | Show the average price range of hotels that have 5 star ratings and allow pets. | SELECT AVG(price_range) FROM HOTELS WHERE star_rating_code = "5" AND pets_allowed_yn = 1 | sql_create_context |
CREATE TABLE table_25561560_3 (
yacht VARCHAR,
skipper VARCHAR
) | What yacht did Andrew Saies sail on? | SELECT yacht FROM table_25561560_3 WHERE skipper = "Andrew Saies" | sql_create_context |
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
CREATE TABLE zyjzjlb (
CYBQDM text,
CYBQMC text,
CYCWH text,
CYKSDM text,
CYKSMC text,
CYSJ time,
CYZTDM number,
HZXM text,
JZKSDM text,
JZKSMC text,
JZLSH text,
KH text,
KLX number,... | 自2001.10.27起,至2007.12.2止,共有多少医务人员为患者41857706检测指标303435,想知道他们的工号及姓名 | SELECT jyjgzbb.JCRGH, jyjgzbb.JCRXM FROM hz_info JOIN mzjzjlb JOIN jyjgzbb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jyjgzbb.jybgb_YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jyjgzbb.jybgb_JZLSH_MZJZJLB WHERE jyjgzbb.JYRQ BETWEEN '2001-10-27' AND '2007-12-0... | css |
CREATE TABLE table_65323 (
"Year" real,
"Record" text,
"Finish" text,
"Manager" text,
"Playoffs" text
) | Which Record has a Year larger than 1974, and a Finish of 3rd? | SELECT "Record" FROM table_65323 WHERE "Year" > '1974' AND "Finish" = '3rd' | wikisql |
CREATE TABLE table_743 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Result" text,
"Candidates" text
) | What was the result of the election of the incumbent clyde doyle? | SELECT "Result" FROM table_743 WHERE "Incumbent" = 'Clyde Doyle' | wikisql |
CREATE TABLE table_53089 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Date" text
) | Name the home team score when the away team is south melbourne | SELECT "Home team score" FROM table_53089 WHERE "Away team" = 'south melbourne' | wikisql |
CREATE TABLE table_8228 (
"Position" real,
"Name" text,
"Played" real,
"Drawn" real,
"Lost" real,
"Points" real
) | What is the whole of Drawn that has a Played larger than 14? | SELECT SUM("Drawn") FROM table_8228 WHERE "Played" > '14' | wikisql |
CREATE TABLE table_203_330 (
id number,
"year of election" number,
"candidates elected" number,
"# of seats available" number,
"# of votes" number,
"% of popular vote" text
) | year with largest number of candidates selected | SELECT "year of election" FROM table_203_330 ORDER BY "candidates elected" DESC LIMIT 1 | squall |
CREATE TABLE table_train_178 (
"id" int,
"gender" string,
"pregnancy_or_lactation" bool,
"hiv_infection" bool,
"hepatitis_c" bool,
"renal_disease" bool,
"hypoglycemia" bool,
"serum_creatinine" float,
"seizure_disorder" bool,
"body_mass_index_bmi" float,
"NOUSE" float
) | history of severe hypoglycemia ( seizure ) | SELECT * FROM table_train_178 WHERE hypoglycemia = 1 OR seizure_disorder = 1 | criteria2sql |
CREATE TABLE table_name_13 (
tournament VARCHAR,
score VARCHAR
) | What Tournament had a Score of 6 3, 2 6, 6 3? | SELECT tournament FROM table_name_13 WHERE score = "6–3, 2–6, 6–3" | sql_create_context |
CREATE TABLE table_54887 (
"Tournament" text,
"2005" text,
"2006" text,
"2007" text,
"2008" text,
"2009" text,
"2010" text,
"2011" text,
"2012" text,
"2013" text
) | Which tournament in 2013 had a 2010 finish of 1R? | SELECT "2013" FROM table_54887 WHERE "2006" = 'a' AND "2010" = '1r' | wikisql |
CREATE TABLE course_offering (
offering_id int,
course_id int,
semester int,
section_number int,
start_time time,
end_time time,
monday varchar,
tuesday varchar,
wednesday varchar,
thursday varchar,
friday varchar,
saturday varchar,
sunday varchar,
has_final_proje... | What classes are offered next Winter for PreMajor ? | SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester INNER JOIN program_course ON program_course.course_id = course_offering.course_id WHERE program_cour... | advising |
CREATE TABLE table_name_33 (
band INTEGER,
power__w_ INTEGER
) | What Band's Power (W) is 400 or less? | SELECT MAX(band) FROM table_name_33 WHERE power__w_ > 400 | sql_create_context |
CREATE TABLE table_name_47 (
drawn VARCHAR,
club VARCHAR
) | What is the drawn value for furnace united rfc? | SELECT drawn FROM table_name_47 WHERE club = "furnace united rfc" | sql_create_context |
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... | specify age and icd9 code of patient id 52118 | SELECT demographic.age, procedures.long_title FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.subject_id = "52118" | mimicsql_data |
CREATE TABLE table_39299 (
"Outcome" text,
"Date" text,
"Tournament" text,
"Surface" text,
"Partner" text,
"Opponents in the final" text,
"Score" text
) | Which Date has Opponents in the final of valeria casillo lilly raffa? | SELECT "Date" FROM table_39299 WHERE "Opponents in the final" = 'valeria casillo lilly raffa' | wikisql |
CREATE TABLE table_name_16 (
money___ INTEGER,
score VARCHAR
) | What is the most money for the score 75-74-72-67=288? | SELECT MAX(money___) AS $__ FROM table_name_16 WHERE score = 75 - 74 - 72 - 67 = 288 | sql_create_context |
CREATE TABLE month (
month_number int,
month_name text
)
CREATE TABLE flight_fare (
flight_id int,
fare_id int
)
CREATE TABLE flight_leg (
flight_id int,
leg_number int,
leg_flight int
)
CREATE TABLE time_zone (
time_zone_code text,
time_zone_name text,
hours_from_gmt int
)
C... | give me a combination of CO flights from CHICAGO to SEATTLE that have meals early saturday morning | SELECT DISTINCT flight_id FROM flight WHERE (((((flight_days IN (SELECT DAYSalias0.days_code FROM days AS DAYSalias0 WHERE DAYSalias0.day_name IN (SELECT DATE_DAYalias0.day_name FROM date_day AS DATE_DAYalias0 WHERE DATE_DAYalias0.day_number = 26 AND DATE_DAYalias0.month_number = 7 AND DATE_DAYalias0.year = 1991)) AND ... | atis |
CREATE TABLE table_name_73 (
team__number1 VARCHAR
) | What was the team Unics Kazan's 1st leg score? | SELECT 1 AS st_leg FROM table_name_73 WHERE team__number1 = "unics kazan" | sql_create_context |
CREATE TABLE table_name_62 (
bronze INTEGER,
total VARCHAR,
gold VARCHAR,
silver VARCHAR
) | What is the sum of the Bronze medals when the Gold medals are larger than 0, Silver medals are smaller than 1, and the total is smaller than 1? | SELECT SUM(bronze) FROM table_name_62 WHERE gold > 0 AND silver < 1 AND total < 1 | sql_create_context |
CREATE TABLE table_15717093_1 (
title VARCHAR,
us_viewers__millions_ VARCHAR
) | What was the title when there were 14.39 million viewers? | SELECT title FROM table_15717093_1 WHERE us_viewers__millions_ = "14.39" | sql_create_context |
CREATE TABLE table_name_98 (
league_cup_goals INTEGER,
total_apps VARCHAR,
fa_cup_apps VARCHAR,
league_cup_apps VARCHAR,
league_goals VARCHAR
) | what is the average league cup goals when the league cup apps is 4, league goals is less than 4, fa cup apps is 1 and total apps is 35? | SELECT AVG(league_cup_goals) FROM table_name_98 WHERE league_cup_apps = 4 AND league_goals < 4 AND fa_cup_apps = "1" AND total_apps = "35" | sql_create_context |
CREATE TABLE table_69607 (
"Tournament" text,
"2006" text,
"2007" text,
"2008" text,
"2009" text,
"2010" text,
"2011" text,
"2012" text
) | Which tournament has a 2007 of 2r, and a 2011 of 2r? | SELECT "Tournament" FROM table_69607 WHERE "2007" = '2r' AND "2011" = '2r' | wikisql |
CREATE TABLE table_name_69 (
position VARCHAR,
team_from VARCHAR
) | What is the position of the team player from Aik? | SELECT position FROM table_name_69 WHERE team_from = "aik" | sql_create_context |
CREATE TABLE table_name_93 (
year_born__age_ VARCHAR,
height VARCHAR,
current_club VARCHAR
) | What is the Year born (Age) for the player who is taller than 2.04 and currently plays for the Los Angeles Clippers? | SELECT year_born__age_ FROM table_name_93 WHERE height > 2.04 AND current_club = "los angeles clippers" | sql_create_context |
CREATE TABLE table_name_70 (
games VARCHAR,
name VARCHAR
) | Which game is named tsegay kebede category:articles with hcards? | SELECT games FROM table_name_70 WHERE name = "tsegay kebede category:articles with hcards" | sql_create_context |
CREATE TABLE Customers (
customer_id INTEGER,
customer_first_name VARCHAR(20),
customer_last_name VARCHAR(20),
customer_address VARCHAR(255),
customer_phone VARCHAR(255),
customer_email VARCHAR(255),
other_customer_details VARCHAR(255)
)
CREATE TABLE Accounts (
account_id INTEGER,
c... | Bar graph to show sum card number from different card type code, could you rank Y from high to low order? | SELECT card_type_code, SUM(card_number) FROM Customers_Cards GROUP BY card_type_code ORDER BY SUM(card_number) DESC | nvbench |
CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
LOCATION_ID decimal(4,0)
)
CREATE TABLE locations (
LOCATION_ID decimal(4,0),
STREET_ADDRESS varchar(40),
POSTAL_CODE varchar(12),
CITY varchar(30),
STATE_PROVINCE varchar(25... | For those employees who do not work in departments with managers that have ids between 100 and 200, a line chart shows the trend of salary over hire_date , I want to order by the X in ascending. | SELECT HIRE_DATE, SALARY FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY HIRE_DATE | nvbench |
CREATE TABLE dorm (
dormid number,
dorm_name text,
student_capacity number,
gender text
)
CREATE TABLE student (
stuid number,
lname text,
fname text,
age number,
sex text,
major number,
advisor number,
city_code text
)
CREATE TABLE dorm_amenity (
amenid number,
... | Find the first and last name of students who are not in the largest major. | SELECT fname, lname FROM student WHERE major <> (SELECT major FROM student GROUP BY major ORDER BY COUNT(*) DESC LIMIT 1) | spider |
CREATE TABLE table_16244 (
"No. in series" real,
"No. in season" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Featured character(s)" text,
"Original air date" text,
"U.S. viewers (million)" text
) | Who directed the episode where u.s. viewers (million) is 12.90? | SELECT "Directed by" FROM table_16244 WHERE "U.S. viewers (million)" = '12.90' | wikisql |
CREATE TABLE table_17323042_11 (
high_assists VARCHAR,
game VARCHAR
) | Who was the High Assist in game 1? | SELECT high_assists FROM table_17323042_11 WHERE game = 1 | sql_create_context |
CREATE TABLE VOTING_RECORD (
Secretary_Vote VARCHAR,
ELECTION_CYCLE VARCHAR
) | What are the distinct secretary votes in the fall election cycle? | SELECT DISTINCT Secretary_Vote FROM VOTING_RECORD WHERE ELECTION_CYCLE = "Fall" | sql_create_context |
CREATE TABLE table_name_98 (
first_elected VARCHAR,
district VARCHAR
) | What is the first elected date for the incumbent in the South Carolina 4 district? | SELECT first_elected FROM table_name_98 WHERE district = "south carolina 4" | sql_create_context |
CREATE TABLE table_1849243_1 (
viewers__in_millions_ VARCHAR,
run_time VARCHAR
) | How many viewers in millions watched the episode 23:55 minutes long? | SELECT viewers__in_millions_ FROM table_1849243_1 WHERE run_time = "23:55" | sql_create_context |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.