context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE table_15249 ( "Year" real, "Entrant" text, "Chassis" text, "Engine" text, "Pts." real )
What are the points for a chassis of march 811?
SELECT SUM("Pts.") FROM table_15249 WHERE "Chassis" = 'march 811'
wikisql
CREATE TABLE table_1342426_5 ( first_elected INTEGER, incumbent VARCHAR )
Name the lowest first elected for chester w. taylor
SELECT MIN(first_elected) FROM table_1342426_5 WHERE incumbent = "Chester W. Taylor"
sql_create_context
CREATE TABLE table_50032 ( "Res." text, "Record" text, "Opponent" text, "Method" text, "Event" text, "Round" real, "Time" text, "Location" text )
Name the lowest Round with Opponent of rolando delgado?
SELECT MIN("Round") FROM table_50032 WHERE "Opponent" = 'rolando delgado'
wikisql
CREATE TABLE table_5207 ( "Position" text, "Game 1" text, "Game 2" text, "Game 3" text, "Exhibition*" text )
Which Exhibition has a Position of second row, and a Game 3 of les davidson?
SELECT "Exhibition*" FROM table_5207 WHERE "Position" = 'second row' AND "Game 3" = 'les davidson'
wikisql
CREATE TABLE table_11589522_3 ( original_air_date VARCHAR, written_by VARCHAR )
what's the original air date where written by is iain morris & damon beesley
SELECT original_air_date FROM table_11589522_3 WHERE written_by = "Iain Morris & Damon Beesley"
sql_create_context
CREATE TABLE table_203_166 ( id number, "pos" text, "no" number, "rider" text, "manufacturer" text, "laps" number, "time" text, "grid" number, "points" number )
who finished next after sylvain guintoli in the 2008 malaysian motorcycle grand prix ?
SELECT "rider" FROM table_203_166 WHERE "pos" = (SELECT "pos" FROM table_203_166 WHERE "rider" = 'sylvain guintoli') + 1
squall
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...
count the number of patients whose marital status is single and lab test name is amylase, ascites?
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 = "Amylase, Ascites"
mimicsql_data
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, ...
what is the number of inpatient hospital admission patients who have lab test item id 51419?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_location = "TRSF WITHIN THIS FACILITY" AND lab.itemid = "51419"
mimicsql_data
CREATE TABLE FACULTY ( Rank VARCHAR )
Find the rank of the faculty that the fewest faculties belong to.
SELECT Rank FROM FACULTY GROUP BY Rank ORDER BY COUNT(*) LIMIT 1
sql_create_context
CREATE TABLE table_17798548_4 ( _number_of_discs INTEGER, season VARCHAR )
How many discs for the complete 4th series?
SELECT MAX(_number_of_discs) FROM table_17798548_4 WHERE season = "The Complete 4th Series"
sql_create_context
CREATE TABLE table_44707 ( "Place" text, "Player" text, "Country" text, "Score" real, "To par" text )
Where is the player Davis Love III?
SELECT "Place" FROM table_44707 WHERE "Player" = 'davis love iii'
wikisql
CREATE TABLE gwyjzb ( 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, ...
查询4944209这个医院从19年11月19到20年2月23医疗的异地患者的次数
SELECT COUNT(*) FROM gwyjzb WHERE gwyjzb.MED_SER_ORG_NO = '4944209' AND gwyjzb.IN_HOSP_DATE BETWEEN '2019-11-19' AND '2020-02-23' AND gwyjzb.REMOTE_SETTLE_FLG = '异地1' OR gwyjzb.REMOTE_SETTLE_FLG = '异地2' UNION SELECT COUNT(*) FROM fgwyjzb WHERE fgwyjzb.MED_SER_ORG_NO = '4944209' AND fgwyjzb.IN_HOSP_DATE BETWEEN '2019-11...
css
CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) ) CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(40), POSTAL_CODE varchar(12), CITY varchar(30), STATE_PROVINCE varchar(25), COUNTRY_ID varc...
For those employees who was hired before 2002-06-21, draw a line chart about the change of manager_id over hire_date , and sort from high to low by the X-axis.
SELECT HIRE_DATE, MANAGER_ID FROM employees WHERE HIRE_DATE < '2002-06-21' ORDER BY HIRE_DATE DESC
nvbench
CREATE TABLE table_59322 ( "Date" text, "Time" text, "Opponent#" text, "Rank #" text, "Result" text, "Attendance" text )
On what date was the game played where the opponent was Stanford, ranked #5?
SELECT "Date" FROM table_59322 WHERE "Rank #" = '5' AND "Opponent#" = 'stanford'
wikisql
CREATE TABLE table_1341690_43 ( incumbent VARCHAR, district VARCHAR )
Name the incumbent for district texas 12
SELECT incumbent FROM table_1341690_43 WHERE district = "Texas 12"
sql_create_context
CREATE TABLE table_9760 ( "Coach" text, "Years" text, "Seasons" real, "Record" text, "Winning %" real )
what is the record for years 2006-11?
SELECT "Record" FROM table_9760 WHERE "Years" = '2006-11'
wikisql
CREATE TABLE table_53091 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Date" text )
Name the date for princes park
SELECT "Date" FROM table_53091 WHERE "Venue" = 'princes park'
wikisql
CREATE TABLE table_203_164 ( id number, "#" number, "date" text, "venue" text, "opponent" text, "score" text, "result" text, "competition" text )
what is the number of wins ?
SELECT COUNT(*) FROM table_203_164 WHERE "result" = 'won'
squall
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 Votes ( Id number, PostId number, VoteTypeId number,...
Questions with answer along with tag.
SELECT p.Id, p.Title, p.Score, p.ViewCount, p.AnswerCount, p.CommentCount FROM Posts AS p JOIN PostTags AS pt ON p.Id = pt.PostId JOIN Tags AS t ON pt.TagId = t.Id JOIN Posts AS a ON p.AcceptedAnswerId = a.Id WHERE (t.TagName = '##TagName:string##') AND (NOT p.AcceptedAnswerId IS NULL) AND (p.CreationDate >= '##Date1?2...
sede
CREATE TABLE table_20776 ( "Model number" text, "sSpec number" text, "Frequency" text, "L2 cache" text, "FSB" text, "Mult." text, "Voltage" text, "TDP" text, "Socket" text, "Release date" text, "Part number(s)" text, "Release price ( USD )" text )
What is the socket location for sSPEC number sl3f7(kc0)sl3fj(kc0)?
SELECT "Socket" FROM table_20776 WHERE "sSpec number" = 'SL3F7(kC0)SL3FJ(kC0)'
wikisql
CREATE TABLE procedures_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 d_icd_diagnoses ( row_id number, icd9_code text, ...
what was the first procedure time of the revision of pedicle grft of patient 2004?
SELECT procedures_icd.charttime FROM procedures_icd WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'revision of pedicle grft') AND procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 2004) ORDE...
mimic_iii
CREATE TABLE jybgb ( YLJGDM text, YLJGDM_MZJZJLB text, YLJGDM_ZYJZJLB text, BGDH text, BGRQ time, JYLX number, JZLSH text, JZLSH_MZJZJLB text, JZLSH_ZYJZJLB text, JZLX number, KSBM text, KSMC text, SQRGH text, SQRXM text, BGRGH text, BGRXM text, SHRGH ...
检验报告在检验结果指标记录07906762221上对应的单号是什么?
SELECT BGDH FROM jyjgzbb WHERE JYZBLSH = '07906762221'
css
CREATE TABLE t_kc21_t_kc22 ( MED_CLINIC_ID text, MED_EXP_DET_ID number ) 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, C...
统计一下在医疗机构2632106里,使用次数排在top19的项目
SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM t_kc21 JOIN t_kc22 JOIN t_kc21_t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc21_t_kc22.MED_CLINIC_ID AND t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID WHERE t_kc21.MED_SER_ORG_NO = '2632106' GROUP BY t_kc22.SOC_SRT_DIRE_CD ORDER BY COUNT(*) DESC LIMIT 19
css
CREATE TABLE table_name_11 ( constituency_number VARCHAR, reserved_for___sc___st__none_ VARCHAR, name VARCHAR )
What is the Constituency number for Bikhangaon with a Reserved for ( SC / ST /None) of st?
SELECT constituency_number FROM table_name_11 WHERE reserved_for___sc___st__none_ = "st" AND name = "bikhangaon"
sql_create_context
CREATE TABLE table_72040 ( "Code Name" text, "Function (figure)" text, "Real Name" text, "Birthplace" text, "Serial number" text, "Primary military speciality" text, "Secondary military speciality" text )
What is the code name of the person born in Liverpool?
SELECT "Code Name" FROM table_72040 WHERE "Birthplace" = 'liverpool'
wikisql
CREATE TABLE table_57985 ( "Block A" text, "Ryuji Hijikata" text, "Shuji Kondo" text, "MAZADA" text, "El Samurai" text )
Name the Shuji Kondo for MAZADA of hijikata (14:24)
SELECT "Shuji Kondo" FROM table_57985 WHERE "MAZADA" = 'hijikata (14:24)'
wikisql
CREATE TABLE table_73429 ( "Number" real, "Name" text, "Height (m)" real, "Date of Birth" text, "Position" text, "Nationality" text )
Name the least number
SELECT MIN("Number") FROM table_73429
wikisql
CREATE TABLE table_name_63 ( brigade VARCHAR, name VARCHAR )
What is the brigade when Al-Hamra ('arab al-hamra) shows for name?
SELECT brigade FROM table_name_63 WHERE name = "al-hamra ('arab al-hamra)"
sql_create_context
CREATE TABLE t_kc22 ( MED_EXP_DET_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, MED_CLINIC_ID text, MED_EXP_BILL_ID text, SOC_SRT_DIRE_CD text, SOC_SRT_DIRE_NM text, DIRE_TYPE number, CHA_ITEM_LEV number, MED_INV_ITEM_TYPE text, MED_DIRE_CD text, MED_DIRE_NM text,...
35515358233这次医疗就诊,查询个人自费的总金额
SELECT PER_EXP FROM t_kc24 WHERE MED_CLINIC_ID = '35515358233'
css
CREATE TABLE table_name_90 ( date VARCHAR, tv_time VARCHAR, result VARCHAR )
What is the Date of the Game with a Result of w 22 16 in TV Time of CBS 1:00ET?
SELECT date FROM table_name_90 WHERE tv_time = "cbs 1:00et" AND result = "w 22–16"
sql_create_context
CREATE TABLE table_26060 ( "Episode #" real, "Season #" real, "Title" text, "Directed by" text, "Written by" text, "Original airdate" text, "Production code #" real )
How many original air dates are there for the episode titled 'Everyone can't be George Washington'?
SELECT COUNT("Original airdate") FROM table_26060 WHERE "Title" = 'Everyone Can''t Be George Washington'
wikisql
CREATE TABLE record ( ID int, Result text, Swimmer_ID int, Event_ID int ) 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 ) ...
Give me the comparison about meter_100 over the meter_600 by a bar chart, and could you order from low to high by the Y-axis?
SELECT meter_600, meter_100 FROM swimmer ORDER BY meter_100
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...
沈玉堂这个患者所有检验报告单中的标本在2002年6月12日到2006年8月24日期间内采集的都是啥呀?
SELECT jybgb.BBCJBW 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 jy...
css
CREATE TABLE table_18172 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Results" text, "Candidates" text )
What party was first elected in 1974?
SELECT "Party" FROM table_18172 WHERE "First elected" = '1974'
wikisql
CREATE TABLE table_204_473 ( id number, "pos" text, "no" number, "driver" text, "constructor" text, "laps" number, "time/retired" text, "grid" number, "points" number )
what are the total number of laps phil hill drove ?
SELECT "laps" FROM table_204_473 WHERE "driver" = 'phil hill'
squall
CREATE TABLE table_78746 ( "Judge" text, "State" text, "Born/Died" text, "Began active service*" real, "Ended active service" real )
Who was the judge for the state SD?
SELECT "Judge" FROM table_78746 WHERE "State" = 'sd'
wikisql
CREATE TABLE table_42413 ( "City of license" text, "Identifier" text, "Frequency" text, "Power" text, "Class" text, "RECNet" text )
What is Identifier, when City of License is Hornepayne?
SELECT "Identifier" FROM table_42413 WHERE "City of license" = 'hornepayne'
wikisql
CREATE TABLE table_61952 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text )
What is the Place of the Player with a To par of 5?
SELECT "Place" FROM table_61952 WHERE "To par" = '–5'
wikisql
CREATE TABLE table_23192661_3 ( location VARCHAR, record VARCHAR )
Name the location for 2-1 record
SELECT location FROM table_23192661_3 WHERE record = "2-1"
sql_create_context
CREATE TABLE table_36989 ( "Round" real, "Player" text, "Position" text, "Nationality" text, "College/Junior/Club Team (League)" text )
Which player's nationality is from Sweden?
SELECT "Player" FROM table_36989 WHERE "Nationality" = 'sweden'
wikisql
CREATE TABLE table_9886 ( "Team" text, "Outgoing manager" text, "Manner of departure" text, "Date of vacancy" text, "Replaced by" text, "Date of appointment" text )
Who was the outgoing manager that was replaced by Thomas Von Heesen?
SELECT "Outgoing manager" FROM table_9886 WHERE "Replaced by" = 'thomas von heesen'
wikisql
CREATE TABLE table_203_460 ( id number, "player" text, "played" number, "legs won" number, "legs lost" number, "lwat" number, "100+" number, "140+" number, "180s" number, "high checkout" number, "3-dart average" number )
who won the highest number of legs in the 2009 world matchplay ?
SELECT "player" FROM table_203_460 ORDER BY "legs won" DESC LIMIT 1
squall
CREATE TABLE table_15646 ( "Region" text, "Date" text, "Label" text, "Format" text, "Catalog" text )
Which catalog did Village Records have on February 14, 2002?
SELECT "Catalog" FROM table_15646 WHERE "Label" = 'village records' AND "Date" = 'february 14, 2002'
wikisql
CREATE TABLE table_name_63 ( date_sent VARCHAR, constellation VARCHAR )
What date sent has orion as the constellation?
SELECT date_sent FROM table_name_63 WHERE constellation = "orion"
sql_create_context
CREATE TABLE table_24496 ( "District" text, "Vacator" text, "Reason for change" text, "Successor" text, "Date successor seated" text )
What is every reason for change for the Washington 3rd District?
SELECT "Reason for change" FROM table_24496 WHERE "District" = 'Washington 3rd'
wikisql
CREATE TABLE table_1690 ( "Province" text, "Provincial capital" text, "Largest city" text, "Area (km 2 )" real, "Population (2013)" real )
what is minimum area where the largest city is bloemfontein?
SELECT MIN("Area (km 2 )") FROM table_1690 WHERE "Largest city" = 'Bloemfontein'
wikisql
CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time...
tell me the total number of patients in the micu careunits until 1 year ago?
SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT transfers.hadm_id FROM transfers WHERE transfers.careunit = 'micu' AND DATETIME(transfers.intime) <= DATETIME(CURRENT_TIME(), '-1 year'))
mimic_iii
CREATE TABLE routes ( rid integer, dst_apid integer, dst_ap varchar(4), src_apid bigint, src_ap varchar(4), alid bigint, airline varchar(4), codeshare text ) CREATE TABLE airlines ( alid integer, name text, iata varchar(2), icao varchar(3), callsign text, country...
Find the country of the airlines whose name starts with 'Orbit', and count them by a bar chart, rank from low to high by the y axis.
SELECT country, COUNT(country) FROM airlines WHERE name LIKE 'Orbit%' GROUP BY country ORDER BY COUNT(country)
nvbench
CREATE TABLE table_name_46 ( venue VARCHAR, result VARCHAR )
Name the venue for eng by 6 wkts
SELECT venue FROM table_name_46 WHERE result = "eng by 6 wkts"
sql_create_context
CREATE TABLE table_name_48 ( population INTEGER, median_family_income VARCHAR, number_of_households VARCHAR )
What is the population where the median family income is $48,446 and there are more than 35,343 households?
SELECT AVG(population) FROM table_name_48 WHERE median_family_income = "$48,446" AND number_of_households > 35 OFFSET 343
sql_create_context
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text, person_info_CSD text, person_info_CSRQ time, person_info_GJDM text, person_info_GJMC text, person_info_JGDM text, person_info_JGMC text, person_info_MZDM text, person_info_MZMC text, person_info_XBDM ...
列出患者蒋清淑门诊诊断名称不包含维生素的在医院6779932中有哪些门诊就诊记录?
SELECT * 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 hz_info.YLJGDM = '6779932' AND NOT mzjzjlb.JZZDSM LIKE '%维生素%'
css
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...
at what time was the patient stephanie suchan admitted in hospital?
SELECT demographic.admittime FROM demographic WHERE demographic.name = "Stephanie Suchan"
mimicsql_data
CREATE TABLE table_25597136_1 ( focal_plane_in_ft__m_ VARCHAR, location VARCHAR )
Location for focal plane in ft (m) is naidi hills, basco.
SELECT focal_plane_in_ft__m_ FROM table_25597136_1 WHERE location = "Naidi Hills, Basco"
sql_create_context
CREATE TABLE table_name_65 ( venue VARCHAR, result VARCHAR )
Which Venue has a Result of won 5-4?
SELECT venue FROM table_name_65 WHERE result = "won 5-4"
sql_create_context
CREATE TABLE table_31118 ( "Team" text, "Chairman" text, "Head Coach" text, "Captain" text, "Kitmaker" text, "Shirt sponsor" text )
Name the chairman for iker casillas
SELECT "Chairman" FROM table_31118 WHERE "Captain" = 'Iker Casillas'
wikisql
CREATE TABLE table_name_59 ( gold INTEGER, nation VARCHAR )
How many Gold medals did Australia receive?
SELECT AVG(gold) FROM table_name_59 WHERE nation = "australia"
sql_create_context
CREATE TABLE table_27437601_2 ( no_in_series VARCHAR, no_in_season VARCHAR )
List the series number for season 12.
SELECT COUNT(no_in_series) FROM table_27437601_2 WHERE no_in_season = 12
sql_create_context
CREATE TABLE table_58193 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
What did the home team score when the away team scored 18.20 (128)?
SELECT "Home team score" FROM table_58193 WHERE "Away team score" = '18.20 (128)'
wikisql
CREATE TABLE table_name_2 ( date VARCHAR, game VARCHAR )
On what date was Game 3?
SELECT date FROM table_name_2 WHERE game = "game 3"
sql_create_context
CREATE TABLE table_19283806_4 ( cook_pvi VARCHAR, representative VARCHAR )
What is the Cook PVI for the location that has a representative of Mike Thompson?
SELECT cook_pvi FROM table_19283806_4 WHERE representative = "Mike Thompson"
sql_create_context
CREATE TABLE table_43916 ( "Pastoral Region" text, "Episcopal vicar" text, "Parishes" real, "High schools" real, "Elementary schools" text, "Cemeteries" real )
What Pastoral Region has 3 Cemeteries?
SELECT "Pastoral Region" FROM table_43916 WHERE "Cemeteries" = '3'
wikisql
CREATE TABLE t_kc24 ( MED_SAFE_PAY_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, MED_CLINIC_ID text, REF_SLT_FLG number, CLINIC_SLT_DATE time, COMP_ID text, PERSON_ID text, FLX_MED_ORG_ID text, INSU_TYPE text, MED_AMOUT number, PER_ACC_PAY number, OVE_PAY numb...
在医疗就诊99940959667中患者96248752给哪个项目付出的自费金额最高
SELECT SOC_SRT_DIRE_CD, SOC_SRT_DIRE_NM FROM t_kc22 WHERE MED_CLINIC_ID = '99940959667' GROUP BY SOC_SRT_DIRE_CD ORDER BY SUM(SELF_PAY_AMO) DESC LIMIT 1
css
CREATE TABLE table_55627 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
What home team played Fitzroy?
SELECT "Home team" FROM table_55627 WHERE "Away team" = 'fitzroy'
wikisql
CREATE TABLE table_65765 ( "Rank" real, "Athlete" text, "Country" text, "Day 1" real, "Total" real )
what is the country when the total is 111 and the day 1 is 69?
SELECT "Country" FROM table_65765 WHERE "Total" = '111' AND "Day 1" = '69'
wikisql
CREATE TABLE table_name_83 ( college VARCHAR, school VARCHAR )
What college did the player with a school of crete-monee high school go to?
SELECT college FROM table_name_83 WHERE school = "crete-monee high school"
sql_create_context
CREATE TABLE table_59934 ( "Date" text, "Name of ship" text, "Flag" text, "Tonnage" real, "Fate" text )
What is the Fate of the HMS Manistee (f 104) with a Tonnage of 4,671 or more?
SELECT "Fate" FROM table_59934 WHERE "Tonnage" > '4,671' AND "Name of ship" = 'hms manistee (f 104)'
wikisql
CREATE TABLE table_name_6 ( round INTEGER, player VARCHAR )
In what Round was Grant Long Drafted?
SELECT MIN(round) FROM table_name_6 WHERE player = "grant long"
sql_create_context
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number,...
what are the five most commonly given diagnoses for patients who have previously received parenteral feeds - tpn in the same hospital encounter a year before?
SELECT t3.diagnosisname FROM (SELECT t2.diagnosisname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, treatment.treatmenttime, patient.patienthealthsystemstayid FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'paren...
eicu
CREATE TABLE park ( state VARCHAR )
List the names of states that have more than 2 parks.
SELECT state FROM park GROUP BY state HAVING COUNT(*) > 2
sql_create_context
CREATE TABLE park ( park_id TEXT, park_name TEXT, park_alias TEXT, city TEXT, state TEXT, country TEXT ) CREATE TABLE team ( year INTEGER, league_id TEXT, team_id TEXT, franchise_id TEXT, div_id TEXT, rank INTEGER, g INTEGER, ghome NUMERIC, w INTEGER, l I...
I want to see trend of the total number by yearid, display yearid from high to low order please.
SELECT yearid, COUNT(*) FROM hall_of_fame GROUP BY yearid ORDER BY yearid DESC
nvbench
CREATE TABLE Addresses ( address_id INTEGER, line_1_number_building VARCHAR(80), city VARCHAR(50), zip_postcode VARCHAR(20), state_province_county VARCHAR(50), country VARCHAR(50) ) CREATE TABLE Vehicles ( vehicle_id INTEGER, vehicle_details VARCHAR(255) ) CREATE TABLE Lessons ( le...
When are the birthdays of customer who are classified as 'Good Customer' status, and count them by a bar chart, could you order y-axis in ascending order?
SELECT date_of_birth, COUNT(date_of_birth) FROM Customers WHERE customer_status_code = 'Good Customer' ORDER BY COUNT(date_of_birth)
nvbench
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 countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0...
Give me a bar chart to compare the number of state provinces located in different cities, show from low to high by the bar.
SELECT STATE_PROVINCE, COUNT(STATE_PROVINCE) FROM locations GROUP BY STATE_PROVINCE ORDER BY STATE_PROVINCE
nvbench
CREATE TABLE airport ( id int, City text, Country text, IATA text, ICAO text, name text ) CREATE TABLE flight ( id int, Vehicle_Flight_number text, Date text, Pilot text, Velocity real, Altitude real, airport_id int, company_id int ) CREATE TABLE operate_company...
What are the ids and names of the companies that operated more than one flight, I want to order y-axis in descending order.
SELECT T1.name, T1.id FROM operate_company AS T1 JOIN flight AS t2 ON T1.id = T2.company_id ORDER BY T1.id DESC
nvbench
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...
How many customers for different customer last name? Draw a bar chart, rank by the bar in desc.
SELECT customer_last_name, COUNT(customer_last_name) FROM Customers GROUP BY customer_last_name ORDER BY customer_last_name DESC
nvbench
CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(40), POSTAL_CODE varchar(12), CITY varchar(30), STATE_PROVINCE varchar(25), COUNTRY_ID varchar(2) ) CREATE TABLE countries ( COUNTRY_ID...
For those employees who was hired before 2002-06-21, visualize a bar chart about the distribution of hire_date and the average of salary bin hire_date by weekday, rank in ascending by the Y.
SELECT HIRE_DATE, AVG(SALARY) FROM employees WHERE HIRE_DATE < '2002-06-21' ORDER BY AVG(SALARY)
nvbench
CREATE TABLE time_zone ( time_zone_code text, time_zone_name text, hours_from_gmt int ) CREATE TABLE date_day ( month_number int, day_number int, year int, day_name varchar ) CREATE TABLE state ( state_code text, state_name text, country_name text ) CREATE TABLE airport ( ...
do you have an 819 flight from DENVER to SAN FRANCISCO
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 = 'SAN FRANCISCO' AND flight.departure_time = 819 AND flight.to_airport = AIRPORT_SERVICE_1....
atis
CREATE TABLE table_73181 ( "Date" text, "Team #1" text, "Res." text, "Team #2" text, "Competition" text, "Attendance" real, "Remarks" text )
What are the remarks for 8 October 2008?
SELECT "Remarks" FROM table_73181 WHERE "Date" = '8 October 2008'
wikisql
CREATE TABLE Project_Staff ( date_to VARCHAR )
What is the last date of the staff leaving the projects?
SELECT date_to FROM Project_Staff ORDER BY date_to DESC LIMIT 1
sql_create_context
CREATE TABLE table_name_29 ( floors INTEGER, metres VARCHAR, feet VARCHAR, name VARCHAR )
What's the lowest Floors with Feet that's larger htan 262, has a Name of Standard Bank Building, and Metres that's larger htan 138.8?
SELECT MIN(floors) FROM table_name_29 WHERE feet > 262 AND name = "standard bank building" AND metres > 138.8
sql_create_context
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, ...
what is the number of patients whose ethnicity is black/african american and drug code is myco500i?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.ethnicity = "BLACK/AFRICAN AMERICAN" AND prescriptions.formulary_drug_cd = "MYCO500I"
mimicsql_data
CREATE TABLE table_2886617_8 ( nhl_team VARCHAR, player VARCHAR )
What NHL team picked Sergei Luchinkin?
SELECT nhl_team FROM table_2886617_8 WHERE player = "Sergei Luchinkin"
sql_create_context
CREATE TABLE table_name_94 ( surface VARCHAR, tournament VARCHAR, score VARCHAR )
What is the surface of eckental tournament with a w/o score?
SELECT surface FROM table_name_94 WHERE tournament = "eckental" AND score = "w/o"
sql_create_context
CREATE TABLE table_name_79 ( producer VARCHAR, power_plant VARCHAR )
What company is the producer in the chennai mohan power plant?
SELECT producer FROM table_name_79 WHERE power_plant = "chennai mohan"
sql_create_context
CREATE TABLE Marketing_Regions ( Marketing_Region_Code CHAR(15), Marketing_Region_Name VARCHAR(255), Marketing_Region_Descriptrion VARCHAR(255), Other_Details VARCHAR(255) ) CREATE TABLE Stores ( Store_ID VARCHAR(100), Address_ID INTEGER, Marketing_Region_Code CHAR(15), Store_Name VARCH...
Give me a bar chart for the total number of each payment method code, and list by the y axis in ascending.
SELECT payment_method_code, COUNT(*) FROM Invoices GROUP BY payment_method_code ORDER BY COUNT(*)
nvbench
CREATE TABLE table_2668254_22 ( party VARCHAR, candidates VARCHAR )
What party did candidate george mcduffie (j) represent?
SELECT party FROM table_2668254_22 WHERE candidates = "George McDuffie (J)"
sql_create_context
CREATE TABLE table_37549 ( "Date" text, "City" text, "Opponent" text, "Results\u00b9" text, "Type of game" text )
What city did Yugoslavia play against Poland in?
SELECT "City" FROM table_37549 WHERE "Opponent" = 'poland'
wikisql
CREATE TABLE table_61418 ( "Name" text, "Street address" text, "Years as tallest" text, "Height ft ( m )" text, "Floors" real )
WHAT IS THE YEARS AS TALLEST WITH 01.0 10 light street?
SELECT "Years as tallest" FROM table_61418 WHERE "Street address" = '01.0 10 light street'
wikisql
CREATE TABLE table_name_65 ( team VARCHAR, home_city VARCHAR )
What team that has a Home city of Zadar?
SELECT team FROM table_name_65 WHERE home_city = "zadar"
sql_create_context
CREATE TABLE table_name_47 ( general_classification VARCHAR, points_classification VARCHAR )
What is the General classification for a points classification leader of Bradley Wiggins?
SELECT general_classification FROM table_name_47 WHERE points_classification = "bradley wiggins"
sql_create_context
CREATE TABLE table_38378 ( "Team" text, "Manufacturer" text, "Car model" text, "Engine" text, "Driver" text )
Who is the Driver with the Team of P & L Mechanical Services?
SELECT "Driver" FROM table_38378 WHERE "Team" = 'p & l mechanical services'
wikisql
CREATE TABLE table_204_739 ( id number, "districts" text, "ubigeo" number, "area\n(km2)" number, "population" number, "population density\n(/km2)" number, "created" text, "postal\ncode" number )
what district has the least amount of population ?
SELECT "districts" FROM table_204_739 ORDER BY "population" LIMIT 1
squall
CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org...
what was the last urine out foley-output time of patient 59049 since 02/24/2105?
SELECT outputevents.charttime FROM outputevents WHERE outputevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 59049)) AND outputevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'urin...
mimic_iii
CREATE TABLE table_8517 ( "Player" text, "Nationality" text, "Position" text, "Years for Grizzlies" text, "School/Club Team" text )
What's the United States team that played for the Grizzlies in 1995-1996?
SELECT "School/Club Team" FROM table_8517 WHERE "Nationality" = 'united states' AND "Years for Grizzlies" = '1995-1996'
wikisql
CREATE TABLE table_name_49 ( total INTEGER, player VARCHAR, country VARCHAR, to_par VARCHAR )
What is the average total of Gay Brewer from the United States with a to par of 9?
SELECT AVG(total) FROM table_name_49 WHERE country = "united states" AND to_par = 9 AND player = "gay brewer"
sql_create_context
CREATE TABLE table_name_91 ( college_junior_club_team__league_ VARCHAR, player VARCHAR )
what is the school that hosts mikael renberg
SELECT college_junior_club_team__league_ FROM table_name_91 WHERE player = "mikael renberg"
sql_create_context
CREATE TABLE table_65675 ( "Date" text, "Venue" text, "Score" text, "Result" text, "Competition" text )
What date has uefa euro 2008 qualification as the competition?
SELECT "Date" FROM table_65675 WHERE "Competition" = 'uefa euro 2008 qualification'
wikisql
CREATE TABLE table_203_797 ( id number, "genre" text, "year" number, "title" text, "role" text, "episodes" text, "notes" text )
which year has the most film appearances ?
SELECT "year" FROM table_203_797 GROUP BY "year" ORDER BY COUNT(*) DESC LIMIT 1
squall
CREATE TABLE table_name_51 ( bike VARCHAR, laps VARCHAR, time VARCHAR )
What is the Bike with 18 laps and +41.280 as the time?
SELECT bike FROM table_name_51 WHERE laps = 18 AND time = "+41.280"
sql_create_context
CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) CREATE TABLE SuggestedEdits ( Id number, PostId number, CreationDate time, ApprovalDate time, RejectionDate time, OwnerUserId number, Comment text, Text text, Title text, Tags text, Revision...
View comments sorted by score.
SELECT * FROM Comments WHERE UserId = '##UserId##' AND Score > 0 ORDER BY Score DESC
sede
CREATE TABLE table_25259 ( "Number" real, "Name" text, "Position" text, "Height" text, "Experience" text, "College" text )
What position did the player from San Jose State play?
SELECT "Position" FROM table_25259 WHERE "College" = 'San Jose State'
wikisql