instruction
stringlengths
0
1.06k
input
stringlengths
11
5.3k
response
stringlengths
2
4.44k
What area is named Mackenzie college?
CREATE TABLE table_79983 ("Name" text,"Years" text,"Gender" text,"Area" text,"Authority" text,"Decile" real,"Roll" real)
SELECT "Area" FROM table_79983 WHERE "Name" = 'mackenzie college'
How many dates did the episode with a production code of 804 originally air on?
CREATE TABLE table_30187 ("No. in series" real,"No. in season" real,"Title" text,"Directed by" text,"Written by" text,"Original air date" text,"Production code" real)
SELECT COUNT("Original air date") FROM table_30187 WHERE "Production code" = '804'
List the names of entrepreneurs and their companies in descending order of money requested?
CREATE TABLE entrepreneur (Company VARCHAR,People_ID VARCHAR,Money_Requested VARCHAR)CREATE TABLE people (Name VARCHAR,People_ID VARCHAR)
SELECT T2.Name, T1.Company FROM entrepreneur AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID ORDER BY T1.Money_Requested
Which team had a season 1954-55?
CREATE TABLE table_59798 ("Season" text,"League" text,"Teams" text,"Home" text,"Away" text)
SELECT "Teams" FROM table_59798 WHERE "Season" = '1954-55'
how many government insurance patients had emergency room admission?
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 lab (subject_id text,hadm_id text,itemid text,charttime tex...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.insurance = "Government" AND demographic.admission_location = "EMERGENCY ROOM ADMIT"
WHAT IS THE DEVICE WITH MTS MOBILITY?
CREATE TABLE table_62089 ("Device" text,"Carrier" text,"Package Version" text,"Applications" text,"Software Platform" text)
SELECT "Device" FROM table_62089 WHERE "Carrier" = 'mts mobility'
Name the directors for peter gawler
CREATE TABLE table_28099 ("Season #" real,"Episode #" real,"Title" text,"Director(s)" text,"Writer(s)" text,"Original Air Date" text)
SELECT "Director(s)" FROM table_28099 WHERE "Writer(s)" = 'Peter Gawler'
Display a bar chart for what is the name of each aircraft and how many flights does each one complete?, show in asc by the names.
CREATE TABLE flight (flno number(4,0),origin varchar2(20),destination varchar2(20),distance number(6,0),departure_date date,arrival_date date,price number(7,2),aid number(9,0))CREATE TABLE employee (eid number(9,0),name varchar2(30),salary number(10,2))CREATE TABLE aircraft (aid number(9,0),name varchar2(30),distance n...
SELECT name, COUNT(*) FROM flight AS T1 JOIN aircraft AS T2 ON T1.aid = T2.aid GROUP BY T1.aid ORDER BY name
What's the smallest area in Russia that is ranked 23 with a population more than 522,800?
CREATE TABLE table_name_21 (area__km²_ INTEGER,population VARCHAR,country VARCHAR,rank VARCHAR)
SELECT MIN(area__km²_) FROM table_name_21 WHERE country = "russia" AND rank = 23 AND population > 522 OFFSET 800
What is the Manufacturer with a Fuel Type that is diesel?
CREATE TABLE table_name_9 (manufacturer VARCHAR,fuel_type VARCHAR)
SELECT manufacturer FROM table_name_9 WHERE fuel_type = "diesel"
Tell me the Laps for time/retired of +8 laps
CREATE TABLE table_10280 ("Driver" text,"Constructor" text,"Laps" real,"Time/retired" text,"Grid" real)
SELECT "Laps" FROM table_10280 WHERE "Time/retired" = '+8 laps'
what are the top five most common procedures that followed within 2 months for patients who received liver transplant nec in 2104?
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 procedures_icd (row_id number,subject_id number,hadm_id number,icd9_code text,chartti...
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, procedures_icd.charttime FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admi...
What is the amount of trees, that require replacement when district is leninsky?
CREATE TABLE table_10342194_3 (amount_of_trees VARCHAR,_that_require_replacement VARCHAR,district VARCHAR)
SELECT amount_of_trees, _that_require_replacement FROM table_10342194_3 WHERE district = "Leninsky"
Date of 7 september 1996 includes which highest rank athlete?
CREATE TABLE table_name_68 (rank INTEGER,date VARCHAR)
SELECT MAX(rank) FROM table_name_68 WHERE date = "7 september 1996"
What was Ralph Shoaf's pick number?
CREATE TABLE table_8829 ("Round" real,"Pick" real,"Overall" real,"Name" text,"Position" text,"College" text)
SELECT "Pick" FROM table_8829 WHERE "Name" = 'ralph shoaf'
Which role had a closing broadway cast of Adam Grupper?
CREATE TABLE table_name_78 (role VARCHAR,closing_broadway_cast VARCHAR)
SELECT role FROM table_name_78 WHERE closing_broadway_cast = "adam grupper"
how many capital with population census 2009 being 284657
CREATE TABLE table_19086 ("Code" real,"County" text,"Former Province" text,"Area (km 2)" text,"Population Census 2009" real,"Capital" text)
SELECT COUNT("Capital") FROM table_19086 WHERE "Population Census 2009" = '284657'
how many patients whose admission type is urgent and lab test fluid is pleural?
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 text,gender text,language text,religion text,admission_type text,days_stay ...
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 = "Pleural"
what's the minimum production code written by jay sommers & dick chevillat and al schwartz
CREATE TABLE table_17542 ("No. in series" real,"No. in season" real,"Title" text,"Directed by" text,"Written by" text,"Original air date" text,"Production code" real)
SELECT MIN("Production code") FROM table_17542 WHERE "Written by" = 'Jay Sommers & Dick Chevillat and Al Schwartz'
WHich Facility ID has a Call sign of wnpr?
CREATE TABLE table_name_64 (facility_id INTEGER,call_sign VARCHAR)
SELECT AVG(facility_id) FROM table_name_64 WHERE call_sign = "wnpr"
For those employees who did not have any job in the past, show me about the distribution of job_id and the amount of job_id , and group by attribute job_id in a bar chart, and show by the x axis in ascending please.
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 JOB_ID, COUNT(JOB_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) GROUP BY JOB_ID ORDER BY JOB_ID
From which region is the album with release date of 19 June 2007?
CREATE TABLE table_75840 ("Region" text,"Date" text,"Label" text,"Format" text,"Catalog" text)
SELECT "Region" FROM table_75840 WHERE "Date" = '19 june 2007'
what are the top five commonly prescribed drugs that patients were prescribed after having received a packed cell transfusion treatment since 6 years ago within the same hospital visit?
CREATE TABLE cost (row_id number,subject_id number,hadm_id number,event_type text,event_id number,chargetime time,cost number)CREATE TABLE d_labitems (row_id number,itemid number,label text)CREATE TABLE diagnoses_icd (row_id number,subject_id number,hadm_id number,icd9_code text,charttime time)CREATE TABLE d_icd_diagno...
SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, procedures_icd.charttime, admissions.hadm_id FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FR...
Who is the incumbent who was first elected before 2002 from the maryland 3 district?
CREATE TABLE table_name_41 (incumbent VARCHAR,first_elected VARCHAR,district VARCHAR)
SELECT incumbent FROM table_name_41 WHERE first_elected < 2002 AND district = "maryland 3"
which song has the most time ?
CREATE TABLE table_204_573 (id number,"#" number,"title" text,"performer(s)" text,"film" text,"length" text)
SELECT "title" FROM table_204_573 ORDER BY "length" DESC LIMIT 1
For those employees who was hired before 2002-06-21, give me the comparison about the average of manager_id over the job_id , and group by attribute job_id by a bar chart, and rank from low to high by the x-axis.
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 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...
SELECT JOB_ID, AVG(MANAGER_ID) FROM employees WHERE HIRE_DATE < '2002-06-21' GROUP BY JOB_ID ORDER BY JOB_ID
What is the ICAO when the IATA is ika?
CREATE TABLE table_name_19 (icao VARCHAR,iata VARCHAR)
SELECT icao FROM table_name_19 WHERE iata = "ika"
What are all types where registration is HB-OPU?
CREATE TABLE table_24840 ("Type" text,"Registration" text,"Design" text,"Construction" text,"Service" text,"Construction date" text,"Conformity to original design" text,"Interest" text,"Number existing in Switzerland" text,"Number existing worldwide" text,"Status" text)
SELECT "Type" FROM table_24840 WHERE "Registration" = 'HB-OPU'
What is the preliminaries of the contestant from Massachusetts with an evening gown higher than 8.631, an average less than 8.791, and an interview higher than 8.608?
CREATE TABLE table_name_97 (preliminaries VARCHAR,interview VARCHAR,state VARCHAR,evening_gown VARCHAR,average VARCHAR)
SELECT COUNT(preliminaries) FROM table_name_97 WHERE evening_gown > 8.631 AND average < 8.791 AND state = "massachusetts" AND interview > 8.608
Give me a scatter chart of showing the id and the number of journal committees they are on.
CREATE TABLE editor (Editor_ID int,Name text,Age real)CREATE TABLE journal (Journal_ID int,Date text,Theme text,Sales int)CREATE TABLE journal_committee (Editor_ID int,Journal_ID int,Work_Type text)
SELECT T1.Editor_ID, COUNT(*) FROM editor AS T1 JOIN journal_committee AS T2 ON T1.Editor_ID = T2.Editor_ID GROUP BY T1.Editor_ID
What is the date of game with tie number of 10?
CREATE TABLE table_name_35 (date VARCHAR,tie_no VARCHAR)
SELECT date FROM table_name_35 WHERE tie_no = "10"
Amount of questions closed after 3 leading close votes in the Close Vote review queue. Amount of posts closed (and not closed) after 'n' leading close votes in the Close Vote review queue (counts/consider the vote/flag which triggered the review activity) AND with at least 5 close/do not close votes in total (this is...
CREATE TABLE PostLinks (Id number,CreationDate time,PostId number,RelatedPostId number,LinkTypeId number)CREATE TABLE PostNoticeTypes (Id number,ClassId number,Name text,Body text,IsHidden boolean,Predefined boolean,PostNoticeDurationId number)CREATE TABLE Tags (Id number,TagName text,Count number,ExcerptPostId number,...
SELECT p.Id AS "post_link", pf.PostId, vt.Name, pf.CreationDate FROM Posts AS p INNER JOIN PostFeedback AS pf ON pf.PostId = p.Id INNER JOIN VoteTypes AS vt ON vt.Id = pf.VoteTypeId WHERE NOT p.ClosedDate IS NULL AND pf.PostId = 3923221 ORDER BY pf.PostId, pf.CreationDate DESC LIMIT 50
In EECS 569 how is work load ?
CREATE TABLE jobs (job_id int,job_title varchar,description varchar,requirement varchar,city varchar,state varchar,country varchar,zip int)CREATE TABLE gsi (course_offering_id int,student_id int)CREATE TABLE area (course_id int,area varchar)CREATE TABLE program (program_id int,name varchar,college varchar,introduction ...
SELECT DISTINCT program_course.workload FROM course, program_course WHERE course.department = 'EECS' AND course.number = 569 AND program_course.course_id = course.course_id
What date was the opponent the Los Angeles Raiders?
CREATE TABLE table_21000 ("Week" real,"Date" text,"Opponent" text,"Result" text,"Game site" text,"Record" text,"Attendance" real)
SELECT "Date" FROM table_21000 WHERE "Opponent" = 'Los Angeles Raiders'
impaired renal function ( creatinine > 200 mmol ) at the time of cell therapy
CREATE TABLE table_test_20 ("id" int,"ejection_fraction_ef" int,"anemia" bool,"gender" string,"bleeding" int,"systolic_blood_pressure_sbp" int,"left_main_coronary_artery_stenosis" int,"hemoglobin_a1c_hba1c" float,"renal_disease" bool,"creatinine_clearance_cl" float,"prior_creatinine" float,"diastolic_blood_pressure_dbp...
SELECT * FROM table_test_20 WHERE renal_disease = 1 OR creatinine_clearance_cl > 200
find out the icu stay id of patient with patient id 18480.
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 demographic (subject_id text,hadm_id text,name text,marital...
SELECT prescriptions.icustay_id FROM prescriptions WHERE prescriptions.subject_id = "18480"
what is the total number of electorates (2009) when the name is govindpura?
CREATE TABLE table_name_97 (number_of_electorates__2009_ VARCHAR,name VARCHAR)
SELECT COUNT(number_of_electorates__2009_) FROM table_name_97 WHERE name = "govindpura"
what was the name of the drug that patient 009-7776 was prescribed with within the same day after being diagnosed with hypoglycemia on the current hospital visit?
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 cost (costid number,uniquepid text,patienthealthsystemstayid number,eventt...
SELECT t2.drugname FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '009-7776' AND patient.hospitaldis...
what is maximum age of patients whose death status is 0 and primary disease is femoral artery thrombosis?
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 MAX(demographic.age) FROM demographic WHERE demographic.expire_flag = "0" AND demographic.diagnosis = "FEMORAL ARTERY THROMBOSIS"
Self-answered questions that would have been deleted.
CREATE TABLE PostTypes (Id number,Name text)CREATE TABLE TagSynonyms (Id number,SourceTagName text,TargetTagName text,CreationDate time,OwnerUserId number,AutoRenameCount number,LastAutoRename time,Score number,ApprovedByUserId number,ApprovalDate time)CREATE TABLE Badges (Id number,UserId number,Name text,Date time,Cl...
SELECT COUNT(DISTINCT q.Id) AS Questions FROM Posts AS q JOIN Posts AS a ON q.Id = a.ParentId WHERE q.PostTypeId = 1 AND a.PostTypeId = 2 AND q.ClosedDate IS NULL AND DATEPART(yyyy, q.CreationDate) = 2012 AND a.OwnerUserId = q.OwnerUserId AND q.Score >= 0 AND DATEDIFF(DD, q.CreationDate, creationDate) > 1
how many patients have diagnosis icd9 code 49392?
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 diagnoses.icd9_code = "49392"
count the number of patients whose ethnicity is black/african american and admission year is less than 2178?
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 demographic (subject_id text,hadm_id text,name text,marital_status text,age text,dob...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "BLACK/AFRICAN AMERICAN" AND demographic.admityear < "2178"
How many weeks have an attendance greater than 21,231, with l 38-10 as the result?
CREATE TABLE table_38067 ("Week" real,"Date" text,"Opponent" text,"Result" text,"Attendance" real)
SELECT COUNT("Week") FROM table_38067 WHERE "Attendance" > '21,231' AND "Result" = 'l 38-10'
What are the Lyrics (l) / Music (m) when the draw was 5?
CREATE TABLE table_61464 ("Draw" real,"Artist" text,"Song" text,"Lyrics (l) / Music (m)" text,"Results" text)
SELECT "Lyrics (l) / Music (m)" FROM table_61464 WHERE "Draw" = '5'
What is the highest rank that has 5 silvers, less than 5 golds, and less than 7 total medals?
CREATE TABLE table_9618 ("Rank" real,"Nation" text,"Gold" real,"Silver" real,"Bronze" real,"Total" real)
SELECT MAX("Rank") FROM table_9618 WHERE "Silver" = '5' AND "Gold" < '5' AND "Total" < '7'
What is the 2009 result when 2011 is 1R and 2007 is A?
CREATE TABLE table_name_84 (Id VARCHAR)
SELECT 2009 FROM table_name_84 WHERE 2011 = "1r" AND 2007 = "a"
what was the name of the medicine patient 61591 was prescribed during the same hospital encounter after having received a cont inv mec ven 96+ hrs procedure since 33 months ago?
CREATE TABLE patients (row_id number,subject_id number,gender text,dob time,dod time)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,a...
SELECT t2.drug FROM (SELECT admissions.subject_id, procedures_icd.charttime, admissions.hadm_id FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE admissions.subject_id = 61591 AND procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_proce...
Compare the total number of journalist with different nationality using a bar chart, I want to order by the names in ascending.
CREATE TABLE news_report (journalist_ID int,Event_ID int,Work_Type text)CREATE TABLE event (Event_ID int,Date text,Venue text,Name text,Event_Attendance int)CREATE TABLE journalist (journalist_ID int,Name text,Nationality text,Age text,Years_working int)
SELECT Nationality, COUNT(Nationality) FROM journalist GROUP BY Nationality ORDER BY Nationality
For those employees who do not work in departments with managers that have ids between 100 and 200, give me the comparison about the amount of hire_date over the hire_date bin hire_date by time by a bar chart, and could you rank in descending by the total number?
CREATE TABLE countries (COUNTRY_ID varchar(2),COUNTRY_NAME varchar(40),REGION_ID decimal(10,0))CREATE TABLE departments (DEPARTMENT_ID decimal(4,0),DEPARTMENT_NAME varchar(30),MANAGER_ID decimal(6,0),LOCATION_ID decimal(4,0))CREATE TABLE locations (LOCATION_ID decimal(4,0),STREET_ADDRESS varchar(40),POSTAL_CODE varchar...
SELECT HIRE_DATE, COUNT(HIRE_DATE) FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY COUNT(HIRE_DATE) DESC
Return a scatter chart about the correlation between Team_ID and School_ID .
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 Team_ID, School_ID FROM basketball_match
What is the IHSAA class with 395 in enrollment?
CREATE TABLE table_name_69 (ihsaa_class VARCHAR,enrollment VARCHAR)
SELECT ihsaa_class FROM table_name_69 WHERE enrollment = 395
What Rank has a 65 s Wicket?
CREATE TABLE table_name_25 (rank VARCHAR,s_wicket VARCHAR)
SELECT rank FROM table_name_25 WHERE s_wicket = "65"
Which class is the easiest one to fulfill the Other requirement ?
CREATE TABLE area (course_id int,area varchar)CREATE TABLE course_prerequisite (pre_course_id int,course_id int)CREATE TABLE semester (semester_id int,semester varchar,year int)CREATE TABLE ta (campus_job_id int,student_id int,location varchar)CREATE TABLE program_course (program_id int,course_id int,workload int,categ...
SELECT DISTINCT course.department, course.name, course.number, program_course.workload, program_course.workload FROM course, program_course WHERE program_course.category LIKE '%Other%' AND program_course.course_id = course.course_id AND program_course.workload = (SELECT MIN(PROGRAM_COURSEalias1.workload) FROM program_c...
How many millions viewers watched the episode that ran 23:25?
CREATE TABLE table_2101431_1 (viewers__in_millions_ VARCHAR,run_time VARCHAR)
SELECT viewers__in_millions_ FROM table_2101431_1 WHERE run_time = "23:25"
What is the score for the date of December 7?
CREATE TABLE table_23286112_7 (score VARCHAR,date VARCHAR)
SELECT score FROM table_23286112_7 WHERE date = "December 7"
i'd like a flight on UA from DALLAS to SAN FRANCISCO that leaves after 815
CREATE TABLE flight_leg (flight_id int,leg_number int,leg_flight int)CREATE TABLE date_day (month_number int,day_number int,year int,day_name varchar)CREATE TABLE food_service (meal_code text,meal_number int,compartment text,meal_description varchar)CREATE TABLE time_interval (period text,begin_time int,end_time int)CR...
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN FRANCISCO' AND flight.departure_time > 815 AND flight.to_airport = AIRPORT_SERVICE_1...
List the name and count of each product in all orders with a bar chart.
CREATE TABLE Products (product_id INTEGER,product_name VARCHAR(80),product_details VARCHAR(255))CREATE TABLE Order_Items (order_item_id INTEGER,product_id INTEGER,order_id INTEGER,order_item_status VARCHAR(10),order_item_details VARCHAR(255))CREATE TABLE Invoices (invoice_number INTEGER,invoice_date DATETIME,invoice_de...
SELECT T3.product_name, SUM(COUNT(*)) FROM Orders AS T1 JOIN Order_Items AS T2 JOIN Products AS T3 ON T1.order_id = T2.order_id AND T2.product_id = T3.product_id GROUP BY T3.product_name
What is Score, when Opponent Team is Belgium, and when Opponent is Kirsten Flipkens?
CREATE TABLE table_62012 ("Outcome" text,"Edition" real,"Round" text,"Opponent Team" text,"Surface" text,"Opponent" text,"Score" text)
SELECT "Score" FROM table_62012 WHERE "Opponent Team" = 'belgium' AND "Opponent" = 'kirsten flipkens'
how many patients admitted for more than 2 days had a lab test for urine
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,admission_type text,days_stay text,insurance text,ethnicity text,expire_flag...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.days_stay > "2" AND lab.fluid = "Urine"
show me flights from PHILADELPHIA to BALTIMORE
CREATE TABLE time_zone (time_zone_code text,time_zone_name text,hours_from_gmt int)CREATE TABLE code_description (code varchar,description text)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,r...
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 = 'PHILADELPHIA' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'B...
What was the venue where goal #2 occured?
CREATE TABLE table_name_11 (venue VARCHAR,goal__number VARCHAR)
SELECT venue FROM table_name_11 WHERE goal__number = 2
Could you tell me if there are any 500 -level courses for this Fall or Winter term ?
CREATE TABLE area (course_id int,area varchar)CREATE TABLE student_record (student_id int,course_id int,semester int,grade varchar,how varchar,transfer_source varchar,earn_credit varchar,repeat_term varchar,test_id varchar)CREATE TABLE gsi (course_offering_id int,student_id int)CREATE TABLE comment_instructor (instruct...
SELECT DISTINCT course.department, course.name, course.number, semester.semester FROM course, course_offering, semester WHERE ((semester.semester = 'FA' AND semester.year = 2016) OR (semester.semester = 'WN' AND semester.year = 2017)) AND course.course_id = course_offering.course_id AND course.department = 'department0...
What is the most points recorded for a right halfback?
CREATE TABLE table_28037 ("Player" text,"Position" text,"Starter" text,"Touchdowns" real,"Extra points" real,"Field goals" real,"Points" real)
SELECT MAX("Points") FROM table_28037 WHERE "Position" = 'Right halfback'
count the number of patients whose diagnoses icd9 code is v1000 and lab test fluid is ascites?
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,dob text,gender text,language text,religion text,admission_type text,days_stay text,insurance text,ethni...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.icd9_code = "V1000" AND lab.fluid = "Ascites"
when did patient 031-4423 receive a microbiology test first time?
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 microlab.culturetakentime FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-4423')) ORDER BY microlab.culturetakentime LIMIT 1
What was the wicket ranking for the match that had a fielding team of Sri Lanka?
CREATE TABLE table_9276 ("Wicket" text,"Runs" text,"Batting partners" text,"Batting team" text,"Fielding team" text,"Venue" text,"Date" text)
SELECT "Wicket" FROM table_9276 WHERE "Fielding team" = 'sri lanka'
For those records from the products and each product's manufacturer, return a bar chart about the distribution of headquarter and the average of revenue , and group by attribute headquarter, and I want to list from low to high by the Headquarter.
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)
SELECT Headquarter, AVG(Revenue) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter ORDER BY Headquarter
What is the sum of Blank Ends for Denmark when less than 42 is the ends lost?
CREATE TABLE table_name_39 (blank_ends INTEGER,nation VARCHAR,ends_lost VARCHAR)
SELECT SUM(blank_ends) FROM table_name_39 WHERE nation = "denmark" AND ends_lost < 42
Which School did Player Tyrone Johnson attend?
CREATE TABLE table_name_42 (school VARCHAR,player VARCHAR)
SELECT school FROM table_name_42 WHERE player = "tyrone johnson"
What is the attendance on 24 December 1898?
CREATE TABLE table_name_23 (attendance VARCHAR,date VARCHAR)
SELECT attendance FROM table_name_23 WHERE date = "24 december 1898"
What is S.K. Ho's Country?
CREATE TABLE table_name_58 (country VARCHAR,player VARCHAR)
SELECT country FROM table_name_58 WHERE player = "s.k. ho"
Where in Sweden is the home of the Swedish team?
CREATE TABLE table_62755 ("Team" text,"Country" text,"Home" text,"Skip" text,"Third" text,"Second" text,"Lead" text)
SELECT "Home" FROM table_62755 WHERE "Country" = 'sweden'
Which Driver that has a Grid less than 9 and a Time/Retired of 2:06:26.358?
CREATE TABLE table_32122 ("Driver" text,"Constructor" text,"Laps" real,"Time/Retired" text,"Grid" real)
SELECT "Driver" FROM table_32122 WHERE "Grid" < '9' AND "Time/Retired" = '2:06:26.358'
What is the English name of the country whose official native language is Dutch Papiamento?
CREATE TABLE table_72080 ("Country (exonym)" text,"Capital (exonym)" text,"Country (endonym)" text,"Capital (endonym)" text,"Official or native language(s) (alphabet/script)" text)
SELECT "Country ( exonym )" FROM table_72080 WHERE "Official or native language(s) (alphabet/script)" = 'Dutch Papiamento'
Who was the runner-up in the tournament that has a margin of victory of 2 strokes, and a To par of 16?
CREATE TABLE table_77497 ("Date" text,"Tournament" text,"Winning score" text,"To par" text,"Margin of victory" text,"Runner-up" text)
SELECT "Runner-up" FROM table_77497 WHERE "Margin of victory" = '2 strokes' AND "To par" = '−16'
What is listed as the highest Participants that also have a Rank of 5, and Silver that's smaller than 0?
CREATE TABLE table_name_13 (participants INTEGER,rank VARCHAR,silver VARCHAR)
SELECT MAX(participants) FROM table_name_13 WHERE rank = 5 AND silver < 0
What is Larry Combest's district?
CREATE TABLE table_18222 ("District" text,"Incumbent" text,"Party" text,"Elected" real,"Status" text,"Opponent" text)
SELECT "District" FROM table_18222 WHERE "Incumbent" = 'Larry Combest'
What's the enrollment at 41 Johnson?
CREATE TABLE table_name_24 (enrollment INTEGER,_number___county VARCHAR)
SELECT AVG(enrollment) FROM table_name_24 WHERE _number___county = "41 johnson"
What was the away score when North Melbourne was played?
CREATE TABLE table_11260 ("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_11260 WHERE "Home team" = 'north melbourne'
what is the highest % hydropower when % coal is 4.9 and % nuclear power is more than 0?
CREATE TABLE table_name_59 (_percentage_hydropower INTEGER,_percentage_coal VARCHAR,_percentage_nuclear_power VARCHAR)
SELECT MAX(_percentage_hydropower) FROM table_name_59 WHERE _percentage_coal = 4.9 AND _percentage_nuclear_power > 0
When did the duchess, who was married to philippe, die?
CREATE TABLE table_name_56 (death VARCHAR,spouse VARCHAR)
SELECT death FROM table_name_56 WHERE spouse = "philippe"
Return a pie on what are the investors of entrepreneurs and the corresponding number of entrepreneurs invested by each investor?
CREATE TABLE people (People_ID int,Name text,Height real,Weight real,Date_of_Birth text)CREATE TABLE entrepreneur (Entrepreneur_ID int,People_ID int,Company text,Money_Requested real,Investor text)
SELECT Investor, COUNT(*) FROM entrepreneur GROUP BY Investor
WHAT YEAR DID MIKE BRADY GET RUNNER-UP?
CREATE TABLE table_1507806_1 (year INTEGER,runner_up VARCHAR)
SELECT MIN(year) FROM table_1507806_1 WHERE runner_up = "Mike Brady"
what's the constructor with location being hockenheimring
CREATE TABLE table_16710 ("Rnd" real,"Race" text,"Date" text,"Location" text,"Pole Position" text,"Fastest Lap" text,"Race Winner" text,"Constructor" text,"Report" text)
SELECT "Constructor" FROM table_16710 WHERE "Location" = 'Hockenheimring'
What is the minimum number of seasons?
CREATE TABLE table_2140071_13 (season INTEGER)
SELECT MIN(season) FROM table_2140071_13
What is Fuzzy Zoeller's To par?
CREATE TABLE table_name_29 (to_par VARCHAR,player VARCHAR)
SELECT to_par FROM table_name_29 WHERE player = "fuzzy zoeller"
what playoff result occurred the most ?
CREATE TABLE table_204_463 (id number,"year" number,"division" number,"league" text,"regular season" text,"playoffs" text,"open cup" text)
SELECT "playoffs" FROM table_204_463 GROUP BY "playoffs" ORDER BY COUNT(*) DESC LIMIT 1
What is the average year with Nathan Robertson Gail Emms in mixed doubles?
CREATE TABLE table_14868 ("Year" real,"Men's singles" text,"Women's singles" text,"Men's doubles" text,"Women's doubles" text,"Mixed doubles" text)
SELECT AVG("Year") FROM table_14868 WHERE "Mixed doubles" = 'nathan robertson gail emms'
What is the date of game 66?
CREATE TABLE table_46001 ("Game" real,"Date" text,"Team" text,"Score" text,"Record" text,"Streak" text)
SELECT "Date" FROM table_46001 WHERE "Game" = '66'
which film/show only had two award ceremonies ?
CREATE TABLE table_203_757 (id number,"year" number,"award ceremony" text,"category" text,"film/show" text,"result" text)
SELECT "film/show" FROM table_203_757 GROUP BY "film/show" HAVING COUNT("award ceremony") = 2
what is the average number of previou council ?
CREATE TABLE table_204_223 (id number,"party" text,"previous council" number,"staying councillors" number,"seats up for election" number,"election result" number,"new council" number)
SELECT AVG("previous council") FROM table_204_223
Find the name and email of the user followed by the least number of people.
CREATE TABLE user_profiles (name VARCHAR,email VARCHAR,followers VARCHAR)
SELECT name, email FROM user_profiles ORDER BY followers LIMIT 1
What was the record at the game attended by 10,389?
CREATE TABLE table_79961 ("Date" text,"Opponent" text,"Score" text,"Loss" text,"Attendance" text,"Record" text)
SELECT "Record" FROM table_79961 WHERE "Attendance" = '10,389'
How many interceptions for the team who played 31 games?
CREATE TABLE table_22824302_3 (steals VARCHAR,games_played VARCHAR)
SELECT steals FROM table_22824302_3 WHERE games_played = 31
Where did god & guns peak on the Billboard?
CREATE TABLE table_64120 ("Date of release" text,"Title" text,"Billboard peak" text,"RIAA cert." text,"Label" text)
SELECT "Billboard peak" FROM table_64120 WHERE "Title" = 'god & guns'
What was the rank in 1955?
CREATE TABLE table_name_89 (rank VARCHAR,year VARCHAR)
SELECT rank FROM table_name_89 WHERE year = "1955"
What is the content of the television service ewtn in the United Kingdom?
CREATE TABLE table_40743 ("Television service" text,"Country" text,"Language" text,"Content" text,"HDTV" text,"Package/Option" text)
SELECT "Content" FROM table_40743 WHERE "Country" = 'united kingdom' AND "Television service" = 'ewtn'
In the afternoon of Winter 2001 is 595 offered ?
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 COUNT(*) > 0 FROM course, course_offering, semester WHERE course_offering.start_time >= '12:00:00' AND course.course_id = course_offering.course_id AND course.department = 'EECS' AND course.number = 595 AND semester.semester = 'Winter' AND semester.semester_id = course_offering.semester AND semester.year = 2001
What is every number when the player is Aigars Vitols?
CREATE TABLE table_23670057_7 (no VARCHAR,player VARCHAR)
SELECT no FROM table_23670057_7 WHERE player = "Aigars Vitols"
List the builder from 1930.
CREATE TABLE table_25028 ("Date" text,"Builder" text,"Type" text,"Operator" text,"Number" text,"Withdrawn" text,"Status" text)
SELECT "Builder" FROM table_25028 WHERE "Date" = '1930'