context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
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 transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, ...
when's the last time that patient 65838 had a excision intervert disc in the last hospital visit?
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 = 'excision intervert disc') AND procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 65838 AND N...
mimic_iii
CREATE TABLE table_49172 ( "Round" real, "Pick" real, "Player" text, "Position" text, "School/Club Team" text )
What pick was used to select a Defensive End in round 8?
SELECT SUM("Pick") FROM table_49172 WHERE "Position" = 'defensive end' AND "Round" = '8'
wikisql
CREATE TABLE table_70715 ( "Dance" text, "Best dancer(s)" text, "Best score" real, "Worst dancer(s)" text, "Worst score" real )
What's the best average score with a bad score of 15?
SELECT AVG("Best score") FROM table_70715 WHERE "Worst score" = '15'
wikisql
CREATE TABLE CLASS ( CLASS_CODE varchar(5), CRS_CODE varchar(10), CLASS_SECTION varchar(2), CLASS_TIME varchar(20), CLASS_ROOM varchar(8), PROF_NUM int ) CREATE TABLE DEPARTMENT ( DEPT_CODE varchar(10), DEPT_NAME varchar(30), SCHOOL_CODE varchar(8), EMP_NUM int, DEPT_ADDRESS...
How many professors have a PhD in each department Show bar chart, sort Y-axis in desc order.
SELECT DEPT_CODE, COUNT(*) FROM PROFESSOR WHERE PROF_HIGH_DEGREE = 'Ph.D.' GROUP BY DEPT_CODE ORDER BY COUNT(*) DESC
nvbench
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...
在不同科室编码下,列出所有医疗就诊记录在医院9913454的统筹基金支出与医疗费总额的平均比值是多少?
SELECT t_kc24.t_kc21_MED_ORG_DEPT_CD, AVG(t_kc24.OVE_PAY) FROM t_kc24 WHERE t_kc24.t_kc21_MED_SER_ORG_NO = '9913454' GROUP BY t_kc24.t_kc21_MED_ORG_DEPT_CD
css
CREATE TABLE vocals ( songid number, bandmate number, type text ) CREATE TABLE albums ( aid number, title text, year number, label text, type text ) CREATE TABLE songs ( songid number, title text ) CREATE TABLE performance ( songid number, bandmate number, stagepos...
Find all the stage positions of the musicians with first name 'Solveig
SELECT DISTINCT T1.stageposition FROM performance AS T1 JOIN band AS T2 ON T1.bandmate = T2.id WHERE firstname = "Solveig"
spider
CREATE TABLE table_21546 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text )
What was the high assists on November 14?
SELECT "High assists" FROM table_21546 WHERE "Date" = 'November 14'
wikisql
CREATE TABLE table_name_91 ( school_club_team VARCHAR, nationality VARCHAR, player VARCHAR )
What is the School/Club Team with a nationality of United States for Arron Afflalo?
SELECT school_club_team FROM table_name_91 WHERE nationality = "united states" AND player = "arron afflalo"
sql_create_context
CREATE TABLE table_2263152_1 ( version VARCHAR, security_issues VARCHAR, distribution_mechanism VARCHAR )
With the distribution mechanism of Microsoft website and the security issues of 98-004, what is the version?
SELECT version FROM table_2263152_1 WHERE security_issues = "98-004" AND distribution_mechanism = "Microsoft website"
sql_create_context
CREATE TABLE table_name_36 ( attendance INTEGER, result VARCHAR, week VARCHAR )
What is the highest Attendance, when Result is l 26-16, and when Week is less than 12?
SELECT MAX(attendance) FROM table_name_36 WHERE result = "l 26-16" AND week < 12
sql_create_context
CREATE TABLE table_name_46 ( score VARCHAR, opponent VARCHAR, record VARCHAR )
Which Score has an Opponent of @ houston, and a Record of 2-0?
SELECT score FROM table_name_46 WHERE opponent = "@ houston" AND record = "2-0"
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 procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ...
tell me the age and health insurance under which the patient with patient id 42067 is covered.
SELECT demographic.age, demographic.insurance FROM demographic WHERE demographic.subject_id = "42067"
mimicsql_data
CREATE TABLE icustays ( row_id number, subject_id number, hadm_id number, icustay_id number, first_careunit text, last_careunit text, first_wardid number, last_wardid number, intime time, outtime time ) CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, s...
how many times on the current intensive care unit visit did patient 83062 produce chest tubes left pleural 2?
SELECT COUNT(*) 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 = 83062) AND icustays.outtime IS NULL) AND outputevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_item...
mimic_iii
CREATE TABLE table_name_52 ( ccbs INTEGER, launches_to_date VARCHAR, payload_to_gto VARCHAR )
What is the greatest CCBs with Launches to date of 4, and a Payload to GTO of 8,900kg?
SELECT MAX(ccbs) FROM table_name_52 WHERE launches_to_date = 4 AND payload_to_gto = "8,900kg"
sql_create_context
CREATE TABLE table_name_86 ( realvideo VARCHAR, mpeg_2 VARCHAR, mpeg_1 VARCHAR )
Tell me the MPEG-2 of yes and MPEG-1 of yes
SELECT realvideo FROM table_name_86 WHERE mpeg_2 = "yes" AND mpeg_1 = "yes"
sql_create_context
CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemicsystolic number, systemicdiastolic number, systemicmean number, observationtime time ) CREATE TABLE medication ( medi...
have patient 033-22108 been to the er in the current hospital encounter?
SELECT COUNT(*) > 0 FROM patient WHERE patient.uniquepid = '033-22108' AND patient.hospitaladmitsource = 'emergency department' AND patient.hospitaldischargetime IS NULL
eicu
CREATE TABLE university ( School_ID int, School text, Location text, Founded real, Affiliation text, Enrollment real, Nickname text, Primary_conference text ) CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Per...
Give me the comparison about All_Games_Percent over the ACC_Regular_Season , list total number in ascending order.
SELECT ACC_Regular_Season, All_Games_Percent FROM basketball_match ORDER BY All_Games_Percent
nvbench
CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Percent text, ACC_Home text, ACC_Road text, All_Games text, All_Games_Percent int, All_Home text, All_Road text, All_Neutral text ) CREATE TABLE university ( Scho...
Show me school_id by all road in a histogram, and I want to list from low to high by the x axis.
SELECT All_Road, School_ID FROM basketball_match ORDER BY All_Road
nvbench
CREATE TABLE table_name_18 ( games VARCHAR, event VARCHAR )
Tell me the games for men's 5000 metres
SELECT games FROM table_name_18 WHERE event = "men's 5000 metres"
sql_create_context
CREATE TABLE table_name_94 ( site VARCHAR, opponent VARCHAR )
Where did the game(s) against Iowa take place?
SELECT site FROM table_name_94 WHERE opponent = "iowa"
sql_create_context
CREATE TABLE table_204_270 ( id number, "transmitter" text, "kw" number, "bbca" number, "bbcb" number, "d3&4" number, "sdn" number, "arqa" number, "arqb" number, "pol." text, "a.g." text )
tell me the transmitter directly above the one with a kw of 0.04 and a bbca of 22 .
SELECT "transmitter" FROM table_204_270 WHERE id = (SELECT id FROM table_204_270 WHERE "kw" = 0.04 AND "bbca" = 22) - 1
squall
CREATE TABLE table_203_663 ( id number, "country" text, "zone" text, "national federation" text, "#gm" number, "#fide" number, "national championship" text )
what is the total number of fide players in the united states ?
SELECT "#fide" FROM table_203_663 WHERE "country" = 'united states'
squall
CREATE TABLE table_28457809_3 ( first_llcr VARCHAR, province VARCHAR )
What year was Ontario's first LLCR?
SELECT first_llcr FROM table_28457809_3 WHERE province = "Ontario"
sql_create_context
CREATE TABLE flight ( aircraft_code_sequence text, airline_code varchar, airline_flight text, arrival_time int, connections int, departure_time int, dual_carrier text, flight_days text, flight_id int, flight_number int, from_airport varchar, meal_code text, stops int,...
list flights from LGA to BURBANK
SELECT DISTINCT flight_id FROM flight WHERE (from_airport IN (SELECT AIRPORTalias0.airport_code FROM airport AS AIRPORTalias0 WHERE AIRPORTalias0.airport_code = 'LGA') AND to_airport IN (SELECT AIRPORT_SERVICEalias0.airport_code FROM airport_service AS AIRPORT_SERVICEalias0 WHERE AIRPORT_SERVICEalias0.city_code IN (SEL...
atis
CREATE TABLE table_name_42 ( week VARCHAR, date VARCHAR )
What is the Week on November 10, 1996?
SELECT week FROM table_name_42 WHERE date = "november 10, 1996"
sql_create_context
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...
列出医院3491233中不同疾病的平均患者年龄是多少,根据入院诊断疾病编码?
SELECT t_kc21.IN_DIAG_DIS_CD, AVG(t_kc21.PERSON_AGE) FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '3491233' GROUP BY t_kc21.IN_DIAG_DIS_CD
css
CREATE TABLE table_49740 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text, "Money ( $ )" real )
What is the Country of T6 Place Player Ben Crenshaw?
SELECT "Country" FROM table_49740 WHERE "Place" = 't6' AND "Player" = 'ben crenshaw'
wikisql
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) C...
what is drug type and drug code of drug name propafenone hcl?
SELECT prescriptions.drug_type, prescriptions.formulary_drug_cd FROM prescriptions WHERE prescriptions.drug = "Propafenone HCl"
mimicsql_data
CREATE TABLE table_name_14 ( venue VARCHAR, player VARCHAR )
what venue does tim southee bowl at?
SELECT venue FROM table_name_14 WHERE player = "tim southee"
sql_create_context
CREATE TABLE Movie ( title VARCHAR, mID VARCHAR, year VARCHAR ) CREATE TABLE Reviewer ( rID VARCHAR, name VARCHAR ) CREATE TABLE Rating ( mID VARCHAR, rID VARCHAR )
What are names of the movies that are either made after 2000 or reviewed by Brittany Harris?
SELECT DISTINCT T2.title FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID JOIN Reviewer AS T3 ON T1.rID = T3.rID WHERE T3.name = 'Brittany Harris' OR T2.year > 2000
sql_create_context
CREATE TABLE table_170958_2 ( official_name VARCHAR, area_km_2 VARCHAR )
What is the official name of the land with an area of 276.84 km2?
SELECT official_name FROM table_170958_2 WHERE area_km_2 = "276.84"
sql_create_context
CREATE TABLE table_name_63 ( product_name VARCHAR, company_name VARCHAR )
What is the Product Name, when the Company Name is HTC Corporation?
SELECT product_name FROM table_name_63 WHERE company_name = "htc corporation"
sql_create_context
CREATE TABLE Apartment_Buildings ( building_id INTEGER, building_short_name CHAR(15), building_full_name VARCHAR(80), building_description VARCHAR(255), building_address VARCHAR(255), building_manager VARCHAR(50), building_phone VARCHAR(80) ) CREATE TABLE Apartment_Bookings ( apt_bookin...
What are the apartment number and the room count of each apartment Visualize by bar chart, and list x-axis from high to low order.
SELECT apt_number, room_count FROM Apartments ORDER BY apt_number DESC
nvbench
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...
在2021年4月7日到2021年11月9日内参保人35034507一种药品最多购买了多少次?
SELECT COUNT(*) FROM t_kc22 WHERE t_kc22.t_kc21_PERSON_ID = '35034507' AND t_kc22.STA_DATE BETWEEN '2021-04-07' AND '2021-11-09' GROUP BY t_kc22.SOC_SRT_DIRE_CD ORDER BY COUNT(*) DESC LIMIT 1
css
CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varchar(20), LAST_NAME varchar(25), EMAIL varchar(25), PHONE_NUMBER varchar(20), HIRE_DATE date, JOB_ID varchar(10), SALARY decimal(8,2), COMMISSION_PCT decimal(2,2), MANAGER_ID decimal(6,0), DEPARTMENT_ID decimal(...
For those employees who did not have any job in the past, return a bar chart about the distribution of hire_date and the average of department_id bin hire_date by time, sort by the y-axis in ascending.
SELECT HIRE_DATE, AVG(DEPARTMENT_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) ORDER BY AVG(DEPARTMENT_ID)
nvbench
CREATE TABLE shop ( Shop_ID int, Shop_Name text, Location text, Open_Date text, Open_Year int ) CREATE TABLE device ( Device_ID int, Device text, Carrier text, Package_Version text, Applications text, Software_Platform text ) CREATE TABLE stock ( Shop_ID int, Device...
Give a bar chart showing how many shops in each carrier, display in asc by the y axis.
SELECT Carrier, COUNT(Carrier) FROM stock AS T1 JOIN device AS T2 ON T1.Device_ID = T2.Device_ID JOIN shop AS T3 ON T1.Shop_ID = T3.Shop_ID GROUP BY Carrier ORDER BY COUNT(Carrier)
nvbench
CREATE TABLE table_name_38 ( record VARCHAR, date VARCHAR )
What is the record of the game on March 21?
SELECT record FROM table_name_38 WHERE date = "march 21"
sql_create_context
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 procedures that are the top five most common during this year?
SELECT t1.treatmentname FROM (SELECT treatment.treatmentname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM treatment WHERE DATETIME(treatment.treatmenttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') GROUP BY treatment.treatmentname) AS t1 WHERE t1.c1 <= 5
eicu
CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text ) CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, U...
Edits containing a comment starting with 'Relevance'.
SELECT 'site://posts/' + CAST(PostId AS TEXT) + '/revisions|' + 'Revision History for Post ' + CAST(PostId AS TEXT) AS "revision_link" FROM PostHistory WHERE Comment LIKE 'Relevance%'
sede
CREATE TABLE table_name_49 ( roll INTEGER, decile VARCHAR, years VARCHAR, name VARCHAR )
What is the largest roll with Years 1 8, a Name of dorie school, and a Decile larger than 9?
SELECT MAX(roll) FROM table_name_49 WHERE years = "1–8" AND name = "dorie school" AND decile > 9
sql_create_context
CREATE TABLE Products_for_Hire ( product_id INTEGER, product_type_code VARCHAR(15), daily_hire_cost DECIMAL(19,4), product_name VARCHAR(80), product_description VARCHAR(255) ) CREATE TABLE Bookings ( booking_id INTEGER, customer_id INTEGER, booking_status_code VARCHAR(10), returned_...
How many bookings did each customer make? List the first name as the X-axis, and the count as the Y-axis in the bar chart.
SELECT first_name, COUNT(*) FROM Customers AS T1 JOIN Bookings AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id
nvbench
CREATE TABLE table_3611 ( "District" text, "Incumbent" text, "Party" text, "First elected" text, "Result" text, "Candidates" text )
Who were the candidates in the election where william wilson was the incumbent?
SELECT "Candidates" FROM table_3611 WHERE "Incumbent" = 'William Wilson'
wikisql
CREATE TABLE table_52813 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
Where did st kilda play as the away team?
SELECT "Venue" FROM table_52813 WHERE "Away team" = 'st kilda'
wikisql
CREATE TABLE table_name_37 ( home_team VARCHAR )
What was Melbourne's score when they were the home team?
SELECT home_team AS score FROM table_name_37 WHERE home_team = "melbourne"
sql_create_context
CREATE TABLE table_name_48 ( venue VARCHAR, extra VARCHAR, result VARCHAR )
Which venue had an extra of Team Competition and a result of 1st?
SELECT venue FROM table_name_48 WHERE extra = "team competition" AND result = "1st"
sql_create_context
CREATE TABLE table_39711 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" text )
What Week has a Result of l 17-14?
SELECT SUM("Week") FROM table_39711 WHERE "Result" = 'l 17-14'
wikisql
CREATE TABLE table_name_19 ( score VARCHAR, attendance VARCHAR )
What is the score of the game with 39,592 attendance?
SELECT score FROM table_name_19 WHERE attendance = "39,592"
sql_create_context
CREATE TABLE table_name_77 ( score VARCHAR, money___$__ VARCHAR, player VARCHAR )
What is the score of Ralph Guldahl, who has more than $100?
SELECT score FROM table_name_77 WHERE money___$__ > 100 AND player = "ralph guldahl"
sql_create_context
CREATE TABLE table_name_42 ( laps INTEGER, constructor VARCHAR, time_retired VARCHAR )
What is the high lap total for tyrrell - yamaha, and a Time/Retired of + 1 lap?
SELECT MAX(laps) FROM table_name_42 WHERE constructor = "tyrrell - yamaha" AND time_retired = "+ 1 lap"
sql_create_context
CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number ) CREATE TABLE Tags ( Id number, TagName text, Count number, ExcerptPostId number, WikiPostId number ) CREATE TABLE CloseAsO...
Look for suspicious upvote patterns in a particular tag. Helps find people benefiting from sock puppet or 'Admirer' upvotes. For a particular tag get the Avg and StDev of score - suspicious scores are likely to have * BOTH HIGH AVERAGE AND LOW STD DEV * of score (e.g. they routinely upvote each of their own posts x ...
SELECT Users.Id, Users.Id AS "user_link", COUNT(Posts.Id) AS NumPosts, SUM(Posts.Score) AS SumScore, AVG(CAST(Posts.Score AS FLOAT)) AS AvgScore, STDEV(Posts.Score) AS StdDevScore, VAR(Posts.Score) AS VarScore, AVG(CAST(Posts.Score AS FLOAT)) - STDEV(Posts.Score) AS "avg-stdev" FROM Posts INNER JOIN Users ON Posts.Owne...
sede
CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE prescriptio...
how many drugs were prescribed to patient 5828 in this month?
SELECT COUNT(*) FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 5828) AND DATETIME(prescriptions.startdate, 'start of month') = DATETIME(CURRENT_TIME(), 'start of month', '-0 month')
mimic_iii
CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, ExpiryDate time, Body text, OwnerUserId number, DeletionUserId number ) CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE PostTags ( PostId num...
Tag usage in Notable Questions.
SELECT t.TagName, COUNT(*) AS usage FROM Posts AS p INNER JOIN PostTags AS pt ON pt.PostId = p.Id INNER JOIN Tags AS t ON t.Id = pt.TagId WHERE p.PostTypeId = 1 AND p.ViewCount >= 2500 GROUP BY t.TagName ORDER BY COUNT(*) DESC
sede
CREATE TABLE table_name_77 ( result VARCHAR, road_team VARCHAR, game VARCHAR )
Which Result has a Road Team of san francisco, and a Game of game 2?
SELECT result FROM table_name_77 WHERE road_team = "san francisco" AND game = "game 2"
sql_create_context
CREATE TABLE table_name_11 ( class VARCHAR, horse VARCHAR, event VARCHAR, result VARCHAR )
What is the class of Fabuleux 5 get less than 70.277 in the freestyle test?
SELECT class FROM table_name_11 WHERE event = "freestyle test" AND result < 70.277 AND horse = "fabuleux 5"
sql_create_context
CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number ) CREATE TABLE Tags ( Id number, TagName text, Count number, ExcerptPostId number, WikiPostId number ) CREATE TABLE PostsWit...
La persona que publique una pregunta con la mayor puntuaci n..
SELECT * FROM PostTags
sede
CREATE TABLE table_47645 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Decision" text, "Attendance" real, "Record" text, "Points" real )
What is Date, when Visitor is Toronto?
SELECT "Date" FROM table_47645 WHERE "Visitor" = 'toronto'
wikisql
CREATE TABLE table_18461635_1 ( captain VARCHAR, county VARCHAR )
Who is the captain of the team in Essex county?
SELECT captain FROM table_18461635_1 WHERE county = "Essex"
sql_create_context
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...
把2002年3月16日到2004年10月26日期间患者鲁和颂总共花了多少医保统筹基金金额查看一下
SELECT SUM(t_kc24.OVE_PAY) FROM qtb JOIN t_kc24 ON qtb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE qtb.PERSON_NM = '鲁和颂' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2002-03-16' AND '2004-10-26' UNION SELECT SUM(t_kc24.OVE_PAY) FROM gyb JOIN t_kc24 ON gyb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE gyb.PERSON_NM = '鲁和颂' AND t_kc2...
css
CREATE TABLE table_name_34 ( date VARCHAR, year VARCHAR, location VARCHAR )
What was the date for morocco when the year was lerger than 1981?
SELECT date FROM table_name_34 WHERE year > 1981 AND location = "morocco"
sql_create_context
CREATE TABLE table_name_59 ( format VARCHAR, call_sign VARCHAR )
What is the Format of the Frequency CJBX-FM?
SELECT format FROM table_name_59 WHERE call_sign = "cjbx-fm"
sql_create_context
CREATE TABLE time_interval ( period text, begin_time int, end_time int ) CREATE TABLE flight_stop ( flight_id int, stop_number int, stop_days text, stop_airport text, arrival_time int, arrival_airline text, arrival_flight_number int, departure_time int, departure_airline...
what flights from KANSAS CITY to CHICAGO arrive at CHICAGO at 1900 next wednesday
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, date_day, days, flight WHERE ((((((flight.arrival_time < 41 OR flight.time_elapsed >= 60) AND flight.departure_time > flight.arrival_time) AND date_day.day_number = 23 AND da...
atis
CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL ) CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER )
For those records from the products and each product's manufacturer, show me about the distribution of founder and the average of code , and group by attribute founder in a bar chart, rank x-axis from low to high order.
SELECT T2.Founder, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Founder ORDER BY T2.Founder
nvbench
CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE TagSynonyms ( Id number...
Questions per day in a given year.
SELECT TIME_TO_STR(CreationDate, '%Y'), TIME_TO_STR(CreationDate, '%M'), TIME_TO_STR(CreationDate, '%d'), COUNT(Id) FROM Posts WHERE TIME_TO_STR(CreationDate, '%Y') = '##Year:int##' AND CommunityOwnedDate IS NULL GROUP BY TIME_TO_STR(CreationDate, '%Y'), TIME_TO_STR(CreationDate, '%M'), TIME_TO_STR(CreationDate, '%d') ...
sede
CREATE TABLE table_23287 ( "Draw" real, "Artist" text, "Song" text, "Jury votes" real, "Televotes" real, "Total votes" real, "Result" text )
What is Salva Ortega's result?
SELECT "Result" FROM table_23287 WHERE "Artist" = 'Salva Ortega'
wikisql
CREATE TABLE table_22694 ( "Rank" real, "Peak" text, "Country" text, "Island" text, "Elevation (m)" real, "Prominence (m)" real, "Col (m)" real )
When mount kobowre is the peak what is the highest elevation in meters?
SELECT MAX("Elevation (m)") FROM table_22694 WHERE "Peak" = 'Mount Kobowre'
wikisql
CREATE TABLE hz_info ( KH text, KLX number, YLJGDM text, RYBH text ) CREATE TABLE mzjzjlb ( YLJGDM text, JZLSH text, KH text, KLX number, MJZH text, HZXM text, NLS number, NLY number, ZSEBZ number, JZZTDM number, JZZTMC text, JZJSSJ time, TXBZ number,...
有多少人在医疗机构7283097住院天数超过6天?
SELECT COUNT(DISTINCT hz_info.RYBH) FROM hz_info JOIN zyjzjlb ON hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX WHERE zyjzjlb.YLJGDM = '7283097' AND DATEDIFF(zyjzjlb.CYSJ, zyjzjlb.RYSJ) > 6
css
CREATE TABLE table_75548 ( "Week" real, "Date" text, "Opponent" text, "Location" text, "Time ( ET )" text, "Result" text, "Record" text )
What is the result of the game at three rivers stadium with a Record of 6 3?
SELECT "Result" FROM table_75548 WHERE "Location" = 'three rivers stadium' AND "Record" = '6–3'
wikisql
CREATE TABLE table_name_26 ( general_classification VARCHAR, points_classification VARCHAR )
What general classification has levi leipheimer as points classification?
SELECT general_classification FROM table_name_26 WHERE points_classification = "levi leipheimer"
sql_create_context
CREATE TABLE repair ( repair_ID int, name text, Launch_Date text, Notes text ) CREATE TABLE technician ( technician_id real, Name text, Team text, Starting_Year real, Age int ) CREATE TABLE machine ( Machine_ID int, Making_Year int, Class text, Team text, Machin...
Create a bar chart showing the total number across team, show the total number in ascending order.
SELECT Team, COUNT(*) FROM technician GROUP BY Team ORDER BY COUNT(*)
nvbench
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_...
SAN FRANCISCO to PHILADELPHIA please
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 = 'SAN FRANCISCO' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = '...
atis
CREATE TABLE jybgb ( BBCJBW text, BBDM text, BBMC text, BBZT number, BGDH text, BGJGDM text, BGJGMC text, BGRGH text, BGRQ time, BGRXM text, BGSJ time, CJRQ time, JSBBRQSJ time, JSBBSJ time, JYBBH text, JYJGMC text, JYJSGH text, JYJSQM text, JY...
编号为89963549的病患的检验报告单的报告日期在15年3月17日之前的是在哪些门诊就诊的?列出门诊就诊的流水号
SELECT wdmzjzjlb.JZLSH FROM hz_info JOIN wdmzjzjlb ON hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX WHERE hz_info.RYBH = '89963549' AND NOT wdmzjzjlb.JZLSH IN (SELECT jybgb.JZLSH FROM jybgb WHERE jybgb.BGRQ >= '2015-03-17') UNION SELECT bdmzjzjlb.JZLSH FROM hz_info JOIN...
css
CREATE TABLE table_40432 ( "Res." text, "Record" text, "Opponent" text, "Method" text, "Event" text, "Round" text, "Time" text, "Location" text )
What is the Event when the opponent was wesslan evaristo de oliveira?
SELECT "Event" FROM table_40432 WHERE "Opponent" = 'wesslan evaristo de oliveira'
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...
Return a bar chart about the distribution of All_Road and All_Games_Percent , rank from high to low by the y axis please.
SELECT All_Road, All_Games_Percent FROM basketball_match ORDER BY All_Games_Percent DESC
nvbench
CREATE TABLE table_272865_20 ( years_active VARCHAR, asian_cup_played_as_a_captain VARCHAR )
What is the total number of years active listings where Asian Cup played as a captain is Japan 1992?
SELECT COUNT(years_active) FROM table_272865_20 WHERE asian_cup_played_as_a_captain = "Japan 1992"
sql_create_context
CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAddress text ) CREATE TABLE PostsWithDeleted ( Id number, PostTypeId number, ...
Number of comments starting with ' ' (U+FF0B) instead of '+'.
SELECT COUNT(*) FROM Comments WHERE SUBSTRING(Text, 1, 1) COLLATE SQL_Latin1_General_CP850_BIN2 = NCHAR(65291)
sede
CREATE TABLE table_79540 ( "City" text, "Country" text, "IATA" text, "ICAO" text, "Airport" text )
What Airport's IATA is SEA?
SELECT "Airport" FROM table_79540 WHERE "IATA" = 'sea'
wikisql
CREATE TABLE state ( state_code text, state_name text, country_name text ) CREATE TABLE flight_fare ( flight_id int, fare_id int ) CREATE TABLE flight ( aircraft_code_sequence text, airline_code varchar, airline_flight text, arrival_time int, connections int, departure_time...
all flights from SAN FRANCISCO to BOSTON leaving before 1200
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 = 'BOSTON' AND flight.departure_time < 1200 AND flight.to_airport = AIRPORT_SERVICE_1.airpor...
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 demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob te...
How many patients have had a calculated tbg lab test and are on a main drug type drug prescription?
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.drug_type = "MAIN" AND lab.label = "Calculated TBG"
mimicsql_data
CREATE TABLE program_course ( program_id int, course_id int, workload int, category varchar ) CREATE TABLE jobs ( job_id int, job_title varchar, description varchar, requirement varchar, city varchar, state varchar, country varchar, zip int ) CREATE TABLE course ( c...
I need to take a class this semester that 's a prerequisite for most of the other classes .
SELECT COUNT(DISTINCT COURSE_PREREQUISITEalias0.course_id), COURSEalias0.department, COURSEalias0.name, COURSEalias0.number FROM (SELECT course_id FROM student_record WHERE earn_credit = 'Y' AND student_id = 1) AS DERIVED_TABLEalias0, course AS COURSEalias0, course AS COURSEalias1, course_offering AS COURSE_OFFERINGali...
advising
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...
find the number of patients who had blood fluid lab test and had diagnoses icd9 code 29281.
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.icd9_code = "29281" AND lab.fluid = "Blood"
mimicsql_data
CREATE TABLE table_21113 ( "Rank" real, "Company" text, "Headquarters" text, "Industry" text, "Sales (billion $)" text, "Profits (billion $)" text, "Assets (billion $)" text, "Market Value (billion $)" text )
What are the profits (in billions) where the assets are 192.8 billion?
SELECT "Profits (billion $)" FROM table_21113 WHERE "Assets (billion $)" = '192.8'
wikisql
CREATE TABLE table_22297140_3 ( team VARCHAR, outgoing_manager VARCHAR )
Which team had an outgoing manager of Behtash Fariba?
SELECT team FROM table_22297140_3 WHERE outgoing_manager = "Behtash Fariba"
sql_create_context
CREATE TABLE program_course ( program_id int, course_id int, workload int, category varchar ) CREATE TABLE course_tags_count ( course_id int, clear_grading int, pop_quiz int, group_projects int, inspirational int, long_lectures int, extra_credit int, few_tests int, g...
For the Spring or Summer term , can I take 100 -level classes ?
SELECT DISTINCT COURSEalias0.department, COURSEalias0.name, COURSEalias0.number, SEMESTERalias0.semester FROM (SELECT course_id FROM student_record WHERE earn_credit = 'Y' AND student_id = 1) AS DERIVED_TABLEalias0, course AS COURSEalias0, course_offering AS COURSE_OFFERINGalias0, semester AS SEMESTERalias0 WHERE COURS...
advising
CREATE TABLE table_203_123 ( id number, "year" number, "title" text, "b-side" text, "mediums" text, "label (catalog)" text )
how many consecutive singles were released under the epic label ?
SELECT COUNT("title") FROM table_203_123 WHERE "label (catalog)" = 'epic'
squall
CREATE TABLE table_79715 ( "Rank" real, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
How much Silver has a Rank of 7?
SELECT COUNT("Silver") FROM table_79715 WHERE "Rank" = '7'
wikisql
CREATE TABLE table_35676 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Leading scorer" text, "Record" text )
What score has devin brown (24) as the leading scorer?
SELECT "Score" FROM table_35676 WHERE "Leading scorer" = 'devin brown (24)'
wikisql
CREATE TABLE table_5408 ( "Date" text, "Venue" text, "Score" text, "Result" text, "Competition" text )
What was the date of the friendly competition with a score of 4-0?
SELECT "Date" FROM table_5408 WHERE "Competition" = 'friendly' AND "Score" = '4-0'
wikisql
CREATE TABLE table_1715730_2 ( nickname VARCHAR, founded VARCHAR )
what is the nickname founded in 1902?
SELECT nickname FROM table_1715730_2 WHERE founded = 1902
sql_create_context
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREA...
when patient 031-23605 received a microbiology test for a blood, venipuncture for the last time until 12/2104?
SELECT microlab.culturetakentime FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-23605')) AND microlab.culturesite = 'blood, venipuncture' AND...
eicu
CREATE TABLE table_12667 ( "Rank" real, "Result" text, "Wind" text, "Athlete" text, "Date" text, "Location" text )
What kind of Wind has an Athlete of kerron stewart?
SELECT "Wind" FROM table_12667 WHERE "Athlete" = 'kerron stewart'
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...
病人71927625购买的九味镇心颗粒都是在哪些医院买的?
SELECT qtb.MED_SER_ORG_NO FROM qtb WHERE qtb.PERSON_ID = '71927625' AND qtb.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.SOC_SRT_DIRE_NM = '九味镇心颗粒') UNION SELECT gyb.MED_SER_ORG_NO FROM gyb WHERE gyb.PERSON_ID = '71927625' AND gyb.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE...
css
CREATE TABLE table_51443 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Decision" text, "Attendance" real, "Record" text )
What was the date of the game with a decision of Niittymaki and when the Flyers had a record of 30 21 5?
SELECT "Date" FROM table_51443 WHERE "Decision" = 'niittymaki' AND "Record" = '30–21–5'
wikisql
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TA...
what are the three most commonly ordered procedures for patients in the age of 30s until 3 years ago?
SELECT t1.treatmentname FROM (SELECT treatment.treatmentname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.age BETWEEN 30 AND 39) AND DATETIME(treatment.treatmenttime) <= DATETIME(CURRENT_TIME(), '-3 yea...
eicu
CREATE TABLE table_1949 ( "Period" text, "Kit manufacturer" text, "Main sponsor" text, "Secondary sponsor" text, "Minor sponsors" text )
When batavo is the main sponsor and olympikus is the kit manufacturer who are the minor sponsors?
SELECT "Minor sponsors" FROM table_1949 WHERE "Kit manufacturer" = 'Olympikus' AND "Main sponsor" = 'Batavo'
wikisql
CREATE TABLE mzjzjlb_jybgb ( YLJGDM_MZJZJLB text, BGDH number, YLJGDM number ) CREATE TABLE zyjzjlb ( CYBQDM text, CYBQMC text, CYCWH text, CYKSDM text, CYKSMC text, CYSJ time, CYZTDM number, HZXM text, JZKSDM text, JZKSMC text, JZLSH text, KH text, KLX n...
这个被门诊诊断为疾病F42.715的患者的检测指标677145参考值范围的下限与上限是什么?
SELECT jyjgzbb.CKZFWXX, jyjgzbb.CKZFWSX FROM mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN mzjzjlb_jybgb ON mzjzjlb.YLJGDM = mzjzjlb_jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH AND mzjzjlb_jybgb.YLJGDM = jybgb.YLJGDM AND mzjzjlb_jybgb.BGDH = jybgb....
css
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) CREATE TABLE wdmzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH number, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, K...
在从04年7月22日直到19年1月6日期间,病患67745789的所有检验结果指标记录中的仪器编号以及名称都叫什么?
SELECT jyjgzbb.YQBH, jyjgzbb.YQMC FROM hz_info JOIN wdmzjzjlb JOIN jybgb JOIN jyjgzbb ON hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX AND wdmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND wdmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH ...
css
CREATE TABLE table_203_824 ( id number, "pick #" number, "player" text, "position" text, "nationality" text, "nhl team" text, "college/junior/club team" text )
who was the only player picked above joe reekie ?
SELECT "player" FROM table_203_824 WHERE "pick #" < (SELECT "pick #" FROM table_203_824 WHERE "player" = 'joe reekie')
squall
CREATE TABLE table_47076 ( "Year" real, "Award" text, "Category" text, "Nominated Work" text, "Result" text )
What is the result for the nomination at the Laurence Olivier award in 2009 for best actress in a musical?
SELECT "Result" FROM table_47076 WHERE "Category" = 'best actress in a musical' AND "Award" = 'laurence olivier award' AND "Year" = '2009'
wikisql
CREATE TABLE table_name_92 ( round INTEGER, school VARCHAR )
What is the University of Southern California's highest Round?
SELECT MAX(round) FROM table_name_92 WHERE school = "university of southern california"
sql_create_context
CREATE TABLE store ( store_id TINYINT UNSIGNED, manager_staff_id TINYINT UNSIGNED, address_id SMALLINT UNSIGNED, last_update TIMESTAMP ) CREATE TABLE address ( address_id SMALLINT UNSIGNED, address VARCHAR(50), address2 VARCHAR(50), district VARCHAR(20), city_id SMALLINT UNSIGNED, ...
What are the payment dates for any payments that have an amount greater than 10 or were handled by a staff member with the first name Elsa, and count them by a line chart, rank from high to low by the payment_date please.
SELECT payment_date, COUNT(payment_date) FROM payment WHERE amount > 10 UNION SELECT T1.payment_date FROM payment AS T1 JOIN staff AS T2 ON T1.staff_id = T2.staff_id WHERE T2.first_name = 'Elsa' GROUP BY payment_date ORDER BY payment_date DESC
nvbench