context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE table_2179 ( "Pitcher" text, "Starts" real, "Wins" real, "Losses" real, "No decisions" real, "Winning %" text, "Seasons" text )
what is the least number of no decisions for scott feldman category:articles with hcards
SELECT MIN("No decisions") FROM table_2179 WHERE "Pitcher" = 'Scott Feldman Category:Articles with hCards'
wikisql
CREATE TABLE table_17525 ( "Round" real, "Date" text, "Grand Prix" text, "Circuit" text, "125cc winner" text, "250cc winner" text, "MotoGP winner" text, "Report" text )
What circuit was on the date 4 May?
SELECT "Circuit" FROM table_17525 WHERE "Date" = '4 May'
wikisql
CREATE TABLE table_name_56 ( description VARCHAR, date VARCHAR )
Which description is dated 1962?
SELECT description FROM table_name_56 WHERE date = "1962"
sql_create_context
CREATE TABLE table_name_1 ( video VARCHAR, channel VARCHAR, programming VARCHAR )
Which Video has a Channel smaller than 35.66, and a Programming of nhk world?
SELECT video FROM table_name_1 WHERE channel < 35.66 AND programming = "nhk world"
sql_create_context
CREATE TABLE table_name_65 ( rank INTEGER, player VARCHAR, wins VARCHAR )
What is the highest rank for ben crenshaw after winning more than 14 times?
SELECT MAX(rank) FROM table_name_65 WHERE player = "ben crenshaw" AND wins > 14
sql_create_context
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, ...
give the number of patients whose diagnoses long title is personal history of malignant neoplasm of bladder and lab test abnormal status is abnormal.
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.long_title = "Personal history of malignant neoplasm of bladder" AND lab.flag = "abnormal"
mimicsql_data
CREATE TABLE table_name_67 ( nationality VARCHAR, fate VARCHAR, name VARCHAR )
Which Nationality has a Fate of sunk, and a Name of alderamin?
SELECT nationality FROM table_name_67 WHERE fate = "sunk" AND name = "alderamin"
sql_create_context
CREATE TABLE table_name_61 ( tournament VARCHAR )
Which 1995's tournament was the French Open?
SELECT 1995 FROM table_name_61 WHERE tournament = "french open"
sql_create_context
CREATE TABLE table_57436 ( "Games" text, "Gold" text, "Silver" text, "Bronze" text, "Total" text, "Rank" text )
What is the total of the ranks that did not participate?
SELECT "Total" FROM table_57436 WHERE "Rank" = 'did not participate'
wikisql
CREATE TABLE table_23692 ( "Club" text, "Played" text, "Won" text, "Drawn" text, "Lost" text, "Points for" text, "Points against" text, "Points difference" text, "Bonus Points" text, "Points" text )
when points against is points again, which are the drawn?
SELECT "Drawn" FROM table_23692 WHERE "Points against" = 'Points against'
wikisql
CREATE TABLE table_203_28 ( id number, "year" number, "competition" text, "venue" text, "position" text, "event" text, "notes" text )
how many years consecutive featured the 20 km event ?
SELECT COUNT(DISTINCT "year") FROM table_203_28 WHERE "event" = '20 km'
squall
CREATE TABLE table_name_63 ( tournaments_played INTEGER, cuts_made VARCHAR )
what is the average tournaments played when cuts made is 14?
SELECT AVG(tournaments_played) FROM table_name_63 WHERE cuts_made = 14
sql_create_context
CREATE TABLE fgwyjzb ( CLINIC_ID text, CLINIC_TYPE 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, ...
从2010年2月7日到2014年5月21日内医院1521051科室涉及医疗费总额超过1941.65元的有多少?
SELECT COUNT(*) FROM (SELECT gwyjzb.MED_ORG_DEPT_CD FROM gwyjzb JOIN t_kc24 ON gwyjzb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE gwyjzb.MED_SER_ORG_NO = '1521051' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2010-02-07' AND '2014-05-21' GROUP BY gwyjzb.MED_ORG_DEPT_CD HAVING SUM(t_kc24.MED_AMOUT) > 1941.65 UNION SELECT fgwyjzb....
css
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...
对于医疗费总额不少于5529.18元患者12483440的就医记录,能列出出院诊断疾病编号和名称吗?
SELECT gwyjzb.OUT_DIAG_DIS_CD, gwyjzb.OUT_DIAG_DIS_NM FROM gwyjzb WHERE gwyjzb.PERSON_ID = '12483440' AND gwyjzb.MED_CLINIC_ID IN (SELECT t_kc24.MED_CLINIC_ID FROM t_kc24 WHERE t_kc24.MED_AMOUT >= 5529.18) UNION SELECT fgwyjzb.OUT_DIAG_DIS_CD, fgwyjzb.OUT_DIAG_DIS_NM FROM fgwyjzb WHERE fgwyjzb.PERSON_ID = '12483440' AN...
css
CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time, drug text, ...
what was the three most commonly carried out specimen tests until 2104?
SELECT t1.spec_type_desc FROM (SELECT microbiologyevents.spec_type_desc, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM microbiologyevents WHERE STRFTIME('%y', microbiologyevents.charttime) <= '2104' GROUP BY microbiologyevents.spec_type_desc) AS t1 WHERE t1.c1 <= 3
mimic_iii
CREATE TABLE table_72184 ( "Route Name" text, "Direction" text, "Termini" text, "Junctions" text, "Length" text, "Population Area" text, "Remarks" text )
How many termini are there that have 'east west' listed in their direction section, 'none' listed in their junction section, and have a route name of 'sh 202'?
SELECT COUNT("Termini") FROM table_72184 WHERE "Direction" = 'East West' AND "Junctions" = 'none' AND "Route Name" = 'SH 202'
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 procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) ...
among patients with other preterm infants 1,750-1,999 grams how many of them were male?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.gender = "M" AND diagnoses.long_title = "Other preterm infants, 1,750-1,999 grams"
mimicsql_data
CREATE TABLE table_name_97 ( year INTEGER, venue VARCHAR )
What is the average year of events that took place in Antwerp, Belgium?
SELECT AVG(year) FROM table_name_97 WHERE venue = "antwerp, belgium"
sql_create_context
CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE labevents ( row_id number, subject_id number, ...
when was the last time the arterial bp [systolic] of patient 10278 was less than 129.0, until 10/20/2105?
SELECT chartevents.charttime FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 10278)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'arterial...
mimic_iii
CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPrivilegedUserGuidance text, MarkdownConcensusDescription text, CreationDate time, CreationModeratorId number, ApprovalDa...
Top 100 Lowest Rated Posts.
SELECT Posts.Id AS "post_link", Posts.Score AS "score" FROM Posts WHERE 'posttypeid' = 1 AND 'score' < 0 ORDER BY 'score' LIMIT 100
sede
CREATE TABLE table_47470 ( "Res." text, "Record" text, "Opponent" text, "Method" text, "Event" text, "Round" real, "Location" text )
What is the record for the loss in UFC 62?
SELECT "Record" FROM table_47470 WHERE "Res." = 'loss' AND "Event" = 'ufc 62'
wikisql
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 demographic (...
give me the number of patients whose admission year is less than 2155 and diagnoses long title is other specified gastritis, with hemorrhage?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admityear < "2155" AND diagnoses.long_title = "Other specified gastritis, with hemorrhage"
mimicsql_data
CREATE TABLE table_14748457_1 ( lines_served VARCHAR, station_users_2008_9 VARCHAR )
what are the lines served where station users is 210076?
SELECT lines_served FROM table_14748457_1 WHERE station_users_2008_9 = "210076"
sql_create_context
CREATE TABLE table_46773 ( "Game" real, "Date" text, "Opponent" text, "Score" text, "Location/Attendance" text, "Record" text )
What was the location of the game on February 2?
SELECT "Location/Attendance" FROM table_46773 WHERE "Date" = 'february 2'
wikisql
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, ...
柳娟秀这个病人的检验报告单结果指标均异常的有哪些?看看检验报告的单号
SELECT jybgb.BGDH FROM hz_info JOIN mzjzjlb JOIN jybgb ON 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 hz_info.person_info_XM = '柳娟秀' AND NOT jybgb.BGDH IN (SELECT jyjgzbb.BGDH FROM jyjgz...
css
CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER ) CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL )
Just list the name and price of its most expensive product in a bar chart, and could you sort in ascending by the bars?
SELECT T1.Name, MAX(T1.Price) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name ORDER BY Name
nvbench
CREATE TABLE table_2461720_1 ( language_of_films VARCHAR, theatre_name VARCHAR )
Name the total number of language of films for m ga-plex taschereau imax
SELECT COUNT(language_of_films) FROM table_2461720_1 WHERE theatre_name = "Méga-Plex Taschereau IMAX"
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_...
flights from LONG BEACH to NASHVILLE
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 = 'LONG BEACH' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'NAS...
atis
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, ...
find the number of patients under the procedure icd9 code 66 who were admitted in emergency.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_type = "EMERGENCY" AND procedures.icd9_code = "66"
mimicsql_data
CREATE TABLE table_25665 ( "No. in series" real, "No. in season" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Prod. code" text, "Viewers (millions)" text )
which is the biggest number of episode in the season, when the director of the episode was Constantine Makris?
SELECT MAX("No. in season") FROM table_25665 WHERE "Directed by" = 'Constantine Makris'
wikisql
CREATE TABLE Documents ( Document_ID INTEGER, Document_Type_Code CHAR(15), Project_ID INTEGER, Document_Date DATETIME, Document_Name VARCHAR(255), Document_Description VARCHAR(255), Other_Details VARCHAR(255) ) CREATE TABLE Projects ( Project_ID INTEGER, Project_Details VARCHAR(255)...
Show the number of documents for different budget type code in a bar chart, show in ascending by the total number.
SELECT T1.Budget_Type_Code, COUNT(T1.Budget_Type_Code) FROM Documents_with_Expenses AS T1 JOIN Ref_Budget_Codes AS T2 ON T1.Budget_Type_Code = T2.Budget_Type_Code GROUP BY T1.Budget_Type_Code ORDER BY COUNT(T1.Budget_Type_Code)
nvbench
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE prescription...
provide the number of patients whose marital status is single and lab test name is transferrin?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.marital_status = "SINGLE" AND lab.label = "Transferrin"
mimicsql_data
CREATE TABLE table_2668378_5 ( party VARCHAR, district VARCHAR )
Name the number of party for kentucky 1
SELECT COUNT(party) FROM table_2668378_5 WHERE district = "Kentucky 1"
sql_create_context
CREATE TABLE table_name_43 ( opponent VARCHAR, week VARCHAR, date VARCHAR )
What opponent has a week less than 16, with September 7, 2008 as the date?
SELECT opponent FROM table_name_43 WHERE week < 16 AND date = "september 7, 2008"
sql_create_context
CREATE TABLE table_name_60 ( original_airing VARCHAR, audience_share__average_ VARCHAR )
Where the audience share is 8%, what is the original airing?
SELECT original_airing FROM table_name_60 WHERE audience_share__average_ = "8%"
sql_create_context
CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) 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, insuranc...
what are the three most commonly performed lab tests for patients who have been diagnosed with hypercalcemia previously within the same hospital visit, during the last year?
SELECT d_labitems.label FROM d_labitems WHERE d_labitems.itemid IN (SELECT t3.itemid FROM (SELECT t2.itemid, 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 W...
mimic_iii
CREATE TABLE table_1342256_13 ( incumbent VARCHAR, district VARCHAR )
Who won the election of 1942 in the district Illinois 13?
SELECT incumbent FROM table_1342256_13 WHERE district = "Illinois 13"
sql_create_context
CREATE TABLE table_name_4 ( constructor VARCHAR, driver VARCHAR, grid VARCHAR, laps VARCHAR )
Who made the car that Alberto Ascari went more than 35 laps on a grid less than 7?
SELECT constructor FROM table_name_4 WHERE grid < 7 AND laps > 35 AND driver = "alberto ascari"
sql_create_context
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 the sum of School_ID over the ACC_Road , and group by attribute ACC_Road, and I want to display in asc by the ACC_Road please.
SELECT ACC_Road, SUM(School_ID) FROM basketball_match GROUP BY ACC_Road ORDER BY ACC_Road
nvbench
CREATE TABLE table_70631 ( "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 )
How many resulted in a loss with 479 points against?
SELECT "Lost" FROM table_70631 WHERE "Points against" = '479'
wikisql
CREATE TABLE dorm ( student_capacity INTEGER, gender VARCHAR )
Find the average and total capacity of dorms for the students with gender X.
SELECT AVG(student_capacity), SUM(student_capacity) FROM dorm WHERE gender = 'X'
sql_create_context
CREATE TABLE table_33504 ( "Year" real, "Player" text, "Nationality" text, "Position played" text, "Team represented" text )
What is the latest year featuring candace parker?
SELECT MAX("Year") FROM table_33504 WHERE "Player" = 'candace parker'
wikisql
CREATE TABLE table_65009 ( "School" text, "Location" text, "Mascot" text, "Enrollment 08-09" real, "IHSAA Class" text, "County" text, "Year Joined" real, "Previous Conference" text )
Can you tell me the School that has the IHSAA Class of a, and the Enrollment 08-09 off 244?
SELECT "School" FROM table_65009 WHERE "IHSAA Class" = 'a' AND "Enrollment 08-09" = '244'
wikisql
CREATE TABLE table_8606 ( "Rank" text, "Runs" text, "Player" text, "Opponent" text, "Venue" text, "Season" text )
Name the Runs has a Venue of bellerive oval , hobart, and a Season of 2004/05, and a Rank of 5?
SELECT "Runs" FROM table_8606 WHERE "Venue" = 'bellerive oval , hobart' AND "Season" = '2004/05' AND "Rank" = '5'
wikisql
CREATE TABLE table_68994 ( "Material" text, "Resistivity (10 \u22126 ohm-inches)" real, "Relative permeability" real, "Skin depth, inches" real, "Surface resistance, Relative to copper" real )
What is the sum of skin depth with a resistivity of 1.12 and a relative permeability larger than 1?
SELECT SUM("Skin depth, inches") FROM table_68994 WHERE "Resistivity (10 \u22126 ohm-inches)" = '1.12' AND "Relative permeability" > '1'
wikisql
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 demographic ( subject_id text, hadm_id t...
How many patients with primary disease of brain mass intracranial hemorrhage died in or before 2131?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "BRAIN MASS;INTRACRANIAL HEMORRHAGE" AND demographic.dod_year <= "2131.0"
mimicsql_data
CREATE TABLE campuses ( id number, campus text, location text, county text, year number ) CREATE TABLE csu_fees ( campus number, year number, campusfee number ) CREATE TABLE enrollments ( campus number, year number, totalenrollment_ay number, fte_ay number ) CREATE TAB...
What is the average fee on a CSU campus in 2005?
SELECT AVG(campusfee) FROM csu_fees WHERE year = 2005
spider
CREATE TABLE table_25709 ( "Date" text, "Location" text, "Opponent" text, "Cardinal Points" real, "Opp. Points" real, "Record" text )
Name the location for 2-1 record
SELECT "Location" FROM table_25709 WHERE "Record" = '2-1'
wikisql
CREATE TABLE table_55837 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
What was home team North Melbourne's opponents score?
SELECT "Away team score" FROM table_55837 WHERE "Home team" = 'north melbourne'
wikisql
CREATE TABLE Comments ( Id number, PostId number, Score number, Text text, CreationDate time, UserDisplayName text, UserId number, ContentLicense text ) CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, ...
search a question that appeared on Google - now deleted.
SELECT P.* FROM Posts AS P WHERE P.Id = 33665453
sede
CREATE TABLE table_24942 ( "Rank" real, "Athlete" text, "Nation" text, "Olympics" text, "Gold" real, "Silver" real, "Bronze" real, "Total(min. 2 medals)" real )
Who is the athlete who's rank is 8 and competed in the olympics during 1948 1952?
SELECT "Athlete" FROM table_24942 WHERE "Rank" = '8' AND "Olympics" = '1948–1952'
wikisql
CREATE TABLE table_70253 ( "Pair No." real, "Comedian:1" text, "Comedian:II" text, "Tansen(Singers)" text, "Place(Result)" text )
Who is the comedian that has a pair no larger than 5 with a comedian II: Jimmy Moses?
SELECT "Comedian:1" FROM table_70253 WHERE "Pair No." > '5' AND "Comedian:II" = 'jimmy moses'
wikisql
CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time, drug text, dose_val_rx text, dose_unit_rx text, route text ) CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE tra...
what were the five diagnoses that have the lowest two year survival rate?
SELECT d_icd_diagnoses.short_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.icd9_code IN (SELECT t4.icd9_code FROM (SELECT t3.icd9_code, DENSE_RANK() OVER (ORDER BY t3.c1 DESC) AS c2 FROM (SELECT t2.icd9_code, 100 - SUM(CASE WHEN patients.dod IS NULL THEN 1 WHEN STRFTIME('%j', patients.dod) - STRFTIME('%j', t2.chartt...
mimic_iii
CREATE TABLE table_40779 ( "Ballarat FL" text, "Wins" real, "Byes" real, "Losses" real, "Draws" real, "Against" real )
What is the average number of Byes for the team that had 15 Losses, and less than 1 Win?
SELECT AVG("Byes") FROM table_40779 WHERE "Losses" = '15' AND "Wins" < '1'
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...
how many patients of black/cape verdean ethnicity are diagnosed with unspecified problem with head, neck or trunk?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.ethnicity = "BLACK/CAPE VERDEAN" AND diagnoses.long_title = "Unspecified problem with head, neck, or trunk"
mimicsql_data
CREATE TABLE table_15740666_4 ( at_manhattan VARCHAR, kansas_state_vs VARCHAR )
What is the at Manhattan record against TCU?
SELECT at_manhattan FROM table_15740666_4 WHERE kansas_state_vs = "TCU"
sql_create_context
CREATE TABLE table_74880 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Result" text )
What's the highest First Elected with a Result of Re-elected and DIstrict of California 5?
SELECT MAX("First elected") FROM table_74880 WHERE "Result" = 're-elected' AND "District" = 'california 5'
wikisql
CREATE TABLE Sales ( sales_transaction_id INTEGER, sales_details VARCHAR(255) ) CREATE TABLE Purchases ( purchase_transaction_id INTEGER, purchase_details VARCHAR(255) ) CREATE TABLE Transactions ( transaction_id INTEGER, investor_id INTEGER, transaction_type_code VARCHAR(10), date_of_...
Bin all date of transactions into the weekday interval, and sum the share count of each bin Return the result using a bar chart, order in asc by the total number of share count please.
SELECT date_of_transaction, SUM(share_count) FROM Transactions ORDER BY SUM(share_count)
nvbench
CREATE TABLE table_15017024_2 ( height VARCHAR, player_name VARCHAR )
How many heights does chad henne have?
SELECT COUNT(height) FROM table_15017024_2 WHERE player_name = "Chad Henne"
sql_create_context
CREATE TABLE table_name_19 ( bowling_figures_wickets_runs__overs_ VARCHAR, venue VARCHAR )
What were the bowling figures for the competition at Pietermaritzburg?
SELECT bowling_figures_wickets_runs__overs_ FROM table_name_19 WHERE venue = "pietermaritzburg"
sql_create_context
CREATE TABLE View_Unit_Status ( apt_id INTEGER, apt_booking_id INTEGER, status_date DATETIME, available_yn BIT ) CREATE TABLE Apartments ( apt_id INTEGER, building_id INTEGER, apt_type_code CHAR(15), apt_number CHAR(10), bathroom_count INTEGER, bedroom_count INTEGER, room_co...
Show the minimum room count of apartments in different type with a bar chart, and I want to rank by the Y-axis in desc please.
SELECT apt_type_code, MIN(room_count) FROM Apartments GROUP BY apt_type_code ORDER BY MIN(room_count) DESC
nvbench
CREATE TABLE table_name_37 ( record VARCHAR, high_rebounds VARCHAR )
What is the Record when antonio davis (14) had the high rebounds?
SELECT record FROM table_name_37 WHERE high_rebounds = "antonio davis (14)"
sql_create_context
CREATE TABLE table_name_7 ( start_source VARCHAR, country VARCHAR, ended VARCHAR )
What is the start source of the irl country, which ended on 13 April?
SELECT start_source FROM table_name_7 WHERE country = "irl" AND ended = "13 april"
sql_create_context
CREATE TABLE candidate ( Candidate_ID int, People_ID int, Poll_Source text, Date text, Support_rate real, Consider_rate real, Oppose_rate real, Unsure_rate real ) CREATE TABLE people ( People_ID int, Sex text, Name text, Date_of_Birth text, Height real, Weight re...
A pie chart showing the minimum weight for each gender.
SELECT Sex, MIN(Weight) FROM people GROUP BY Sex
nvbench
CREATE TABLE station ( id INTEGER, name TEXT, lat NUMERIC, long NUMERIC, dock_count INTEGER, city TEXT, installation_date TEXT ) CREATE TABLE weather ( date TEXT, max_temperature_f INTEGER, mean_temperature_f INTEGER, min_temperature_f INTEGER, max_dew_point_f INTEGER, ...
A bar chart for what are the number of the dates in which the mean sea level pressure was between 303 and 31?, display Y-axis from low to high order.
SELECT date, COUNT(date) FROM weather WHERE mean_sea_level_pressure_inches BETWEEN 30.3 AND 31 ORDER BY COUNT(date)
nvbench
CREATE TABLE table_name_6 ( saturated_fat VARCHAR, polyunsaturated_fat VARCHAR )
What is the saturated fat with 28g of polyunsaturated fat?
SELECT saturated_fat FROM table_name_6 WHERE polyunsaturated_fat = "28g"
sql_create_context
CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) 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 employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varchar(20), ...
For those employees who do not work in departments with managers that have ids between 100 and 200, find hire_date and the average of salary bin hire_date by time, and visualize them by a bar chart.
SELECT HIRE_DATE, AVG(SALARY) FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200)
nvbench
CREATE TABLE table_name_54 ( points INTEGER, chassis VARCHAR, year VARCHAR )
What is the most points for a vehicle with a lola thl1, chassis later than 1986?
SELECT MAX(points) FROM table_name_54 WHERE chassis = "lola thl1" AND year > 1986
sql_create_context
CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) 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, insuranc...
what is the four most frequently ordered lab tests until 1 year ago in patients of age 20s?
SELECT d_labitems.label FROM d_labitems WHERE d_labitems.itemid IN (SELECT t1.itemid FROM (SELECT labevents.itemid, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.age BETWEEN 20 AND 29) AND DATETIME(labevents.chartti...
mimic_iii
CREATE TABLE table_32479 ( "Week" text, "Opponent" text, "Result" text, "Stadium" text, "Record" text, "Attendance" text )
What was the score when attendance was 19,887?
SELECT "Record" FROM table_32479 WHERE "Attendance" = '19,887'
wikisql
CREATE TABLE table_1404984_1 ( station_ownership VARCHAR, virtual_channel VARCHAR )
Who owns the station on channel 33.3?
SELECT station_ownership FROM table_1404984_1 WHERE virtual_channel = "33.3"
sql_create_context
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, ...
how many patients whose drug code is dapt500i and lab test fluid is ascites?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE prescriptions.formulary_drug_cd = "DAPT500I" AND lab.fluid = "Ascites"
mimicsql_data
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...
能知道患者韦宜然在2011.9.2到2012.12.4这段时间,2066190这个医疗机构给他做的检查次数是多少吗
SELECT COUNT(*) FROM t_kc22 WHERE t_kc22.t_kc21_PERSON_NM = '韦宜然' AND t_kc22.STA_DATE BETWEEN '2011-09-02' AND '2012-12-04' AND t_kc22.t_kc21_MED_SER_ORG_NO = '2066190' AND t_kc22.MED_INV_ITEM_TYPE = '检查费'
css
CREATE TABLE table_48611 ( "Round" real, "Pick" text, "Player" text, "Position" text, "School/Club Team" text )
What is Pick, when Position is OL, and when Round is less than 6?
SELECT "Pick" FROM table_48611 WHERE "Position" = 'ol' AND "Round" < '6'
wikisql
CREATE TABLE table_name_98 ( score VARCHAR, loss VARCHAR )
What was the score of the game that had a loss of Embree (1-2)?
SELECT score FROM table_name_98 WHERE loss = "embree (1-2)"
sql_create_context
CREATE TABLE table_48401 ( "Driver" text, "Points" real, "Races" real, "Wins" text, "Second" text, "Third" text )
How many wins did the driver with 1 second and more than 12 races have?
SELECT "Wins" FROM table_48401 WHERE "Second" = '1' AND "Races" > '12'
wikisql
CREATE TABLE table_12154 ( "Position" real, "Club" text, "Played" real, "Points" real, "Wins" real, "Draws" real, "Losses" real, "Goals for" real, "Goals against" real, "Goal Difference" real )
What is the average position of club burgos cf, which has more than 42 goals against and more than 14 losses?
SELECT AVG("Position") FROM table_12154 WHERE "Goals against" > '42' AND "Club" = 'burgos cf' AND "Losses" > '14'
wikisql
CREATE TABLE table_6489 ( "Source" text, "Date" text, "GERB" text, "Attack" text, "Blue Coalition" text )
What Attack has a Source of NCIOM?
SELECT "Attack" FROM table_6489 WHERE "Source" = 'nciom'
wikisql
CREATE TABLE table_name_44 ( position VARCHAR, school VARCHAR )
What is the position of the player for Washington school?
SELECT position FROM table_name_44 WHERE school = "washington"
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...
How many patients had a lab test of fluid for ascites after removal of t-tube, other bile duct tube, or liver tube?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE procedures.long_title = "Removal of T-tube, other bile duct tube, or liver tube" AND lab.fluid = "Ascites"
mimicsql_data
CREATE TABLE airport_service ( city_code varchar, airport_code varchar, miles_distant int, direction varchar, minutes_distant int ) CREATE TABLE class_of_service ( booking_class varchar, rank int, class_description text ) CREATE TABLE time_interval ( period text, begin_time int...
are there any nonstop flights from SAN FRANCISCO to BOSTON on THURSDAY
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, days, flight WHERE ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BOSTON' AND days.day_name = 'THURSDAY' AND flight.flight_days = days.days_code AND...
atis
CREATE TABLE table_58451 ( "Date" text, "Venue" text, "Score" text, "Result" text, "Competition" text )
What date was the Competition of 2014 fifa world cup qualification, with a Score of 1 0?
SELECT "Date" FROM table_58451 WHERE "Competition" = '2014 fifa world cup qualification' AND "Score" = '1–0'
wikisql
CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPrivilegedUserGuidance text, MarkdownConcensusDescription text, CreationDate time, CreationModeratorId number, ApprovalDa...
Select Top 30 posts with Bounty containing tag.
SELECT Posts.CreationDate, Posts.Id, Votes.BountyAmount, Posts.Title, Posts.AcceptedAnswerId, Posts.Tags FROM Posts LEFT JOIN Votes ON Votes.PostId = Posts.Id WHERE Posts.Tags LIKE ('%##Tag##%') AND BountyAmount > 0 ORDER BY Posts.CreationDate DESC LIMIT 30
sede
CREATE TABLE table_38455 ( "Poll source" text, "Dates administered" text, "Roy Barnes" text, "Thurbert Baker" text, "DuBose Porter" text, "David Poythress" text, "Undecided" text )
What was the undecided with Roy Barnes at 47%?
SELECT "Undecided" FROM table_38455 WHERE "Roy Barnes" = '47%'
wikisql
CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid number, wardid number, admissionheight number, admissionweight number, dischargeweight number, hospitaladmittime time, ...
what were the top five most common microbiology tests that followed during the same month for patients who had a surgery consultation in the last year?
SELECT t3.culturesite FROM (SELECT t2.culturesite, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, treatment.treatmenttime FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'surgery consultation' AND DATETIME(treatment...
eicu
CREATE TABLE table_43666 ( "Player" text, "Position" text, "Round" real, "Pick" real, "NFL Club" text )
What is the pick of the NFL club buffalo bills?
SELECT "Pick" FROM table_43666 WHERE "NFL Club" = 'buffalo bills'
wikisql
CREATE TABLE table_name_28 ( years_of_nba_experience_ VARCHAR, a_ VARCHAR, pos VARCHAR, team VARCHAR )
How many years of NBA experience does the player who plays position g for the Portland Trail Blazers?
SELECT years_of_nba_experience_ AS "a_" FROM table_name_28 WHERE pos = "g" AND team = "portland trail blazers"
sql_create_context
CREATE TABLE table_name_92 ( position VARCHAR, birthplace VARCHAR )
What is the Position, when the Birthplace is Buffalo, New York?
SELECT position FROM table_name_92 WHERE birthplace = "buffalo, new york"
sql_create_context
CREATE TABLE Student_Course_Attendance ( student_id INTEGER, course_id INTEGER, date_of_attendance DATETIME ) CREATE TABLE Student_Course_Registrations ( student_id INTEGER, course_id INTEGER, registration_date DATETIME ) CREATE TABLE People_Addresses ( person_address_id INTEGER, perso...
List the id of students who registered some courses and the number of their registered courses in a scatter chart
SELECT T1.student_id, COUNT(*) FROM Students AS T1 JOIN Student_Course_Registrations AS T2 ON T1.student_id = T2.student_id GROUP BY T1.student_id
nvbench
CREATE TABLE table_53147 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
When the away team scored 9.8 (62) what was the crowd turnout?
SELECT "Crowd" FROM table_53147 WHERE "Away team score" = '9.8 (62)'
wikisql
CREATE TABLE Investors ( investor_id INTEGER, Investor_details VARCHAR(255) ) CREATE TABLE Transactions_Lots ( transaction_id INTEGER, lot_id INTEGER ) CREATE TABLE Transactions ( transaction_id INTEGER, investor_id INTEGER, transaction_type_code VARCHAR(10), date_of_transaction DATETI...
Find the transaction type descriptions and dates if the share count is smaller than 10, group by transaction type, count the date of transaction, and bin the date into the weekday interval Show the result with a grouping line chart, and order by the x axis in descending.
SELECT T2.date_of_transaction, COUNT(T2.date_of_transaction) FROM Ref_Transaction_Types AS T1 JOIN Transactions AS T2 ON T1.transaction_type_code = T2.transaction_type_code WHERE T2.share_count < 10 GROUP BY transaction_type_description ORDER BY date_of_transaction DESC
nvbench
CREATE TABLE club_rank ( Rank real, Club_ID int, Gold real, Silver real, Bronze real, Total real ) CREATE TABLE competition_result ( Competition_ID int, Club_ID_1 int, Club_ID_2 int, Score text ) CREATE TABLE club ( Club_ID int, name text, Region text, Start_yea...
List the types of competition and the number of competitions of each type Visualize by bar chart, sort bars in asc order please.
SELECT Competition_type, COUNT(*) FROM competition GROUP BY Competition_type ORDER BY Competition_type
nvbench
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) 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, KH te...
检验报告单24571107359是哪个患者门诊就诊中开出的
SELECT person_info.XM FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN mzjzjlb_jybgb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = mzjzjlb_jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND mz...
css
CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, ...
what were the three most commonly ordered lab tests for patients who had received open liver biopsy before in the same month since 2103?
SELECT d_labitems.label FROM d_labitems WHERE d_labitems.itemid IN (SELECT t3.itemid FROM (SELECT t2.itemid, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, procedures_icd.charttime FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_i...
mimic_iii
CREATE TABLE Apartment_Facilities ( apt_id INTEGER, facility_code CHAR(15) ) CREATE TABLE Guests ( guest_id INTEGER, gender_code CHAR(1), guest_first_name VARCHAR(80), guest_last_name VARCHAR(80), date_of_birth DATETIME ) CREATE TABLE Apartment_Buildings ( building_id INTEGER, buil...
Return the apartment number and the number of rooms for each apartment by a bar chart, and list by the room_count in asc.
SELECT apt_number, room_count FROM Apartments ORDER BY room_count
nvbench
CREATE TABLE table_60560 ( "Year" real, "Champion" text, "Runner-up" text, "Score" text, "City" text, "Venue" text )
What was the score when Nacional was the champion, River Plate was the runner-up, and the venue was Centenario?
SELECT "Score" FROM table_60560 WHERE "Champion" = 'nacional' AND "Venue" = 'centenario' AND "Runner-up" = 'river plate'
wikisql
CREATE TABLE table_name_33 ( worship_leader VARCHAR, lead_supporting_vocal VARCHAR )
Who was the worship leader that had a lead supporting vocal Marcus Temu?
SELECT worship_leader FROM table_name_33 WHERE lead_supporting_vocal = "marcus temu"
sql_create_context
CREATE TABLE table_203_353 ( id number, "#" number, "title" text, "producer(s)" text, "featured guest(s)" text, "time" text )
how long is the horsemen track ?
SELECT "time" FROM table_203_353 WHERE "title" = '"horsemen"'
squall
CREATE TABLE table_name_6 ( term VARCHAR, hometown VARCHAR, name VARCHAR )
What was the term of Bruce Biers Kendall whose hometown is Anchorage?
SELECT term FROM table_name_6 WHERE hometown = "anchorage" AND name = "bruce biers kendall"
sql_create_context
CREATE TABLE table_60268 ( "Album#" text, "English Title" text, "Chinese (Traditional)" text, "Chinese (Simplified)" text, "Release date" text, "Label" text )
What is the Release date of the Album Your Friend?
SELECT "Release date" FROM table_60268 WHERE "English Title" = 'your friend'
wikisql