context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_ID decimal(4,0) ) CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varchar(20), LAST_NAME varchar(25), EMAIL varchar(25), PHONE_NUMBER varchar(20), ...
For those employees who do not work in departments with managers that have ids between 100 and 200, return a bar chart about the distribution of phone_number and salary .
SELECT PHONE_NUMBER, SALARY FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200)
nvbench
CREATE TABLE member ( Member_ID text, Name text, Nationality text, Role text ) CREATE TABLE member_attendance ( Member_ID int, Performance_ID int, Num_of_Pieces int ) CREATE TABLE performance ( Performance_ID real, Date text, Host text, Location text, Attendance int )
Compare the total number of locations in each location using a bar graph, and order by the Y-axis from low to high.
SELECT Location, COUNT(Location) FROM performance GROUP BY Location ORDER BY COUNT(Location)
nvbench
CREATE TABLE phone ( Hardware_Model_name VARCHAR, Company_name VARCHAR, Accreditation_type VARCHAR )
Find all phones that have word 'Full' in their accreditation types. List the Hardware Model name and Company name.
SELECT Hardware_Model_name, Company_name FROM phone WHERE Accreditation_type LIKE 'Full'
sql_create_context
CREATE TABLE table_name_16 ( attendance VARCHAR, date VARCHAR )
What is the attendance of the match on October 26?
SELECT attendance FROM table_name_16 WHERE date = "october 26"
sql_create_context
CREATE TABLE table_27146868_1 ( Id VARCHAR )
What is 2010 when 2003 is 5.6?
SELECT 2010 FROM table_27146868_1 WHERE 2003 = "5.6"
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, ...
从出院是被诊断的疾名来看,在医院1586610就诊的患者患有中不同疾病的那些人的平均年龄是多少?
SELECT gwyjzb.OUT_DIAG_DIS_NM, AVG(gwyjzb.PERSON_AGE) FROM gwyjzb WHERE gwyjzb.MED_SER_ORG_NO = '1586610' GROUP BY gwyjzb.OUT_DIAG_DIS_NM UNION SELECT fgwyjzb.OUT_DIAG_DIS_NM, AVG(fgwyjzb.PERSON_AGE) FROM fgwyjzb WHERE fgwyjzb.MED_SER_ORG_NO = '1586610' GROUP BY fgwyjzb.OUT_DIAG_DIS_NM
css
CREATE TABLE Ref_Hotel_Star_Ratings ( star_rating_code CHAR(15), star_rating_description VARCHAR(80) ) CREATE TABLE Museums ( Museum_ID INTEGER, Museum_Details VARCHAR(255) ) CREATE TABLE Tourist_Attractions ( Tourist_Attraction_ID INTEGER, Attraction_Type_Code CHAR(15), Location_ID INTEGE...
What are the names and ids of the tourist attractions that are visited at most once. Visualize by bar chart.
SELECT T1.Name, T1.Tourist_Attraction_ID FROM Tourist_Attractions AS T1 JOIN Visits AS T2 ON T1.Tourist_Attraction_ID = T2.Tourist_Attraction_ID
nvbench
CREATE TABLE table_name_37 ( school VARCHAR, state VARCHAR, city VARCHAR )
What school has oregon as the state, and ashland as the city?
SELECT school FROM table_name_37 WHERE state = "oregon" AND city = "ashland"
sql_create_context
CREATE TABLE files ( f_id number(10), artist_name varchar2(50), file_size varchar2(20), duration varchar2(20), formats varchar2(20) ) CREATE TABLE song ( song_name varchar2(50), artist_name varchar2(50), country varchar2(20), f_id number(10), genre_is varchar2(20), rating nu...
For each file format, return the number of artists who released songs in that format.
SELECT formats, COUNT(*) FROM files GROUP BY formats
nvbench
CREATE TABLE table_201_10 ( id number, "#" number, "name" text, "office" text, "political party" text, "occupation" text )
after what year were austevoll mayors affiliated with political parties ?
SELECT "office" FROM table_201_10 WHERE "political party" IS NULL ORDER BY "office" DESC LIMIT 1
squall
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, visualize a bar chart about the distribution of headquarter and the sum of revenue , and group by attribute headquarter, and I want to rank total number in asc order.
SELECT Headquarter, SUM(Revenue) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter ORDER BY SUM(Revenue)
nvbench
CREATE TABLE ReviewTasks ( Id number, ReviewTaskTypeId number, CreationDate time, DeletionDate time, ReviewTaskStateId number, PostId number, SuggestedEditId number, CompletedByReviewTaskId number ) CREATE TABLE Users ( Id number, Reputation number, CreationDate time, Di...
Question Views by Hour (last 2 years).
SELECT DATEPART(hour, CreationDate) AS Hour, AVG(CAST(ViewCount AS FLOAT)) AS "average_views" FROM Posts WHERE PostTypeId = 1 AND CreationDate > DATEADD(year, -2, GETUTCDATE()) GROUP BY DATEPART(hour, CreationDate) ORDER BY Hour
sede
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, ...
How many patients were admitted as transfer from hosp/extram before the year 2163?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_location = "TRANSFER FROM HOSP/EXTRAM" AND demographic.admityear < "2163"
mimicsql_data
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
how many patients less than 61 years were admitted to hospital for more than 23 days?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.age < "61" AND demographic.days_stay > "23"
mimicsql_data
CREATE TABLE table_1965650_4 ( position VARCHAR, nhl_team VARCHAR )
What's the number of positions of the player playing in Minnesota North Stars?
SELECT COUNT(position) FROM table_1965650_4 WHERE nhl_team = "Minnesota North Stars"
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, ...
List user with Deputy badge and less than 10K reputation.. List user with Deputy badge with no access to moderation tools
SELECT UserId AS "user_link" FROM Badges INNER JOIN Users ON Users.Id = Badges.UserId WHERE Name LIKE 'Deputy' AND Reputation < 10000
sede
CREATE TABLE table_52631 ( "Week" text, "Opponent" text, "Result" text, "Game site" text, "Time" text, "Attendance" text )
I want to know the opponent that ha a week of 3
SELECT "Opponent" FROM table_52631 WHERE "Week" = '3'
wikisql
CREATE TABLE table_7036 ( "Season" real, "Overall" text, "Slalom" text, "Giant Slalom" text, "Super G" text, "Downhill" text, "Combined" text )
Which Slalom has a Super G of 4?
SELECT "Slalom" FROM table_7036 WHERE "Super G" = '4'
wikisql
CREATE TABLE table_name_74 ( school VARCHAR, player VARCHAR )
What School did Player Alonzo Mourning attend?
SELECT school FROM table_name_74 WHERE player = "alonzo mourning"
sql_create_context
CREATE TABLE table_4378 ( "Rank" text, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
Tell me the total number of gold for total less than 1
SELECT COUNT("Gold") FROM table_4378 WHERE "Total" < '1'
wikisql
CREATE TABLE table_name_58 ( skip VARCHAR, country VARCHAR )
What skip has denmark as the country?
SELECT skip FROM table_name_58 WHERE country = "denmark"
sql_create_context
CREATE TABLE zyjzjlb ( CYBQDM text, CYBQMC text, CYCWH text, CYKSDM text, CYKSMC text, CYSJ time, CYZTDM number, HZXM text, JZKSDM text, JZKSMC text, JZLSH text, KH text, KLX number, MZBMLX number, MZJZLSH text, MZZDBM text, MZZDMC text, MZZYZDZZBM...
审核检验报告单的编码为09731045975的人姓名以及工号都是啥?
SELECT jybgb.SHRGH, jybgb.SHRXM FROM jybgb WHERE jybgb.BGDH = '09731045975'
css
CREATE TABLE table_78691 ( "Name" text, "Pos." text, "Height" text, "Weight" text, "Date of Birth" text, "Club" text )
What is Date of Birth, when Height is 'Head Coach: Adel Shamala'?
SELECT "Date of Birth" FROM table_78691 WHERE "Height" = 'head coach: adel shamala'
wikisql
CREATE TABLE table_name_29 ( score VARCHAR, team VARCHAR )
What is Score, when Team is '@ Memphis'?
SELECT score FROM table_name_29 WHERE team = "@ memphis"
sql_create_context
CREATE TABLE table_43538 ( "Tie no" text, "Home team" text, "Score" text, "Away team" text, "Date" text )
Which tie number has Bolton Wanderers as away?
SELECT "Tie no" FROM table_43538 WHERE "Away team" = 'bolton wanderers'
wikisql
CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) 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...
tb of organ nec-histo dx what does it stand for?
SELECT d_icd_diagnoses.long_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'tb of organ nec-histo dx' UNION SELECT d_icd_procedures.long_title FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'tb of organ nec-histo dx'
mimic_iii
CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAddress text ) CREATE TABLE R...
#SOreadytohelp winners - week 1.
SELECT Id AS "user_link" FROM Users WHERE DisplayName LIKE '%tehran%' LIMIT 1000
sede
CREATE TABLE table_28607 ( "Election number" real, "Election date" text, "District" text, "Province" text, "Took office" text, "Left office" text )
What is the date in which a politician who left office on 1840-10-11 for a politician whose election number was 11?
SELECT "Left office" FROM table_28607 WHERE "Election number" = '11'
wikisql
CREATE TABLE table_name_86 ( opponent VARCHAR, record VARCHAR )
Which opponent has a record of 17-11?
SELECT opponent FROM table_name_86 WHERE record = "17-11"
sql_create_context
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, a bar chart shows the distribution of name and the average of code , and group by attribute name.
SELECT T2.Name, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name
nvbench
CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number ) CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number...
Posts where last event was CW-ification.
SELECT ph.PostId AS "post_link", revisions = 'site://posts/' + CAST(ph.PostId AS TEXT) + '/revisions' FROM PostHistory AS ph WHERE (ph.PostHistoryTypeId = 16) AND ph.Id IN (SELECT MAX(Id) AS last FROM PostHistory GROUP BY PostId) ORDER BY ph.PostId DESC
sede
CREATE TABLE course ( course_id text, title text, dept_name text, credits number ) CREATE TABLE section ( course_id text, sec_id text, semester text, year number, building text, room_number text, time_slot_id text ) CREATE TABLE teaches ( id text, course_id text, ...
What is the lowest salary in departments with average salary greater than the overall average.
SELECT MIN(salary), dept_name FROM instructor GROUP BY dept_name HAVING AVG(salary) > (SELECT AVG(salary) FROM instructor)
spider
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text,...
for patients id 83678, specify the time and type of admission
SELECT demographic.admission_type, demographic.admittime FROM demographic WHERE demographic.subject_id = "83678"
mimicsql_data
CREATE TABLE person ( name text, age number, city text, gender text, job text ) CREATE TABLE personfriend ( name text, friend text, year number )
How many different jobs are listed?
SELECT COUNT(DISTINCT job) FROM person
spider
CREATE TABLE table_203_77 ( id number, "album title" text, "format" text, "year" number, "original label" text, "chart positions" text )
what is the total number of albus from this chart that made the billboard 200 ?
SELECT COUNT("album title") FROM table_203_77 WHERE NOT "chart positions" IS NULL
squall
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...
在医院9579618所有的就诊记载里按照科室和出院诊断的病名不同列一下患者平均岁数
SELECT MED_ORG_DEPT_NM, OUT_DIAG_DIS_NM, AVG(PERSON_AGE) FROM t_kc21 WHERE MED_SER_ORG_NO = '9579618' GROUP BY MED_ORG_DEPT_NM, OUT_DIAG_DIS_NM
css
CREATE TABLE table_name_40 ( glider VARCHAR, speed VARCHAR )
What is Glider, when Speed is '147.3km/h'?
SELECT glider FROM table_name_40 WHERE speed = "147.3km/h"
sql_create_context
CREATE TABLE people ( people_id number, sex text, name text, date_of_birth text, height number, weight number ) CREATE TABLE candidate ( candidate_id number, people_id number, poll_source text, date text, support_rate number, consider_rate number, oppose_rate number,...
What are the names of all female candidates in alphabetical order (sex is F)?
SELECT t1.name FROM people AS t1 JOIN candidate AS t2 ON t1.people_id = t2.people_id WHERE t1.sex = 'F' ORDER BY t1.name
spider
CREATE TABLE table_76827 ( "Game" text, "Date" text, "Home Team" text, "Result" text, "Road Team" text )
WHAT IS THE RESULT WITH THE BOSTON ROAD TEAM, ON APRIL 23?
SELECT "Result" FROM table_76827 WHERE "Road Team" = 'boston' AND "Date" = 'april 23'
wikisql
CREATE TABLE table_46272 ( "Year" real, "Date" text, "Winner" text, "Result" text, "Loser" text, "Location" text )
Which date had a game with the New York Giants as the winner, year over 1985, and a result of 17-14?
SELECT "Date" FROM table_46272 WHERE "Winner" = 'new york giants' AND "Year" > '1985' AND "Result" = '17-14'
wikisql
CREATE TABLE table_69943 ( "Year" real, "Entrant" text, "Chassis" text, "Engine" text, "Points" real )
What engine did Scuderia Ambrosiana with fewer than 4 points have?
SELECT "Engine" FROM table_69943 WHERE "Entrant" = 'scuderia ambrosiana' AND "Points" < '4'
wikisql
CREATE TABLE table_name_16 ( supplier VARCHAR, keys__x_modes_ VARCHAR, basic_shape VARCHAR, wrist_pad VARCHAR )
Which Supplier have a Basic shape of flat, a Wrist pad of no, and Keys (x modes) of 25+?
SELECT supplier FROM table_name_16 WHERE basic_shape = "flat" AND wrist_pad = "no" AND keys__x_modes_ = "25+"
sql_create_context
CREATE TABLE table_name_64 ( gold VARCHAR, nation VARCHAR, rank VARCHAR )
How many gold medals for germany (GER) having a rank less than 15?
SELECT COUNT(gold) FROM table_name_64 WHERE nation = "germany (ger)" AND rank < 15
sql_create_context
CREATE TABLE table_37848 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Record" text )
What score has vancouver as the home, and february 16 as the date?
SELECT "Score" FROM table_37848 WHERE "Home" = 'vancouver' AND "Date" = 'february 16'
wikisql
CREATE TABLE table_204_307 ( id number, "year" number, "english title" text, "chinese title" text, "role" text, "notes" text )
what is the total number of english titles ?
SELECT COUNT("english title") FROM table_204_307
squall
CREATE TABLE table_15206 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Record" text )
Who was the opponent at the game that had a loss of Bell (6 9)?
SELECT "Opponent" FROM table_15206 WHERE "Loss" = 'bell (6–9)'
wikisql
CREATE TABLE table_78319 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
When Essendon was the Home Team, what was the Away Team score?
SELECT "Away team score" FROM table_78319 WHERE "Home team" = 'essendon'
wikisql
CREATE TABLE table_21165255_1 ( no_in_season INTEGER, production_code VARCHAR )
Name the number in season for 4300062
SELECT MAX(no_in_season) FROM table_21165255_1 WHERE production_code = 4300062
sql_create_context
CREATE TABLE table_42325 ( "1965" text, "1966" text, "1967" text, "1968" text, "1969" text, "1970" text, "1971" text, "1972" text )
What is the value in 1965 when 7 is the value for 1967?
SELECT "1965" FROM table_42325 WHERE "1967" = '7'
wikisql
CREATE TABLE table_12340907_1 ( cost_per_capita VARCHAR, municipality VARCHAR )
What is the cost per capita in the Courtenay municipality?
SELECT cost_per_capita FROM table_12340907_1 WHERE municipality = "Courtenay"
sql_create_context
CREATE TABLE table_13564637_4 ( played VARCHAR, points_against VARCHAR )
What is the played total when the points against was 321?
SELECT played FROM table_13564637_4 WHERE points_against = "321"
sql_create_context
CREATE TABLE job_history ( EMPLOYEE_ID decimal(6,0), START_DATE date, END_DATE date, JOB_ID varchar(10), DEPARTMENT_ID decimal(4,0) ) CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(40), POSTAL_CODE varchar(12), CITY varchar(30), STATE_PROVINCE varchar(...
For those employees who was hired before 2002-06-21, find hire_date and the average of manager_id bin hire_date by weekday, and visualize them by a bar chart.
SELECT HIRE_DATE, AVG(MANAGER_ID) FROM employees WHERE HIRE_DATE < '2002-06-21'
nvbench
CREATE TABLE table_31341 ( "Rank 2012" real, "Country" text, "UNWTO Region" text, "International tourism expenditure 2011" text, "International tourism expenditure 2012" text, "% change" text )
How many countries spent $83.7 billion on international tourism in 2012?
SELECT COUNT("% change") FROM table_31341 WHERE "International tourism expenditure 2012" = '$83.7 billion'
wikisql
CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type text, admission_location text, discharge_location text, insurance text, language text, marital_status text, ethnicity text, age number ) CREATE ...
what procedure did patient 64873 undergo for the first time since 3 years ago?
SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT procedures_icd.icd9_code FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 64873) AND DATETIME(procedures_icd.charttime) >= DATETIME(CURRENT_TI...
mimic_iii
CREATE TABLE table_20700 ( "Year" real, "Lansing (LAN)" text, "Detroit (DTW)" text, "Grand Rapids (GRR)" text, "Flint (FNT)" text, "Kalamazoo (AZO)" text, "Saginaw (MBS)" text )
At a Saginaw fare of $470.47, what is the fare to Lansing?
SELECT "Lansing (LAN)" FROM table_20700 WHERE "Saginaw (MBS)" = '$470.47'
wikisql
CREATE TABLE table_name_94 ( street_address VARCHAR, name VARCHAR )
What is the address of the Life & Casualty Tower?
SELECT street_address FROM table_name_94 WHERE name = "life & casualty tower"
sql_create_context
CREATE TABLE hz_info_zyjzjlb ( JZLSH number, YLJGDM number, zyjzjlb_id number ) CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) CREATE TABLE person_info ( CSD text, CSRQ time, GJDM text, GJMC text, JGDM text, JGMC text, MZDM text, MZMC t...
在2012年9月17日到2021年6月15日内84842097患者被开出的所有检验报告单的检验报告单号一共都有哪些?
SELECT jybgb.BGDH FROM hz_info JOIN mzjzjlb JOIN jybgb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE hz_info.RYBH = '84842097' AND jybgb.BGRQ BETWEEN '2012-09-17' AND '2021-06-15' UNION...
css
CREATE TABLE table_65 ( "Approximate Age" text, "Virtues" text, "Psycho Social Crisis" text, "Significant Relationship" text, "Existential Question [ not in citation given ]" text, "Examples" text )
Which examples ask the existential question 'Can I Love?
SELECT "Examples" FROM table_65 WHERE "Existential Question [ not in citation given ]" = 'Can I Love?'
wikisql
CREATE TABLE table_74052 ( "English" text, "Proto-Semitic" text, "Akkadian" text, "Arabic" text, "Aramaic" text, "Hebrew" text, "Geez" text, "Mehri" text )
if the geez is libb, what is the akkadian?
SELECT "Akkadian" FROM table_74052 WHERE "Geez" = 'libb'
wikisql
CREATE TABLE Person ( job VARCHAR )
How many type of jobs do they have?
SELECT COUNT(DISTINCT job) FROM Person
sql_create_context
CREATE TABLE table_3877 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text )
What is the score of the game played on october 16?
SELECT "Score" FROM table_3877 WHERE "Date" = 'October 16'
wikisql
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE demographic ...
give me the number of patients whose days of hospital stay is greater than 1 and lab test fluid is urine?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.days_stay > "1" AND lab.fluid = "Urine"
mimicsql_data
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid number, wa...
how many patients were prescribed furosemide 20 mg po tabs within the same month since 5 years ago following the procedure of oxygen therapy (40% to 60%)?
SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, treatment.treatmenttime FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'oxygen therapy (40% to 60%)' AND DATETIME(treatment.treatmenttime) >= DATETIME(CURRENT_TIME(), '-5 year')) A...
eicu
CREATE TABLE wine ( no number, grape text, winery text, appelation text, state text, name text, year number, price number, score number, cases number, drink text ) CREATE TABLE appellations ( no number, appelation text, county text, state text, area text,...
What is the winery at which the wine with the highest score was made?
SELECT winery FROM wine ORDER BY score LIMIT 1
spider
CREATE TABLE table_name_75 ( date VARCHAR, home_team VARCHAR )
What date did Collingwood play as the home team?
SELECT date FROM table_name_75 WHERE home_team = "collingwood"
sql_create_context
CREATE TABLE table_1656555_1 ( Appointed VARCHAR, ordained_priest VARCHAR )
How many appointed archbishops were ordained as priests on December 20, 1959
SELECT COUNT(Appointed) AS archbishop FROM table_1656555_1 WHERE ordained_priest = "December 20, 1959"
sql_create_context
CREATE TABLE table_203_657 ( id number, "call sign" text, "frequency" text, "city of license" text, "licensee" text, "format" text )
how many christian contemporary stations are there ?
SELECT COUNT(*) FROM table_203_657 WHERE "format" = 'christian contemporary'
squall
CREATE TABLE table_name_79 ( rank INTEGER, name VARCHAR, status VARCHAR, floors VARCHAR )
What rank has a status of proposed, with 80 floors for Celestia Spaces 4?
SELECT AVG(rank) FROM table_name_79 WHERE status = "proposed" AND floors = 80 AND name = "celestia spaces 4"
sql_create_context
CREATE TABLE table_name_76 ( athlete VARCHAR, time VARCHAR )
Who had the time 13.6?
SELECT athlete FROM table_name_76 WHERE time = 13.6
sql_create_context
CREATE TABLE table_name_67 ( melbourne VARCHAR, gold_coast VARCHAR )
What is The Melbourne with a No- Gold Coast
SELECT melbourne FROM table_name_67 WHERE gold_coast = "no"
sql_create_context
CREATE TABLE table_12165135_1 ( position VARCHAR, player VARCHAR )
What is the position of john charles?
SELECT position FROM table_12165135_1 WHERE player = "John Charles"
sql_create_context
CREATE TABLE table_name_63 ( opponents_in_the_final VARCHAR, partner VARCHAR, championship VARCHAR )
Which opponent in the final had a partner of Katarina Srebotnik and a championship of wimbledon (4)?
SELECT opponents_in_the_final FROM table_name_63 WHERE partner = "katarina srebotnik" AND championship = "wimbledon (4)"
sql_create_context
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob te...
How many patients had other body fluid as lab test fluid and were admitted on an urgent basis?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_type = "URGENT" AND lab.fluid = "Other Body Fluid"
mimicsql_data
CREATE TABLE table_204_28 ( id number, "election" text, "name of the party/alliance" text, "number of votes" number, "percentage" text, "seats in the parliament" number )
which election cycle yielded more parliament seats won : 1994 , or 2001 ?
SELECT "election" FROM table_204_28 WHERE "election" IN (1994, 2001) ORDER BY "seats in the parliament" DESC LIMIT 1
squall
CREATE TABLE table_name_1 ( away_team VARCHAR, venue VARCHAR )
Who was the away team at Victoria Park?
SELECT away_team FROM table_name_1 WHERE venue = "victoria park"
sql_create_context
CREATE TABLE table_name_58 ( song VARCHAR, index VARCHAR )
What Song's Index is F6?
SELECT song FROM table_name_58 WHERE index = "f6"
sql_create_context
CREATE TABLE table_24555 ( "Municipality" text, "Type" text, "District" text, "Area (km\u00b2)" text, "Population (2010)" real, "Pop. Density (per km\u00b2)" text, "No. of Barangays" real, "Municipal Mayor" text )
In what municipality were there 757.5 people per km2?
SELECT "Municipality" FROM table_24555 WHERE "Pop. Density (per km\u00b2)" = '757.5'
wikisql
CREATE TABLE table_name_23 ( bronze INTEGER, team VARCHAR, gold VARCHAR )
what is the average bronze when the team is northwest territories and gold is more than 34?
SELECT AVG(bronze) FROM table_name_23 WHERE team = "northwest territories" AND gold > 34
sql_create_context
CREATE TABLE table_69783 ( "Region" text, "Date" text, "Label" text, "Format" text, "Catalog" text )
What is the catalog number for the January 25, 1987 release?
SELECT "Catalog" FROM table_69783 WHERE "Date" = 'january 25, 1987'
wikisql
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE procedures ( ...
report the number of patients diagnosed with percutaneous transluminal coronary angioplasty status who had home health care discharge.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.discharge_location = "HOME HEALTH CARE" AND diagnoses.short_title = "Status-post ptca"
mimicsql_data
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREA...
what is the cost for a drug named vancocin?
SELECT DISTINCT cost.cost FROM cost WHERE cost.eventtype = 'medication' AND cost.eventid IN (SELECT medication.medicationid FROM medication WHERE medication.drugname = 'vancocin')
eicu
CREATE TABLE table_51641 ( "Year" real, "Franchise" text, "League" text, "Percentage" real, "Finish" text )
In the Year 1939, what was the Finish when Al was the League?
SELECT "Finish" FROM table_51641 WHERE "League" = 'al' AND "Year" = '1939'
wikisql
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...
Is Friday the day that Prof. Matthew Schulmerich 's classes always meet ?
SELECT COUNT(*) = 0 FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN offering_instructor ON offering_instructor.offering_id = course_offering.offering_id INNER JOIN instructor ON offering_instructor.instructor_id = instructor.instructor_id WHERE course_offering.friday = ...
advising
CREATE TABLE table_2076595_1 ( founded INTEGER, school VARCHAR )
When was Southern Vermont College founded?
SELECT MAX(founded) FROM table_2076595_1 WHERE school = "Southern Vermont College"
sql_create_context
CREATE TABLE table_36737 ( "Position" real, "Artist" text, "Song title" text, "Highest position" real, "Points" real )
What is the number of points associated with the highest position under 9 and a current position of 22?
SELECT "Points" FROM table_36737 WHERE "Highest position" < '9' AND "Position" = '22'
wikisql
CREATE TABLE table_54374 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
What is the size of the crowd when the home team is Fitzroy?
SELECT COUNT("Crowd") FROM table_54374 WHERE "Home team" = 'fitzroy'
wikisql
CREATE TABLE table_name_7 ( event VARCHAR, location VARCHAR, record VARCHAR )
what is the even when the location is tokyo, japan and the record is 6-1?
SELECT event FROM table_name_7 WHERE location = "tokyo, japan" AND record = "6-1"
sql_create_context
CREATE TABLE table_37751 ( "Date" text, "Round" text, "Circuit" text, "Race 1 Winner" text, "Race 2 Winner" text, "Report" text )
what circuit is in italy
SELECT "Circuit" FROM table_37751 WHERE "Round" = 'italy'
wikisql
CREATE TABLE requirement ( requirement_id int, requirement varchar, college varchar ) CREATE TABLE student ( student_id int, lastname varchar, firstname varchar, program_id int, declare_major varchar, total_credit int, total_gpa float, entered_as varchar, admit_term int,...
Is 574 for undergrads too ?
SELECT DISTINCT advisory_requirement, enforced_requirement, name FROM course WHERE department = 'EECS' AND number = 574
advising
CREATE TABLE table_59470 ( "Tie no" text, "Home team" text, "Score" text, "Away team" text, "Date" text )
When the tie no was 1, what was the score?
SELECT "Score" FROM table_59470 WHERE "Tie no" = '1'
wikisql
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 departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), ...
For all employees who have the letters D or S in their first name, return a bar chart about the distribution of hire_date and the sum of department_id bin hire_date by time, and order in desc by the y axis.
SELECT HIRE_DATE, SUM(DEPARTMENT_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' ORDER BY SUM(DEPARTMENT_ID) DESC
nvbench
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 text, KLX number, MJZH text, ML number, MZZYZDZZBM text, MZZYZDZZMC ...
患者21324611在01年4月21日到2011年6月2日内的所有检验结果指标记录的检测人为姜欣合的检测指标流水号是多少?
SELECT jyjgzbb.JYZBLSH FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN mzjzjlb_jybgb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = mzjzjlb_jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.B...
css
CREATE TABLE table_30409 ( "No. in series" real, "No. in season" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "U.S. viewers (millions)" text )
Who was the director of the episode with series number 116?
SELECT "Directed by" FROM table_30409 WHERE "No. in series" = '116'
wikisql
CREATE TABLE table_7382 ( "Pick" real, "Player" text, "Country of origin*" text, "PBA team" text, "College" text )
Which colleges have a pick above 7?
SELECT "College" FROM table_7382 WHERE "Pick" > '7'
wikisql
CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) 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 o...
when was patient 86786 received the last sputum microbiology test on the last hospital encounter?
SELECT microbiologyevents.charttime FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 86786 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime DESC LIMIT 1) AND microbiologyevents.spec_type_desc = 'sputum' ORDER BY microb...
mimic_iii
CREATE TABLE table_59014 ( "Team 1" text, "Agg." text, "Team 2" text, "1st leg" text, "2nd leg" text )
Who is team 1 where team 2 is Fluminense (RJ)?
SELECT "Team 1" FROM table_59014 WHERE "Team 2" = 'fluminense (rj)'
wikisql
CREATE TABLE table_77642 ( "NGC number" text, "Object type" text, "Constellation" text, "Right ascension ( J2000 )" text, "Declination ( J2000 )" text )
What is the declination of the spiral galaxy Pegasus with 7337 NGC
SELECT "Declination ( J2000 )" FROM table_77642 WHERE "Object type" = 'spiral galaxy' AND "Constellation" = 'pegasus' AND "NGC number" = '7337'
wikisql
CREATE TABLE table_25837 ( "Model" text, "Engine" text, "Displacement" text, "Max. power output" text, "Peak torque" text, "0\u2013100km/h,s 0-62mph,s" text, "Top speed" text, "CO 2 emissions" text, "Years" text, "Note" text, "Engine code" text )
List the amount of carbon emissions for models that go from 0-62 MPH in 8.5 seconds.
SELECT "CO 2 emissions" FROM table_25837 WHERE "0\u2013100km/h,s 0-62mph,s" = '8.5'
wikisql
CREATE TABLE table_name_52 ( score VARCHAR, record VARCHAR )
The record of 35-31 has what score?
SELECT score FROM table_name_52 WHERE record = "35-31"
sql_create_context
CREATE TABLE ReviewTaskResultTypes ( Id number, Name text, Description text ) CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId num...
Find questions ripe for the Revival and Necromancer badges. Searches for open, non-CW posts older than 60 days with no accepted answer and no answer scoring 2 or more. (Now updated so merged questions do not appear.)
SELECT p.Id AS "post_link", p.Score, p.CreationDate AS "asked_date", p.ViewCount FROM Posts AS p WHERE p.AcceptedAnswerId IS NULL AND p.PostTypeId = 1 AND p.CreationDate < CURRENT_TIMESTAMP() - 60 AND p.CommunityOwnedDate IS NULL AND p.ClosedDate IS NULL AND NOT EXISTS(SELECT * FROM Posts AS p2 WHERE p2.ParentId = p.Id...
sede