instruction stringlengths 0 1.06k | input stringlengths 11 5.3k | response stringlengths 2 4.44k |
|---|---|---|
How many courses with more than one prerequisite for each title? Return a bar chart, show by the bar in desc. | CREATE TABLE classroom (building varchar(15),room_number varchar(7),capacity numeric(4,0))CREATE TABLE prereq (course_id varchar(8),prereq_id varchar(8))CREATE TABLE student (ID varchar(5),name varchar(20),dept_name varchar(20),tot_cred numeric(3,0))CREATE TABLE takes (ID varchar(5),course_id varchar(8),sec_id varchar(... | SELECT title, COUNT(title) FROM course AS T1 JOIN prereq AS T2 ON T1.course_id = T2.course_id GROUP BY title ORDER BY title DESC |
What is the Year of Kodansha Novels' Tokyo Nightmare? | CREATE TABLE table_64837 ("Japanese Title" text,"English Title" text,"Year" real,"First publisher" text,"ISBN" text) | SELECT "Year" FROM table_64837 WHERE "First publisher" = 'kodansha novels' AND "English Title" = 'tokyo nightmare' |
WHAT IS THE 4:30PM WITH 1:30PM LOCAL PROGRAMS? | CREATE TABLE table_61660 ("7:00 am" text,"7:30 am" text,"8:00 am" text,"9:00 am" text,"10:00 am" text,"11:00 am" text,"noon" text,"12:30 pm" text,"1:00 pm" text,"1:30 pm" text,"2:00 pm" text,"3:00 pm" text,"3:30 pm" text,"4:00 pm" text,"4:30 pm" text,"5:00 pm" text,"6:30 pm" text) | SELECT "4:30 pm" FROM table_61660 WHERE "1:30 pm" = 'local programs' |
What is the status of the membership application on 2008-12-15? | CREATE TABLE table_name_26 (status VARCHAR,membership_application VARCHAR) | SELECT status FROM table_name_26 WHERE membership_application = "2008-12-15" |
Name the least points with chassis of kurtis kraft 3000 and year before 1951 | CREATE TABLE table_name_92 (points INTEGER,chassis VARCHAR,year VARCHAR) | SELECT MIN(points) FROM table_name_92 WHERE chassis = "kurtis kraft 3000" AND year < 1951 |
has she won more doubles tournaments on clay or on hard ? | CREATE TABLE table_204_47 (id number,"outcome" text,"no." number,"date" text,"tournament" text,"surface" text,"partner" text,"opponents" text,"score" text) | SELECT "surface" FROM table_204_47 WHERE "surface" IN ('clay', 'hard') GROUP BY "surface" ORDER BY COUNT(*) DESC LIMIT 1 |
out of v hawks and mustangs , who has the least enrollment ? | CREATE TABLE table_204_501 (id number,"institution" text,"location" text,"nickname" text,"founded" number,"type" text,"enrollment" number,"joined" number) | SELECT "nickname" FROM table_204_501 WHERE "nickname" IN ('v-hawks', 'mustangs') ORDER BY "enrollment" LIMIT 1 |
If the home team scored 14.15 (99), who was the away team? | CREATE TABLE table_53279 ("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_53279 WHERE "Home team score" = '14.15 (99)' |
On what date was the result w 26 20? | CREATE TABLE table_45365 ("Week" real,"Date" text,"Opponent" text,"Result" text,"Attendance" text) | SELECT "Date" FROM table_45365 WHERE "Result" = 'w 26–20' |
can you list costs of DENVER RENTAL CAR | CREATE TABLE dual_carrier (main_airline varchar,low_flight_number int,high_flight_number int,dual_airline varchar,service_name text)CREATE TABLE ground_service (city_code text,airport_code text,transport_type text,ground_fare int)CREATE TABLE airline (airline_code varchar,airline_name text,note text)CREATE TABLE restri... | SELECT DISTINCT ground_service.ground_fare FROM city, ground_service WHERE city.city_name = 'DENVER' AND ground_service.city_code = city.city_code AND ground_service.transport_type = 'RENTAL CAR' |
Where did the Oakland Raiders play in week 12 of their 1976 season? | CREATE TABLE table_name_90 (game_site VARCHAR,week VARCHAR) | SELECT game_site FROM table_name_90 WHERE week = 12 |
What year was the rank final of 6? | CREATE TABLE table_59228 ("Year" real,"Competition Description" text,"Location" text,"Apparatus" text,"Rank-Final" text) | SELECT "Year" FROM table_59228 WHERE "Rank-Final" = '6' |
What is the Date of the Player from Marshfield High School? | CREATE TABLE table_name_63 (date VARCHAR,school VARCHAR) | SELECT date FROM table_name_63 WHERE school = "marshfield high school" |
What are the names of the county that the delegates on 'Appropriations' committee belong to? | CREATE TABLE party (party_id number,year number,party text,governor text,lieutenant_governor text,comptroller text,attorney_general text,us_senate text)CREATE TABLE county (county_id number,county_name text,population number,zip_code text)CREATE TABLE election (election_id number,counties_represented text,district numb... | SELECT T1.county_name FROM county AS T1 JOIN election AS T2 ON T1.county_id = T2.district WHERE T2.committee = "Appropriations" |
how many patients discharged to snf had incision of aorta procedure? | 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 text,formulary_drug_cd text,route text,drug_dose text)CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime te... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.discharge_location = "SNF" AND procedures.short_title = "Incision of aorta" |
What is the number of branches that have more than the average number of memberships? | CREATE TABLE member (member_id number,card_number text,name text,hometown text,level number)CREATE TABLE purchase (member_id number,branch_id text,year text,total_pounds number)CREATE TABLE membership_register_branch (member_id number,branch_id text,register_year text)CREATE TABLE branch (branch_id number,name text,ope... | SELECT COUNT(*) FROM branch WHERE membership_amount > (SELECT AVG(membership_amount) FROM branch) |
What is the world record when 14 July 1998 is 13 August 1997? | CREATE TABLE table_26470 ("World record" text,"Hicham El Guerrouj (MAR)" text,"3:26.00" text,"Rome,Italy" text,"14 July 1998" text) | SELECT "World record" FROM table_26470 WHERE "14 July 1998" = '13 August 1997' |
what was the difference in weight of patient 14987 second measured on the first hospital visit compared to the first value measured on the first hospital visit? | CREATE TABLE admissions (row_id number,subject_id number,hadm_id number,admittime time,dischtime time,admission_type text,admission_location text,discharge_location text,insurance text,language text,marital_status text,ethnicity text,age number)CREATE TABLE transfers (row_id number,subject_id number,hadm_id number,icus... | SELECT (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 = 14987 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1)) AND chartev... |
How many laps had a grid number of 7? | CREATE TABLE table_56886 ("Driver" text,"Constructor" text,"Laps" real,"Time/Retired" text,"Grid" real) | SELECT SUM("Laps") FROM table_56886 WHERE "Grid" = '7' |
Name the opponent in the final for 3 6, 1 6 | CREATE TABLE table_23284597_3 (opponent_in_the_final VARCHAR,score_in_the_final VARCHAR) | SELECT opponent_in_the_final FROM table_23284597_3 WHERE score_in_the_final = "3–6, 1–6" |
How tall is the contestant from Guatemala? | CREATE TABLE table_2315 ("Country" text,"Contestant" text,"Age" real,"Height (cm)" real,"Height (ft)" text,"Hometown" text) | SELECT "Height (cm)" FROM table_2315 WHERE "Country" = 'Guatemala' |
Which Total has Gold smaller than 12, and a Nation of hong kong (hkg)? | CREATE TABLE table_13213 ("Rank" text,"Nation" text,"Gold" real,"Silver" real,"Bronze" real,"Total" real) | SELECT MAX("Total") FROM table_13213 WHERE "Gold" < '12' AND "Nation" = 'hong kong (hkg)' |
5 YEAR TREND FOR NON-EXPERTS. | 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 * FROM Posts WHERE OwnerUserId IN (SELECT Id FROM Users WHERE CreationDate >= '20130101' AND CreationDate < '20130201' AND LastAccessDate >= '20190101' AND Reputation >= 551) AND PostTypeId = 1 AND CreationDate >= '20180101' AND CreationDate < '20190101' ORDER BY OwnerUserId, CreationDate |
Find the common login name of course authors and students. | CREATE TABLE student_course_enrolment (registration_id number,student_id number,course_id number,date_of_enrolment time,date_of_completion time)CREATE TABLE course_authors_and_tutors (author_id number,author_tutor_atb text,login_name text,password text,personal_name text,middle_name text,family_name text,gender_mf text... | SELECT login_name FROM course_authors_and_tutors INTERSECT SELECT login_name FROM students |
In which state is the Petrie electorate? | CREATE TABLE table_name_39 (state VARCHAR,electorate VARCHAR) | SELECT state FROM table_name_39 WHERE electorate = "petrie" |
How many wins did Canterbury Wizards have? | CREATE TABLE table_27604 ("Team" text,"Played" real,"Won" real,"Lost" real,"No-Result" real,"Abandoned" real,"Bonus Points" real,"Total Points" real,"Net Run Rate" text) | SELECT MAX("Won") FROM table_27604 WHERE "Team" = 'Canterbury Wizards' |
What is the highest Quantity for PTRD Nos. 3, 15? | CREATE TABLE table_53633 ("Manufacturer" text,"Type" text,"Quantity" real,"PTRD Nos." text,"GWR Nos." text) | SELECT MAX("Quantity") FROM table_53633 WHERE "PTRD Nos." = '3, 15' |
What player's hometown is Roebuck, South Carolina? | CREATE TABLE table_17088 ("Player" text,"Position" text,"School" text,"Hometown" text,"College" text) | SELECT "Player" FROM table_17088 WHERE "Hometown" = 'Roebuck, South Carolina' |
Tell me the overall rank for roland schoeman | CREATE TABLE table_32000 ("Heat Rank" real,"Lane" real,"Swimmer" text,"Country" text,"Time" real,"Overall Rank" text) | SELECT "Overall Rank" FROM table_32000 WHERE "Swimmer" = 'roland schoeman' |
What is the total of a crowd with an Away team score of 8.17 (65)? | CREATE TABLE table_53007 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Venue" text,"Crowd" real,"Date" text) | SELECT SUM("Crowd") FROM table_53007 WHERE "Away team score" = '8.17 (65)' |
In the country Switzerland, what is the total trade? | CREATE TABLE table_28338 ("Country" text,"Exports" text,"Imports" text,"Total Trade" text,"Trade Balance" text) | SELECT "Total Trade" FROM table_28338 WHERE "Country" = 'Switzerland' |
What was the Attendance at Jobing.com Arena? | CREATE TABLE table_59817 ("Date" text,"Opponent" text,"Score" text,"Loss" text,"Attendance" real,"Record" text,"Arena" text) | SELECT COUNT("Attendance") FROM table_59817 WHERE "Arena" = 'jobing.com arena' |
HOW MANY TONS OF CO2 EMISSIONS DID RUSSIA PRODUCE IN 2006? | CREATE TABLE table_11251601_2 (carbon_dioxide_emissions_per_year__10_6_tons___2006_ INTEGER,country VARCHAR) | SELECT MAX(carbon_dioxide_emissions_per_year__10_6_tons___2006_) FROM table_11251601_2 WHERE country = "Russia" |
provide the number of patients whose admission location is emergency room admit and procedure short title is percutan aspiration gb? | 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 text,formulary_drug_cd text,route text,drug_dose text)CREATE TABLE demographic (subject_id text,hadm_id text,name text,marita... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_location = "EMERGENCY ROOM ADMIT" AND procedures.short_title = "Percutan aspiration gb" |
give me the number of patients whose diagnoses long title is transient neonatal thrombocytopenia and drug type is additive? | 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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.long_title = "Transient neonatal thrombocytopenia" AND prescriptions.drug_type = "ADDITIVE" |
The frequency 89.3 belongs to what class? | CREATE TABLE table_name_79 (class VARCHAR,frequency_mhz VARCHAR) | SELECT class FROM table_name_79 WHERE frequency_mhz = 89.3 |
Who was the visiting team when the home team was Seattle? | CREATE TABLE table_11518 ("Date" text,"Visitor" text,"Score" text,"Home" text,"Leading scorer" text,"Attendance" real,"Record" text) | SELECT "Visitor" FROM table_11518 WHERE "Home" = 'seattle' |
what is at 8:00 am when at 3:30 pm is general hospital? | CREATE TABLE table_12625 ("7:00 am" text,"7:30 am" text,"8:00 am" text,"9:00 am" text,"10:00 am" text,"11:00 am" text,"noon" text,"12:30 pm" text,"1:00 pm" text,"1:30 pm" text,"2:00 pm" text,"3:30 pm" text,"4:00 pm" text,"5:00 pm" text,"6:30 pm" text) | SELECT "8:00 am" FROM table_12625 WHERE "3:30 pm" = 'general hospital' |
What is the record when the time is 1:11? | CREATE TABLE table_12211 ("Res." text,"Record" text,"Opponent" text,"Method" text,"Event" text,"Round" real,"Time" text,"Location" text) | SELECT "Record" FROM table_12211 WHERE "Time" = '1:11' |
Name the total number 1980 mil for soviet union | CREATE TABLE table_24748 ("Country" text,"Area (000s)" text,"1950 (mil)" text,"1970 (mil)" text,"1980 (mil)" text,"1985 (mil)" text,"Annual Growth (1950\u20131985)" text,"Density (1980)" text) | SELECT COUNT("1980 (mil)") FROM table_24748 WHERE "Country" = 'Soviet Union' |
How many millions of US viewers were there for the episode 'No Safe Place'? | CREATE TABLE table_29488 ("No. in Series" real,"No. in Season" real,"Title" text,"Directed by" text,"Written by" text,"Original air date" text,"U.S. viewers (millions)" text) | SELECT "U.S. viewers (millions)" FROM table_29488 WHERE "Title" = 'No Safe Place' |
Which Nation has a Bronze smaller than 1, and a Total larger than 1, and a Silver of 1? | CREATE TABLE table_name_82 (nation VARCHAR,silver VARCHAR,bronze VARCHAR,total VARCHAR) | SELECT nation FROM table_name_82 WHERE bronze < 1 AND total > 1 AND silver = 1 |
How many skaters have a Rank in FS of 3, and a Rank in SP larger than 4? | CREATE TABLE table_51814 ("Final Rank" real,"Skater" text,"Rank in SP" real,"Rank in FS" real,"Total Score" text) | SELECT COUNT("Final Rank") FROM table_51814 WHERE "Rank in FS" = '3' AND "Rank in SP" > '4' |
What is the record in the 2 round fight that ended by submission (injury)? | CREATE TABLE table_name_70 (record VARCHAR,round VARCHAR,method VARCHAR) | SELECT record FROM table_name_70 WHERE round = "2" AND method = "submission (injury)" |
What is the hometown of the player which has a height of 6-0? | CREATE TABLE table_57884 ("Player" text,"Height" text,"School" text,"Hometown" text,"College" text) | SELECT "Hometown" FROM table_57884 WHERE "Height" = '6-0' |
what was patient 82132's first output time of the foley today? | CREATE TABLE d_icd_procedures (row_id number,icd9_code text,short_title text,long_title text)CREATE TABLE d_labitems (row_id number,itemid number,label text)CREATE TABLE microbiologyevents (row_id number,subject_id number,hadm_id number,charttime time,spec_type_desc text,org_name text)CREATE TABLE d_items (row_id numbe... | SELECT outputevents.charttime FROM outputevents WHERE outputevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 82132)) AND outputevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'fole... |
what is the seating capacity of the aircraft M80 | 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 airport_service (city_code varchar,airport_code varchar,miles_distant int,direction varchar,minutes_distant int)CREATE TABLE equipment_sequence (aircraft_cod... | SELECT DISTINCT aircraft_code FROM aircraft WHERE aircraft_code = 'M80' |
Name the outgoing manager for position in table being 11th | CREATE TABLE table_17039232_3 (outgoing_manager VARCHAR,position_in_table VARCHAR) | SELECT outgoing_manager FROM table_17039232_3 WHERE position_in_table = "11th" |
Name the total number of eu for quinn | CREATE TABLE table_2682 ("N" real,"P" text,"Name" text,"EU" text,"Country" text,"Age" real,"Type" text,"Moving from" text,"Transfer window" text,"Ends" real,"Transfer fee" text,"Source" text) | SELECT COUNT("EU") FROM table_2682 WHERE "Name" = 'Quinn' |
keyphrases used by dan klein in his emnlp papers | CREATE TABLE paperdataset (paperid int,datasetid int)CREATE TABLE journal (journalid int,journalname varchar)CREATE TABLE paper (paperid int,title varchar,venueid int,year int,numciting int,numcitedby int,journalid int)CREATE TABLE paperfield (fieldid int,paperid int)CREATE TABLE author (authorid int,authorname varchar... | SELECT DISTINCT paperkeyphrase.keyphraseid FROM author, paper, paperkeyphrase, venue, writes WHERE author.authorname = 'dan klein' AND paper.paperid = paperkeyphrase.paperid AND venue.venueid = paper.venueid AND venue.venuename = 'emnlp' AND writes.authorid = author.authorid AND writes.paperid = paper.paperid |
What is the course on 1 June? | CREATE TABLE table_70808 ("Date" text,"Course" text,"Distance" text,"Winner" text,"Race Leader" text) | SELECT "Course" FROM table_70808 WHERE "Date" = '1 june' |
Return a bar chart about the distribution of ACC_Regular_Season and ACC_Percent , order in asc by the ACC_Regular_Season. | 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 ACC_Regular_Season, ACC_Percent FROM basketball_match ORDER BY ACC_Regular_Season |
What was the score of the tie that had Tottenham Hotspur as the home team? | CREATE TABLE table_79562 ("Tie no" text,"Home team" text,"Score" text,"Away team" text,"Date" text) | SELECT "Score" FROM table_79562 WHERE "Home team" = 'tottenham hotspur' |
Which Draw has a Season of 2001 02, and Points larger than 47? | CREATE TABLE table_name_45 (draw INTEGER,season VARCHAR,points VARCHAR) | SELECT SUM(draw) FROM table_name_45 WHERE season = "2001–02" AND points > 47 |
there are in tobago species name helicops angulatus | CREATE TABLE table_1850282_5 (tobago VARCHAR,species VARCHAR) | SELECT tobago FROM table_1850282_5 WHERE species = "Helicops angulatus" |
Return a bar chart on what is the total revenue of each manufacturer? | 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 Name, SUM(Revenue) FROM Manufacturers GROUP BY Name |
What was the record at week 7 | CREATE TABLE table_11391448_2 (record VARCHAR,week VARCHAR) | SELECT record FROM table_11391448_2 WHERE week = 7 |
What happened in week 14 when week 11's result was Michigan (7-2)? | CREATE TABLE table_name_17 (week_14_dec_3 VARCHAR,week_11_nov_12 VARCHAR) | SELECT week_14_dec_3 FROM table_name_17 WHERE week_11_nov_12 = "michigan (7-2)" |
What is the model number for part numbers of cm80616003177acbx80616i5660? | CREATE TABLE table_25642 ("Model number" text,"sSpec number" text,"Frequency" text,"Turbo" text,"GPU frequency" text,"Cores" real,"L2 cache" text,"L3 cache" text,"I/O bus" text,"Mult." text,"Memory" text,"Voltage" text,"TDP" text,"Socket" text,"Release date" text,"Part number(s)" text,"Release price (USD)" text) | SELECT "Model number" FROM table_25642 WHERE "Part number(s)" = 'CM80616003177ACBX80616I5660' |
Name the macedonian for il/elle avait entendu | CREATE TABLE table_1841901_1 (macedonian VARCHAR,french VARCHAR) | SELECT macedonian FROM table_1841901_1 WHERE french = "il/elle avait entendu" |
What director ranked higher than 1 from Universal Studios and grossed $201,957,688? | CREATE TABLE table_44123 ("Rank" real,"Title" text,"Studio" text,"Director" text,"Gross" text) | SELECT "Director" FROM table_44123 WHERE "Rank" > '1' AND "Studio" = 'universal' AND "Gross" = '$201,957,688' |
What is the total number of draws when there is 1 Win, and less than 1728 against matches? | CREATE TABLE table_63494 ("Club" text,"Wins" real,"Losses" real,"Draws" real,"Against" real) | SELECT COUNT("Draws") FROM table_63494 WHERE "Wins" = '1' AND "Against" < '1728' |
How much does the champion get for stadthalle dinslaken, dinslaken? | CREATE TABLE table_22629 ("Year" real,"Champion (average in final)" text,"Legs" text,"Runner-up (average in final)" text,"Sponsor" text,"Prize Fund" text,"Champion" text,"Runner-up" text,"Venue" text) | SELECT "Champion" FROM table_22629 WHERE "Venue" = 'Stadthalle Dinslaken, Dinslaken' |
For all employees who have the letters D or S in their first name, show me about the distribution of job_id and the sum of salary , and group by attribute job_id in a bar chart, and order from low to high by the y axis please. | CREATE TABLE regions (REGION_ID decimal(5,0),REGION_NAME varchar(25))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_DATE date,END_DATE date,JOB_ID varchar(10),DEPARTMENT_ID decimal(4,0))CREATE TABLE jobs (JOB_ID var... | SELECT JOB_ID, SUM(SALARY) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' GROUP BY JOB_ID ORDER BY SUM(SALARY) |
For all employees who have the letters D or S in their first name, find job_id and the average of manager_id , and group by attribute job_id, and visualize them by a bar chart, could you order by the bar in desc please? | 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 employees (EMPLOYEE_ID decimal(6,0),FIRST_NAME varchar(20),LAST_NAME varchar(25),E... | SELECT JOB_ID, AVG(MANAGER_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' GROUP BY JOB_ID ORDER BY JOB_ID DESC |
What is the total number of Pl GP when the pick number is 199 and the Reg GP is bigger than 0? | CREATE TABLE table_78201 ("Rd #" real,"Pick #" real,"Player" text,"Team (League)" text,"Reg GP" real,"Pl GP" real) | SELECT SUM("Pl GP") FROM table_78201 WHERE "Pick #" = '199' AND "Reg GP" > '0' |
Which type entered service in 1976/1997 and is located in Brazil? | CREATE TABLE table_38842 ("Name" text,"Type" text,"Entered service" text,"Water depth" text,"Location" text) | SELECT "Type" FROM table_38842 WHERE "Location" = 'brazil' AND "Entered service" = '1976/1997' |
List venues of all matches in the order of their dates starting from the most recent one. | CREATE TABLE MATCH (venue VARCHAR,date VARCHAR) | SELECT venue FROM MATCH ORDER BY date DESC |
What is independence community college's newest campus? | CREATE TABLE table_name_37 (founded INTEGER,institution VARCHAR) | SELECT MIN(founded) FROM table_name_37 WHERE institution = "independence community college" |
what is the difference of silver medals between south africa and kenya ? | CREATE TABLE table_203_61 (id number,"rank" number,"nation" text,"gold" number,"silver" number,"bronze" number,"total" number) | SELECT (SELECT "silver" FROM table_203_61 WHERE "nation" = 'south africa') - (SELECT "silver" FROM table_203_61 WHERE "nation" = 'kenya') |
Show the number of projects. | CREATE TABLE documents (document_id number,document_type_code text,project_id number,document_date time,document_name text,document_description text,other_details text)CREATE TABLE ref_document_types (document_type_code text,document_type_name text,document_type_description text)CREATE TABLE projects (project_id number... | SELECT COUNT(*) FROM projects |
what are the three drugs most frequently prescribed within the same hospital visit to the patients aged 40s after they had been diagnosed with dysthymic disorder since 2101? | 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,charttime time)CREATE TABLE cost (row_id number,subject_id number,hadm_id number,event_type text,event_id number,chargetime time,cost number)CREATE TABLE ch... | SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime, admissions.hadm_id FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_... |
Which Year Start has a Number of 28? | CREATE TABLE table_name_41 (year_start INTEGER,number VARCHAR) | SELECT MAX(year_start) FROM table_name_41 WHERE number = 28 |
What is the Time/Retired for the car going 42 Laps? | CREATE TABLE table_name_2 (time_retired VARCHAR,laps VARCHAR) | SELECT time_retired FROM table_name_2 WHERE laps = 42 |
How many capacities are possible for the 1.6 Duratec model/engine? | CREATE TABLE table_17431 ("Model/Engine" text,"Capacity" text,"Cylinders/Valves" text,"Power/rpm" text,"Torque (Nm)/rpm" text) | SELECT COUNT("Capacity") FROM table_17431 WHERE "Model/Engine" = '1.6 Duratec' |
What was the score when the heat played at charlotte arena? | CREATE TABLE table_13762472_7 (score VARCHAR,location_attendance VARCHAR) | SELECT score FROM table_13762472_7 WHERE location_attendance = "Charlotte Arena" |
What is the GDP $IDB in Istanbul? | CREATE TABLE table_name_42 (gdp_in_$id_b VARCHAR,city VARCHAR) | SELECT gdp_in_$id_b FROM table_name_42 WHERE city = "istanbul" |
The driver in class A with 125 laps is in what position? | CREATE TABLE table_name_92 (position VARCHAR,class VARCHAR,laps VARCHAR) | SELECT position FROM table_name_92 WHERE class = "a" AND laps = 125 |
Who has a time of 3:50.90? | CREATE TABLE table_name_35 (name VARCHAR,time VARCHAR) | SELECT name FROM table_name_35 WHERE time = "3:50.90" |
last time, what drug was prescribed for patient 14054 during the previous month? | CREATE TABLE outputevents (row_id number,subject_id number,hadm_id number,icustay_id number,charttime time,itemid number,value 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 text,l... | SELECT prescriptions.drug FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 14054) AND DATETIME(prescriptions.startdate, 'start of month') = DATETIME(CURRENT_TIME(), 'start of month', '-1 month') ORDER BY prescriptions.startdate DESC LIMIT 1 |
What is the street address of Oliver Building? | CREATE TABLE table_51734 ("Name" text,"Street address" text,"Years as tallest" text,"Height ft / m" text,"Floors" text) | SELECT "Street address" FROM table_51734 WHERE "Name" = 'oliver building' |
give me the number of patients whose year of birth is less than 2110 and lab test name is bands? | CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid ... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dob_year < "2110" AND lab.label = "Bands" |
what is marital status and ethnicity of subject id 21796? | 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 demographic.marital_status, demographic.ethnicity FROM demographic WHERE demographic.subject_id = "21796" |
When will 411 be offered during the week ? | 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 course_offering.end_time, course_offering.friday, course_offering.monday, course_offering.saturday, course_offering.start_time, course_offering.sunday, course_offering.thursday, course_offering.tuesday, course_offering.wednesday FROM semester INNER JOIN course_offering ON semester.semester_id = course_o... |
how many patients underwent closed bronchial biopsy during the same hospital encounter after having received closed bronchial biopsy,? | CREATE TABLE d_labitems (row_id number,itemid number,label text)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 cost (row_id number,subject_id number,hadm_id number,event_type text,event_id number,c... | SELECT COUNT(DISTINCT t1.subject_id) 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 FROM d_icd_procedures WHERE d_icd_procedures.short_... |
tell me the number of married patients who have diagnoses icd9 code 25541. | 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.marital_status = "MARRIED" AND diagnoses.icd9_code = "25541" |
show me the flights from SAN DIEGO to NEWARK by way of HOUSTON | CREATE TABLE class_of_service (booking_class varchar,rank int,class_description text)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 flight_stop (flight_id int,stop_number int,stop_day... | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, airport_service AS AIRPORT_SERVICE_2, city AS CITY_0, city AS CITY_1, city AS CITY_2, flight, flight_stop WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'NEWARK' AND CITY_2.cit... |
What is the average upper index MJ/Nm 3 for the upper index Kcal/Nm 3 entry of 19,376? | CREATE TABLE table_name_70 (upper_index_mj__nm_3 INTEGER,upper_index_kcal__nm_3 VARCHAR) | SELECT AVG(upper_index_mj__nm_3) FROM table_name_70 WHERE upper_index_kcal__nm_3 = 19 OFFSET 376 |
how many parts where first released to the public in 2003 ? | CREATE TABLE table_203_679 (id number,"part" text,"number" text,"first public release date (first edition)" number,"latest public release date (edition)" number,"latest amendment" text,"title" text,"description" text) | SELECT COUNT("part") FROM table_203_679 WHERE "first public release date (first edition)" = 2003 |
what is the difference between weights on patient 006-141797 second measured on the last hospital visit compared to the value first measured on the last hospital visit? | CREATE TABLE lab (labid number,patientunitstayid number,labname text,labresult number,labresulttime time)CREATE TABLE treatment (treatmentid number,patientunitstayid number,treatmentname text,treatmenttime time)CREATE TABLE vitalperiodic (vitalperiodicid number,patientunitstayid number,temperature number,sao2 number,he... | SELECT (SELECT patient.admissionweight FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-141797' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospitaladmittime DESC LIMIT 1) AND NOT patient.admissionweight IS N... |
Which Nationality has a School/Club Team of louisiana state? | CREATE TABLE table_name_63 (nationality VARCHAR,school_club_team VARCHAR) | SELECT nationality FROM table_name_63 WHERE school_club_team = "louisiana state" |
How many instructors for every course in 2008? Show me a bar chart grouping by course title, and I want to rank by the y-axis in asc. | CREATE TABLE classroom (building varchar(15),room_number varchar(7),capacity numeric(4,0))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 course (course_id varchar(8),title varchar(50),dep... | SELECT title, COUNT(title) FROM course AS T1 JOIN teaches AS T2 ON T1.course_id = T2.course_id JOIN instructor AS T3 ON T2.ID = T3.ID WHERE year = 2008 GROUP BY title ORDER BY COUNT(title) |
What is the average Assists, when Club is Iserlohn Roosters,when Points is 71, and when Goals is greater than 44? | CREATE TABLE table_name_18 (assists INTEGER,goals VARCHAR,club VARCHAR,points VARCHAR) | SELECT AVG(assists) FROM table_name_18 WHERE club = "iserlohn roosters" AND points = 71 AND goals > 44 |
count the number of patients who were given a lithium test until 2104. | 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 COUNT(DISTINCT patient.uniquepid) FROM patient WHERE patient.patientunitstayid IN (SELECT lab.patientunitstayid FROM lab WHERE lab.labname = 'lithium' AND STRFTIME('%y', lab.labresulttime) <= '2104') |
show me the cheapest one way flights from DALLAS to SAN FRANCISCO leaving DALLAS after 1600 | 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 food_service (meal_code text,meal_number int,compartment text,meal_description varchar)CREATE TABLE code_description (code varchar,descr... | 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, fare, flight, flight_fare WHERE ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN FRANCISCO' AND flight.departure_time > 1600 AND flight.to_airport... |
Who was the runnerup when the margin of victory was 1 stroke on jan 30, 2000? | CREATE TABLE table_39481 ("Date" text,"Tournament" text,"Winning score" text,"Margin of victory" text,"Runner(s)-up" text) | SELECT "Runner(s)-up" FROM table_39481 WHERE "Margin of victory" = '1 stroke' AND "Date" = 'jan 30, 2000' |
What is the size of the crowd for the home team of Footscray? | CREATE TABLE table_name_28 (crowd VARCHAR,home_team VARCHAR) | SELECT crowd FROM table_name_28 WHERE home_team = "footscray" |
what is the number of patients whose ethnicity is black/cape verdean and primary disease is sternal wound infection? | CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital_status text,age text,dob text,gender text,language text,religion text,admission_type text,days_stay text,insurance text,ethnicity text,expire_fla... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "BLACK/CAPE VERDEAN" AND demographic.diagnosis = "STERNAL WOUND INFECTION" |
For those employees who do not work in departments with managers that have ids between 100 and 200, show me about the distribution of hire_date and the sum of department_id bin hire_date by weekday in a bar chart. | 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 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 (D... | SELECT HIRE_DATE, SUM(DEPARTMENT_ID) FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) |
Search for potential Link-Only answers. | CREATE TABLE ReviewTasks (Id number,ReviewTaskTypeId number,CreationDate time,DeletionDate time,ReviewTaskStateId number,PostId number,SuggestedEditId number,CompletedByReviewTaskId number)CREATE TABLE Posts (Id number,PostTypeId number,AcceptedAnswerId number,ParentId number,CreationDate time,DeletionDate time,Score n... | SELECT Id FROM Posts WHERE (Body LIKE '%http://%' OR Body LIKE 'http://%' OR Body LIKE 'https://%' OR Body LIKE '%https://%') AND PostTypeId = 2 ORDER BY LENGTH(Body) |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.