context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
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 prereq ( course_id varchar(8), prereq_id varchar(8) ) CREATE TABLE section ( course_id varchar(8), sec_id varchar(8), semeste...
What is the lowest salary in departments with average salary greater than the overall average Plot them as bar chart, and sort dept_name in ascending order.
SELECT dept_name, MIN(salary) FROM instructor GROUP BY dept_name ORDER BY dept_name
nvbench
CREATE TABLE table_80413 ( "Team 1" text, "Agg." text, "Team 2" text, "1st leg" text, "2nd leg" text )
When Kabwe Warriors (team 1) played, what was the result of the 1st leg?
SELECT "1st leg" FROM table_80413 WHERE "Team 1" = 'kabwe warriors'
wikisql
CREATE TABLE table_25780 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text )
How many times was the high points david lee (30)
SELECT COUNT("Date") FROM table_25780 WHERE "High points" = 'David Lee (30)'
wikisql
CREATE TABLE table_name_44 ( to_par VARCHAR, player VARCHAR )
WHAT IS THE TO PAR FOR ERNIE ELS?
SELECT to_par FROM table_name_44 WHERE player = "ernie els"
sql_create_context
CREATE TABLE table_name_46 ( score VARCHAR, record VARCHAR )
What is the score of the game that resulted in a 15-9 record?
SELECT score FROM table_name_46 WHERE record = "15-9"
sql_create_context
CREATE TABLE table_75052 ( "Date" text, "Result" text, "Score" text, "Brazil scorers" text, "Competition" text )
What is the result of the International Friendly competition on May 15, 1966?
SELECT "Result" FROM table_75052 WHERE "Competition" = 'international friendly' AND "Date" = 'may 15, 1966'
wikisql
CREATE TABLE table_59006 ( "Engine" text, "Power" text, "Torque" text, "0\u2013100km/h (62mph)" text, "Top speed" text )
What is the torque of the 5.8l v12 engine?
SELECT "Torque" FROM table_59006 WHERE "Engine" = '5.8l v12'
wikisql
CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE Badges ( Id number, UserId number, Name text, Date time, Class number, TagBased boolean ) CREATE TABLE ReviewTasks ( Id number, ReviewTaskTypeId number, CreationDate time, DeletionDate time, ReviewTa...
Number of answers a user has for a specific tag. Load all posts a certain user upvoted and filter by tag (tag1)
SELECT COUNT(*) FROM Users AS u JOIN Posts AS p ON p.OwnerUserId = u.Id JOIN Posts AS q ON q.Id = p.ParentId JOIN PostTags AS pt ON pt.PostId = q.Id JOIN Tags AS t ON t.Id = pt.TagId WHERE u.Id = '##UserId##' AND p.PostTypeId = 2 AND t.TagName IN ('##Tag1:string##')
sede
CREATE TABLE table_name_44 ( grid INTEGER, laps INTEGER )
What is the maximum grid when the laps were greater than 22?
SELECT MAX(grid) FROM table_name_44 WHERE laps > 22
sql_create_context
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,...
give me the number of patients whose diagnoses short title is subarachnoid hemorrhage and drug route is iv bolus?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.short_title = "Subarachnoid hemorrhage" AND prescriptions.route = "IV BOLUS"
mimicsql_data
CREATE TABLE table_27334 ( "Episode No." text, "Prod No." real, "Title" text, "Directed by" text, "Written by" text, "Original UK airdate" text )
When don inglis and ralph smart are the writers how many episode numbers are there?
SELECT COUNT("Episode No.") FROM table_27334 WHERE "Written by" = 'Don Inglis and Ralph Smart'
wikisql
CREATE TABLE table_name_60 ( Id VARCHAR )
What shows for 2010 when 2005 shows 1r?
SELECT 2010 FROM table_name_60 WHERE 2005 = "1r"
sql_create_context
CREATE TABLE table_name_84 ( catalog VARCHAR, label VARCHAR, format VARCHAR )
Name the catalog for alfa records and cd format
SELECT catalog FROM table_name_84 WHERE label = "alfa records" AND format = "cd"
sql_create_context
CREATE TABLE table_name_67 ( laps VARCHAR, rank VARCHAR, start VARCHAR )
Name the laps for rank of 14 and start of 16
SELECT laps FROM table_name_67 WHERE rank = "14" AND start = "16"
sql_create_context
CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL ) CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER )
For those records from the products and each product's manufacturer, return a scatter chart about the correlation between code and code , and group by attribute name.
SELECT T1.Code, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Name
nvbench
CREATE TABLE compartment_class ( compartment varchar, class_type varchar ) CREATE TABLE time_interval ( period text, begin_time int, end_time int ) CREATE TABLE class_of_service ( booking_class varchar, rank int, class_description text ) CREATE TABLE city ( city_code varchar, ...
MEMPHIS to LAS VEGAS sunday afternoon
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 = 27 AND DATE_DAYalias0.month_number = 8 AND DATE_DAYalias0.year = 1991)) AND to...
atis
CREATE TABLE table_28317 ( "City / Municipality" text, "Date of Creation" text, "Area (km 2 )" text, "Population (2010)" real, "Income Classification ( DOF )" text )
How many city/municipalties have an area (km2) of 506.64?
SELECT COUNT("City / Municipality") FROM table_28317 WHERE "Area (km 2 )" = '506.64'
wikisql
CREATE TABLE company ( main_industry VARCHAR )
Show all main industry for all companies.
SELECT DISTINCT main_industry FROM company
sql_create_context
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 jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) ) CREATE TABLE departments ( DEP...
For those employees whose salary is in the range of 8000 and 12000 and commission is not null or department number does not equal to 40, draw a bar chart about the distribution of job_id and the sum of department_id , and group by attribute job_id, and sort total number in asc order.
SELECT JOB_ID, SUM(DEPARTMENT_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 GROUP BY JOB_ID ORDER BY SUM(DEPARTMENT_ID)
nvbench
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, ...
what is procedure icd9 code and procedure long title of subject name jerry deberry?
SELECT procedures.icd9_code, procedures.long_title FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.name = "Jerry Deberry"
mimicsql_data
CREATE TABLE table_17739 ( "Team" text, "Car(s)" text, "#" real, "Driver(s)" text, "Primary Sponsor(s)" text, "Owner(s)" text, "Crew Chief" text )
What is the biggest number of the team who's owned by Jeff Gordon?
SELECT MAX("#") FROM table_17739 WHERE "Owner(s)" = 'Jeff Gordon'
wikisql
CREATE TABLE PostsWithDeleted ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId number, OwnerDisplayName text, LastEditorUserId number, LastEditorDispl...
What does raw data look like.
SELECT * FROM "dbo".Posts
sede
CREATE TABLE table_77000 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Kickoff Time" text, "Attendance" text )
What was the kickoff time on week 1?
SELECT "Kickoff Time" FROM table_77000 WHERE "Week" = '1'
wikisql
CREATE TABLE table_name_24 ( years_in_the_acc VARCHAR, founded VARCHAR, location VARCHAR )
What are the years in the ACC of an institution that was founded before 1885 and is located in College Park, Maryland?
SELECT years_in_the_acc FROM table_name_24 WHERE founded < 1885 AND location = "college park, maryland"
sql_create_context
CREATE TABLE table_27961684_1 ( enrollment INTEGER, team_name VARCHAR )
How many people enrolled for the institute with the Pioneers?
SELECT MIN(enrollment) FROM table_27961684_1 WHERE team_name = "Pioneers"
sql_create_context
CREATE TABLE table_76433 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "TV Time" text, "Attendance" text )
WHAT IS THE TV TIME WOTH A WEEK BIGGER THAN 15, WITH THE OAKLAND RAIDERS AS OPPONENT?
SELECT "TV Time" FROM table_76433 WHERE "Week" > '15' AND "Opponent" = 'oakland raiders'
wikisql
CREATE TABLE table_name_55 ( silver INTEGER, gold VARCHAR, rank VARCHAR, nation VARCHAR )
What is the highest silver that has 9 as the rank, germany as the nation, with a gold less than 0?
SELECT MAX(silver) FROM table_name_55 WHERE rank = 9 AND nation = "germany" AND gold < 0
sql_create_context
CREATE TABLE table_28120 ( "Series #" real, "Season #" real, "Title" text, "Director" text, "Writer(s)" text, "Airdate" text )
How many directors worked on #158?
SELECT COUNT("Director") FROM table_28120 WHERE "Series #" = '158'
wikisql
CREATE TABLE table_26538461_2 ( metrical_equivalence VARCHAR, portuguese_name VARCHAR )
Name the metrical equivalence for linha
SELECT metrical_equivalence FROM table_26538461_2 WHERE portuguese_name = "Linha"
sql_create_context
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREAT...
when was patient 028-66126 for the last time leaving the hospital in 2104?
SELECT patient.hospitaldischargetime FROM patient WHERE patient.uniquepid = '028-66126' AND STRFTIME('%y', patient.hospitaldischargetime) = '2104' ORDER BY patient.hospitaldischargetime DESC LIMIT 1
eicu
CREATE TABLE table_50511 ( "Rider" text, "Manufacturer" text, "Laps" real, "Time/Retired" text, "Grid" real )
WHAT IS THE GRID WITH AN ACCIDENT AND HONDA MANUFACTURER?
SELECT MAX("Grid") FROM table_50511 WHERE "Time/Retired" = 'accident' AND "Manufacturer" = 'honda'
wikisql
CREATE TABLE table_6804 ( "Round" text, "Year" real, "Team" text, "Opponent" text, "Goals" real, "Behinds" real )
What is the goals for Round 15?
SELECT "Goals" FROM table_6804 WHERE "Round" = 'round 15'
wikisql
CREATE TABLE table_68682 ( "Title" text, "Year" text, "Developer" text, "Publisher" text, "Platform" text )
Which title was developed by Battlecry Studios?
SELECT "Title" FROM table_68682 WHERE "Developer" = 'battlecry studios'
wikisql
CREATE TABLE airline ( airline_code varchar, airline_name text, note text ) CREATE TABLE dual_carrier ( main_airline varchar, low_flight_number int, high_flight_number int, dual_airline varchar, service_name text ) CREATE TABLE food_service ( meal_code text, meal_number int, ...
what airlines fly from BOSTON to SAN FRANCISCO
SELECT DISTINCT airline.airline_code FROM airline, 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 = 'BOSTON' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_na...
atis
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 COURSE ( CRS_CODE varchar(10), DEPT_CODE varchar(10), CRS_DESCRIPTION varchar(35), CRS_CREDIT float(8) ) CREATE...
Show the number of courses for each course description in a bar chart, could you order bar from high to low order?
SELECT CRS_DESCRIPTION, COUNT(CRS_DESCRIPTION) FROM CLASS AS T1 JOIN EMPLOYEE AS T2 ON T1.PROF_NUM = T2.EMP_NUM JOIN COURSE AS T3 ON T1.CRS_CODE = T3.CRS_CODE GROUP BY CRS_DESCRIPTION ORDER BY CRS_DESCRIPTION DESC
nvbench
CREATE TABLE table_name_9 ( round VARCHAR, opponent VARCHAR, date VARCHAR )
What round did the celtic played away on 24 february 1900?
SELECT round FROM table_name_9 WHERE opponent = "celtic" AND date = "24 february 1900"
sql_create_context
CREATE TABLE table_name_47 ( expected_speed_up† VARCHAR, application VARCHAR )
What is the expected speed up of the gpu-hmmer application?
SELECT expected_speed_up† FROM table_name_47 WHERE application = "gpu-hmmer"
sql_create_context
CREATE TABLE table_52311 ( "Name" text, "Years" text, "Gender" text, "Area" text, "Authority" text, "Decile" real, "Roll" real )
What is the name of the school in Hillcrest?
SELECT "Name" FROM table_52311 WHERE "Area" = 'hillcrest'
wikisql
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...
沈雅懿患者的检验报告单对应的检验结果指标均异常都是哪些?列出对应的检验报告单号都是啥?
SELECT jybgb.BGDH FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE person_info.XM = '沈雅懿' AND NOT ...
css
CREATE TABLE table_18904831_7 ( game INTEGER, date VARCHAR )
What was # of the first game played on August 20?
SELECT MIN(game) FROM table_18904831_7 WHERE date = "August 20"
sql_create_context
CREATE TABLE table_name_50 ( class_aAA VARCHAR, school_year VARCHAR )
what AAA class has a school year of 1989-90?
SELECT class_aAA FROM table_name_50 WHERE school_year = "1989-90"
sql_create_context
CREATE TABLE table_name_55 ( played VARCHAR, tries_for VARCHAR )
What was the played with 38 tries?
SELECT played FROM table_name_55 WHERE tries_for = "38"
sql_create_context
CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number,...
what lab test was given for the first time in 05/last year to patient 12572?
SELECT d_labitems.label FROM d_labitems WHERE d_labitems.itemid IN (SELECT labevents.itemid FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 12572) AND DATETIME(labevents.charttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') ...
mimic_iii
CREATE TABLE table_31621 ( "Year" text, "Men's singles" text, "Women's singles" text, "Men's doubles" text, "Women's doubles" text )
Who played women's singles in 1955?
SELECT "Women's singles" FROM table_31621 WHERE "Year" = '1955'
wikisql
CREATE TABLE flight_leg ( flight_id int, leg_number int, leg_flight int ) CREATE TABLE dual_carrier ( main_airline varchar, low_flight_number int, high_flight_number int, dual_airline varchar, service_name text ) CREATE TABLE state ( state_code text, state_name text, countr...
i need flight information for flights departing from CLEVELAND going back to MILWAUKEE wednesday after 1700
SELECT DISTINCT flight_id FROM flight WHERE (((departure_time > 1700 AND 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 = 23 AND DATE_DAYalias0.month_number = 4 AND DATE_DAYa...
atis
CREATE TABLE table_name_60 ( attendance VARCHAR, decision VARCHAR, home VARCHAR )
What is the number of people in attendance when the decision was brodeur and the home was ottawa?
SELECT attendance FROM table_name_60 WHERE decision = "brodeur" AND home = "ottawa"
sql_create_context
CREATE TABLE table_204_160 ( id number, "rank" number, "name" text, "nationality" text, "time" text, "notes" text )
what are the names of each of the australian competitors ?
SELECT "name" FROM table_204_160 WHERE "nationality" = 'australia'
squall
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...
what is the number of patients whose religion is catholic and lab test name is absolute cd3 count?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.religion = "CATHOLIC" AND lab.label = "Absolute CD3 Count"
mimicsql_data
CREATE TABLE table_70678 ( "Name" text, "Pennant" text, "Builder" text, "Laid Down" text, "Launched" text, "Commissioned" text )
Tell me the name for commissioned of 30 august 1941 and laid down of 22 september 1939
SELECT "Name" FROM table_70678 WHERE "Laid Down" = '22 september 1939' AND "Commissioned" = '30 august 1941'
wikisql
CREATE TABLE table_13036251_1 ( runner_up VARCHAR, season VARCHAR )
what's runner-up with season being season 13
SELECT runner_up FROM table_13036251_1 WHERE season = "season 13"
sql_create_context
CREATE TABLE aircraft ( aircraft_code varchar, aircraft_description varchar, manufacturer varchar, basic_type varchar, engines int, propulsion varchar, wide_body varchar, wing_span int, length int, weight int, capacity int, pay_load int, cruising_speed int, range_...
how many flights does EA have from BOSTON to ATLANTA
SELECT COUNT(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 = 'BOSTON' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = ...
atis
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...
张承悦这位患者自04.12.30起,到08.2.28止,到医院就诊的次数是多少
SELECT (SELECT COUNT(*) FROM hz_info JOIN mzjzjlb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX WHERE hz_info.person_info_XM = '张承悦' AND mzjzjlb.JZKSRQ BETWEEN '2004-12-30' AND '2008-02-28') + (SELECT COUNT(*) FROM hz_info JOIN zyjzjlb ON hz_info.YLJGDM = zyjzjlb.YLJGDM AN...
css
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_DIRE_CD text, MED_DIRE_NM text,...
列出医院5003066非科室小儿屈光科负责的在二零一二年十月一号到二零一九年十一月二十四号内全部医疗就诊记录
SELECT * FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '5003066' AND t_kc21.IN_HOSP_DATE BETWEEN '2012-10-01' AND '2019-11-24' EXCEPT SELECT * FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '5003066' AND t_kc21.IN_HOSP_DATE BETWEEN '2012-10-01' AND '2019-11-24' AND t_kc21.MED_ORG_DEPT_NM = '小儿屈光科'
css
CREATE TABLE table_27722734_7 ( game INTEGER, date VARCHAR )
Name the most game for december 1
SELECT MAX(game) FROM table_27722734_7 WHERE date = "December 1"
sql_create_context
CREATE TABLE table_204_268 ( id number, "album/single" text, "performer" text, "year" number, "variant" text, "notes" text )
which album has the same name as its performer ?
SELECT "album/single" FROM table_204_268 WHERE "album/single" = "performer"
squall
CREATE TABLE hz_info_zyjzjlb ( JZLSH number, YLJGDM number, zyjzjlb_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, ...
把患者云成双在医院5772837住院的就诊记录列出来,选择入院时的科室名字有免疫科的记录
SELECT * FROM person_info JOIN hz_info JOIN zyjzjlb JOIN hz_info_zyjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = hz_info_zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX AND hz_info_zyjzjlb.JZLSH = zyjzjlb.JZLSH AND hz_info_zyjzjlb.YLJGDM = hz_info_zyjzjlb.YLJGDM AND hz_info_zyjz...
css
CREATE TABLE table_name_10 ( round INTEGER, college_junior_club_team__league_ VARCHAR )
Which Round is the highest one that has a College/Junior/Club Team (League) of torpedo yaroslavl (rus)?
SELECT MAX(round) FROM table_name_10 WHERE college_junior_club_team__league_ = "torpedo yaroslavl (rus)"
sql_create_context
CREATE TABLE venue ( venueid int, venuename varchar ) CREATE TABLE cite ( citingpaperid int, citedpaperid int ) CREATE TABLE paperkeyphrase ( paperid int, keyphraseid int ) CREATE TABLE dataset ( datasetid int, datasetname varchar ) CREATE TABLE paperfield ( fieldid int, pape...
datasets for knn
SELECT DISTINCT dataset.datasetid FROM dataset, keyphrase, paperdataset, paperkeyphrase WHERE keyphrase.keyphrasename = 'knn' AND paperdataset.datasetid = dataset.datasetid AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paperkeyphrase.paperid = paperdataset.paperid
scholar
CREATE TABLE table_name_39 ( qual_2 VARCHAR, team VARCHAR, best VARCHAR )
What was the second qualification time for Dale Coyne Racing with a best of 1:03.757?
SELECT qual_2 FROM table_name_39 WHERE team = "dale coyne racing" AND best = "1:03.757"
sql_create_context
CREATE TABLE table_44140 ( "Season" real, "Wins" real, "Poles" real, "Podiums" real, "Position" text )
What is the sum of Poles, when Season is greater than 2004, and when Podiums is less than 1?
SELECT SUM("Poles") FROM table_44140 WHERE "Season" < '2004' AND "Podiums" < '1'
wikisql
CREATE TABLE table_15827397_1 ( locomotive_type VARCHAR, status VARCHAR )
Which locomotive type has a status in static display
SELECT locomotive_type FROM table_15827397_1 WHERE status = "Static display"
sql_create_context
CREATE TABLE table_44092 ( "Usage" text, "Class" text, "Performance" text, "Performance test" text, "Particulate size approaching 100% retention" text, "Test Standard" text )
Which Performance has a Usage of hepa and a Class of h14?
SELECT "Performance" FROM table_44092 WHERE "Usage" = 'hepa' AND "Class" = 'h14'
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 procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses ( ...
what is procedure short title and lab test name of subject name michelle skidmore?
SELECT procedures.short_title, lab.label FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.name = "Michelle Skidmore"
mimicsql_data
CREATE TABLE table_204_392 ( id number, "#" number, "stadium" text, "capacity" number, "city" text, "country" text, "domed or retractable roof" text )
which country has the most stadiums with a capacity of more than 70,000 ?
SELECT "country" FROM table_204_392 WHERE "capacity" > 70000 GROUP BY "country" ORDER BY COUNT("stadium") DESC LIMIT 1
squall
CREATE TABLE table_11929 ( "Number & name" text, "Description" text, "Current status" text, "Livery" text, "Date" text )
What is the name and number in 1964?
SELECT "Number & name" FROM table_11929 WHERE "Date" = '1964'
wikisql
CREATE TABLE Claims ( Claim_ID INTEGER, Policy_ID INTEGER, Date_Claim_Made DATE, Date_Claim_Settled DATE, Amount_Claimed INTEGER, Amount_Settled INTEGER ) CREATE TABLE Customers ( Customer_ID INTEGER, Customer_Details VARCHAR(255) ) CREATE TABLE Payments ( Payment_ID INTEGER, S...
Sum the amount for all the payments processed with Visa of each day of week using a bar chart, show Y from low to high order please.
SELECT Date_Payment_Made, SUM(Amount_Payment) FROM Payments WHERE Payment_Method_Code = 'Visa' ORDER BY SUM(Amount_Payment)
nvbench
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 prescriptions...
how many dead/expired discharged patients were admitted before the year 2145?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.discharge_location = "DEAD/EXPIRED" AND demographic.admityear < "2145"
mimicsql_data
CREATE TABLE comment_instructor ( instructor_id int, student_id int, score int, comment_text varchar ) CREATE TABLE course_prerequisite ( pre_course_id int, course_id int ) CREATE TABLE course_offering ( offering_id int, course_id int, semester int, section_number int, star...
What class is easier , EECS 537 or EECS 401 ?
SELECT DISTINCT course.number FROM course INNER JOIN program_course ON program_course.course_id = course.course_id WHERE (course.number = 537 OR course.number = 401) AND program_course.workload = (SELECT MIN(PROGRAM_COURSEalias1.workload) FROM program_course AS PROGRAM_COURSEalias1 INNER JOIN course AS COURSEalias1 ON ...
advising
CREATE TABLE table_name_59 ( average INTEGER, games VARCHAR, w_l_t VARCHAR, season VARCHAR )
Which Average that has a W-L-T of 5-1, and a Season smaller than 2001, and Games smaller than 6?
SELECT AVG(average) FROM table_name_59 WHERE w_l_t = "5-1" AND season < 2001 AND games < 6
sql_create_context
CREATE TABLE table_29239 ( "City" text, "Population" real, "Registered voters" text, "Democratic" text, "Republican" text, "D\u2013R spread" text, "Other" text, "No party preference" text )
What is the percentage of registered voters in which the d-r spread is +14.3%?
SELECT "Registered voters" FROM table_29239 WHERE "D\u2013R spread" = '+14.3%'
wikisql
CREATE TABLE table_1315616_1 ( kōhaku__number VARCHAR, red_team_host VARCHAR )
In what number k haku was the red team host Peggy Hayama?
SELECT kōhaku__number FROM table_1315616_1 WHERE red_team_host = "Peggy Hayama"
sql_create_context
CREATE TABLE table_name_25 ( date_of_vacancy VARCHAR, position_in_table VARCHAR, outgoing_manager VARCHAR )
what is the date of vacancy when the position in table is 16th and the outgoing manager is russell slade?
SELECT date_of_vacancy FROM table_name_25 WHERE position_in_table = "16th" AND outgoing_manager = "russell slade"
sql_create_context
CREATE TABLE table_204_986 ( id number, "#" number, "event year" number, "season" text, "flag bearer" text )
who bore the flag the olympics after henry smith bore the flag ?
SELECT "flag bearer" FROM table_204_986 WHERE "event year" > (SELECT "event year" FROM table_204_986 WHERE "flag bearer" = 'henry smith') ORDER BY "event year" LIMIT 1
squall
CREATE TABLE table_67852 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" real, "Record" text )
Which opponent lost with pitcher Kinney (0-1)?
SELECT "Opponent" FROM table_67852 WHERE "Loss" = 'kinney (0-1)'
wikisql
CREATE TABLE table_56601 ( "Season" text, "Club" text, "League" text, "Apps." real, "Goals" real )
What are the average apps for the Major League Soccer team club for the Seattle Sounders FC that has goals less than 0?
SELECT AVG("Apps.") FROM table_56601 WHERE "League" = 'major league soccer' AND "Club" = 'seattle sounders fc' AND "Goals" < '0'
wikisql
CREATE TABLE mzjzjlb_jybgb ( YLJGDM_MZJZJLB text, BGDH number, YLJGDM number ) CREATE TABLE mzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH text, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, ...
列出患者柳阳文所有检验结果指标记录的检测人为61543019的检验指标流水号有多少在在2007-05-14到2020-07-28内?
SELECT jyjgzbb.JYZBLSH FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN mzjzjlb_jybgb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = mzjzjlb_jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_...
css
CREATE TABLE table_name_33 ( created INTEGER, map_number VARCHAR )
What is the earliest created year when the map# was 10?
SELECT MIN(created) FROM table_name_33 WHERE map_number = 10
sql_create_context
CREATE TABLE table_name_28 ( greek_designation VARCHAR, city VARCHAR )
What's the greek designation of the city riverside?
SELECT greek_designation FROM table_name_28 WHERE city = "riverside"
sql_create_context
CREATE TABLE table_name_83 ( network VARCHAR, year VARCHAR, colour_commentator_s_ VARCHAR )
For which network was Chris Walby the color commentator after 1990?
SELECT network FROM table_name_83 WHERE year > 1990 AND colour_commentator_s_ = "chris walby"
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, ...
provide the number of patients whose admission type is urgent and lab test name is albumin, pleural?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_type = "URGENT" AND lab.label = "Albumin, Pleural"
mimicsql_data
CREATE TABLE table_1598533_8 ( public_debt__percentage_of_gdp__2013_q1_ VARCHAR, gdp__percentage_of_eu__2012_ VARCHAR )
What is the public debt % of GDP in 2013 Q1 with a 4.7% GDP of EU in 2012?
SELECT public_debt__percentage_of_gdp__2013_q1_ FROM table_1598533_8 WHERE gdp__percentage_of_eu__2012_ = "4.7%"
sql_create_context
CREATE TABLE Sales ( sales_transaction_id INTEGER, sales_details VARCHAR(255) ) CREATE TABLE Transactions ( transaction_id INTEGER, investor_id INTEGER, transaction_type_code VARCHAR(10), date_of_transaction DATETIME, amount_of_transaction DECIMAL(19,4), share_count VARCHAR(40), oth...
Bin all date of transactions into the YEAR interval, and sum the share count of each bin What is the trend?, and list in asc by the x axis please.
SELECT date_of_transaction, SUM(share_count) FROM Transactions ORDER BY date_of_transaction
nvbench
CREATE TABLE table_16799784_12 ( name VARCHAR, longitude VARCHAR )
What is every name for longitude of 152.0E?
SELECT name FROM table_16799784_12 WHERE longitude = "152.0E"
sql_create_context
CREATE TABLE mediatype ( mediatypeid number, name text ) CREATE TABLE invoiceline ( invoicelineid number, invoiceid number, trackid number, unitprice number, quantity number ) CREATE TABLE customer ( customerid number, firstname text, lastname text, company text, addres...
Find the average unit price for a track.
SELECT AVG(unitprice) FROM track
spider
CREATE TABLE table_name_78 ( season VARCHAR, losses VARCHAR, points VARCHAR, games VARCHAR )
Which season has less than 26 points, more than 18 games, and exactly 13 losses?
SELECT season FROM table_name_78 WHERE points < 26 AND games > 18 AND losses = 13
sql_create_context
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, ...
自2002年1月29日起,截止到2014年8月8日,医疗机构5160324的外地住院就诊有多少
SELECT COUNT(*) FROM zyjzjlb WHERE YLJGDM = '5160324' AND RYDJSJ BETWEEN '2002-01-29' AND '2014-08-08' AND WDBZ > 0
css
CREATE TABLE Locations ( Location_ID INTEGER, Location_Name VARCHAR(255), Address VARCHAR(255), Other_Details VARCHAR(255) ) CREATE TABLE Museums ( Museum_ID INTEGER, Museum_Details VARCHAR(255) ) CREATE TABLE Staff ( Staff_ID INTEGER, Tourist_Attraction_ID INTEGER, Name VARCHAR(40...
List all the possible ways to get to attractions, together with the number of attractions accessible by these methods in a bar chart, rank from high to low by the bars please.
SELECT How_to_Get_There, COUNT(*) FROM Tourist_Attractions GROUP BY How_to_Get_There ORDER BY How_to_Get_There DESC
nvbench
CREATE TABLE table_name_74 ( obesity_rank INTEGER, obese_children_and_adolescents VARCHAR )
What's the rank when the obese children and adolescent count is 14.2%?
SELECT SUM(obesity_rank) FROM table_name_74 WHERE obese_children_and_adolescents = "14.2%"
sql_create_context
CREATE TABLE table_20532 ( "#" real, "Air Date" text, "Timeslot" text, "Rating" text, "Share" real, "18-49" text, "Viewers" text, "Weekly Rank" text )
What is the total number of viewers where the share is 7 and the week rank is 64?
SELECT COUNT("Viewers") FROM table_20532 WHERE "Share" = '7' AND "Weekly Rank" = '64'
wikisql
CREATE TABLE table_name_25 ( minutes INTEGER, games_played VARCHAR )
What is the lowest minutes a goalkeeper with 13 games played has?
SELECT MIN(minutes) FROM table_name_25 WHERE games_played = 13
sql_create_context
CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE icustays ( row_id number, subject_id number, h...
how many times is the bupivacaine until 1 year ago prescribed to patient 90165?
SELECT COUNT(*) FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 90165) AND prescriptions.drug = 'bupivacaine' AND DATETIME(prescriptions.startdate) <= DATETIME(CURRENT_TIME(), '-1 year')
mimic_iii
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...
统计医疗记录中入院诊断为S20.783的在医院7357954最低医疗费总额和最高医疗费总额分别是多少?
SELECT MIN(t_kc24.MED_AMOUT), MAX(t_kc24.MED_AMOUT) FROM t_kc24 WHERE t_kc24.MED_CLINIC_ID IN (SELECT qtb.MED_CLINIC_ID FROM qtb WHERE qtb.MED_SER_ORG_NO = '7357954' AND qtb.IN_DIAG_DIS_CD = 'S20.783' UNION SELECT gyb.MED_CLINIC_ID FROM gyb WHERE gyb.MED_SER_ORG_NO = '7357954' AND gyb.IN_DIAG_DIS_CD = 'S20.783' UNION S...
css
CREATE TABLE table_name_94 ( length VARCHAR, circuit VARCHAR, class VARCHAR )
What is the length of the Laguna Seca Raceway circuit with a class of gtu?
SELECT length FROM table_name_94 WHERE circuit = "laguna seca raceway" AND class = "gtu"
sql_create_context
CREATE TABLE made_by ( id int, msid int, pid 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 writer ( wid int, gender text, name text, nationality text, ...
What is the number of movies featuring ' Brad Pitt ' ?
SELECT COUNT(DISTINCT (movie.title)) FROM actor, cast, movie WHERE actor.name = 'Brad Pitt' AND cast.aid = actor.aid AND movie.mid = cast.msid
imdb
CREATE TABLE table_22863 ( "#" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production code" real, "U.S. viewers (in millions)" text )
Who wrote the episode 'Confession'?
SELECT "Written by" FROM table_22863 WHERE "Title" = 'Confession'
wikisql
CREATE TABLE people ( People_ID int, Name text, Age real, Height real, Hometown text ) CREATE TABLE gymnast ( Gymnast_ID int, Floor_Exercise_Points real, Pommel_Horse_Points real, Rings_Points real, Vault_Points real, Parallel_Bars_Points real, Horizontal_Bar_Points real...
Return a bar chart on how many gymnasts are from each hometown?, and rank by the Y from low to high.
SELECT Hometown, COUNT(*) FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID = T2.People_ID GROUP BY T2.Hometown ORDER BY COUNT(*)
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...
Give me the comparison about Team_ID over the All_Home , and group by attribute ACC_Road, and I want to order in descending by the Y please.
SELECT All_Home, Team_ID FROM basketball_match GROUP BY ACC_Road, All_Home ORDER BY Team_ID DESC
nvbench
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, ...
when patient 018-95228 was prescribed albumin 5% 500 ml inj last time since 141 months ago.
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 = '018-95228')) AND medication.drugname = 'albumin 5% 500 ml inj'...
eicu
CREATE TABLE jyjgzbb ( BGDH text, BGRQ time, CKZFWDX text, CKZFWSX number, CKZFWXX number, JCFF text, JCRGH text, JCRXM text, JCXMMC text, JCZBDM text, JCZBJGDL number, JCZBJGDW text, JCZBJGDX text, JCZBMC text, JLDW text, JYRQ time, JYZBLSH text, ...
姓名是谢飞烟的那个病人在2015年3月8日之后都有哪些当时的住院就诊记录对应的检验报告单?住院期间就诊流水号是什么数字?
SELECT wdmzjzjlb.JZLSH FROM person_info JOIN hz_info JOIN wdmzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX WHERE person_info.XM = '谢飞烟' AND NOT wdmzjzjlb.JZLSH IN (SELECT jybgb.JZLSH FROM jybgb WHERE jybgb.BGRQ <= '2015-03-0...
css
CREATE TABLE product_characteristics ( characteristic_id VARCHAR ) CREATE TABLE CHARACTERISTICS ( characteristic_name VARCHAR, other_characteristic_details VARCHAR, characteristic_data_type VARCHAR, characteristic_id VARCHAR )
What are the names, details and data types of the characteristics which are never used by any product?
SELECT characteristic_name, other_characteristic_details, characteristic_data_type FROM CHARACTERISTICS EXCEPT SELECT t1.characteristic_name, t1.other_characteristic_details, t1.characteristic_data_type FROM CHARACTERISTICS AS t1 JOIN product_characteristics AS t2 ON t1.characteristic_id = t2.characteristic_id
sql_create_context