instruction
stringlengths
0
1.06k
input
stringlengths
11
5.3k
response
stringlengths
2
4.44k
What's the downstream rate for the Itu g.992.2 having a version of ADSL?
CREATE TABLE table_64592 ("Version" text,"Standard name" text,"Common name" text,"Downstream rate" text,"Upstream rate" text)
SELECT "Downstream rate" FROM table_64592 WHERE "Version" = 'adsl' AND "Standard name" = 'itu g.992.2'
Who got the gold in seoul before 2002?
CREATE TABLE table_name_53 (gold VARCHAR,year VARCHAR,location VARCHAR)
SELECT gold FROM table_name_53 WHERE year < 2002 AND location = "seoul"
What is the population for the English name Spiddal?
CREATE TABLE table_101196_1 (population VARCHAR,english_name VARCHAR)
SELECT population FROM table_101196_1 WHERE english_name = "Spiddal"
What is the result of the game at three rivers stadium with a Record of 6 3?
CREATE TABLE table_name_20 (result VARCHAR,location VARCHAR,record VARCHAR)
SELECT result FROM table_name_20 WHERE location = "three rivers stadium" AND record = "6–3"
Name the minimum derby county goals
CREATE TABLE table_19949 ("Competition" text,"Played" real,"Derby County" real,"Draw" real,"Nottingham Forest" real,"Derby County Goals" real,"Nottingham Forest Goals" real)
SELECT MIN("Derby County Goals") FROM table_19949
Can you tell me the sum of 100s that has the Matches of 12, and the Strike Rate smaller than 144.81?
CREATE TABLE table_name_92 (matches VARCHAR,strike_rate VARCHAR)
SELECT SUM(100 AS s) FROM table_name_92 WHERE matches = 12 AND strike_rate < 144.81
Show the season, the player, and the name of the country that player belongs to.
CREATE TABLE country (Country_name VARCHAR,Country_id VARCHAR)CREATE TABLE match_season (Season VARCHAR,Player VARCHAR,Country VARCHAR)
SELECT T2.Season, T2.Player, T1.Country_name FROM country AS T1 JOIN match_season AS T2 ON T1.Country_id = T2.Country
what's the party with district being alabama 3
CREATE TABLE table_1342292_2 (party VARCHAR,district VARCHAR)
SELECT party FROM table_1342292_2 WHERE district = "Alabama 3"
In next semester what classes is Dr. Jonathan Wipplinger teaching ?
CREATE TABLE program_course (program_id int,course_id int,workload int,category varchar)CREATE TABLE comment_instructor (instructor_id int,student_id int,score int,comment_text varchar)CREATE TABLE course_offering (offering_id int,course_id int,semester int,section_number int,start_time time,end_time time,monday varcha...
SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, instructor, offering_instructor, semester WHERE course.course_id = course_offering.course_id AND instructor.name LIKE '%Jonathan Wipplinger%' AND offering_instructor.instructor_id = instructor.instructor_id AND offering_instruct...
What is the attendance date of the game home team Shrewsbury Town played?
CREATE TABLE table_name_48 (attendance VARCHAR,home_team VARCHAR)
SELECT attendance FROM table_name_48 WHERE home_team = "shrewsbury town"
Show all distinct product categories along with the number of mailshots in each category in a bar chart, I want to sort in asc by the x-axis.
CREATE TABLE Customer_Addresses (customer_id INTEGER,premise_id INTEGER,date_address_from DATETIME,address_type_code VARCHAR(15),date_address_to DATETIME)CREATE TABLE Premises (premise_id INTEGER,premises_type VARCHAR(15),premise_details VARCHAR(255))CREATE TABLE Mailshot_Campaigns (mailshot_id INTEGER,product_category...
SELECT product_category, COUNT(*) FROM Mailshot_Campaigns GROUP BY product_category ORDER BY product_category
who published in vldb or icml ?
CREATE TABLE cite (citingpaperid int,citedpaperid int)CREATE TABLE keyphrase (keyphraseid int,keyphrasename varchar)CREATE TABLE paperkeyphrase (paperid int,keyphraseid int)CREATE TABLE writes (paperid int,authorid int)CREATE TABLE author (authorid int,authorname varchar)CREATE TABLE paperfield (fieldid int,paperid int...
SELECT DISTINCT writes.authorid FROM paper, venue, writes WHERE venue.venueid = paper.venueid AND venue.venuename IN ('vldb', 'icml') AND writes.paperid = paper.paperid GROUP BY writes.authorid
WHAT IS THE HOME TEAM, RESULT 99-112?
CREATE TABLE table_name_21 (home_team VARCHAR,result VARCHAR)
SELECT home_team FROM table_name_21 WHERE result = "99-112"
What was Barry Jamieson's pick number?
CREATE TABLE table_26996293_1 (pick__number INTEGER,player VARCHAR)
SELECT MAX(pick__number) FROM table_26996293_1 WHERE player = "Barry Jamieson"
Compute the total acc_percent across all games as a pie chart.
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_Percent text,ACC_Home text,ACC_Road text,All_Games text,All_Games_Perce...
SELECT All_Games, ACC_Percent FROM basketball_match
What is every Finnish name for the English name of Province of Viborg and Nyslott?
CREATE TABLE table_2169 ("Map number" real,"English name" text,"Finnish name" text,"Swedish name" text,"Residence city" text,"Dates of existence" text,"Notes" text)
SELECT "Finnish name" FROM table_2169 WHERE "English name" = 'Province of Viborg and Nyslott'
patient 739's arterial bp [systolic] on 12/16/this year was normal?
CREATE TABLE labevents (row_id number,subject_id number,hadm_id number,itemid number,charttime time,valuenum number,valueuom text)CREATE TABLE d_icd_diagnoses (row_id number,icd9_code text,short_title text,long_title text)CREATE TABLE diagnoses_icd (row_id number,subject_id number,hadm_id number,icd9_code text,charttim...
SELECT COUNT(*) > 0 FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 739)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'arterial bp [systol...
What is Race 2, when Driver is John Faulkner?
CREATE TABLE table_name_2 (race_2 VARCHAR,driver VARCHAR)
SELECT race_2 FROM table_name_2 WHERE driver = "john faulkner"
Top 100 users by total comment score.
CREATE TABLE CloseAsOffTopicReasonTypes (Id number,IsUniversal boolean,InputTitle text,MarkdownInputGuidance text,MarkdownPostOwnerGuidance text,MarkdownPrivilegedUserGuidance text,MarkdownConcensusDescription text,CreationDate time,CreationModeratorId number,ApprovalDate time,ApprovalModeratorId number,DeactivationDat...
SELECT Users.Id AS "user_link", SUM(Comments.Score) AS "Total comment score" FROM Users INNER JOIN Comments ON Users.Id = Comments.UserId GROUP BY Users.Id ORDER BY SUM(Comments.Score) DESC LIMIT 100
What is the highest student GPA for every department? Return a bar chart, and list X in asc order.
CREATE TABLE STUDENT (STU_NUM int,STU_LNAME varchar(15),STU_FNAME varchar(15),STU_INIT varchar(1),STU_DOB datetime,STU_HRS int,STU_CLASS varchar(2),STU_GPA float(8),STU_TRANSFER numeric,DEPT_CODE varchar(18),STU_PHONE varchar(4),PROF_NUM int)CREATE TABLE EMPLOYEE (EMP_NUM int,EMP_LNAME varchar(15),EMP_FNAME varchar(12)...
SELECT DEPT_CODE, MAX(STU_GPA) FROM STUDENT GROUP BY DEPT_CODE ORDER BY DEPT_CODE
what are the top five most frequent procedures that patients received in the same hospital encounter after being diagnosed with candidiasis site nec during this year?
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,short_title text,long_title text)CREATE TABLE diagnoses_icd (row_id n...
SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT t3.icd9_code FROM (SELECT t2.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime, admissions.hadm_id FROM diagnoses_icd JOIN admissions ON diagnoses_i...
Who was the opponent at the game that had a loss of Leonard (7 8)?
CREATE TABLE table_72032 ("Date" text,"Opponent" text,"Score" text,"Loss" text,"Record" text)
SELECT "Opponent" FROM table_72032 WHERE "Loss" = 'leonard (7–8)'
What was the position of Jon Perlman?
CREATE TABLE table_64359 ("Pick" real,"Player" text,"Team" text,"Position" text,"Hometown/School" text)
SELECT "Position" FROM table_64359 WHERE "Player" = 'jon perlman'
What city has channel tv (dt) 25 (31)?
CREATE TABLE table_1353096_1 (city_of_license__market VARCHAR,channel_tv___dt__ VARCHAR)
SELECT city_of_license__market FROM table_1353096_1 WHERE channel_tv___dt__ = "25 (31)"
Name the format for 12cm note and catalog of alca-9198
CREATE TABLE table_name_28 (format VARCHAR,note VARCHAR,catalog VARCHAR)
SELECT format FROM table_name_28 WHERE note = "12cm" AND catalog = "alca-9198"
What's the Total for a Mexico City game with a Gold of less than 4 and a Bronze of less than 2?
CREATE TABLE table_68724 ("Year" text,"Edition" text,"Host city" text,"Gold" real,"Silver" real,"Bronze" real,"Total" real)
SELECT COUNT("Total") FROM table_68724 WHERE "Host city" = 'mexico city' AND "Gold" < '4' AND "Bronze" < '2'
i am interested in booking an early morning flight from DALLAS into HOUSTON and returning in the late evening
CREATE TABLE month (month_number int,month_name text)CREATE TABLE flight_leg (flight_id int,leg_number int,leg_flight int)CREATE TABLE fare (fare_id int,from_airport varchar,to_airport varchar,fare_basis_code text,fare_airline text,restriction_code text,one_direction_cost int,round_trip_cost int,round_trip_required var...
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 (((flight.departure_time <= 2200 AND flight.departure_time >= 2000) AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'HOUSTON' AND fligh...
count the number of patients whose discharge location is short term hospital and procedure short title is percu endosc jejunostomy?
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)CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime tex...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.discharge_location = "SHORT TERM HOSPITAL" AND procedures.short_title = "Percu endosc jejunostomy"
Which airport is in South Africa and has a ICAO fajs?
CREATE TABLE table_33252 ("City" text,"Country" text,"IATA" text,"ICAO" text,"Airport" text)
SELECT "Airport" FROM table_33252 WHERE "Country" = 'south africa' AND "ICAO" = 'fajs'
Who is the coach with a w-l% greater than 0.516, a first yr before 1925, a yr plyf greater than 2, and a last yr in 1967?
CREATE TABLE table_44738 ("Coach" text,"First Yr" real,"Last Yr" real,"W-L%" real,"G > .500" real,"Yr plyf" real,"G plyf" real,"W plyf" real,"L plyf" real)
SELECT "Coach" FROM table_44738 WHERE "W-L%" > '0.516' AND "First Yr" < '1925' AND "Yr plyf" > '2' AND "Last Yr" = '1967'
Which game does the quentyn martell have?
CREATE TABLE table_67948 ("POV character" text,"Game" text,"Clash" text,"Storm" text,"Feast" text,"Dance" text)
SELECT "Game" FROM table_67948 WHERE "POV character" = 'quentyn martell'
How many TDs are there were the long is smaller than 23?
CREATE TABLE table_78045 ("Player" text,"Rec." real,"Yards" real,"Avg." real,"TD's" real,"Long" real)
SELECT MIN("TD's") FROM table_78045 WHERE "Long" < '23'
Which is located in Angola and entered service in 1988?
CREATE TABLE table_38838 ("Name" text,"Type" text,"Entered service" text,"Water depth" text,"Location" text)
SELECT "Name" FROM table_38838 WHERE "Location" = 'angola' AND "Entered service" = '1988'
What was Jos Mar a Olaz bal's score?
CREATE TABLE table_48723 ("Place" text,"Player" text,"Country" text,"Score" text,"To par" text)
SELECT "To par" FROM table_48723 WHERE "Player" = 'josé maría olazábal'
What is the total when the nation is brazil (bra) and bronze is more than 2?
CREATE TABLE table_name_38 (total INTEGER,nation VARCHAR,bronze VARCHAR)
SELECT SUM(total) FROM table_name_38 WHERE nation = "brazil (bra)" AND bronze > 2
What state has the king title?
CREATE TABLE table_42717 ("State" text,"Type" text,"Name" text,"Title" text,"Royal house" text,"From" text)
SELECT "State" FROM table_42717 WHERE "Title" = 'king'
When emt 9 is the series what is the date?
CREATE TABLE table_27805 ("Circuit" text,"Location" text,"Date" text,"Series" text,"Winning driver" text,"Winning team" text)
SELECT "Date" FROM table_27805 WHERE "Series" = 'EMT 9'
What was the date of the game when the Avalanche had a record of 8 3 1?
CREATE TABLE table_name_34 (date VARCHAR,record VARCHAR)
SELECT date FROM table_name_34 WHERE record = "8–3–1"
has patient 006-122587 in 09/this year excreted any urinary catheter output: indwelling/continuous ure.
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)CREATE TABLE diagnosis (diagnosisid number,patientunitstayid numbe...
SELECT COUNT(*) > 0 FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-122587')) AND intakeoutput.cellpath LIKE '%output%' AND intakeoutp...
Show the number of start dates of all the apartment bookings made by guests with gender code 'Female' for each year with a bar chart, and list by the y axis in asc.
CREATE TABLE Apartments (apt_id INTEGER,building_id INTEGER,apt_type_code CHAR(15),apt_number CHAR(10),bathroom_count INTEGER,bedroom_count INTEGER,room_count CHAR(5))CREATE TABLE Apartment_Facilities (apt_id INTEGER,facility_code CHAR(15))CREATE TABLE Apartment_Buildings (building_id INTEGER,building_short_name CHAR(1...
SELECT booking_start_date, COUNT(booking_start_date) FROM Apartment_Bookings AS T1 JOIN Guests AS T2 ON T1.guest_id = T2.guest_id WHERE T2.gender_code = "Female" ORDER BY COUNT(booking_start_date)
with race of ranvet stakes what is the group?
CREATE TABLE table_name_12 (group VARCHAR,race VARCHAR)
SELECT group FROM table_name_12 WHERE race = "ranvet stakes"
Which network had unknown games and a title of hvem kan sl ylvis hvem kan sl aamodt & kjus?
CREATE TABLE table_8391 ("Country" text,"Title" text,"Network" text,"Games" text,"Date aired" text)
SELECT "Network" FROM table_8391 WHERE "Games" = 'unknown' AND "Title" = 'hvem kan slå ylvis hvem kan slå aamodt & kjus'
what is the number of patients whose admission location is trsf within this facility and drug name is levothyroxine sodium?
CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital_status text,age text,dob text,gender text,la...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admission_location = "TRSF WITHIN THIS FACILITY" AND prescriptions.drug = "Levothyroxine Sodium"
What opponent has l 27-7 as the result?
CREATE TABLE table_66422 ("Week" real,"Date" text,"Opponent" text,"Result" text,"Attendance" real)
SELECT "Opponent" FROM table_66422 WHERE "Result" = 'l 27-7'
What is the visiting team of Melbourne's score?
CREATE TABLE table_54261 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Venue" text,"Crowd" real,"Date" text)
SELECT "Away team score" FROM table_54261 WHERE "Away team" = 'melbourne'
What was the result on December 31, 2005?
CREATE TABLE table_name_68 (result VARCHAR,date VARCHAR)
SELECT result FROM table_name_68 WHERE date = "december 31, 2005"
What is the sum of grid values of driver Michael Schumacher with lap counts larger than 66?
CREATE TABLE table_name_7 (grid INTEGER,laps VARCHAR,driver VARCHAR)
SELECT SUM(grid) FROM table_name_7 WHERE laps > 66 AND driver = "michael schumacher"
Show the number of courses for each course description in a stacked bar chart The x-axis is course description and group by instructor's name, I want to rank y axis in desc order.
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 STUDENT (STU_NUM int,STU_LNAME varchar(15),STU_FNAME varchar(15),STU_INIT varchar(1),STU_DOB datetime,STU_HRS int,STU_CLASS varchar(2),STU_GPA float(8),STU_TRANS...
SELECT CRS_DESCRIPTION, COUNT(CRS_DESCRIPTION) FROM CLASS AS T1 JOIN EMPLOYEE AS T2 ON T1.PROF_NUM = T2.EMP_NUM JOIN COURSE AS T3 ON T1.CRS_CODE = T3.CRS_CODE GROUP BY EMP_FNAME, CRS_DESCRIPTION ORDER BY COUNT(CRS_DESCRIPTION) DESC
does patient 031-15417 have any results of his or her sputum, expectorated microbiology tests until 06/2103?
CREATE TABLE intakeoutput (intakeoutputid number,patientunitstayid number,cellpath text,celllabel text,cellvaluenumeric number,intakeoutputtime time)CREATE TABLE microlab (microlabid number,patientunitstayid number,culturesite text,organism text,culturetakentime time)CREATE TABLE allergy (allergyid number,patientunitst...
SELECT COUNT(*) FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-15417')) AND microlab.culturesite = 'sputum, expectorated' AND STRFTIME('%y-%m...
What is the average lane for china?
CREATE TABLE table_14393 ("Rank" real,"Lane" real,"Name" text,"Nationality" text,"Time" text)
SELECT AVG("Lane") FROM table_14393 WHERE "Nationality" = 'china'
Show all branch names with the number of members in each branch registered after 2015 with a bar chart, and could you show Name from high to low order?
CREATE TABLE member (Member_ID int,Card_Number text,Name text,Hometown text,Level int)CREATE TABLE membership_register_branch (Member_ID int,Branch_ID text,Register_Year text)CREATE TABLE purchase (Member_ID int,Branch_ID text,Year text,Total_pounds real)CREATE TABLE branch (Branch_ID int,Name text,Open_year text,Addre...
SELECT Name, COUNT(*) FROM membership_register_branch AS T1 JOIN branch AS T2 ON T1.Branch_ID = T2.Branch_ID WHERE T1.Register_Year > 2015 GROUP BY T2.Branch_ID ORDER BY Name DESC
For those employees who do not work in departments with managers that have ids between 100 and 200, draw a bar chart about the distribution of phone_number and department_id , order y-axis from low to high order.
CREATE TABLE departments (DEPARTMENT_ID decimal(4,0),DEPARTMENT_NAME varchar(30),MANAGER_ID decimal(6,0),LOCATION_ID decimal(4,0))CREATE TABLE jobs (JOB_ID varchar(10),JOB_TITLE varchar(35),MIN_SALARY decimal(6,0),MAX_SALARY decimal(6,0))CREATE TABLE employees (EMPLOYEE_ID decimal(6,0),FIRST_NAME varchar(20),LAST_NAME ...
SELECT PHONE_NUMBER, DEPARTMENT_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY DEPARTMENT_ID
What is the sum of Points 1, when Team is 'Gainsborough Trinity', and when Played is greater than 46?
CREATE TABLE table_name_55 (points_1 INTEGER,team VARCHAR,played VARCHAR)
SELECT SUM(points_1) FROM table_name_55 WHERE team = "gainsborough trinity" AND played > 46
What are the modern equivalents for the province of 'hanju'?
CREATE TABLE table_160510_1 (modern_equivalent VARCHAR,province VARCHAR)
SELECT modern_equivalent FROM table_160510_1 WHERE province = "Hanju"
Which tags have the most closed questions?.
CREATE TABLE CloseAsOffTopicReasonTypes (Id number,IsUniversal boolean,InputTitle text,MarkdownInputGuidance text,MarkdownPostOwnerGuidance text,MarkdownPrivilegedUserGuidance text,MarkdownConcensusDescription text,CreationDate time,CreationModeratorId number,ApprovalDate time,ApprovalModeratorId number,DeactivationDat...
SELECT Tags.TagName, COUNT(*) AS ClosedCount FROM Tags INNER JOIN PostTags ON PostTags.TagId = Tags.Id INNER JOIN Posts ON PostTags.PostId = Posts.Id WHERE NOT Posts.ClosedDate IS NULL GROUP BY Tags.TagName ORDER BY ClosedCount DESC
How many times did the sounddock series II aux in?
CREATE TABLE table_24384861_1 (aux_in VARCHAR,version VARCHAR)
SELECT COUNT(aux_in) FROM table_24384861_1 WHERE version = "SoundDock series II"
Which rebound was 8 and has and ast that was less than 57?
CREATE TABLE table_31771 ("Nationality" text,"No [a ]" text,"Pos [a ]" text,"From" text,"School/club" text,"Pts [b ]" real,"Reb [b ]" real,"Ast [b ]" real)
SELECT AVG("Reb [b ]") FROM table_31771 WHERE "No [a ]" = '8' AND "Ast [b ]" < '57'
Who is directed the latest movie by ' NBCUniversal
CREATE TABLE made_by (id int,msid int,pid int)CREATE TABLE directed_by (id int,msid int,did int)CREATE TABLE classification (id int,msid int,gid int)CREATE TABLE tv_series (sid int,title text,release_year int,num_of_seasons int,num_of_episodes int,title_aka text,budget text)CREATE TABLE tags (id int,msid int,kid int)CR...
SELECT director.name FROM company, copyright, directed_by, director, movie WHERE company.name = 'NBCUniversal' AND copyright.cid = company.id AND director.did = directed_by.did AND movie.mid = copyright.msid AND movie.mid = directed_by.msid ORDER BY movie.release_year DESC LIMIT 1
Show me about the distribution of All_Road and Team_ID in a bar chart.
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 (School_ID int,School text,Location text,Founded real,Affiliation text,En...
SELECT All_Road, Team_ID FROM basketball_match
What is the highest Week when the opponent was kansas city chiefs, with more than 26,469 in attendance?
CREATE TABLE table_name_54 (week INTEGER,opponent VARCHAR,attendance VARCHAR)
SELECT MAX(week) FROM table_name_54 WHERE opponent = "kansas city chiefs" AND attendance > 26 OFFSET 469
What is the English spelling of the strongs transliteration: 'adoniyah?
CREATE TABLE table_17660 ("Strongs #" text,"Hebrew word" text,"Strongs Transliteration" text,"Strongs Words Compounded" text,"English Spelling" text)
SELECT "English Spelling" FROM table_17660 WHERE "Strongs Transliteration" = 'Adoniyah'
count the number of patients whose age is less than 67?
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 text,discharge_location text,diagnosis text,dod text,dob_year text,dod_year ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.age < "67"
since 5 years ago, how many patients were prescribed with aspart insulin in the same hospital visit after having received valve replacement or repair?
CREATE TABLE allergy (allergyid number,patientunitstayid number,drugname text,allergyname text,allergytime time)CREATE TABLE medication (medicationid number,patientunitstayid number,drugname text,dosage text,routeadmin text,drugstarttime time,drugstoptime time)CREATE TABLE patient (uniquepid text,patienthealthsystemsta...
SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, treatment.treatmenttime, patient.patienthealthsystemstayid FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'valve replacement or repair' AND DATETIME(treatment.treatmenttime) >= DAT...
what was the daily maximum amount of foley given to patient 53176 since 12/28/2105?
CREATE TABLE procedures_icd (row_id number,subject_id number,hadm_id number,icd9_code text,charttime time)CREATE TABLE inputevents_cv (row_id number,subject_id number,hadm_id number,icustay_id number,charttime time,itemid number,amount number)CREATE TABLE patients (row_id number,subject_id number,gender text,dob time,d...
SELECT MAX(outputevents.value) 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 = 53176)) AND outputevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'fol...
What episode in the series was the Amaral family featured?
CREATE TABLE table_23399 ("No. in series" text,"No. in season" real,"Family/families" text,"Location(s)" text,"Original air date" text)
SELECT "No. in series" FROM table_23399 WHERE "Family/families" = 'The Amaral Family'
What are the distinct types of mills that are built by American or Canadian architects?
CREATE TABLE mill (type VARCHAR,architect_id VARCHAR)CREATE TABLE architect (Id VARCHAR)
SELECT DISTINCT T1.type FROM mill AS T1 JOIN architect AS t2 ON T1.architect_id = T2.Id WHERE T2.nationality = 'American' OR T2.nationality = 'Canadian'
Show me about the distribution of other_details and the average of monthly_rental , and group by attribute other_details in a bar chart.
CREATE TABLE Detention (detention_id INTEGER,detention_type_code VARCHAR(10),teacher_id INTEGER,datetime_detention_start DATETIME,datetime_detention_end DATETIME,detention_summary VARCHAR(255),other_details VARCHAR(255))CREATE TABLE Teachers (teacher_id INTEGER,address_id INTEGER,first_name VARCHAR(80),middle_name VARC...
SELECT other_details, AVG(monthly_rental) FROM Student_Addresses GROUP BY other_details ORDER BY monthly_rental DESC
Plot how many party by grouped by party as a bar graph
CREATE TABLE representative (Representative_ID int,Name text,State text,Party text,Lifespan text)CREATE TABLE election (Election_ID int,Representative_ID int,Date text,Votes real,Vote_Percent real,Seats real,Place real)
SELECT Party, COUNT(Party) FROM representative GROUP BY Party
What is the Home Town with a Year of freshman, and a Height with 6 6?
CREATE TABLE table_name_81 (home_town VARCHAR,year VARCHAR,height VARCHAR)
SELECT home_town FROM table_name_81 WHERE year = "freshman" AND height = "6–6"
how many series had 8 episodes ?
CREATE TABLE table_203_461 (id number,"dvd title" text,"discs" number,"year" text,"no. of ep." number,"dvd release\nregion 2" text,"dvd release\nregion 4" text)
SELECT COUNT("dvd title") FROM table_203_461 WHERE "no. of ep." = 8
How many timeslots had viewers of 0.238 million?
CREATE TABLE table_27987623_3 (timeslot VARCHAR,viewers__millions_ VARCHAR)
SELECT COUNT(timeslot) FROM table_27987623_3 WHERE viewers__millions_ = "0.238"
What is the sum of poverty (2009) HPI-1 % when the GDP (PPP) (2012) US$ per capita of 11,284?
CREATE TABLE table_79328 ("Country" text,"Human development (2012) HDI" real,"GDP (PPP) (2012) US$ per capita" text,"Real GDP growth (2011) %" text,"Income inequality (2011) Gini" text,"Poverty (2009) HPI-1 %" real,"Extreme poverty (2011) <1.25 US$ %" text,"Literacy (2010) %" real,"Life expectancy (2011) Years" real,"M...
SELECT COUNT("Poverty (2009) HPI-1 %") FROM table_79328 WHERE "GDP (PPP) (2012) US$ per capita" = '11,284'
What's the largest amount of assists juan ignacio s nchez ever had?
CREATE TABLE table_8555 ("Rank" real,"Name" text,"Team" text,"Games" real,"Assists" real)
SELECT MAX("Assists") FROM table_8555 WHERE "Name" = 'juan ignacio sánchez'
What album came out before 2008 called We're not Made in the USA?
CREATE TABLE table_name_93 (album VARCHAR,year VARCHAR,title VARCHAR)
SELECT album FROM table_name_93 WHERE year < 2008 AND title = "we're not made in the usa"
Who as the home team for game on 5 october 2011?
CREATE TABLE table_27228 ("Season" text,"Date" text,"Home team" text,"Result" text,"Away team" text,"Stadium" text)
SELECT "Home team" FROM table_27228 WHERE "Date" = '5 October 2011'
retrieve the patient identifications of patients that were diagnosed with long-term use anticoagul during the previous year.
CREATE TABLE diagnoses_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 number,charttime time,spec_type_desc text,org_name text)CREATE TABLE cost (row_id number,subject_id number,hadm_id number,event_type text,even...
SELECT admissions.subject_id FROM admissions WHERE admissions.hadm_id IN (SELECT diagnoses_icd.hadm_id FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'long-term use anticoagul') AND DATETIME(diagnoses_icd.charttime, 'start of...
give me the number of patients born before 2041 who left against medical advice.
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 (subject_id text,hadm_id text,name text,marital_status text,age text,do...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.discharge_location = "LEFT AGAINST MEDICAL ADVI" AND demographic.dob_year < "2041"
which team has the most wins ?
CREATE TABLE table_204_448 (id number,"team" text,"winners" number,"runners-up" number,"years won" text,"years runner-up" text)
SELECT "team" FROM table_204_448 ORDER BY "winners" DESC LIMIT 1
What is the location for the 23-17 record?
CREATE TABLE table_name_67 (location VARCHAR,record VARCHAR)
SELECT location FROM table_name_67 WHERE record = "23-17"
count the number of patients whose primary disease is rash and age is less than 43?
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 text,discharge_location text,diagnosis text,dod text,dob_year text,dod_year ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "RASH" AND demographic.age < "43"
What in 2006 07 has a 2007 08 of q?
CREATE TABLE table_7527 ("Event" text,"2006\u201307" text,"2007\u201308" text,"2008\u201309" text,"2010\u201311" text)
SELECT "2006\u201307" FROM table_7527 WHERE "2007\u201308" = 'q'
what is the daily average value of patient 002-11679's weight?
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,age text,ethnicity text,hospitalid number,wardid number,admissio...
SELECT AVG(patient.admissionweight) FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '002-11679') AND NOT patient.admissionweight IS NULL GROUP BY STRFTIME('%y-%m-%d', patient.unitadmittime)
Who is every main presenter for the Estonia region/country?
CREATE TABLE table_26679 ("Region/Country" text,"Local name" text,"Main presenter" text,"Network" text,"Year premiered" real)
SELECT "Main presenter" FROM table_26679 WHERE "Region/Country" = 'Estonia'
Selects answers with score 0 from users with <50 score. (Helps to find answers to upvote :) ).
CREATE TABLE PostNoticeTypes (Id number,ClassId number,Name text,Body text,IsHidden boolean,Predefined boolean,PostNoticeDurationId number)CREATE TABLE PostLinks (Id number,CreationDate time,PostId number,RelatedPostId number,LinkTypeId number)CREATE TABLE SuggestedEditVotes (Id number,SuggestedEditId number,UserId num...
SELECT Posts.Body, Posts.Id, Posts.ParentId, Users.DisplayName, Users.Id, Users.Reputation FROM Posts INNER JOIN Users ON Users.Id = Posts.OwnerUserId WHERE Posts.PostTypeId = 2 AND Posts.Score = 0 AND Users.Reputation < 50 ORDER BY Posts.CreationDate DESC
Which Director has an Episode of 13?
CREATE TABLE table_44223 ("Episode" real,"Title" text,"Writer" text,"Director" text,"Original Airdate" text)
SELECT "Director" FROM table_44223 WHERE "Episode" = '13'
How many Picks have a Position of defensive end, and an Overall smaller than 33?
CREATE TABLE table_35346 ("Round" real,"Pick #" real,"Overall" real,"Name" text,"Position" text,"College" text)
SELECT COUNT("Pick #") FROM table_35346 WHERE "Position" = 'defensive end' AND "Overall" < '33'
What is the highest draw against 2161?
CREATE TABLE table_39950 ("Wins" real,"Byes" real,"Losses" real,"Draws" real,"Against" real)
SELECT MAX("Draws") FROM table_39950 WHERE "Against" > '2161'
What team had the record asscoiated with the 9th inning?
CREATE TABLE table_name_54 (team VARCHAR,inn VARCHAR)
SELECT team FROM table_name_54 WHERE inn = "9th"
If the Venue is brunswick street oval, what date was the game played ?
CREATE TABLE table_name_81 (date VARCHAR,venue VARCHAR)
SELECT date FROM table_name_81 WHERE venue = "brunswick street oval"
how many patients whose ethnicity is hispanic or latino and age is less than 20?
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 text,discharge_location text,diagnosis text,dod text,dob_year text,dod_year ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "HISPANIC OR LATINO" AND demographic.age < "20"
What is the repeat date of the episode that aired 22/12/1968?
CREATE TABLE table_18089 ("#" real,"Title" text,"Director" text,"Writer(s)" text,"Originalairdate" text,"Repeatairdate(s)" text,"Prod.Code" text)
SELECT "Repeatairdate(s)" FROM table_18089 WHERE "Originalairdate" = '22/12/1968'
what flights from LOS ANGELES to MINNEAPOLIS
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 restriction (restriction_code text,advance_purchase int,stopovers text,saturday_stay_required text,minimum_stay int,maximum_stay int,application ...
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 = 'LOS ANGELES' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'MI...
On which date did episode # 18 air in the U.S.?
CREATE TABLE table_26464364_1 (us_air_date VARCHAR,_number VARCHAR)
SELECT us_air_date FROM table_26464364_1 WHERE _number = 18
where are some good places for arabic on buchanan in san francisco ?
CREATE TABLE location (restaurant_id int,house_number int,street_name varchar,city_name varchar)CREATE TABLE geographic (city_name varchar,county varchar,region varchar)CREATE TABLE restaurant (id int,name varchar,food_type varchar,city_name varchar,rating "decimal)
SELECT location.house_number, restaurant.name FROM location, restaurant WHERE location.city_name = 'san francisco' AND location.street_name = 'buchanan' AND restaurant.food_type = 'arabic' AND restaurant.id = location.restaurant_id AND restaurant.rating > 2.5
What are the points in the season with 47 games and 28 goals?
CREATE TABLE table_name_38 (points VARCHAR,goals VARCHAR,games VARCHAR)
SELECT points FROM table_name_38 WHERE goals = "28" AND games = "47"
when was patient 013-27480 first prescribed a drug via subcutan in 05/this year?
CREATE TABLE lab (labid number,patientunitstayid number,labname text,labresult number,labresulttime time)CREATE TABLE vitalperiodic (vitalperiodicid number,patientunitstayid number,temperature number,sao2 number,heartrate number,respiration number,systemicsystolic number,systemicdiastolic number,systemicmean number,obs...
SELECT medication.drugstarttime FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '013-27480')) AND medication.routeadmin = 'subcutan' AND DATETI...
Which film has the highest rental rate? And what is the rate?
CREATE TABLE film (title VARCHAR,rental_rate VARCHAR)
SELECT title, rental_rate FROM film ORDER BY rental_rate DESC LIMIT 1
what is the score when the surface is clay and the tournament is san marino?
CREATE TABLE table_name_18 (score VARCHAR,surface VARCHAR,tournament VARCHAR)
SELECT score FROM table_name_18 WHERE surface = "clay" AND tournament = "san marino"
What is the highest number of gold medals won by a team that won fewer than 2 silver and fewer than 4 bronze medals?
CREATE TABLE table_name_83 (gold INTEGER,silver VARCHAR,bronze VARCHAR)
SELECT MAX(gold) FROM table_name_83 WHERE silver < 2 AND bronze < 4
What college is pick number 268 from?
CREATE TABLE table_name_44 (college VARCHAR,pick__number VARCHAR)
SELECT college FROM table_name_44 WHERE pick__number = "268"