context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE gas_station ( Station_ID int, Open_Year int, Location text, Manager_Name text, Vice_Manager_Name text, Representative_Name text ) CREATE TABLE company ( Company_ID int, Rank int, Company text, Headquarters text, Main_Industry text, Sales_billion real, Pr...
Show all main industry and total market value in each industry by a bar chart, display x-axis from high to low order.
SELECT Main_Industry, SUM(Market_Value) FROM company GROUP BY Main_Industry ORDER BY Main_Industry DESC
nvbench
CREATE TABLE table_23003 ( "House name" text, "House mascot" text, "House colour" text, "Year opened" real, "House leader" text )
How many house colours are associated with house names of Hillary?
SELECT COUNT("House colour") FROM table_23003 WHERE "House name" = 'Hillary'
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 prescriptions ( subject_id text, hadm_id...
what is discharge location of subject id 24425?
SELECT demographic.discharge_location FROM demographic WHERE demographic.subject_id = "24425"
mimicsql_data
CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, ...
what was patient 5395 diagnosed with on their last hospital encounter for the last time?
SELECT d_icd_diagnoses.short_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.icd9_code IN (SELECT diagnoses_icd.icd9_code FROM diagnoses_icd WHERE diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 5395 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime DE...
mimic_iii
CREATE TABLE t_kc22 ( AMOUNT number, CHA_ITEM_LEV number, DATA_ID text, DIRE_TYPE number, DOSE_FORM text, DOSE_UNIT text, EACH_DOSAGE text, EXP_OCC_DATE time, FLX_MED_ORG_ID text, FXBZ number, HOSP_DOC_CD text, HOSP_DOC_NM text, MED_CLINIC_ID text, MED_DIRE_CD tex...
金额top18的项目是医疗机构3979463哪个项目?
SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.MED_SER_ORG_NO = '3979463' GROUP BY t_kc22.SOC_SRT_DIRE_CD ORDER BY SUM(t_kc22.AMOUNT) DESC LIMIT 18
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_CLINIC_ID text, MED_DIRE_CD tex...
82392960392对应的住院或门诊流水号在医疗就诊里面分别是多少?
SELECT t_kc24.CLINIC_ID FROM t_kc24 JOIN t_kc21_t_kc24 JOIN t_kc21 ON t_kc21_t_kc24.MED_SAFE_PAY_ID = t_kc24.MED_SAFE_PAY_ID AND t_kc21_t_kc24.MED_CLINIC_ID = t_kc21.MED_CLINIC_ID WHERE t_kc21.MED_CLINIC_ID = '82392960392'
css
CREATE TABLE table_60098 ( "Edition" text, "Round" text, "Date" text, "Against" text, "Surface" text, "Opponent" text, "Result" text )
What is the result of the match in round 1r against tunisia and on a hard surface?
SELECT "Result" FROM table_60098 WHERE "Round" = '1r' AND "Surface" = 'hard' AND "Against" = 'tunisia'
wikisql
CREATE TABLE table_60695 ( "Tie no" text, "Home team" text, "Score" text, "Away team" text, "Date" text )
Who was the team who played home team woking?
SELECT "Away team" FROM table_60695 WHERE "Home team" = 'woking'
wikisql
CREATE TABLE table_name_26 ( genre VARCHAR, year_recorded VARCHAR )
What genre is the song recorded in 1929?
SELECT genre FROM table_name_26 WHERE year_recorded = "1929"
sql_create_context
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, ...
4050783这个医院的患者78487358,列出其出院诊断医生是韦医生的那次出院诊断的结果
SELECT gwyjzb.OUT_DIAG_DIS_CD, gwyjzb.OUT_DIAG_DIS_NM FROM gwyjzb WHERE gwyjzb.PERSON_ID = '78487358' AND gwyjzb.MED_SER_ORG_NO = '4050783' AND gwyjzb.OUT_DIAG_DOC_NM LIKE '韦%' UNION SELECT fgwyjzb.OUT_DIAG_DIS_CD, fgwyjzb.OUT_DIAG_DIS_NM FROM fgwyjzb WHERE fgwyjzb.PERSON_ID = '78487358' AND fgwyjzb.MED_SER_ORG_NO = '4...
css
CREATE TABLE table_41954 ( "Tournament" text, "1993" text, "1994" text, "1995" text, "1996" text, "1997" text, "1998" text, "1999" text, "2000" text, "2001" text, "2002" text, "2003" text, "2004" text, "2005" text, "2006" text, "2007" text, "2008" text...
What is 2009, when 2000 is 1R, and when 1998 is 3R?
SELECT "2009" FROM table_41954 WHERE "2000" = '1r' AND "1998" = '3r'
wikisql
CREATE TABLE table_39106 ( "Year" real, "Competition" text, "Venue" text, "Position" text, "Event" text )
What is the number of years that the event was foil team and took place in Los Angeles?
SELECT COUNT("Year") FROM table_39106 WHERE "Venue" = 'los angeles' AND "Event" = 'foil team'
wikisql
CREATE TABLE table_52160 ( "Track" real, "Recorded" text, "Original Issue" text, "Song Title" text, "Time" text )
Which track has a title : Just a little bit
SELECT MIN("Track") FROM table_52160 WHERE "Song Title" = 'just a little bit'
wikisql
CREATE TABLE table_name_4 ( country VARCHAR, player VARCHAR, score VARCHAR, place VARCHAR )
Which Country has a Score smaller than 70, and a Place of t3, and a Player of andr s romero?
SELECT country FROM table_name_4 WHERE score < 70 AND place = "t3" AND player = "andrés romero"
sql_create_context
CREATE TABLE table_1057316_1 ( wheel_arrangement___whyte_notation__ VARCHAR, disposition VARCHAR )
What is the wheel arrangement for the train in Riverdale, Georgia?
SELECT wheel_arrangement___whyte_notation__ FROM table_1057316_1 WHERE disposition = "Riverdale, Georgia"
sql_create_context
CREATE TABLE airline ( airline_code varchar, airline_name text, note text ) CREATE TABLE fare_basis ( fare_basis_code text, booking_class text, class_type text, premium text, economy text, discounted text, night text, season text, basis_days text ) CREATE TABLE month ( ...
what airlines have flights from BOSTON to PHILADELPHIA that leave before 630
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_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'PHILADELPHIA' AND flight.departure_time < 630 AND flight.to_airport = AIRPOR...
atis
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...
what is minimum days of hospital stay of patients whose marital status is single?
SELECT MIN(demographic.days_stay) FROM demographic WHERE demographic.marital_status = "SINGLE"
mimicsql_data
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 PostNoticeTypes ( Id number, ClassId number, Name te...
Total number of questions posted in a given year..
SELECT COUNT(*) FROM Posts WHERE CreationDate BETWEEN '2018-01-01' AND '2018-12-31' AND Tags LIKE '%python%'
sede
CREATE TABLE course ( course_id int, name varchar, department varchar, number varchar, credits varchar, advisory_requirement varchar, enforced_requirement varchar, description varchar, num_semesters int, num_enrolled int, has_discussion varchar, has_lab varchar, has_p...
What time of the day does BCS 439 start next semester ?
SELECT DISTINCT course_offering.start_time FROM course INNER JOIN program_course ON program_course.course_id = course.course_id INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester WHERE course.department = 'BCS' AND course.num...
advising
CREATE TABLE table_name_83 ( title VARCHAR, production_number VARCHAR )
What is the title of the production with a number of 1039?
SELECT title FROM table_name_83 WHERE production_number = "1039"
sql_create_context
CREATE TABLE table_65905 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text )
What was Laura Diaz's score for place t9?
SELECT "Score" FROM table_65905 WHERE "Place" = 't9' AND "Player" = 'laura diaz'
wikisql
CREATE TABLE table_45743 ( "Player" text, "Nationality" text, "Jersey Number(s)" real, "Position" text, "Years" text, "From" text )
What is the Nationality of the Player with Jersey Number 6?
SELECT "Nationality" FROM table_45743 WHERE "Jersey Number(s)" = '6'
wikisql
CREATE TABLE table_1341577_44 ( candidates VARCHAR, incumbent VARCHAR )
Who were the candidates when Jack Fields was the incumbent?
SELECT candidates FROM table_1341577_44 WHERE incumbent = "Jack Fields"
sql_create_context
CREATE TABLE table_22850 ( "Rank" real, "London Borough" text, "Indian Population" real, "Pakistani Population" real, "Bangladeshi Population" real, "Chinese Population" real, "Other Asian Population" real, "Total Asian Population" real )
How many Bangladeshi citizens live in the borough ranked at number 14?
SELECT MAX("Bangladeshi Population") FROM table_22850 WHERE "Rank" = '14'
wikisql
CREATE TABLE table_76832 ( "Name" text, "Country" text, "Status" text, "Transfer window" text, "Transfer fee" text )
What is the name of the free transfer fee with a transfer status and an ENG country?
SELECT "Name" FROM table_76832 WHERE "Transfer fee" = 'free' AND "Status" = 'transfer' AND "Country" = 'eng'
wikisql
CREATE TABLE table_name_54 ( attendance INTEGER, result VARCHAR )
What is the sum of attendance when the result was l 16-13?
SELECT SUM(attendance) FROM table_name_54 WHERE result = "l 16-13"
sql_create_context
CREATE TABLE table_54982 ( "Rank" real, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
Which mean rank had a silver number smaller than 0?
SELECT AVG("Rank") FROM table_54982 WHERE "Silver" < '0'
wikisql
CREATE TABLE table_name_60 ( to_par VARCHAR, place VARCHAR, player VARCHAR )
What is T5 Place Vijay Singh's To par?
SELECT to_par FROM table_name_60 WHERE place = "t5" AND player = "vijay singh"
sql_create_context
CREATE TABLE table_29451 ( "Club" text, "Chairman" text, "Current manager" text, "Team captain" text, "Kitmaker" text, "Shirt sponsor" text )
Who is the team captain when the club is k.f.c. germinal beerschot?
SELECT "Team captain" FROM table_29451 WHERE "Club" = 'K.F.C. Germinal Beerschot'
wikisql
CREATE TABLE table_56544 ( "Round" text, "Player" text, "Position" text, "Team" text, "College" text )
Who plays f position for depauw?
SELECT "Player" FROM table_56544 WHERE "Position" = 'f' AND "College" = 'depauw'
wikisql
CREATE TABLE field ( fieldid int ) CREATE TABLE author ( authorid int, authorname varchar ) CREATE TABLE venue ( venueid int, venuename varchar ) CREATE TABLE dataset ( datasetid int, datasetname varchar ) CREATE TABLE paperkeyphrase ( paperid int, keyphraseid int ) CREATE TABLE...
monte carlo simulation papers published after 2011
SELECT DISTINCT paper.paperid FROM keyphrase, paper, paperkeyphrase WHERE keyphrase.keyphrasename = 'monte carlo simulation' AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paper.paperid = paperkeyphrase.paperid AND paper.year > 2011
scholar
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 prescription...
give me the number of patients whose admission type is urgent and diagnoses long title is antifungal antibiotics causing adverse effects in therapeutic use?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admission_type = "URGENT" AND diagnoses.long_title = "Antifungal antibiotics causing adverse effects in therapeutic use"
mimicsql_data
CREATE TABLE jyjgzbb ( JYZBLSH text, YLJGDM text, BGDH text, BGRQ time, JYRQ time, JCRGH text, JCRXM text, SHRGH text, SHRXM text, JCXMMC text, JCZBDM text, JCFF text, JCZBMC text, JCZBJGDX text, JCZBJGDL number, JCZBJGDW text, SBBM text, YQBH text...
孔雅静患者报告日期均在2011年1月25日之后的住院就诊记录对应着哪些检验报告单和住院就诊流水号是多少?
SELECT zyjzjlb.JZLSH FROM person_info JOIN hz_info JOIN zyjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX WHERE person_info.XM = '孔雅静' AND NOT zyjzjlb.JZLSH IN (SELECT JZLSH FROM jybgb WHERE BGRQ <= '2011-01-25')
css
CREATE TABLE table_52559 ( "Week" text, "Date" text, "Opponent" text, "Result" text, "Kickoff [a ]" text, "Game site" text, "Attendance" text, "Record" text )
Where was the game that had an attendance of 39,889?
SELECT "Game site" FROM table_52559 WHERE "Attendance" = '39,889'
wikisql
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 SuggestedEditVotes ( Id number, SuggestedEditId number, ...
For Posts Created in 2017, Avg time between Question created and Accepted Ans.
SELECT CreationDate FROM PostFeedback WHERE CAST(CreationDate AS DATETIME) BETWEEN '2017-01-01 00:00:00' AND '2017-12-31 23:59:59'
sede
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, ...
列出在医院8360401中患者喻浩岚名称不包含整形科的出院科室有哪些住院就诊记录?
SELECT * FROM hz_info JOIN zyjzjlb ON hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX WHERE hz_info.person_info_XM = '喻浩岚' AND hz_info.YLJGDM = '8360401' AND NOT zyjzjlb.CYKSMC LIKE '%整形科%'
css
CREATE TABLE table_59448 ( "Outcome" text, "Date" text, "Tournament" text, "Surface" text, "Partner" text, "Opponents in the final" text, "Score in the final" text )
What was the score where Olga Lugina played in the Tournament of poitiers , france itf $25,000?
SELECT "Score in the final" FROM table_59448 WHERE "Partner" = 'olga lugina' AND "Tournament" = 'poitiers , france itf $25,000'
wikisql
CREATE TABLE t_kc22 ( AMOUNT number, CHA_ITEM_LEV number, DATA_ID text, DIRE_TYPE number, DOSE_FORM text, DOSE_UNIT text, EACH_DOSAGE text, EXP_OCC_DATE time, FLX_MED_ORG_ID text, FXBZ number, HOSP_DOC_CD text, HOSP_DOC_NM text, MED_CLINIC_ID text, MED_DIRE_CD tex...
在医院1150862里根据不同的科室编码和入院诊断疾病名称列出所有医疗就诊记录中病人的平均年龄是多少?
SELECT qtb.MED_ORG_DEPT_CD, qtb.IN_DIAG_DIS_NM, AVG(qtb.PERSON_AGE) FROM qtb WHERE qtb.MED_SER_ORG_NO = '1150862' GROUP BY qtb.MED_ORG_DEPT_CD, qtb.IN_DIAG_DIS_NM UNION SELECT gyb.MED_ORG_DEPT_CD, gyb.IN_DIAG_DIS_NM, AVG(gyb.PERSON_AGE) FROM gyb WHERE gyb.MED_SER_ORG_NO = '1150862' GROUP BY gyb.MED_ORG_DEPT_CD, gyb.IN_...
css
CREATE TABLE table_74908 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Attendance" real, "Record" text, "Points" real )
Score of 2 1 has what record?
SELECT "Record" FROM table_74908 WHERE "Score" = '2–1'
wikisql
CREATE TABLE comment_instructor ( instructor_id int, student_id int, score int, comment_text varchar ) CREATE TABLE offering_instructor ( offering_instructor_id int, offering_id int, instructor_id int ) CREATE TABLE student_record ( student_id int, course_id int, semester int, ...
If I want to be prepared for WOMENSTD 444 , what course should I take ?
SELECT DISTINCT advisory_requirement FROM course WHERE department = 'WOMENSTD' AND number = 444
advising
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...
列出医疗就诊记录中医疗费总额与医疗就诊18542009470相同的的ID、人员ID、人员姓名、公民身份号码、人员性别、人员年龄都是什么啊?
SELECT qtb.MED_CLINIC_ID, qtb.PERSON_ID, qtb.PERSON_NM, qtb.IDENTITY_CARD, qtb.PERSON_SEX, qtb.PERSON_AGE FROM qtb JOIN t_kc24 ON qtb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE t_kc24.MED_AMOUT = (SELECT t_kc24.MED_AMOUT FROM t_kc24 WHERE t_kc24.MED_CLINIC_ID = '18542009470') UNION SELECT gyb.MED_CLINIC_ID, gyb.PERSON_...
css
CREATE TABLE aircraft ( aid number(9,0), name varchar2(30), distance number(6,0) ) CREATE TABLE flight ( flno number(4,0), origin varchar2(20), destination varchar2(20), distance number(6,0), departure_date date, arrival_date date, price number(7,2), aid number(9,0) ) CREAT...
Display a bar chart for what is the name of each aircraft and how many flights does each one complete?, and sort in ascending by the y-axis.
SELECT name, COUNT(*) FROM flight AS T1 JOIN aircraft AS T2 ON T1.aid = T2.aid GROUP BY T1.aid ORDER BY COUNT(*)
nvbench
CREATE TABLE table_name_99 ( league VARCHAR, open_cup VARCHAR, year VARCHAR )
Which League that has a Open Cup of 1st round, and a Year of 2009?
SELECT league FROM table_name_99 WHERE open_cup = "1st round" AND year = 2009
sql_create_context
CREATE TABLE table_1342013_9 ( result VARCHAR, district VARCHAR )
what's the result with dbeingtrict being florida 4
SELECT result FROM table_1342013_9 WHERE district = "Florida 4"
sql_create_context
CREATE TABLE t_kc21_t_kc24 ( MED_CLINIC_ID text, MED_SAFE_PAY_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, ...
查一下华曼衍这个病人的医疗记录中,有几回被开出的药品金额不多于7616.57元?请列出他的医疗就诊编号
SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_NM = '华曼衍' AND NOT t_kc21.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT > 7616.57)
css
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...
列出患者花春雪被开出的所有药品的编码、名称、数量、单价、金额是多少,在2000-04-01到2018-05-25这十八年内?
SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM, t_kc22.QTY, t_kc22.UNIVALENT, t_kc22.AMOUNT FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.PERSON_NM = '花春雪' AND t_kc21.IN_HOSP_DATE BETWEEN '2000-04-01' AND '2018-05-25'
css
CREATE TABLE table_20468206_1 ( obama_number INTEGER, mccain_number VARCHAR )
Name the most abama number for mccain being 29266
SELECT MAX(obama_number) FROM table_20468206_1 WHERE mccain_number = 29266
sql_create_context
CREATE TABLE gsi ( course_offering_id int, student_id int ) CREATE TABLE program_requirement ( program_id int, category varchar, min_credit int, additional_req varchar ) CREATE TABLE offering_instructor ( offering_instructor_id int, offering_id int, instructor_id int ) CREATE TABL...
What does STRATEGY 564 entail ?
SELECT DISTINCT description, name FROM course WHERE department = 'STRATEGY' AND number = 564
advising
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 )
For those records from the products and each product's manufacturer, show me about the distribution of name and revenue , and group by attribute headquarter in a bar chart, display by the bars in asc.
SELECT T1.Name, T2.Revenue FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter, T1.Name ORDER BY T1.Name
nvbench
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...
what is the yearly minimum intake of volume (ml) dopamine that patient 006-78314 is getting?
SELECT MIN(intakeoutput.cellvaluenumeric) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-78314')) AND intakeoutput.celllabel = 'volum...
eicu
CREATE TABLE program_requirement ( program_id int, category varchar, min_credit int, additional_req varchar ) CREATE TABLE offering_instructor ( offering_instructor_id int, offering_id int, instructor_id int ) CREATE TABLE program ( program_id int, name varchar, college varchar...
EECS 174 has what kind of workload ?
SELECT DISTINCT program_course.workload FROM course, program_course WHERE course.department = 'EECS' AND course.number = 174 AND program_course.course_id = course.course_id
advising
CREATE TABLE table_21318 ( "Game" real, "Date" text, "Opponent" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location/Attendance" text, "Record" text )
What are the scores for games played on september 9?
SELECT "Score" FROM table_21318 WHERE "Date" = 'September 9'
wikisql
CREATE TABLE table_name_35 ( league_apps VARCHAR, fa_cup_apps VARCHAR, league_goals VARCHAR, position VARCHAR )
Tell me the league apps with league goals less than 2 and position of df and FA cup apps of 5
SELECT league_apps FROM table_name_35 WHERE league_goals < 2 AND position = "df" AND fa_cup_apps = "5"
sql_create_context
CREATE TABLE table_64529 ( "Team" text, "Outgoing manager" text, "Manner of departure" text, "Date of vacancy" text, "Replaced by" text, "Date of appointment" text, "Position in table" text )
Who is the outgoing manager when they were replaced by pablo centrone?
SELECT "Outgoing manager" FROM table_64529 WHERE "Replaced by" = 'pablo centrone'
wikisql
CREATE TABLE table_name_14 ( date_s_ VARCHAR, winner VARCHAR )
What date did Virginia Commonwealth Rams win?
SELECT date_s_ FROM table_name_14 WHERE winner = "virginia commonwealth rams"
sql_create_context
CREATE TABLE table_1341843_19 ( district VARCHAR, incumbent VARCHAR )
What district is F. Edward Hebert the incumbent in?
SELECT district FROM table_1341843_19 WHERE incumbent = "F. Edward Hebert"
sql_create_context
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE patient ( uniquepid text, patientheal...
what was the total input amount that patient 006-157753 has received on the current icu visit?
SELECT SUM(intakeoutput.cellvaluenumeric) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-157753') AND patient.unitdischargetime IS NU...
eicu
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...
what is SA
SELECT DISTINCT day_name FROM days WHERE days_code = 'SA'
atis
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 ) ...
find the language of subject id 52118.
SELECT demographic.language FROM demographic WHERE demographic.subject_id = "52118"
mimicsql_data
CREATE TABLE table_name_92 ( stadium VARCHAR, score VARCHAR )
For the match ending in a score of 66-20, what was the stadium?
SELECT stadium FROM table_name_92 WHERE score = "66-20"
sql_create_context
CREATE TABLE Ref_Address_Types ( address_type_code VARCHAR(15), address_type_description VARCHAR(80) ) CREATE TABLE Teachers ( teacher_id INTEGER, address_id INTEGER, first_name VARCHAR(80), middle_name VARCHAR(80), last_name VARCHAR(80), gender VARCHAR(1), cell_mobile_number VARCHA...
Give me the comparison about the average of monthly_rental over the date_address_from bin date_address_from by time.
SELECT date_address_from, AVG(monthly_rental) FROM Student_Addresses ORDER BY monthly_rental DESC
nvbench
CREATE TABLE schedule ( Cinema_ID int, Film_ID int, Date text, Show_times_per_day int, Price float ) CREATE TABLE film ( Film_ID int, Rank_in_series int, Number_in_season int, Title text, Directed_by text, Original_air_date text, Production_code text ) CREATE TABLE cine...
What is total number of show times per dat for each cinema Show bar chart, sort from high to low by the show times per day please.
SELECT Name, SUM(T1.Show_times_per_day) FROM schedule AS T1 JOIN cinema AS T2 ON T1.Cinema_ID = T2.Cinema_ID GROUP BY T1.Cinema_ID ORDER BY SUM(T1.Show_times_per_day) DESC
nvbench
CREATE TABLE table_11545282_10 ( years_for_jazz VARCHAR, no VARCHAR )
During which years did player number 35 play for Jazz?
SELECT years_for_jazz FROM table_11545282_10 WHERE no = "35"
sql_create_context
CREATE TABLE table_32161 ( "Region" text, "Date" real, "Label" text, "Format" text, "Catalog" text )
Tell me the format for european union
SELECT "Format" FROM table_32161 WHERE "Region" = 'european union'
wikisql
CREATE TABLE table_15869 ( "Player" text, "No." real, "Nationality" text, "Position" text, "Years in Toronto" text, "School/Club Team" text )
What's the number of the player from Boise State?
SELECT "No." FROM table_15869 WHERE "School/Club Team" = 'Boise State'
wikisql
CREATE TABLE table_50585 ( "County" text, "Kerry%" text, "Kerry#" real, "Bush%" text, "Bush#" real, "Others%" text, "Others#" real )
Which county had a Bush number of votes of 566?
SELECT "County" FROM table_50585 WHERE "Bush#" = '566'
wikisql
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...
A bar chart shows the distribution of ACC_Road and the average of School_ID , and group by attribute ACC_Road, list Y-axis in asc order.
SELECT ACC_Road, AVG(School_ID) FROM basketball_match GROUP BY ACC_Road ORDER BY AVG(School_ID)
nvbench
CREATE TABLE course_prerequisite ( pre_course_id int, course_id int ) CREATE TABLE student_record ( student_id int, course_id int, semester int, grade varchar, how varchar, transfer_source varchar, earn_credit varchar, repeat_term varchar, test_id varchar ) CREATE TABLE job...
Are there any RCNSCI classes that meet on any day but Friday ?
SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester WHERE course_offering.friday = 'N' AND course.department = 'RCNSCI' AND semester.semester = 'WN' AND...
advising
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 are the ways to consume gabapentin 300 mg po caps?
SELECT DISTINCT medication.routeadmin FROM medication WHERE medication.drugname = 'gabapentin 300 mg po caps'
eicu
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, a...
on the first icu visit, what was the daily minimum intake of ivpb of patient 007-1517?
SELECT MIN(intakeoutput.cellvaluenumeric) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '007-1517') AND NOT patient.unitdischargetime IS ...
eicu
CREATE TABLE table_53354 ( "Track" real, "Title" text, "Author(s)" text, "Recorded" text, "Length" text )
Which title is 3:38 long?
SELECT "Title" FROM table_53354 WHERE "Length" = '3:38'
wikisql
CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE Users ( Id number, Reputation number, CreationDate time, ...
Top 10000 users on Stack Overflow.
SELECT * FROM Users ORDER BY Reputation DESC LIMIT 10000
sede
CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id n...
in a year before, what is the three most frequently taken lab test for patients of 30s?
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 30 AND 39) AND DATETIME(labevents.chartti...
mimic_iii
CREATE TABLE zyjzjlb_jybgb ( YLJGDM_ZYJZJLB text, BGDH number, YLJGDM 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, X...
从05年8月1日到21年1月3日,病人在8515930这个医疗机构的住院时间超过30天的记录有多少
SELECT COUNT(*) FROM zyjzjlb WHERE zyjzjlb.YLJGDM = '8515930' AND zyjzjlb.RYDJSJ BETWEEN '2005-08-01' AND '2021-01-03' AND DATEDIFF(zyjzjlb.CYSJ, zyjzjlb.RYSJ) > 30
css
CREATE TABLE table_19958 ( "Episode No." text, "Episode Title" text, "UK Broadcast Date" text, "Presenter" text, "Details of Journey" text, "Countries Visited" text )
What is the episode title for the episode numbered #1.4?
SELECT "Episode Title" FROM table_19958 WHERE "Episode No." = '#1.4'
wikisql
CREATE TABLE table_33639 ( "Player" text, "Nationality" text, "Position" text, "From" text, "School/Country" text )
What school did the guard who began playing in 1991 come from?
SELECT "School/Country" FROM table_33639 WHERE "Position" = 'guard' AND "From" = '1991'
wikisql
CREATE TABLE table_name_24 ( gold_coast VARCHAR, melbourne VARCHAR, auckland VARCHAR, adelaide VARCHAR )
Which Gold Coast has Auckland no, Adelaide yes, and Melbourne no?
SELECT gold_coast FROM table_name_24 WHERE auckland = "no" AND adelaide = "yes" AND melbourne = "no"
sql_create_context
CREATE TABLE ref_characteristic_types ( characteristic_type_code text, characteristic_type_description text ) CREATE TABLE characteristics ( characteristic_id number, characteristic_type_code text, characteristic_data_type text, characteristic_name text, other_characteristic_details text ) ...
How many products are in the 'Spices' category and have a typical price of over 1000?
SELECT COUNT(*) FROM products WHERE product_category_code = "Spices" AND typical_buying_price > 1000
spider
CREATE TABLE table_16148 ( "Rd" real, "Name" text, "Pole Position" text, "Fastest Lap" text, "Winning driver" text, "Winning team" text, "Report" text )
What was Johnny Rutherford's fastest lap while Al Unser was the pole position?
SELECT "Fastest Lap" FROM table_16148 WHERE "Winning driver" = 'Johnny Rutherford' AND "Pole Position" = 'Al Unser'
wikisql
CREATE TABLE table_204_860 ( id number, "#" number, "date" text, "venue" text, "opponent" text, "score" text, "result" text, "competition" text )
what is the first venue in calender year 2012 ?
SELECT "venue" FROM table_204_860 WHERE "date" = 2012 ORDER BY "date" LIMIT 1
squall
CREATE TABLE table_35597 ( "Length of game" text, "Date" text, "Away team" text, "Score" text, "Home team" text )
What was the date of the game that lasted 75:43?
SELECT "Date" FROM table_35597 WHERE "Length of game" = '75:43'
wikisql
CREATE TABLE table_32297 ( "Res." text, "Record" text, "Opponent" text, "Method" text, "Event" text, "Round" real, "Time" text, "Location" text )
Who was the opponent when the time was 1:47?
SELECT "Opponent" FROM table_32297 WHERE "Time" = '1:47'
wikisql
CREATE TABLE table_name_28 ( visitor VARCHAR, leading_scorer VARCHAR )
What is the Visitor with a Leading scorer with rudy gay (24)?
SELECT visitor FROM table_name_28 WHERE leading_scorer = "rudy gay (24)"
sql_create_context
CREATE TABLE table_74159 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text )
Who had the most the most rebounds and how many did they have on April 1?
SELECT "High rebounds" FROM table_74159 WHERE "Date" = 'April 1'
wikisql
CREATE TABLE table_58656 ( "Matches" real, "Wins" real, "Draw" real, "Losses" real, "Against" real )
How many total losses were with less than 51 draws but more than 6 wins?
SELECT COUNT("Losses") FROM table_58656 WHERE "Draw" < '51' AND "Wins" > '6'
wikisql
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) ...
what is death status of subject id 83678?
SELECT demographic.expire_flag FROM demographic WHERE demographic.subject_id = "83678"
mimicsql_data
CREATE TABLE table_203_718 ( id number, "pos" text, "rider" text, "manufacturer" text, "time/retired" text, "points" number )
which rider is listed in the position after loris capirossi ?
SELECT "rider" FROM table_203_718 WHERE "pos" = (SELECT "pos" FROM table_203_718 WHERE "rider" = 'loris capirossi') + 1
squall
CREATE TABLE table_6886 ( "Tournament" text, "Wins" real, "Top-5" real, "Top-10" real, "Top-25" real, "Events" real, "Cuts made" real )
What was the total number of Top-25 values, for which Cuts made was 62, and for which Wins were less than 1?
SELECT COUNT("Top-25") FROM table_6886 WHERE "Cuts made" = '62' AND "Wins" < '1'
wikisql
CREATE TABLE table_67992 ( "Year" text, "Date Final" text, "Venue" text, "Prize Money" text, "Champion" text, "Runner-up" text, "Score in final" text, "Commercial name" text )
What date final has 1982 as the year?
SELECT "Date Final" FROM table_67992 WHERE "Year" = '1982'
wikisql
CREATE TABLE table_name_79 ( station VARCHAR, country_of_origin VARCHAR, frequency VARCHAR )
Which station is from China and has a frequency of 684khz?
SELECT station FROM table_name_79 WHERE country_of_origin = "china" AND frequency = "684khz"
sql_create_context
CREATE TABLE table_22248 ( "Name" text, "Notability" text, "Reason for Seeking Refuge" text, "Country" text, "City" text, "Missions Country" text, "Start Date" text, "End Date" text, "Resolution" text )
How many missions countries have notability with president of burundi?
SELECT COUNT("Missions Country") FROM table_22248 WHERE "Notability" = 'President of Burundi'
wikisql
CREATE TABLE table_73207 ( "Season" text, "Series" text, "Team" text, "Races" real, "Wins" real, "Poles" real, "F/Laps" real, "Podiums" real, "Points" real, "Position" text )
What team did he compete for in the GP3 series?
SELECT "Team" FROM table_73207 WHERE "Series" = 'GP3 Series'
wikisql
CREATE TABLE table_25395 ( "Team" text, "SEC Wins" real, "SEC Losses" real, "Percentage" text, "Home Record" text, "Road Record" text, "Overall Record" text )
Name the percentage for ole miss
SELECT "Percentage" FROM table_25395 WHERE "Team" = 'Ole Miss'
wikisql
CREATE TABLE table_71549 ( "Year" real, "Team" text, "Co-Drivers" text, "Class" text, "Laps" real, "Pos." text, "Class Pos." text )
What year did finish 1st in LMP1 class?
SELECT AVG("Year") FROM table_71549 WHERE "Class" = 'lmp1' AND "Class Pos." = '1st'
wikisql
CREATE TABLE debate ( Venue VARCHAR, Num_of_Audience VARCHAR )
List the venues of debates in ascending order of the number of audience.
SELECT Venue FROM debate ORDER BY Num_of_Audience
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...
what is the number of patients with the prescription of ondansetron and have a diagnoses of chronic total occlusion of coronary artery primary disease?
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.long_title = "Chronic total occlusion of coronary artery" AND prescriptions.drug = "Ondansetron"
mimicsql_data
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospit...
how much is the daily minimum weight of patient 015-8398 on their last hospital encounter?
SELECT MIN(patient.admissionweight) FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '015-8398' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospitaladmittime DESC LIMIT 1) AND NOT patient.admissionweight IS NULL G...
eicu
CREATE TABLE restriction ( restriction_code text, advance_purchase int, stopovers text, saturday_stay_required text, minimum_stay int, maximum_stay int, application text, no_discounts text ) CREATE TABLE code_description ( code varchar, description text ) CREATE TABLE month ( ...
show me the flights that go from SAN DIEGO to NEWARK by way of HOUSTON
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, airport_service AS AIRPORT_SERVICE_2, city AS CITY_0, city AS CITY_1, city AS CITY_2, flight, flight_stop WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'NEWARK' AND CITY_2.cit...
atis
CREATE TABLE table_name_54 ( opponent VARCHAR, attendance VARCHAR )
Who did the cowboys play when 65,537 attended?
SELECT opponent FROM table_name_54 WHERE attendance = "65,537"
sql_create_context
CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, ...
Deleted user's answers (link, question title, tags, score).
SELECT a.Id AS link, q.Title AS title, q.Tags AS tags, a.Score AS score FROM Posts AS q INNER JOIN Posts AS a ON q.Id = a.ParentId AND a.PostTypeId = 2 AND q.PostTypeId = 1 WHERE a.CommunityOwnedDate IS NULL AND a.OwnerDisplayName = '##UserName##' AND a.OwnerUserId IS NULL ORDER BY a.Score DESC
sede