instruction
stringlengths
0
1.06k
input
stringlengths
11
5.3k
response
stringlengths
2
4.44k
What are all the employee ids and the names of the countries in which they work Visualize by bar chart, and show total number in ascending order.
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(4,0))CREATE TABLE departments (DEPARTMENT_ID decimal(4,...
SELECT COUNTRY_NAME, SUM(EMPLOYEE_ID) FROM employees AS T1 JOIN departments AS T2 ON T1.DEPARTMENT_ID = T2.DEPARTMENT_ID JOIN locations AS T3 ON T2.LOCATION_ID = T3.LOCATION_ID JOIN countries AS T4 ON T3.COUNTRY_ID = T4.COUNTRY_ID GROUP BY COUNTRY_NAME ORDER BY SUM(EMPLOYEE_ID)
what the first height of patient 20898 in this month.
CREATE TABLE d_labitems (row_id number,itemid number,label text)CREATE TABLE d_items (row_id number,itemid number,label text,linksto text)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,outt...
SELECT chartevents.valuenum 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 = 20898)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'admit ht'...
What was the score for Leo Diegel?
CREATE TABLE table_70298 ("Place" text,"Player" text,"Country" text,"Score" real,"To par" text)
SELECT "Score" FROM table_70298 WHERE "Player" = 'leo diegel'
What is the chassis of rahel frey's volkswagen engine?
CREATE TABLE table_59643 ("Team" text,"Driver" text,"Class" text,"Chassis" text,"Engine" text,"Rounds" text)
SELECT "Chassis" FROM table_59643 WHERE "Engine" = 'volkswagen' AND "Driver" = 'rahel frey'
Phillip Landrum was first elected in 1952 from the ninth district of Georgia.
CREATE TABLE table_18364 ("District" text,"Incumbent" text,"Party" text,"First elected" real,"Result" text,"Candidates" text)
SELECT "District" FROM table_18364 WHERE "First elected" = '1952'
What was the minimum score for r2?
CREATE TABLE table_1955 ("Player" text,"Country" text,"Year(s) won" text,"R1" real,"R2" real,"R3" real,"R4" real,"Total" real,"To par" text,"Finish" text)
SELECT MIN("R2") FROM table_1955
what is the average age of patients who are of black/african american ethnicity and are aged 43 years or above?
CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital_status text,age text,dob text,gender text,la...
SELECT AVG(demographic.age) FROM demographic WHERE demographic.ethnicity = "BLACK/AFRICAN AMERICAN" AND demographic.age >= "43"
what was the marital status of patient 19894 on their first hospital visit?
CREATE TABLE transfers (row_id number,subject_id number,hadm_id number,icustay_id number,eventtype text,careunit text,wardid number,intime time,outtime time)CREATE TABLE d_items (row_id number,itemid number,label text,linksto text)CREATE TABLE diagnoses_icd (row_id number,subject_id number,hadm_id number,icd9_code text...
SELECT admissions.marital_status FROM admissions WHERE admissions.subject_id = 19894 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1
What was the lowest attendance at a game when Pittsburgh was the home team?
CREATE TABLE table_51440 ("Date" text,"Visitor" text,"Score" text,"Home" text,"Decision" text,"Attendance" real,"Record" text)
SELECT MIN("Attendance") FROM table_51440 WHERE "Home" = 'pittsburgh'
What was the 1st leg for Team 2, Leeds United?
CREATE TABLE table_62303 ("Team 1" text,"Agg." text,"Team 2" text,"1st leg" text,"2nd leg" text)
SELECT "1st leg" FROM table_62303 WHERE "Team 2" = 'leeds united'
what is the song after ova here ?
CREATE TABLE table_203_37 (id number,"#" number,"title" text,"producer(s)" text,"performer(s)" text,"length" text)
SELECT "title" FROM table_203_37 WHERE "#" = (SELECT "#" FROM table_203_37 WHERE "title" = '"ova here"') + 1
What was the score in the Tournament of Frankfurt?
CREATE TABLE table_55858 ("Tournament" text,"Winner" text,"Runner-up" text,"Score" text,"Third Place" text)
SELECT "Score" FROM table_55858 WHERE "Tournament" = 'frankfurt'
how many female patients are diagnosed with icd9 code 2948?
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 INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.gender = "F" AND diagnoses.icd9_code = "2948"
what is the drug route of the drug pneumococcal vac polyvalent?
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 prescriptions.route FROM prescriptions WHERE prescriptions.drug = "Pneumococcal Vac Polyvalent"
mention the date of birth and death status of the patinet named francis baseler.
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 prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug tex...
SELECT demographic.dob, demographic.expire_flag FROM demographic WHERE demographic.name = "Francis Baseler"
how many papers about program slicing ?
CREATE TABLE paperdataset (paperid int,datasetid int)CREATE TABLE keyphrase (keyphraseid int,keyphrasename varchar)CREATE TABLE paperfield (fieldid int,paperid int)CREATE TABLE venue (venueid int,venuename varchar)CREATE TABLE cite (citingpaperid int,citedpaperid int)CREATE TABLE journal (journalid int,journalname varc...
SELECT DISTINCT COUNT(DISTINCT paper.paperid) FROM keyphrase, paper, paperkeyphrase WHERE keyphrase.keyphrasename = 'program slicing' AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paper.paperid = paperkeyphrase.paperid
how many exhibitions has each artist had?, and could you order Y in ascending order?
CREATE TABLE exhibition (Exhibition_ID int,Year int,Theme text,Artist_ID int,Ticket_Price real)CREATE TABLE exhibition_record (Exhibition_ID int,Date text,Attendance int)CREATE TABLE artist (Artist_ID int,Name text,Country text,Year_Join int,Age int)
SELECT Name, COUNT(*) FROM exhibition AS T1 JOIN artist AS T2 ON T1.Artist_ID = T2.Artist_ID GROUP BY T1.Artist_ID ORDER BY COUNT(*)
What was the result on October 29, 1989?
CREATE TABLE table_name_41 (result VARCHAR,date VARCHAR)
SELECT result FROM table_name_41 WHERE date = "october 29, 1989"
What days is ROMLING 450 going on ?
CREATE TABLE course_offering (offering_id int,course_id int,semester int,section_number int,start_time time,end_time time,monday varchar,tuesday varchar,wednesday varchar,thursday varchar,friday varchar,saturday varchar,sunday varchar,has_final_project varchar,has_final_exam varchar,textbook varchar,class_address varch...
SELECT DISTINCT course_offering.friday, course_offering.monday, course_offering.saturday, course_offering.sunday, course_offering.thursday, course_offering.tuesday, course_offering.wednesday FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_i...
what is the number of patients whose year of birth is less than 1850 and diagnoses short title is nutritional marasmus?
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,label text,fluid text)CREATE TABLE diagnoses (subject_id text,hadm_id tex...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.dob_year < "1850" AND diagnoses.short_title = "Nutritional marasmus"
i need a flight from DENVER to PITTSBURGH on 7 7 that leaves in the afternoon
CREATE TABLE airline (airline_code varchar,airline_name text,note text)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...
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.departure_time BETWEEN 1200 AND 1800) AND date_day.day_number = 7 AND date_day.month_number = 7 AND date_day.year = 1991 AND days.day_n...
What number was there 6.01 million u.s. drivers?
CREATE TABLE table_2894 ("No. in series" real,"No. in season" real,"Title" text,"Directed by" text,"Written by" text,"U.S. viewers (million)" text,"Original air date" text,"Production code" real)
SELECT "No. in season" FROM table_2894 WHERE "U.S. viewers (million)" = '6.01'
For all employees who have the letters D or S in their first name, a line chart shows the trend of department_id over hire_date , I want to show in asc by the HIRE_DATE.
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 varchar(25),EMAIL varchar(25),PHONE_NUMBER varchar(20),HIRE_DATE date,JOB_ID varchar(10),SALARY decimal(8,2),COMMISSION_PCT decima...
SELECT HIRE_DATE, DEPARTMENT_ID FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' ORDER BY HIRE_DATE
Which paper is published in an institution in 'USA' and have 'Turon' as its second author?
CREATE TABLE authorship (authid number,instid number,paperid number,authorder number)CREATE TABLE papers (paperid number,title text)CREATE TABLE authors (authid number,lname text,fname text)CREATE TABLE inst (instid number,name text,country text)
SELECT t3.title FROM authors AS t1 JOIN authorship AS t2 ON t1.authid = t2.authid JOIN papers AS t3 ON t2.paperid = t3.paperid JOIN inst AS t4 ON t2.instid = t4.instid WHERE t4.country = "USA" AND t2.authorder = 2 AND t1.lname = "Turon"
What film festival had the Best Male Actor?
CREATE TABLE table_28560 ("Film Festival" text,"Date of ceremony" text,"Category" text,"Participants/Recipients" text,"Result" text)
SELECT "Film Festival" FROM table_28560 WHERE "Category" = 'Best Male Actor'
what is the number of patients whose primary disease is guillain barre syndrome and year of birth is less than 2076?
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 diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "GUILLAIN BARRE SYNDROME" AND demographic.dob_year < "2076"
What was the away team whose opponents scored 8.16 (64)?
CREATE TABLE table_33781 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Venue" text,"Crowd" real,"Date" text)
SELECT "Away team" FROM table_33781 WHERE "Home team score" = '8.16 (64)'
calculate the length of stay of patient 82159 during his first hospital stay.
CREATE TABLE d_items (row_id number,itemid number,label text,linksto text)CREATE TABLE patients (row_id number,subject_id number,gender text,dob time,dod 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 icustays (r...
SELECT STRFTIME('%j', admissions.dischtime) - STRFTIME('%j', admissions.admittime) FROM admissions WHERE admissions.subject_id = 82159 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1
What is the release date by Editions EG in the Netherlands?
CREATE TABLE table_name_46 (release_date INTEGER,music_label VARCHAR,country VARCHAR)
SELECT AVG(release_date) FROM table_name_46 WHERE music_label = "editions eg" AND country = "netherlands"
What year was the International Cup that was won by Akron Goodyear Wingfoots and had Real Madrid as runner-up?
CREATE TABLE table_76187 ("Year" text,"Host city" text,"Champion" text,"Runner-up" text,"Final" text)
SELECT "Year" FROM table_76187 WHERE "Champion" = 'akron goodyear wingfoots' AND "Runner-up" = 'real madrid'
List the name and the number of enrolled student for each course in a bar chart, show by the X from low to high.
CREATE TABLE Subjects (subject_id INTEGER,subject_name VARCHAR(120))CREATE TABLE Students (student_id INTEGER,date_of_registration DATETIME,date_of_latest_logon DATETIME,login_name VARCHAR(40),password VARCHAR(10),personal_name VARCHAR(40),middle_name VARCHAR(40),family_name VARCHAR(40))CREATE TABLE Student_Course_Enro...
SELECT course_name, COUNT(*) FROM Courses AS T1 JOIN Student_Course_Enrolment AS T2 ON T1.course_id = T2.course_id GROUP BY T1.course_name ORDER BY course_name
List the actual delivery date for all the orders with quantity , and count them by a line chart
CREATE TABLE Bookings_Services (Order_ID INTEGER,Product_ID INTEGER)CREATE TABLE Customers (Customer_ID VARCHAR(100),Address_ID INTEGER,Customer_Name VARCHAR(255),Customer_Phone VARCHAR(255),Customer_Email_Address VARCHAR(255),Other_Details VARCHAR(255))CREATE TABLE Order_Items (Order_Item_ID INTEGER,Order_ID INTEGER,P...
SELECT Actual_Delivery_Date, COUNT(Actual_Delivery_Date) FROM Customer_Orders AS T1 JOIN Order_Items AS T2 ON T1.Order_ID = T2.Order_ID WHERE T2.Order_Quantity = 1 GROUP BY Actual_Delivery_Date
Which Engine has Points of 3?
CREATE TABLE table_15404 ("Year" real,"Team" text,"Chassis" text,"Engine" text,"Points" real)
SELECT "Engine" FROM table_15404 WHERE "Points" = '3'
Show party names and the number of events for each party in a bar chart, I want to sort in asc by the Y.
CREATE TABLE member (Member_ID int,Member_Name text,Party_ID text,In_office text)CREATE TABLE party (Party_ID int,Minister text,Took_office text,Left_office text,Region_ID int,Party_name text)CREATE TABLE party_events (Event_ID int,Event_Name text,Party_ID int,Member_in_charge_ID int)CREATE TABLE region (Region_ID int,...
SELECT Party_name, COUNT(*) FROM party_events AS T1 JOIN party AS T2 ON T1.Party_ID = T2.Party_ID GROUP BY T1.Party_ID ORDER BY COUNT(*)
What is Player, when Pick is '26'?
CREATE TABLE table_name_48 (player VARCHAR,pick VARCHAR)
SELECT player FROM table_name_48 WHERE pick = 26
Name the least dismissals for 4 rank
CREATE TABLE table_25975 ("Rank" real,"Dismissals" real,"Player" text,"Caught" real,"Stumped" real,"Matches" real,"Innings" real)
SELECT MAX("Dismissals") FROM table_25975 WHERE "Rank" = '4'
Select the name of the products with a price less than or equal to $200, and count them by a bar chart, and rank by the y axis in ascending.
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)
SELECT Name, COUNT(Name) FROM Products WHERE Price <= 200 GROUP BY Name ORDER BY COUNT(Name)
What is the most common reason that causes a fire?
CREATE TABLE fires (fire_year number,discovery_date number,discovery_doy number,discovery_time text,stat_cause_code number,stat_cause_descr text,cont_date text,cont_doy text,cont_time text,fire_size number,fire_size_class text,latitude number,longitude number,owner_code number,owner_descr text,state text,county text,fi...
SELECT stat_cause_descr FROM fires GROUP BY stat_cause_descr ORDER BY COUNT(*) DESC LIMIT 1
What was the score for the Perth Wildcats as away team?
CREATE TABLE table_name_38 (score VARCHAR,away_team VARCHAR)
SELECT score FROM table_name_38 WHERE away_team = "perth wildcats"
What season has a runner-up of waseda, and a title of 47th?
CREATE TABLE table_34612 ("Title" text,"Season" text,"Winner" text,"Score" text,"Runner-up" text,"Venue" text,"Attendance" text)
SELECT "Season" FROM table_34612 WHERE "Runner-up" = 'waseda' AND "Title" = '47th'
Worst Questions for a Given Year.
CREATE TABLE Posts (Id number,PostTypeId number,AcceptedAnswerId number,ParentId number,CreationDate time,DeletionDate time,Score number,ViewCount number,Body text,OwnerUserId number,OwnerDisplayName text,LastEditorUserId number,LastEditorDisplayName text,LastEditDate time,LastActivityDate time,Title text,Tags text,Ans...
SELECT Id AS "post_link", Score, AnswerCount, ViewCount, FavoriteCount FROM Posts WHERE PostTypeId = 1 AND YEAR(CreationDate) = '##year##' AND Score <= 0 ORDER BY Score, AnswerCount
Loss of kendrick (11 8) had what record?
CREATE TABLE table_36900 ("Date" text,"Opponent" text,"Score" text,"Loss" text,"Attendance" text,"Record" text)
SELECT "Record" FROM table_36900 WHERE "Loss" = 'kendrick (11–8)'
What is Bob Charles' To par?
CREATE TABLE table_61340 ("Player" text,"Country" text,"Year(s) won" text,"Total" real,"To par" text,"Finish" text)
SELECT "To par" FROM table_61340 WHERE "Player" = 'bob charles'
What record has magomedkhan gamzatkhanov as the opponent, and submission as the method?
CREATE TABLE table_47667 ("Res." text,"Record" text,"Opponent" text,"Method" text,"Round" text)
SELECT "Record" FROM table_47667 WHERE "Opponent" = 'magomedkhan gamzatkhanov' AND "Method" = 'submission'
What was the high points when the team was Washington?
CREATE TABLE table_29916 ("Game" real,"Date" text,"Team" text,"Score" text,"High points" text,"High rebounds" text,"High assists" text,"Location Attendance" text,"Record" text)
SELECT "High points" FROM table_29916 WHERE "Team" = 'Washington'
What year has 14 moves and an opening of C54 Italian Game?
CREATE TABLE table_8510 ("White" text,"Black" text,"Year" real,"Result" text,"Moves" real,"Tournament" text,"Opening" text)
SELECT "Year" FROM table_8510 WHERE "Moves" = '14' AND "Opening" = 'c54 italian game'
How many points did Stuart have when he had less than 1 touchdown?
CREATE TABLE table_35971 ("Player" text,"Touchdowns" real,"Extra points" real,"Field goals" real,"Points" real)
SELECT SUM("Points") FROM table_35971 WHERE "Player" = 'stuart' AND "Touchdowns" < '1'
What is the ranktotal number if the Hashan Tillakaratne?
CREATE TABLE table_26041144_16 (rank VARCHAR,player VARCHAR)
SELECT COUNT(rank) FROM table_26041144_16 WHERE player = "Hashan Tillakaratne"
Name the location attendance for 10-14
CREATE TABLE table_23248940_7 (location_attendance VARCHAR,record VARCHAR)
SELECT location_attendance FROM table_23248940_7 WHERE record = "10-14"
Overall site activity per hour.
CREATE TABLE PostFeedback (Id number,PostId number,IsAnonymous boolean,VoteTypeId number,CreationDate time)CREATE TABLE ReviewTaskStates (Id number,Name text,Description text)CREATE TABLE PostsWithDeleted (Id number,PostTypeId number,AcceptedAnswerId number,ParentId number,CreationDate time,DeletionDate time,Score numb...
SELECT h.hours AS "hour", COUNT(postsCounter) AS "posts" FROM (SELECT TIME_TO_STR(CreationDate, '%h') AS active, 1 AS counter, 1 AS postsCounter, NULL AS commentsCounter, NULL AS editsCounter, NULL AS suggestedCounter FROM Votes WHERE VoteTypeId = 1 AND TIME_TO_STR(CreationDate, '%Y') >= 2013) AS a RIGHT JOIN (SELECT D...
What was the score for the away team when the home team was richmond?
CREATE TABLE table_33353 ("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_33353 WHERE "Home team" = 'richmond'
what are the three most common prescribed medications?
CREATE TABLE outputevents (row_id number,subject_id number,hadm_id number,icustay_id number,charttime time,itemid number,value number)CREATE TABLE d_labitems (row_id number,itemid number,label text)CREATE TABLE procedures_icd (row_id number,subject_id number,hadm_id number,icd9_code text,charttime time)CREATE TABLE inp...
SELECT t1.drug FROM (SELECT prescriptions.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM prescriptions GROUP BY prescriptions.drug) AS t1 WHERE t1.c1 <= 3
which date was attended by the most people ?
CREATE TABLE table_204_855 (id number,"year" number,"date" text,"winner" text,"result" text,"loser" text,"attendance" number,"location" text)
SELECT "date" FROM table_204_855 ORDER BY "attendance" DESC LIMIT 1
how much was patient 808's body weight first measured since 09/2104?
CREATE TABLE inputevents_cv (row_id number,subject_id number,hadm_id number,icustay_id number,charttime time,itemid number,amount number)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 tex...
SELECT chartevents.valuenum 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 = 808)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'admit wt' A...
What is the f bolt for 11.35 p1 diameter (mm)?
CREATE TABLE table_29161 ("Chambering" text,"P1 diameter (mm)" text,"A external (cm 2)" text,"P max (bar)" real,"F bolt (kgf)" real,"F bolt" text)
SELECT "F bolt" FROM table_29161 WHERE "P1 diameter (mm)" = '11.35'
What was the earliest aired show that's returning on September 13?
CREATE TABLE table_76530 ("Show" text,"Last Aired" real,"Previous Network" text,"Retitled as/Same" text,"New/Returning/Same Network" text,"Returning" text)
SELECT MIN("Last Aired") FROM table_76530 WHERE "Returning" = 'september 13'
Find the average unit price of jazz tracks.
CREATE TABLE employee (employeeid number,lastname text,firstname text,title text,reportsto number,birthdate time,hiredate time,address text,city text,state text,country text,postalcode text,phone text,fax text,email text)CREATE TABLE playlisttrack (playlistid number,trackid number)CREATE TABLE invoice (invoiceid number...
SELECT AVG(unitprice) FROM genre AS T1 JOIN track AS T2 ON T1.genreid = T2.genreid WHERE T1.name = "Jazz"
Which is the category of the group was establishe in 1990?
CREATE TABLE table_name_8 (category VARCHAR,established VARCHAR)
SELECT category FROM table_name_8 WHERE established = 1990
What is the lowest round of bob caldwell, who has a pick greater than 7 and an overall larger than 162?
CREATE TABLE table_50320 ("Round" real,"Pick" real,"Overall" real,"Name" text,"Position" text,"College" text)
SELECT MIN("Round") FROM table_50320 WHERE "Pick" > '7' AND "Name" = 'bob caldwell' AND "Overall" > '162'
what year has no place indicated ?
CREATE TABLE table_203_231 (id number,"season" text,"tier" number,"division" text,"place" text)
SELECT "season" FROM table_203_231 WHERE "place" IS NULL
how many teams won only one game ?
CREATE TABLE table_204_419 (id number,"year" text,"tournament" text,"venue" text,"played" number,"won" number,"lost" number,"tied" number,"n/r" number,"result" text)
SELECT COUNT(*) FROM table_204_419 WHERE "won" = 1
Which away team resulted in a 15.14 (104) score for the home team?
CREATE TABLE table_32447 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Venue" text,"Crowd" real,"Date" text)
SELECT "Away team" FROM table_32447 WHERE "Home team score" = '15.14 (104)'
Answer Resonance & Importance to Impacted Users. The goal here is to measure the impact of an answer on the users who have viewed it - the idea being that the higher the percentage of viewers who have upvoted an answer, the more that answer resonated with the group of viewers, and the higher the percentage of viewers w...
CREATE TABLE Tags (Id number,TagName text,Count number,ExcerptPostId number,WikiPostId number)CREATE TABLE SuggestedEdits (Id number,PostId number,CreationDate time,ApprovalDate time,RejectionDate time,OwnerUserId number,Comment text,Text text,Title text,Tags text,RevisionGUID other)CREATE TABLE PendingFlags (Id number...
SELECT a.Id AS answer_id, q.Id AS question_id, q.ViewCount, q.FavoriteCount, a.Score, a.OwnerUserId, (a.Score * 1000) / q.ViewCount AS resonance, (q.FavoriteCount * 1000) / q.ViewCount AS importance, CASE WHEN q.AcceptedAnswerId = a.Id THEN 'Accepted' ELSE '' END AS recognized FROM Posts AS a JOIN Posts AS q ON a.Paren...
Who was the visitor when the record was 24 14 2?
CREATE TABLE table_12349 ("Date" text,"Visitor" text,"Score" text,"Home" text,"Record" text)
SELECT "Visitor" FROM table_12349 WHERE "Record" = '24–14–2'
What ship was built in 2012?
CREATE TABLE table_name_79 (ship VARCHAR,built VARCHAR)
SELECT ship FROM table_name_79 WHERE built = 2012
Show all account ids and account details.
CREATE TABLE Accounts (account_id VARCHAR,account_details VARCHAR)
SELECT account_id, account_details FROM Accounts
For those employees who do not work in departments with managers that have ids between 100 and 200, a bar chart shows the distribution of email and salary .
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 locations (LOCATION_ID decimal(4,0),STREET_ADDRESS varchar(40),POSTAL...
SELECT EMAIL, SALARY FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200)
All users that don't have down vote privileges and upvoted less than 10 times.
CREATE TABLE Users (Id number,Reputation number,CreationDate time,DisplayName text,LastAccessDate time,WebsiteUrl text,Location text,AboutMe text,Views number,UpVotes number,DownVotes number,ProfileImageUrl text,EmailHash text,AccountId number)CREATE TABLE VoteTypes (Id number,Name text)CREATE TABLE ReviewTaskResultTyp...
SELECT * FROM Users WHERE 125 > Reputation AND 10 < UpVotes
how many turns were completed to make a mean of 34.0
CREATE TABLE table_18809 ("Rank by average" real,"Competition finish" real,"Couple" text,"Total" real,"Number of dances" real,"Average" text)
SELECT COUNT("Number of dances") FROM table_18809 WHERE "Average" = '34.0'
My median and average answer score at given date. Reports median and average answer score. The MedianAnswerScore2 is more precise version of median.
CREATE TABLE CloseReasonTypes (Id number,Name text,Description text)CREATE TABLE ReviewTaskResultTypes (Id number,Name text,Description text)CREATE TABLE PostFeedback (Id number,PostId number,IsAnonymous boolean,VoteTypeId number,CreationDate time)CREATE TABLE ReviewTaskResults (Id number,ReviewTaskId number,ReviewTask...
SELECT COUNT(Posts.Id) AS Answers, (SELECT MAX(Score) FROM (SELECT percent AS Score FROM Posts AS PU WHERE PostTypeId = 2 AND CommunityOwnedDate IS NULL AND PU.OwnerUserId = '##UserId##' ORDER BY Score LIMIT 50) AS t) AS MedianAnswerScore FROM Posts WHERE PostTypeId = 2 AND CommunityOwnedDate IS NULL AND OwnerUserId = ...
What is the smallest number of gold medals a country with 1 bronze, and a total of 3 medals which is lower than rank 7?
CREATE TABLE table_60857 ("Rank" real,"Nation" text,"Gold" real,"Silver" real,"Bronze" real,"Total" real)
SELECT MIN("Gold") FROM table_60857 WHERE "Bronze" = '1' AND "Total" = '3' AND "Rank" > '7'
What is the average pick of the kansas city chiefs?
CREATE TABLE table_66638 ("Pick" real,"Team" text,"Player" text,"Position" text,"College" text)
SELECT AVG("Pick") FROM table_66638 WHERE "Team" = 'kansas city chiefs'
What Series has a season that is older than 2003 with a Podiums entry of 1 and a Points entry that is n/a?
CREATE TABLE table_64398 ("Season" real,"Series" text,"Team" text,"Races" text,"Wins" text,"Poles" text,"F/Laps" text,"Podiums" text,"Points" text,"Position" text)
SELECT "Series" FROM table_64398 WHERE "Season" < '2003' AND "Podiums" = '1' AND "Points" = 'n/a'
Find the names and phone numbers of customers living in California state.
CREATE TABLE addresses (address_id VARCHAR,state_province_county VARCHAR)CREATE TABLE customers (customer_name VARCHAR,customer_phone VARCHAR,customer_id VARCHAR)CREATE TABLE customer_addresses (customer_id VARCHAR,address_id VARCHAR)
SELECT t1.customer_name, t1.customer_phone FROM customers AS t1 JOIN customer_addresses AS t2 ON t1.customer_id = t2.customer_id JOIN addresses AS t3 ON t2.address_id = t3.address_id WHERE t3.state_province_county = 'California'
Find the female friends of Alice.
CREATE TABLE PersonFriend (friend VARCHAR,name VARCHAR)CREATE TABLE Person (name VARCHAR,gender VARCHAR)
SELECT T2.friend FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.friend WHERE T2.name = 'Alice' AND T1.gender = 'female'
What is the To par of the Player with a Score of 71-69-68=208?
CREATE TABLE table_name_25 (to_par VARCHAR,score VARCHAR)
SELECT to_par FROM table_name_25 WHERE score = 71 - 69 - 68 = 208
had patient 006-254182 been prescribed in 06/last year proventil,ventolin, prednisone 20 mg po tabs, or vancomycin hcl 1000 mg iv solr?
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 allergy (allergyid number,patientunitstayid number,drugname text,allergyna...
SELECT COUNT(*) > 0 FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-254182')) AND medication.drugname IN ('proventil,ventolin', 'prednison...
What upper-level DESCI courses are scheduled for this Spring ?
CREATE TABLE program (program_id int,name varchar,college varchar,introduction varchar)CREATE TABLE comment_instructor (instructor_id int,student_id int,score int,comment_text varchar)CREATE TABLE offering_instructor (offering_instructor_id int,offering_id int,instructor_id int)CREATE TABLE ta (campus_job_id int,studen...
SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, program_course, semester WHERE course.course_id = course_offering.course_id AND course.department = 'DESCI' AND program_course.category LIKE '%ULCS%' AND program_course.course_id = course.course_id AND semester.semester = 'Sprin...
What is the production code fore the episode titled, life's no fun anymore?
CREATE TABLE table_7465 ("Ep No" text,"Prod Code" text,"Original Air Date" text,"Episode Title" text,"Ratings" text)
SELECT "Prod Code" FROM table_7465 WHERE "Episode Title" = 'life''s no fun anymore'
when fairburn is bigger than 54.0, how many years?
CREATE TABLE table_2225 ("Year" real,"Fowler" real,"Stanier,3 cylinder" real,"Stanier,2 cylinder" real,"Fairburn" real,"BR Standard" real,"Total" real)
SELECT COUNT("Year") FROM table_2225 WHERE "Fairburn" > '54.0'
Which vocal type has the band mate with first name 'Marianne' played the most?
CREATE TABLE band (id VARCHAR)CREATE TABLE vocals (bandmate VARCHAR)
SELECT TYPE FROM vocals AS T1 JOIN band AS T2 ON T1.bandmate = T2.id WHERE firstname = "Marianne" GROUP BY TYPE ORDER BY COUNT(*) DESC LIMIT 1
What is the average number of points for a team in the 250cc class with fewer than 0 wins?
CREATE TABLE table_name_96 (points INTEGER,class VARCHAR,wins VARCHAR)
SELECT AVG(points) FROM table_name_96 WHERE class = "250cc" AND wins < 0
what are the flights from LAS VEGAS to ONTARIO
CREATE TABLE code_description (code varchar,description text)CREATE TABLE restriction (restriction_code text,advance_purchase int,stopovers text,saturday_stay_required text,minimum_stay int,maximum_stay int,application text,no_discounts text)CREATE TABLE time_interval (period text,begin_time int,end_time int)CREATE TAB...
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 = 'LAS VEGAS' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'ONTA...
What was Random House's copyright information?
CREATE TABLE table_54408 ("Year" real,"Title" text,"Publisher" text,"Release Date" text,"Copyright Information" text,"ISBN" real)
SELECT "Copyright Information" FROM table_54408 WHERE "Publisher" = 'random house'
On what Date was Henry I Latin Commander of the Battle of Boruy?
CREATE TABLE table_name_67 (date VARCHAR,latin_commander VARCHAR,battle VARCHAR)
SELECT date FROM table_name_67 WHERE latin_commander = "henry i" AND battle = "battle of boruy"
How man executions in effigie took place at the Lamego tribunal?
CREATE TABLE table_51151 ("Tribunal" text,"Number of autos da f\u00e9 with known sentences" text,"Executions in persona" text,"Executions in effigie" text,"Penanced" text,"Total" text)
SELECT "Executions in effigie" FROM table_51151 WHERE "Tribunal" = 'lamego'
Which Attendance has an Opponent of green bay packers, and a Week larger than 10?
CREATE TABLE table_78306 ("Week" real,"Date" text,"Opponent" text,"Result" text,"Attendance" real)
SELECT MIN("Attendance") FROM table_78306 WHERE "Opponent" = 'green bay packers' AND "Week" > '10'
When was the earliest founded university?
CREATE TABLE table_28406 ("Institution" text,"Location" text,"Nickname" text,"Founded" real,"Type" text,"Enrollment" real,"Joined" text)
SELECT MIN("Founded") FROM table_28406
What are the first names of all students that are not enrolled in courses?
CREATE TABLE department (dno number,division text,dname text,room text,building text,dphone number)CREATE TABLE course (cid text,cname text,credits number,instructor number,days text,hours text,dno number)CREATE TABLE gradeconversion (lettergrade text,gradepoint number)CREATE TABLE minor_in (stuid number,dno number)CRE...
SELECT fname FROM student WHERE NOT stuid IN (SELECT stuid FROM enrolled_in)
which date was attended by the most people ?
CREATE TABLE table_204_917 (id number,"date" text,"opponent#" text,"rank#" text,"site" text,"result" text,"attendance" number)
SELECT "date" FROM table_204_917 ORDER BY "attendance" DESC LIMIT 1
Which country has the score 70-76-68-214?
CREATE TABLE table_67573 ("Place" text,"Player" text,"Country" text,"Score" text,"To par" text)
SELECT "Country" FROM table_67573 WHERE "Score" = '70-76-68-214'
What kind of Manufacturer has a Laps smaller than 20 and a Grid of 21
CREATE TABLE table_name_54 (manufacturer VARCHAR,laps VARCHAR,grid VARCHAR)
SELECT manufacturer FROM table_name_54 WHERE laps < 20 AND grid = 21
Are there any Other classes in the Winter ?
CREATE TABLE program (program_id int,name varchar,college varchar,introduction 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,predicted_graduation_semester int,degree varchar,minor va...
SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester INNER JOIN program_course ON program_course.course_id = course_offering.course_id WHERE program_cour...
What is the easiest courses I can take to complete the PreMajor requirement ?
CREATE TABLE gsi (course_offering_id int,student_id int)CREATE TABLE requirement (requirement_id int,requirement varchar,college varchar)CREATE TABLE offering_instructor (offering_instructor_id int,offering_id int,instructor_id int)CREATE TABLE instructor (instructor_id int,name varchar,uniqname varchar)CREATE TABLE ar...
SELECT DISTINCT course.department, course.name, course.number, program_course.workload, program_course.workload FROM course, program_course WHERE program_course.category LIKE '%PreMajor%' AND program_course.course_id = course.course_id AND program_course.workload = (SELECT MIN(PROGRAM_COURSEalias1.workload) FROM progra...
what was the top five most frequent lab tests that patients had within 2 months after receiving a hemodialysis - for chronic renal failure procedure until 2101?
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,hospitaladmitsource text,unitadmittime time,unitdischargetime tim...
SELECT t3.labname FROM (SELECT t2.labname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, treatment.treatmenttime FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'hemodialysis - for chronic renal failure' AND STRFTI...
in what cities did the competitor participate in the olympics ?
CREATE TABLE table_204_813 (id number,"year" number,"competition" text,"venue" text,"position" text,"event" text,"notes" text)
SELECT "venue" FROM table_204_813 WHERE "competition" = 'olympic games'
What's listed for the Label with a Date of 29 July 1997?
CREATE TABLE table_name_51 (label VARCHAR,date VARCHAR)
SELECT label FROM table_name_51 WHERE date = "29 july 1997"
what is the number of patients whose admission location is clinic referral/premature and discharge location is home health care?
CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE prescriptions (subject_id text,hadm_id 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...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_location = "CLINIC REFERRAL/PREMATURE" AND demographic.discharge_location = "HOME HEALTH CARE"
What is the season 4 # for the production code of 4abb07?
CREATE TABLE table_74246 ("\u2116" real,"#" real,"Title" text,"Directed by" text,"Written by" text,"Original air date" text,"Production code" text,"U.S. viewers (millions)" text)
SELECT "#" FROM table_74246 WHERE "Production code" = '4ABB07'
what was the first dose of soln on their last hospital encounter, prescribed to patient 94316?
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 outputevents (row_id number,subject_id number,hadm_id number,icustay_id number,charttime time,itemid number,value number)CREATE TABLE cost (row_id n...
SELECT prescriptions.dose_val_rx FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 94316 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime DESC LIMIT 1) AND prescriptions.drug = 'soln' ORDER BY prescriptions.startdate LIMIT 1