instruction
stringlengths
0
1.06k
input
stringlengths
11
5.3k
response
stringlengths
2
4.44k
what college has paul seiler as a player?
CREATE TABLE table_name_22 (college VARCHAR,player VARCHAR)
SELECT college FROM table_name_22 WHERE player = "paul seiler"
What's listed as the Issue Price (BU) [Clarification Needed] with a Mintage (Proof) of 29,586?
CREATE TABLE table_name_57 (issue_price__bu_ VARCHAR,_clarification_needed_ VARCHAR,mintage__proof_ VARCHAR)
SELECT issue_price__bu_ AS "_clarification_needed_" FROM table_name_57 WHERE mintage__proof_ = "29,586"
How many episodes with different series numbers were seen by 8.69 people in the US?
CREATE TABLE table_19995378_1 (no_in_season VARCHAR,us_viewers__millions_ VARCHAR)
SELECT COUNT(no_in_season) FROM table_19995378_1 WHERE us_viewers__millions_ = "8.69"
How much Bronze has a Gold larger than 0, and a Total smaller than 1?
CREATE TABLE table_name_88 (bronze VARCHAR,gold VARCHAR,total VARCHAR)
SELECT COUNT(bronze) FROM table_name_88 WHERE gold > 0 AND total < 1
calculate the total number of patients who had radical neck dissection, unilateral
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 COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE procedures.long_title = "Radical neck dissection, unilateral"
Show all countries and the number of people from each country in a pie chart.
CREATE TABLE people (People_ID int,Name text,Country text,Is_Male text,Age int)CREATE TABLE wedding (Church_ID int,Male_ID int,Female_ID int,Year int)CREATE TABLE church (Church_ID int,Name text,Organized_by text,Open_Date int,Continuation_of text)
SELECT Country, COUNT(*) FROM people GROUP BY Country
return me the paper in Databases area with the most citations .
CREATE TABLE domain_keyword (did int,kid int)CREATE TABLE cite (cited int,citing int)CREATE TABLE publication (abstract varchar,cid int,citation_num int,jid int,pid int,reference_num int,title varchar,year int)CREATE TABLE domain (did int,name varchar)CREATE TABLE writes (aid int,pid int)CREATE TABLE author (aid int,ho...
SELECT publication.title FROM domain, domain_publication, publication WHERE domain.did = domain_publication.did AND domain.name = 'Databases' AND publication.pid = domain_publication.pid ORDER BY publication.citation_num DESC LIMIT 1
List the names of members who did not attend any performance.
CREATE TABLE member (member_id text,name text,nationality text,role text)CREATE TABLE performance (performance_id number,date text,host text,location text,attendance number)CREATE TABLE member_attendance (member_id number,performance_id number,num_of_pieces number)
SELECT name FROM member WHERE NOT member_id IN (SELECT member_id FROM member_attendance)
What is the least total number of medals when the bronze medals is 1, and Czech Republic (CZE) is the nation?
CREATE TABLE table_13456 ("Rank" text,"Nation" text,"Gold" real,"Silver" real,"Bronze" real,"Total" real)
SELECT MIN("Total") FROM table_13456 WHERE "Bronze" = '1' AND "Nation" = 'czech republic (cze)'
Posts per day versus total badges earned.
CREATE TABLE Votes (Id number,PostId number,VoteTypeId number,UserId number,CreationDate time,BountyAmount number)CREATE TABLE TagSynonyms (Id number,SourceTagName text,TargetTagName text,CreationDate time,OwnerUserId number,AutoRenameCount number,LastAutoRename time,Score number,ApprovedByUserId number,ApprovalDate ti...
SELECT DATE(p.CreationDate) AS PostDate, COUNT(p.Id) AS Posts, (SELECT COUNT(b.Id) / 100 FROM Badges AS b WHERE b.UserId = u.Id AND b.Date <= DATE(p.CreationDate)) AS BadgesEarned FROM Posts AS p, Users AS u WHERE u.Id = @UserId AND p.OwnerUserId = u.Id GROUP BY DATE(p.CreationDate), u.Id ORDER BY DATE(p.CreationDate)
How many rounds have an Overall larger than 17, and a Position of quarterback?
CREATE TABLE table_32303 ("Round" real,"Overall" real,"Player" text,"Position" text,"College" text)
SELECT COUNT("Round") FROM table_32303 WHERE "Overall" > '17' AND "Position" = 'quarterback'
What are the emails and phone numbers of custoemrs who have never filed a complaint?
CREATE TABLE complaints (complaint_id number,product_id number,customer_id number,complaint_outcome_code text,complaint_status_code text,complaint_type_code text,date_complaint_raised time,date_complaint_closed time,staff_id number)CREATE TABLE customers (customer_id number,customer_type_code text,address_line_1 text,a...
SELECT email_address, phone_number FROM customers WHERE NOT customer_id IN (SELECT customer_id FROM complaints)
Which Surface has a score of 7-5, 5-7, 6-3?
CREATE TABLE table_66438 ("Date" text,"Tournament" text,"Surface" text,"Partnering" text,"Opponents in the final" text,"Score" text)
SELECT "Surface" FROM table_66438 WHERE "Score" = '7-5, 5-7, 6-3'
Which round did the bout that led to a 1-0 record end in?
CREATE TABLE table_64276 ("Res." text,"Record" text,"Opponent" text,"Method" text,"Event" text,"Round" real,"Time" text,"Location" text)
SELECT "Round" FROM table_64276 WHERE "Record" = '1-0'
what were his points when he was in 8th position?
CREATE TABLE table_27260 ("Season" real,"Series" text,"Team" text,"Races" real,"Wins" real,"Poles" real,"F.L." real,"Podiums" real,"Points" text,"Position" text)
SELECT "Points" FROM table_27260 WHERE "Position" = '8th'
Give me the descriptions of the service types that cost more than 100.
CREATE TABLE products (product_id text,product_name text,product_price number,product_description text,other_product_service_details text)CREATE TABLE customers (customer_id text,address_id number,customer_name text,customer_phone text,customer_email_address text,other_details text)CREATE TABLE bookings (booking_id num...
SELECT T1.service_type_description FROM ref_service_types AS T1 JOIN services AS T2 ON T1.service_type_code = T2.service_type_code WHERE T2.product_price > 100
Who is the incumbent of Florida 9?
CREATE TABLE table_18140 ("District" text,"Incumbent" text,"Party" text,"First elected" real,"Results" text,"Candidates" text)
SELECT "Incumbent" FROM table_18140 WHERE "District" = 'Florida 9'
provide the number of patients whose diagnoses icd9 code is v4511 and lab test fluid is other body fluid?
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 INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.icd9_code = "V4511" AND lab.fluid = "Other Body Fluid"
What was the record when the score was 11-10?
CREATE TABLE table_name_85 (record VARCHAR,score VARCHAR)
SELECT record FROM table_name_85 WHERE score = "11-10"
find the number of medicaid patients who had transplant from live non-related donor.
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 procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.insurance = "Medicaid" AND procedures.long_title = "Transplant from live non-related donor"
how many patients have a diagnosis of malignant neoplastic bladder nec along with joint fluid lab test done?
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 procedures (subject_id text,hadm_id text,icd9_code text,sho...
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.short_title = "Malig neo bladder NEC" AND lab.fluid = "Joint Fluid"
give the number of patients of hispanic/latino-puerto rican ethnicity who were admitted as newborn.
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 WHERE demographic.admission_type = "NEWBORN" AND demographic.ethnicity = "HISPANIC/LATINO - PUERTO RICAN"
what was the top position in which he finished ?
CREATE TABLE table_204_445 (id number,"year" number,"competition" text,"venue" text,"position" text,"notes" text)
SELECT MIN("position") FROM table_204_445
Rank in Germany based on reputation.
CREATE TABLE PostHistory (Id number,PostHistoryTypeId number,PostId number,RevisionGUID other,CreationDate time,UserId number,UserDisplayName text,Comment text,Text text,ContentLicense text)CREATE TABLE PostFeedback (Id number,PostId number,IsAnonymous boolean,VoteTypeId number,CreationDate time)CREATE TABLE FlagTypes ...
SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation, Views, AccountId, Age, UpVotes, DownVotes FROM Users WHERE LOWER(Location) LIKE LOWER('%Germany%') AND Reputation >= 578 ORDER BY Reputation
what is the number of patients with a diagnoses of diaphragmatic hernia without mention of obstruction or gangrene who had urine lab test?
CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid text)CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title ...
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.long_title = "Diaphragmatic hernia without mention of obstruction or gangrene" AND lab.fluid = "Urine"
How many times is the score 98 90?
CREATE TABLE table_17287 ("Game" real,"Date" text,"Team" text,"Score" text,"High points" text,"High rebounds" text,"High assists" text,"Location Attendance" text,"Record" text)
SELECT COUNT("Location Attendance") FROM table_17287 WHERE "Score" = '98–90'
show the flights from PITTSBURGH to SAN FRANCISCO again on monday
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 airline (airline_code varchar,airline_name text,note text)CREATE TABLE time_interval (period text,begin_time int,end_time int)CREATE TABLE flight...
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 (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN FRANCISCO' AND date_day.day_number = 21 AND date_day.month_number = 2...
What is GDP 2012 Millions of Euro, when Population in Millions is less than 1.3, and when GDP (Nominal) Per Capita 2012 Euro is 20,700(p)?
CREATE TABLE table_name_51 (gdp_2012_millions_of_euro VARCHAR,population_in_millions VARCHAR,gdp__nominal__per_capita_2012_euro VARCHAR)
SELECT gdp_2012_millions_of_euro FROM table_name_51 WHERE population_in_millions < 1.3 AND gdp__nominal__per_capita_2012_euro = "20,700(p)"
Who is Winning driver on 18 may?
CREATE TABLE table_6340 ("Name" text,"Circuit" text,"Date" text,"Winning driver" text,"Winning constructor" text,"Report" text)
SELECT "Winning driver" FROM table_6340 WHERE "Date" = '18 may'
find me the cheapest one way fare i can get from BOSTON to DENVER
CREATE TABLE airport (airport_code varchar,airport_name text,airport_location text,state_code varchar,country_name varchar,time_zone_code varchar,minimum_connect_time int)CREATE TABLE code_description (code varchar,description text)CREATE TABLE airline (airline_code varchar,airline_name text,note text)CREATE TABLE date...
SELECT DISTINCT fare.fare_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, fare, flight, flight_fare WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'BOSTON' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_...
mean triplicate 12 _ lead ecg demonstrating qt interval ( corrected ) ( qtc ) > 450 msec in male and > 470 msec in female at the screening visit
CREATE TABLE table_train_214 ("id" int,"gender" string,"lead_ecg" bool,"systolic_blood_pressure_sbp" int,"qt_interval" bool,"urine_dipstick_protein" int,"stroke" bool,"transient_ischemic_attack" bool,"qtc" int,"long_qt_syndrome" bool,"cardiovascular_disease" bool,"estimated_glomerular_filtration_rate_egfr" int,"screeni...
SELECT * FROM table_train_214 WHERE lead_ecg = 1 OR (qt_interval = 1 OR (gender = 'male' AND qtc > 450) OR (gender = 'female' AND qtc > 470))
Name the class for 4th position with year before 2006
CREATE TABLE table_name_67 (class VARCHAR,pos VARCHAR,year VARCHAR)
SELECT class FROM table_name_67 WHERE pos = "4th" AND year < 2006
Retrieve the country that has published the most papers.
CREATE TABLE inst (instid number,name text,country text)CREATE TABLE papers (paperid number,title text)CREATE TABLE authorship (authid number,instid number,paperid number,authorder number)CREATE TABLE authors (authid number,lname text,fname text)
SELECT t1.country FROM inst AS t1 JOIN authorship AS t2 ON t1.instid = t2.instid JOIN papers AS t3 ON t2.paperid = t3.paperid GROUP BY t1.country ORDER BY COUNT(*) DESC LIMIT 1
how many performers appeared on the air date 21 january 2011 ?
CREATE TABLE table_203_784 (id number,"no. in\nseries" number,"no. in\nseason" number,"performer" text,"appearance" text,"air date" text)
SELECT COUNT("performer") FROM table_203_784 WHERE "air date" = '21 january 2011'
What is every entry for Friday August 26 when the entry for Wednesday August 24 is 23' 52.67 94.807mph?
CREATE TABLE table_30058355_7 (fri_26_aug VARCHAR,wed_24_aug VARCHAR)
SELECT fri_26_aug FROM table_30058355_7 WHERE wed_24_aug = "23' 52.67 94.807mph"
Who is the winner constructor with driver riccardo patrese?
CREATE TABLE table_57166 ("Round" real,"Grand Prix" text,"Date" text,"Location" text,"Pole Position" text,"Fastest Lap" text,"Winning Driver" text,"Winning Constructor" text,"Report" text)
SELECT "Winning Constructor" FROM table_57166 WHERE "Winning Driver" = 'riccardo patrese'
What was the highest Interview score from a contestant who had a swimsuit score of 8.857 and an Average score over 9.097?
CREATE TABLE table_name_66 (interview INTEGER,swimsuit VARCHAR,average VARCHAR)
SELECT MAX(interview) FROM table_name_66 WHERE swimsuit = 8.857 AND average > 9.097
Number of users authored at least one post.
CREATE TABLE PostsWithDeleted (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,Ta...
SELECT COUNT(DISTINCT OwnerUserId) FROM Posts
For teams with fewer than 5 wins, goals against over 37, and fewer than 8 games played, what is the average number of ties?
CREATE TABLE table_name_21 (ties INTEGER,games_played VARCHAR,wins VARCHAR,goals_against VARCHAR)
SELECT AVG(ties) FROM table_name_21 WHERE wins < 5 AND goals_against > 37 AND games_played < 8
What team has a Record of 50 28?
CREATE TABLE table_46722 ("Game" real,"Date" text,"Team" text,"Score" text,"High points" text,"High rebounds" text,"High assists" text,"Location Attendance" text,"Record" text)
SELECT "Team" FROM table_46722 WHERE "Record" = '50–28'
Who was the away team on 30 January 1988, when the home team was Everton?
CREATE TABLE table_58810 ("Tie no" text,"Home team" text,"Score" text,"Away team" text,"Date" text)
SELECT "Away team" FROM table_58810 WHERE "Home team" = 'everton' AND "Date" = '30 january 1988'
what is the price of a diagnosis for uterine leiomyoma nos?
CREATE TABLE diagnoses_icd (row_id number,subject_id number,hadm_id number,icd9_code text,charttime 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 t...
SELECT DISTINCT cost.cost FROM cost WHERE cost.event_type = 'diagnoses_icd' AND cost.event_id IN (SELECT diagnoses_icd.row_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 = 'uterine leiomyoma nos'))
How many results are there with the original title of ani ohev otach roza ( )?
CREATE TABLE table_12369913_1 (result VARCHAR,original_title VARCHAR)
SELECT COUNT(result) FROM table_12369913_1 WHERE original_title = "Ani Ohev Otach Roza (אני אוהב אותך רוזה)"
What was the first leg score of the matchup with a 2nd leg of 80-70?
CREATE TABLE table_63986 ("Team #1" text,"Agg." text,"Team #2" text,"1st leg" text,"2nd leg" text)
SELECT "1st leg" FROM table_63986 WHERE "2nd leg" = '80-70'
What's the report about townsville crocodiles as an away team?
CREATE TABLE table_name_35 (report VARCHAR,away_team VARCHAR)
SELECT report FROM table_name_35 WHERE away_team = "townsville crocodiles"
How many draft picks is player byron dafoe?
CREATE TABLE table_2897457_2 (pick__number VARCHAR,player VARCHAR)
SELECT COUNT(pick__number) FROM table_2897457_2 WHERE player = "Byron Dafoe"
Find the names of stadiums that some Australian swimmers have been to, and count them by a pie chart
CREATE TABLE record (ID int,Result text,Swimmer_ID int,Event_ID int)CREATE TABLE event (ID int,Name text,Stadium_ID int,Year text)CREATE TABLE stadium (ID int,name text,Capacity int,City text,Country text,Opening_year int)CREATE TABLE swimmer (ID int,name text,Nationality text,meter_100 real,meter_200 text,meter_300 te...
SELECT T4.Name, COUNT(T4.Name) FROM swimmer AS t1 JOIN record AS t2 ON t1.ID = t2.Swimmer_ID JOIN event AS t3 ON t2.Event_ID = t3.ID JOIN stadium AS t4 ON t4.ID = t3.Stadium_ID WHERE t1.Nationality = 'Australia' GROUP BY T4.Name
tell me the top three diagnosis that has the highest two year mortality rate?
CREATE TABLE microbiologyevents (row_id number,subject_id number,hadm_id number,charttime time,spec_type_desc text,org_name text)CREATE TABLE inputevents_cv (row_id number,subject_id number,hadm_id number,icustay_id number,charttime time,itemid number,amount number)CREATE TABLE prescriptions (row_id number,subject_id n...
SELECT d_icd_diagnoses.short_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.icd9_code IN (SELECT t4.icd9_code FROM (SELECT t3.icd9_code, DENSE_RANK() OVER (ORDER BY t3.c1 DESC) AS c2 FROM (SELECT t2.icd9_code, 100 - SUM(CASE WHEN patients.dod IS NULL THEN 1 WHEN STRFTIME('%j', patients.dod) - STRFTIME('%j', t2.chartt...
What tournament was located in Colorado?
CREATE TABLE table_name_5 (tournament VARCHAR,location VARCHAR)
SELECT tournament FROM table_name_5 WHERE location = "colorado"
What is the smallest losses when the wins are 5 and the against less than 1852?
CREATE TABLE table_41898 ("Ballarat FL" text,"Wins" real,"Byes" real,"Losses" real,"Draws" real,"Against" real)
SELECT MIN("Losses") FROM table_41898 WHERE "Wins" = '5' AND "Against" < '1852'
What value for university students and adult goes with male gender for minimum weight?
CREATE TABLE table_5335 ("Specification" text,"Gender" text,"Junior High School (12\u201315 yrs)" text,"Senior High School (15\u201318 yrs)" text,"University students and Adults (18yrs+)" text)
SELECT "University students and Adults (18yrs+)" FROM table_5335 WHERE "Gender" = 'male' AND "Specification" = 'minimum weight'
Of all the teachers , which one teaches PEDDENT 599 ?
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 instructor.name FROM course, course_offering, instructor, offering_instructor WHERE course.course_id = course_offering.course_id AND course.department = 'PEDDENT' AND course.number = 599 AND offering_instructor.instructor_id = instructor.instructor_id AND offering_instructor.offering_id = course_offerin...
how much is the cost of a drug called dorzolamide 2% ophth. soln.?
CREATE TABLE chartevents (row_id number,subject_id number,hadm_id number,icustay_id number,itemid number,charttime time,valuenum number,valueuom text)CREATE TABLE patients (row_id number,subject_id number,gender text,dob time,dod time)CREATE TABLE d_labitems (row_id number,itemid number,label text)CREATE TABLE procedur...
SELECT DISTINCT cost.cost FROM cost WHERE cost.event_type = 'prescriptions' AND cost.event_id IN (SELECT prescriptions.row_id FROM prescriptions WHERE prescriptions.drug = 'dorzolamide 2% ophth. soln.')
since 6 years ago, how many times patient 80119 had visited the hospital?
CREATE TABLE cost (row_id number,subject_id number,hadm_id number,event_type text,event_id number,chargetime time,cost number)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 procedures_icd (row_id n...
SELECT COUNT(DISTINCT admissions.hadm_id) FROM admissions WHERE admissions.subject_id = 80119 AND DATETIME(admissions.admittime) >= DATETIME(CURRENT_TIME(), '-6 year')
Name the 3 -credit courses .
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 name, number FROM course WHERE credits = 3 AND department = 'EECS'
List the name of physicians who took some appointment.
CREATE TABLE appointment (Physician VARCHAR)CREATE TABLE physician (name VARCHAR,EmployeeID VARCHAR)
SELECT T2.name FROM appointment AS T1 JOIN physician AS T2 ON T1.Physician = T2.EmployeeID
Show all student ids who are older than 20.
CREATE TABLE Student (StuID VARCHAR,age INTEGER)
SELECT StuID FROM Student WHERE age > 20
Could I take class HHCR 710 as Core ?
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 COUNT(*) > 0 FROM course, program, program_course WHERE course.department = 'HHCR' AND course.number = 710 AND program_course.category LIKE '%Core%' AND program_course.course_id = course.course_id AND program.name LIKE '%CS-LSA%' AND program.program_id = program_course.program_id
For those employees who do not work in departments with managers that have ids between 100 and 200, show me about the distribution of email and salary in a bar chart, list in asc by the x-axis.
CREATE TABLE locations (LOCATION_ID decimal(4,0),STREET_ADDRESS varchar(40),POSTAL_CODE varchar(12),CITY varchar(30),STATE_PROVINCE varchar(25),COUNTRY_ID varchar(2))CREATE TABLE countries (COUNTRY_ID varchar(2),COUNTRY_NAME varchar(40),REGION_ID decimal(10,0))CREATE TABLE job_history (EMPLOYEE_ID decimal(6,0),START_DA...
SELECT EMAIL, SALARY FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY EMAIL
What body participated in 1973?
CREATE TABLE table_name_43 (body VARCHAR,year VARCHAR)
SELECT body FROM table_name_43 WHERE year = "1973"
Which country has an IATA of JFK?
CREATE TABLE table_name_3 (country VARCHAR,iata VARCHAR)
SELECT country FROM table_name_3 WHERE iata = "jfk"
What is average age of male for different job title?
CREATE TABLE Person (job VARCHAR,age INTEGER,gender VARCHAR)
SELECT AVG(age), job FROM Person WHERE gender = 'male' GROUP BY job
how many years did he play in less than 16 games ?
CREATE TABLE table_204_756 (id number,"year" number,"team" text,"games" number,"combined tackles" number,"tackles" number,"assisted tackles" number,"sacks" number,"forced fumbles" number,"fumble recoveries" number,"fumble return yards" number,"interceptions" number,"interception return yards" number,"yards per intercep...
SELECT COUNT("year") FROM table_204_756 WHERE "games" < 16
Is 510 taken by undergrads ?
CREATE TABLE ta (campus_job_id int,student_id int,location varchar)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 ...
SELECT DISTINCT advisory_requirement, enforced_requirement, name FROM course WHERE department = 'EECS' AND number = 510
which Score has a Partnering of dmitry tursunov?
CREATE TABLE table_name_63 (score VARCHAR,partnering VARCHAR)
SELECT score FROM table_name_63 WHERE partnering = "dmitry tursunov"
What year did Elf Team Tyrrell have 34 points?
CREATE TABLE table_15835 ("Year" real,"Entrant" text,"Chassis" text,"Engine" text,"Points" text)
SELECT AVG("Year") FROM table_15835 WHERE "Entrant" = 'elf team tyrrell' AND "Points" = '34'
calculate the maximum age of unmarried patients who have gangrene primary disease.
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 MAX(demographic.age) FROM demographic WHERE demographic.marital_status = "SINGLE" AND demographic.diagnosis = "GANGRENE"
How many students participated in tryouts for each college by descennding count. Show a pie chart.
CREATE TABLE College (cName varchar(20),state varchar(2),enr numeric(5,0))CREATE TABLE Tryout (pID numeric(5,0),cName varchar(20),pPos varchar(8),decision varchar(3))CREATE TABLE Player (pID numeric(5,0),pName varchar(20),yCard varchar(3),HS numeric(5,0))
SELECT cName, COUNT(*) FROM Tryout GROUP BY cName ORDER BY COUNT(*) DESC
What are the average byes of Bonnie Doon having more than 16 wins?
CREATE TABLE table_name_54 (byes INTEGER,benalla_dfl VARCHAR,wins VARCHAR)
SELECT AVG(byes) FROM table_name_54 WHERE benalla_dfl = "bonnie doon" AND wins > 16
Give me the trend of how many receipt date by receipt date, and could you show in asc by the receipt_date?
CREATE TABLE Circulation_History (document_id INTEGER,draft_number INTEGER,copy_number INTEGER,employee_id INTEGER)CREATE TABLE Roles (role_code CHAR(15),role_description VARCHAR(255))CREATE TABLE Documents_Mailed (document_id INTEGER,mailed_to_address_id INTEGER,mailing_date DATETIME)CREATE TABLE Addresses (address_id...
SELECT receipt_date, COUNT(receipt_date) FROM Documents ORDER BY receipt_date
How did the School/Club Team of Manuel Luis Quezon acquire their Forward?
CREATE TABLE table_42620 ("Name" text,"Position" text,"Number" real,"School/Club Team" text,"Season" text,"Acquisition via" text)
SELECT "Acquisition via" FROM table_42620 WHERE "Position" = 'forward' AND "School/Club Team" = 'manuel luis quezon'
What is the WR player?
CREATE TABLE table_49221 ("Round" real,"Pick" text,"Player" text,"Position" text,"School/Club Team" text)
SELECT "Player" FROM table_49221 WHERE "Position" = 'wr'
Name the attendance on april 17
CREATE TABLE table_name_15 (attendance VARCHAR,date VARCHAR)
SELECT attendance FROM table_name_15 WHERE date = "april 17"
what are the three most common procedures that followed within 2 months for patients who were given a contrast arteriogram-leg?
CREATE TABLE microbiologyevents (row_id number,subject_id number,hadm_id number,charttime time,spec_type_desc text,org_name text)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,langua...
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 are the courses offered this semester ?
CREATE TABLE program_requirement (program_id int,category varchar,min_credit int,additional_req 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...
SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND course.department = 'EECS' AND semester.semester = 'WN' AND semester.semester_id = course_offering.semester AND semester.year = 2016 ORDER BY course.department
show flights from PITTSBURGH into SAN FRANCISCO
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 flight_leg (flight_id int,leg_number int,leg_flight int)CREATE TABLE aircraft (aircraft_code varchar,aircraft_description varchar,manufacturer va...
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 = 'PITTSBURGH' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN...
how many patients whose age is less than 81 and days of hospital stay is greater than 29?
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 < "81" AND demographic.days_stay > "29"
What is the record of game 26 with beno udrih (4) as the highest assists?
CREATE TABLE table_47031 ("Game" real,"Date" text,"Team" text,"Score" text,"High points" text,"High assists" text,"Location Attendance" text,"Record" text)
SELECT "Record" FROM table_47031 WHERE "High assists" = 'beno udrih (4)' AND "Game" = '26'
I want to see trend of the average of budget in billions by creation
CREATE TABLE head (head_ID int,name text,born_state text,age real)CREATE TABLE management (department_ID int,head_ID int,temporary_acting text)CREATE TABLE department (Department_ID int,Name text,Creation text,Ranking int,Budget_in_Billions real,Num_Employees real)
SELECT Creation, AVG(Budget_in_Billions) FROM department
Who was the winner against finalist Lina Krasnoroutskaya?
CREATE TABLE table_name_92 (winner VARCHAR,finalist VARCHAR)
SELECT winner FROM table_name_92 WHERE finalist = "lina krasnoroutskaya"
What is 2000, when 1996 is 'A', when 1997 is 'A', and when 2007 is 'A'?
CREATE TABLE table_48509 ("Tournament" text,"1993" text,"1994" text,"1995" text,"1996" text,"1997" text,"1998" text,"1999" text,"2000" text,"2001" text,"2002" text,"2003" text,"2004" text,"2005" text,"2006" text,"2007" text,"Career WR" text,"Career Win-Loss" text)
SELECT "2000" FROM table_48509 WHERE "1996" = 'a' AND "1997" = 'a' AND "2007" = 'a'
What is the maximum total when the To par is +3?
CREATE TABLE table_59095 ("Player" text,"Country" text,"Year(s) won" text,"Total" real,"To par" text,"Finish" text)
SELECT MAX("Total") FROM table_59095 WHERE "To par" = '+3'
Where did Geelong play as the away team?
CREATE TABLE table_name_62 (venue VARCHAR,away_team VARCHAR)
SELECT venue FROM table_name_62 WHERE away_team = "geelong"
What date has ny islanders as the visitor?
CREATE TABLE table_34997 ("Date" text,"Visitor" text,"Score" text,"Home" text,"Decision" text,"Attendance" text,"Record" text)
SELECT "Date" FROM table_34997 WHERE "Visitor" = 'ny islanders'
Before the year 2012, what award was given to the artist in the category of revelaci n pop del a o?
CREATE TABLE table_48512 ("Year" real,"Award" text,"Nominated Work" text,"Category" text,"Result" text)
SELECT "Award" FROM table_48512 WHERE "Year" < '2012' AND "Category" = 'revelación pop del año'
What is the average attendance on april 24?
CREATE TABLE table_53603 ("Date" text,"Opponent" text,"Score" text,"Loss" text,"Attendance" real,"Record" text)
SELECT AVG("Attendance") FROM table_53603 WHERE "Date" = 'april 24'
What are the ids and names of the architects who built at least 3 bridges , and rank y-axis in desc order.
CREATE TABLE architect (id text,name text,nationality text,gender text)CREATE TABLE bridge (architect_id int,id int,name text,location text,length_meters real,length_feet real)CREATE TABLE mill (architect_id int,id int,location text,name text,type text,built_year int,notes text)
SELECT T1.name, T1.id FROM architect AS T1 JOIN bridge AS T2 ON T1.id = T2.architect_id ORDER BY T1.id DESC
What is the D 46 with a D 43 with r 3?
CREATE TABLE table_name_2 (d_46_√ VARCHAR,d_43_√ VARCHAR)
SELECT d_46_√ FROM table_name_2 WHERE d_43_√ = "r 3"
What are the highest losses that have points agaisnt less than 956, high park demons as the club, and points less than 16?
CREATE TABLE table_name_93 (loses INTEGER,points VARCHAR,points_against VARCHAR,club VARCHAR)
SELECT MAX(loses) FROM table_name_93 WHERE points_against < 956 AND club = "high park demons" AND points < 16
What rank was the team from Australia?
CREATE TABLE table_63443 ("Rank" real,"Rowers" text,"Country" text,"Time" text,"Notes" text)
SELECT COUNT("Rank") FROM table_63443 WHERE "Country" = 'australia'
Name the sum of roll for morrinsville school
CREATE TABLE table_71700 ("Name" text,"Years" text,"Gender" text,"Area" text,"Authority" text,"Decile" real,"Roll" real)
SELECT SUM("Roll") FROM table_71700 WHERE "Name" = 'morrinsville school'
Draw a bar chart of transaction type versus the total number, and rank from low to high by the names.
CREATE TABLE Customers_Cards (card_id INTEGER,customer_id INTEGER,card_type_code VARCHAR(15),card_number VARCHAR(80),date_valid_from DATETIME,date_valid_to DATETIME,other_card_details VARCHAR(255))CREATE TABLE Accounts (account_id INTEGER,customer_id INTEGER,account_name VARCHAR(50),other_account_details VARCHAR(255))C...
SELECT transaction_type, COUNT(*) FROM Financial_Transactions GROUP BY transaction_type ORDER BY transaction_type
How many courses are provided in each year? Visualize with a group line chart grouping by semester, I want to order X from in desc order.
CREATE TABLE section (course_id varchar(8),sec_id varchar(8),semester varchar(6),year numeric(4,0),building varchar(15),room_number varchar(7),time_slot_id varchar(4))CREATE TABLE takes (ID varchar(5),course_id varchar(8),sec_id varchar(8),semester varchar(6),year numeric(4,0),grade varchar(2))CREATE TABLE instructor (...
SELECT year, COUNT(*) FROM section GROUP BY semester ORDER BY year DESC
Show all role codes and the number of employees in each role by a bar chart.
CREATE TABLE All_Documents (Document_ID INTEGER,Date_Stored DATETIME,Document_Type_Code CHAR(15),Document_Name CHAR(255),Document_Description CHAR(255),Other_Details VARCHAR(255))CREATE TABLE Document_Locations (Document_ID INTEGER,Location_Code CHAR(15),Date_in_Location_From DATETIME,Date_in_Locaton_To DATETIME)CREATE...
SELECT Role_Code, COUNT(*) FROM Employees GROUP BY Role_Code
How many starts are there?
CREATE TABLE table_25751 ("Position" real,"Driver" text,"Points" real,"Starts" real,"Wins" real,"Top 5s" real,"Top 10s" real,"Winnings ($)" real)
SELECT MIN("Starts") FROM table_25751
give me the number of patients who had single internal mammary-coronary artery bypass.
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 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...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE procedures.short_title = "1 int mam-cor art bypass"
What is the gross capacity of the unit that started commercial operation on August 28, 1987?
CREATE TABLE table_53324 ("Unit" text,"Reactor Type" text,"Net Capacity" text,"Gross Capacity" text,"Construction Start" text,"Grid Connection" text,"Commercial Operation" text,"Status" text)
SELECT "Gross Capacity" FROM table_53324 WHERE "Commercial Operation" = 'august 28, 1987'
What is the type of the player whose transfer fee was 20m?
CREATE TABLE table_72485 ("N" real,"P" text,"Name" text,"EU" text,"Country" text,"Age" real,"Type" text,"Moving from" text,"Transfer window" text,"Ends" text,"Transfer fee" text,"Source" text)
SELECT "Type" FROM table_72485 WHERE "Transfer fee" = '€20M'
How many yards did the player with 87 attempts rush?
CREATE TABLE table_11157122_5 (yards VARCHAR,attempts VARCHAR)
SELECT yards FROM table_11157122_5 WHERE attempts = 87
Which Score has smaller than 1994, and a Partner of elizabeth sayers smylie?
CREATE TABLE table_75986 ("Outcome" text,"Year" real,"Championship" text,"Surface" text,"Partner" text,"Opponents" text,"Score" text)
SELECT "Score" FROM table_75986 WHERE "Year" < '1994' AND "Partner" = 'elizabeth sayers smylie'