instruction stringlengths 0 1.06k | input stringlengths 11 5.3k | response stringlengths 2 4.44k |
|---|---|---|
How many countries have content of arte? | CREATE TABLE table_15887683_16 (country VARCHAR,content VARCHAR) | SELECT COUNT(country) FROM table_15887683_16 WHERE content = "arte" |
Name the lowest Market Value (billion $) which has Assets (billion $) larger than 276.81, and a Company of toyota, and Profits (billion $) larger than 17.21? | CREATE TABLE table_name_44 (market_value__billion_ INTEGER,profits__billion_$_ VARCHAR,assets__billion_$_ VARCHAR,company VARCHAR) | SELECT MIN(market_value__billion_) AS $_ FROM table_name_44 WHERE assets__billion_$_ > 276.81 AND company = "toyota" AND profits__billion_$_ > 17.21 |
Name the discipline for 1561 fis points | CREATE TABLE table_30073089_2 (discipline VARCHAR,fis_points VARCHAR) | SELECT discipline FROM table_30073089_2 WHERE fis_points = 1561 |
On the SOC 400 -level , which ones offer 13 -credit courses ? | CREATE TABLE comment_instructor (instructor_id int,student_id int,score int,comment_text varchar)CREATE TABLE course_prerequisite (pre_course_id int,course_id int)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,wedn... | SELECT DISTINCT department, name, number FROM course WHERE credits = 13 AND department = 'SOC' AND number < 400 + 100 AND number >= 400 |
Which Points has a Team of s o paulo athletic, and a Position larger than 5? | CREATE TABLE table_name_15 (points INTEGER,team VARCHAR,position VARCHAR) | SELECT SUM(points) FROM table_name_15 WHERE team = "são paulo athletic" AND position > 5 |
provide the number of patients whose admission year is less than 2144 and lab test name is heparin, lmw? | CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital_status text,age text,dob text,gender text,la... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admityear < "2144" AND lab.label = "Heparin, LMW" |
What was the score when the opponent was Detroit Pistons? | CREATE TABLE table_name_46 (score VARCHAR,opponent VARCHAR) | SELECT score FROM table_name_46 WHERE opponent = "detroit pistons" |
For those records from the products and each product's manufacturer, show me about the distribution of founder and the average of revenue , and group by attribute founder in a bar chart, list in descending by the Founder please. | 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 Founder, AVG(Revenue) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder ORDER BY Founder DESC |
Tell me the opponent of week 14 | CREATE TABLE table_name_59 (opponent VARCHAR,week VARCHAR) | SELECT opponent FROM table_name_59 WHERE week = 14 |
Find the minimum salary for the departments whose average salary is above the average payment of all instructors. | CREATE TABLE instructor (dept_name VARCHAR,salary INTEGER) | SELECT MIN(salary), dept_name FROM instructor GROUP BY dept_name HAVING AVG(salary) > (SELECT AVG(salary) FROM instructor) |
What are the correlation between the height and prominence of mountains which do not belong to the range 'Aberdare Range'? Plot the result by a scatter chart. | CREATE TABLE camera_lens (id int,brand text,name text,focal_length_mm real,max_aperture real)CREATE TABLE photos (id int,camera_lens_id int,mountain_id int,color text,name text)CREATE TABLE mountain (id int,name text,Height real,Prominence real,Range text,Country text) | SELECT Height, Prominence FROM mountain WHERE Range <> 'Aberdare Range' |
What was the place and date that the Apartments area was damaged? | CREATE TABLE table_25637 ("No." real,"Place & date" text,"Target" text,"Area damaged" text,"Cause of damage" text,"Intercepted by Patriot" text) | SELECT "Place & date" FROM table_25637 WHERE "Area damaged" = 'Apartments area' |
Which player had 9 blocks? | CREATE TABLE table_27572 ("Player" text,"Games Played" real,"Rebounds" real,"Assists" real,"Steals" real,"Blocks" real,"Points" real) | SELECT "Player" FROM table_27572 WHERE "Blocks" = '9' |
What is Time, when Meet is 'Duel in the Pool', and when Date is '19 December 2009'? | CREATE TABLE table_name_62 (time VARCHAR,meet VARCHAR,date VARCHAR) | SELECT time FROM table_name_62 WHERE meet = "duel in the pool" AND date = "19 december 2009" |
what is the to par when the place is 8? | CREATE TABLE table_name_82 (to_par VARCHAR,place VARCHAR) | SELECT to_par FROM table_name_82 WHERE place = "8" |
In the 2008/2009 season one team had a season total points of 31, for that team how many total points were scored against them? | CREATE TABLE table_18092 ("Club" text,"Played" text,"Won" text,"Drawn" text,"Lost" text,"Points for" text,"Points against" text,"Tries for" text,"Tries against" text,"Try bonus" text,"Losing bonus" text,"Points" text) | SELECT "Points against" FROM table_18092 WHERE "Points" = '31' |
Which player plays for Illinois? | CREATE TABLE table_10260 ("Player" text,"No.(s)" text,"Height in Ft." text,"Position" text,"Years for Rockets" text,"School/Club Team/Country" text) | SELECT "Player" FROM table_10260 WHERE "School/Club Team/Country" = 'illinois' |
Which Home Captain has Venue of Bourda? | CREATE TABLE table_name_42 (home_captain VARCHAR,venue VARCHAR) | SELECT home_captain FROM table_name_42 WHERE venue = "bourda" |
What was the score when the away team was brighton & hove albion? | CREATE TABLE table_name_21 (score VARCHAR,away_team VARCHAR) | SELECT score FROM table_name_21 WHERE away_team = "brighton & hove albion" |
What are incumbent William Vandever's results? | CREATE TABLE table_37699 ("District" text,"Incumbent" text,"Party" text,"First elected" text,"Result" text) | SELECT "Result" FROM table_37699 WHERE "Incumbent" = 'william vandever' |
What time in office does the U.S. Navy have? | CREATE TABLE table_50090 ("Name" text,"Branch" text,"Term began" text,"Term ended" text,"Time in office" text) | SELECT "Time in office" FROM table_50090 WHERE "Branch" = 'u.s. navy' |
What is the average Bronze when silver is more than 2, and rank is 2, and gold more than 2 | CREATE TABLE table_name_62 (bronze INTEGER,gold VARCHAR,silver VARCHAR,rank VARCHAR) | SELECT AVG(bronze) FROM table_name_62 WHERE silver > "2" AND rank = "2" AND gold > 2 |
With a time of 53.33, who ranked the highest? | CREATE TABLE table_name_89 (rank INTEGER,time VARCHAR) | SELECT MAX(rank) FROM table_name_89 WHERE time = 53.33 |
Who was the opponent that led to a record of 23-5? | CREATE TABLE table_5882 ("Res." text,"Record" text,"Opponent" text,"Method" text,"Event" text,"Location" text) | SELECT "Opponent" FROM table_5882 WHERE "Record" = '23-5' |
Who wrote the episodes watched by 1.575 million people in Canada? | CREATE TABLE table_18424435_3 (written_by VARCHAR,canadian_viewers__million_ VARCHAR) | SELECT written_by FROM table_18424435_3 WHERE canadian_viewers__million_ = "1.575" |
what airlines flies out of ATLANTA | CREATE TABLE ground_service (city_code text,airport_code text,transport_type text,ground_fare int)CREATE TABLE time_interval (period text,begin_time int,end_time int)CREATE TABLE flight_fare (flight_id int,fare_id int)CREATE TABLE flight (aircraft_code_sequence text,airline_code varchar,airline_flight text,arrival_time... | SELECT DISTINCT airline.airline_code FROM airline, airport_service, city, flight WHERE city.city_code = airport_service.city_code AND city.city_name = 'ATLANTA' AND flight.airline_code = airline.airline_code AND flight.from_airport = airport_service.airport_code |
How many storms occured in each region? | CREATE TABLE storm (storm_id number,name text,dates_active text,max_speed number,damage_millions_usd number,number_deaths number)CREATE TABLE region (region_id number,region_code text,region_name text)CREATE TABLE affected_region (region_id number,storm_id number,number_city_affected number) | SELECT T1.region_name, COUNT(*) FROM region AS T1 JOIN affected_region AS T2 ON T1.region_id = T2.region_id GROUP BY T1.region_id |
When did they play against West Virginia? | CREATE TABLE table_23957 ("Game" real,"Date" text,"Opponent" text,"Result" text,"Orangemen points" real,"Opponents" real,"Record" text) | SELECT "Date" FROM table_23957 WHERE "Opponent" = 'West Virginia' |
Which team names have 44.5 for tumbling? | CREATE TABLE table_24713 ("Rank" real,"Team Name" text,"Basic Elements" text,"Tumbling" text,"Stunts" text,"Tosses/Pyramids" text,"Deductions" text,"Total" text) | SELECT "Team Name" FROM table_24713 WHERE "Tumbling" = '44.5' |
What was the original nonequity tour when the original broadway was Kevin Chamberlin? | CREATE TABLE table_name_49 (original_nonequity_tour_cast VARCHAR,original_broadway_cast VARCHAR) | SELECT original_nonequity_tour_cast FROM table_name_49 WHERE original_broadway_cast = "kevin chamberlin" |
who is the constructor when the free practice driver(s) is n/a, the chassis is 005 and the driver is takuma sato? | CREATE TABLE table_name_42 (constructor VARCHAR,driver VARCHAR,free_practice_driver_s_ VARCHAR,chassis VARCHAR) | SELECT constructor FROM table_name_42 WHERE free_practice_driver_s_ = "n/a" AND chassis = "005" AND driver = "takuma sato" |
how many patients with polycythemia were treated with main drug? | CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital_status text,age text,dob text,gender text,la... | SELECT 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.short_title = "Polycythemia vera" AND prescriptions.drug_type = "MAIN" |
is the level of arterial bp [diastolic] in patient 28443 last measured on the current intensive care unit visit greater than the value second to last measured on the current intensive care unit visit? | CREATE TABLE diagnoses_icd (row_id number,subject_id number,hadm_id number,icd9_code text,charttime time)CREATE TABLE patients (row_id number,subject_id number,gender text,dob time,dod time)CREATE TABLE outputevents (row_id number,subject_id number,hadm_id number,icustay_id number,charttime time,itemid number,value num... | 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 = 28443) AND icustays.outtime IS NULL) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_i... |
For those ships that do not have a captain, tell me the total number of their classes using a pie chart. | CREATE TABLE captain (Captain_ID int,Name text,Ship_ID int,age text,Class text,Rank text)CREATE TABLE Ship (Ship_ID int,Name text,Type text,Built_Year real,Class text,Flag text) | SELECT Class, COUNT(Class) FROM Ship WHERE NOT Ship_ID IN (SELECT Ship_ID FROM captain) GROUP BY Class |
What college has the Chicago stags and position is G? | CREATE TABLE table_11643 ("Round" text,"Player" text,"Position" text,"Team" text,"College" text) | SELECT "College" FROM table_11643 WHERE "Team" = 'chicago stags' AND "Position" = 'g' |
What is the lowest number of three pointers in games where the number of rebounds was 178? | CREATE TABLE table_25397 ("Player" text,"Games Played" real,"Field Goals" real,"Three Pointers" real,"Free Throws" real,"Rebounds" real,"Assists" real,"Blocks" real,"Steals" real,"Points" real) | SELECT MIN("Three Pointers") FROM table_25397 WHERE "Rebounds" = '178' |
Marcell Jansen of the nation GER has what for the type? | CREATE TABLE table_name_2 (type VARCHAR,nat VARCHAR,name VARCHAR) | SELECT type FROM table_name_2 WHERE nat = "ger" AND name = "marcell jansen" |
How many Grid has a Rider of ryuichi kiyonari? | CREATE TABLE table_name_91 (grid INTEGER,rider VARCHAR) | SELECT SUM(grid) FROM table_name_91 WHERE rider = "ryuichi kiyonari" |
What Tournament has an Outcome of runner-up, and a Score of 4 6, 3 6? | CREATE TABLE table_name_41 (tournament VARCHAR,outcome VARCHAR,score VARCHAR) | SELECT tournament FROM table_name_41 WHERE outcome = "runner-up" AND score = "4–6, 3–6" |
when did patient 006-99708 first receive a lab test in 02/this year? | CREATE TABLE medication (medicationid number,patientunitstayid number,drugname text,dosage text,routeadmin text,drugstarttime time,drugstoptime time)CREATE TABLE cost (costid number,uniquepid text,patienthealthsystemstayid number,eventtype text,eventid number,chargetime time,cost number)CREATE TABLE intakeoutput (intak... | SELECT lab.labresulttime FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-99708')) AND DATETIME(lab.labresulttime, 'start of year') = DATETIME(CURRENT_TI... |
what was patient 3663's monthly average value of body weight since 5 years ago? | CREATE TABLE d_icd_procedures (row_id number,icd9_code text,short_title text,long_title text)CREATE TABLE procedures_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... | SELECT AVG(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 = 3663)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'admit... |
For those employees who did not have any job in the past, give me the comparison about the average of department_id over the job_id , and group by attribute job_id by a bar chart. | CREATE TABLE departments (DEPARTMENT_ID decimal(4,0),DEPARTMENT_NAME varchar(30),MANAGER_ID decimal(6,0),LOCATION_ID decimal(4,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 varchar(10),JOB_TITLE varchar(35),MIN... | SELECT JOB_ID, AVG(DEPARTMENT_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) GROUP BY JOB_ID |
Name the least established | CREATE TABLE table_1450 ("University" text,"Location" text,"Established" real,"Endowment as of 2008" text,"Campus Area (acres)" real,"Kiplingers Top 100 Values" text,"Enrollment as of 2008" real) | SELECT MIN("Established") FROM table_1450 |
What day did they play the bolton wanderers with a result F A of 1 2? | CREATE TABLE table_10762 ("Game" real,"Date" text,"Venue" text,"Opponent" text,"Result F\u2013A" text,"Attendance" real) | SELECT "Date" FROM table_10762 WHERE "Result F\u2013A" = '1–2' AND "Opponent" = 'bolton wanderers' |
How many tag badges have been awarded?. | CREATE TABLE PendingFlags (Id number,FlagTypeId number,PostId number,CreationDate time,CloseReasonTypeId number,CloseAsOffTopicReasonTypeId number,DuplicateOfQuestionId number,BelongsOnBaseHostAddress text)CREATE TABLE PostsWithDeleted (Id number,PostTypeId number,AcceptedAnswerId number,ParentId number,CreationDate ti... | SELECT COUNT(1) FROM Badges AS b |
How many events have each participants attended? Show their average number by each participant type code using a bar chart, sort from low to high by the names. | CREATE TABLE Services (Service_ID INTEGER,Service_Type_Code CHAR(15))CREATE TABLE Events (Event_ID INTEGER,Service_ID INTEGER,Event_Details VARCHAR(255))CREATE TABLE Participants_in_Events (Event_ID INTEGER,Participant_ID INTEGER)CREATE TABLE Participants (Participant_ID INTEGER,Participant_Type_Code CHAR(15),Participa... | SELECT T1.Participant_Type_Code, AVG(COUNT(*)) FROM Participants AS T1 JOIN Participants_in_Events AS T2 ON T1.Participant_ID = T2.Participant_ID GROUP BY T1.Participant_Type_Code ORDER BY T1.Participant_Type_Code |
i would like a flight from DENVER to PITTSBURGH | CREATE TABLE flight (aircraft_code_sequence text,airline_code varchar,airline_flight text,arrival_time int,connections int,departure_time int,dual_carrier text,flight_days text,flight_id int,flight_number int,from_airport varchar,meal_code text,stops int,time_elapsed int,to_airport varchar)CREATE TABLE restriction (res... | 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 = 'DENVER' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'PITTSBU... |
how many patients in this year were prescribed with methylprednisolone sodium succ in the same month after the cont inv mec ven 96+ hrs procedure? | CREATE TABLE prescriptions (row_id number,subject_id number,hadm_id number,startdate time,enddate time,drug text,dose_val_rx text,dose_unit_rx text,route text)CREATE TABLE icustays (row_id number,subject_id number,hadm_id number,icustay_id number,first_careunit text,last_careunit text,first_wardid number,last_wardid nu... | SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, procedures_icd.charttime 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_title = 'cont inv me... |
Average Number of Tags per Post. | 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 PostsWithDeleted (Id number,PostTypeId number,AcceptedAnswerId number,ParentId number,CreationDate... | SELECT MIN(Posts.Tags) AS "minimum_#_of_answers", AVG(CAST(Posts.AnswerCount AS FLOAT)) AS "average_#_of_answers", MAX(Posts.AnswerCount) AS "maximum_#_of_answers" FROM Posts WHERE Posts.PostTypeId = 1 |
What is the production code for the episode directed by Sam weisman? | CREATE TABLE table_27832 ("No. in series" real,"No. in season" real,"Title" text,"Directed by" text,"Written by" text,"Original air date" text,"Production code" text) | SELECT "Production code" FROM table_27832 WHERE "Directed by" = 'Sam Weisman' |
Name the loss on may 22 | CREATE TABLE table_80175 ("Date" text,"Opponent" text,"Score" text,"Loss" text,"Record" text) | SELECT "Loss" FROM table_80175 WHERE "Date" = 'may 22' |
What is the 2nd verb for chena? | CREATE TABLE table_name_7 (verb VARCHAR) | SELECT 2 AS __f_ FROM table_name_7 WHERE verb = "chena" |
What is the average when the highest score is 151? | CREATE TABLE table_28846752_4 (average VARCHAR,highest_score VARCHAR) | SELECT average FROM table_28846752_4 WHERE highest_score = "151" |
What season did Stoke City win? | CREATE TABLE table_name_13 (season VARCHAR,winner VARCHAR) | SELECT season FROM table_name_13 WHERE winner = "stoke city" |
What number from the total number of episodes is the episode written by Julian Unthank? | CREATE TABLE table_1000 ("Total#" real,"Series#" real,"Title" text,"Writer" text,"Director" text,"Original air date" text) | SELECT "Series#" FROM table_1000 WHERE "Writer" = 'Julian Unthank' |
what is the total number of singles w l where doubles w l is 11 14 | CREATE TABLE table_10294071_1 (singles_w_l VARCHAR,doubles_w_l VARCHAR) | SELECT COUNT(singles_w_l) FROM table_10294071_1 WHERE doubles_w_l = "11–14" |
What was the Attendance on November 29, 1953? | CREATE TABLE table_35920 ("Week" real,"Date" text,"Opponent" text,"Result" text,"Attendance" real) | SELECT SUM("Attendance") FROM table_35920 WHERE "Date" = 'november 29, 1953' |
What Pitch is located at Isle of Man? | CREATE TABLE table_78004 ("Name (Irish)" text,"Name (English)" text,"Sport" text,"Teams" text,"Location" text,"Pitch" text) | SELECT "Pitch" FROM table_78004 WHERE "Location" = 'isle of man' |
how many ghostbusters games were released in 1990 ? | CREATE TABLE table_203_489 (id number,"year" number,"title" text,"system" text,"developer" text,"publisher" text) | SELECT COUNT("title") FROM table_203_489 WHERE "year" = 1990 |
What was Olga Govortsova's outcome when she played on a grass surface? | CREATE TABLE table_name_59 (outcome VARCHAR,surface VARCHAR) | SELECT outcome FROM table_name_59 WHERE surface = "grass" |
What was the altitude of the yield of 1.4 megatons? | CREATE TABLE table_148578_1 (altitude__km_ VARCHAR,yield__approximate_ VARCHAR) | SELECT altitude__km_ FROM table_148578_1 WHERE yield__approximate_ = "1.4 megatons" |
Name the mascot for shelbyville | CREATE TABLE table_35550 ("School" text,"Location" text,"Mascot" text,"Enrollment" real,"IHSAA Class" text,"IHSAA Football Class" text,"# / County" text) | SELECT "Mascot" FROM table_35550 WHERE "School" = 'shelbyville' |
School_ID across team name in a pie chart. | CREATE TABLE basketball_match (Team_ID int,School_ID int,Team_Name text,ACC_Regular_Season text,ACC_Percent text,ACC_Home text,ACC_Road text,All_Games text,All_Games_Percent int,All_Home text,All_Road text,All_Neutral text)CREATE TABLE university (School_ID int,School text,Location text,Founded real,Affiliation text,En... | SELECT Team_Name, School_ID FROM basketball_match |
Tell me the time/retired for Laps of 42 and Grids of 4 | CREATE TABLE table_name_74 (time_retired VARCHAR,laps VARCHAR,grid VARCHAR) | SELECT time_retired FROM table_name_74 WHERE laps = 42 AND grid = 4 |
how many patients had been prescribed vancomycin desensitization? | CREATE TABLE labevents (row_id number,subject_id number,hadm_id number,itemid number,charttime time,valuenum number,valueuom 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 d_icd_procedures (row_id number,icd9_cod... | SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT prescriptions.hadm_id FROM prescriptions WHERE prescriptions.drug = 'vancomycin desensitization') |
How many songs have a shared vocal? | CREATE TABLE instruments (songid number,bandmateid number,instrument text)CREATE TABLE band (id number,firstname text,lastname text)CREATE TABLE vocals (songid number,bandmate number,type text)CREATE TABLE songs (songid number,title text)CREATE TABLE tracklists (albumid number,position number,songid number)CREATE TABLE... | SELECT COUNT(DISTINCT title) FROM vocals AS T1 JOIN songs AS T2 ON T1.songid = T2.songid WHERE type = "shared" |
R, Python and C++ Trends (# Questions per Tag per Month). | CREATE TABLE ReviewRejectionReasons (Id number,Name text,Description text,PostTypeId number)CREATE TABLE Badges (Id number,UserId number,Name text,Date time,Class number,TagBased boolean)CREATE TABLE CloseReasonTypes (Id number,Name text,Description text)CREATE TABLE Votes (Id number,PostId number,VoteTypeId number,Use... | SELECT DATEADD(mm, (YEAR(Posts.CreationDate) - 1900) * 12 + MONTH(Posts.CreationDate) - 1, 0) AS Month, Tags.TagName, COUNT(*) AS Questions FROM Tags LEFT JOIN PostTags ON PostTags.TagId = Tags.Id LEFT JOIN Posts ON Posts.Id = PostTags.PostId LEFT JOIN PostTypes ON PostTypes.Id = Posts.PostTypeId WHERE Tags.TagName IN ... |
Find the names of rooms that have been reserved for more than 60 times. | CREATE TABLE rooms (roomid text,roomname text,beds number,bedtype text,maxoccupancy number,baseprice number,decor text)CREATE TABLE reservations (code number,room text,checkin text,checkout text,rate number,lastname text,firstname text,adults number,kids number) | SELECT T2.roomname FROM reservations AS T1 JOIN rooms AS T2 ON T1.room = T2.roomid GROUP BY T1.room HAVING COUNT(*) > 60 |
Which week's game had an attendance of 90,138? | CREATE TABLE table_14551 ("Week" real,"Date" text,"Opponent" text,"Result" text,"Game site" text,"NFL Recap" text,"Record" text,"Attendance" text) | SELECT "Week" FROM table_14551 WHERE "Attendance" = '90,138' |
How many Operating Expenditures have Receipts of 44,259,386? | CREATE TABLE table_54364 ("Candidate" text,"Contributions" real,"Loans Received" real,"All Receipts" real,"Operating Expenditures" real,"All Disbursements" real) | SELECT COUNT("Operating Expenditures") FROM table_54364 WHERE "All Receipts" = '44,259,386' |
Give me a bar chart for how many name of each name, could you show x-axis from low to high order please? | CREATE TABLE train (Train_ID int,Train_Num text,Name text,From text,Arrival text,Railway_ID int)CREATE TABLE manager (Manager_ID int,Name text,Country text,Working_year_starts text,Age int,Level int)CREATE TABLE railway_manage (Railway_ID int,Manager_ID int,From_Year text)CREATE TABLE railway (Railway_ID int,Railway te... | SELECT Name, COUNT(Name) FROM train GROUP BY Name ORDER BY Name |
yes i would like to find what flights are available from ATLANTA to BOSTON on the morning of 7 7 | CREATE TABLE city (city_code varchar,city_name varchar,state_code varchar,country_name varchar,time_zone_code varchar)CREATE TABLE date_day (month_number int,day_number int,year int,day_name varchar)CREATE TABLE restriction (restriction_code text,advance_purchase int,stopovers text,saturday_stay_required text,minimum_s... | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE (((flight.departure_time BETWEEN 0 AND 1200) AND date_day.day_number = 7 AND date_day.month_number = 7 AND date_day.year = 1991 AND days.day_name... |
when the first time patient 94293 was prescribed a medication in 01/2104 via the ivpca route? | CREATE TABLE procedures_icd (row_id number,subject_id number,hadm_id number,icd9_code text,charttime time)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_i... | SELECT prescriptions.startdate FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 94293) AND prescriptions.route = 'ivpca' AND STRFTIME('%y-%m', prescriptions.startdate) = '2104-01' ORDER BY prescriptions.startdate LIMIT 1 |
What are the countries that contain 3 or more cities? | CREATE TABLE staff (staff_id number,first_name text,last_name text,address_id number,picture others,email text,store_id number,active boolean,username text,password text,last_update time)CREATE TABLE actor (actor_id number,first_name text,last_name text,last_update time)CREATE TABLE film_actor (actor_id number,film_id ... | SELECT T2.country FROM city AS T1 JOIN country AS T2 ON T1.country_id = T2.country_id GROUP BY T2.country_id HAVING COUNT(*) >= 3 |
How many million U.S. viewers saw 'Fake Me Home Tonight'? | CREATE TABLE table_74354 ("No." real,"Title" text,"Directed by" text,"Written by" text,"Original air date" text,"Production code" text,"U.S. viewers (million)" text) | SELECT "U.S. viewers (million)" FROM table_74354 WHERE "Title" = 'Fake Me Home Tonight' |
Find the state, account type, and credit score of the customer whose number of loan is 0. | CREATE TABLE bank (branch_id number,bname text,no_of_customers number,city text,state text)CREATE TABLE customer (cust_id text,cust_name text,acc_type text,acc_bal number,no_of_loans number,credit_score number,branch_id number,state text)CREATE TABLE loan (loan_id text,loan_type text,cust_id text,branch_id text,amount ... | SELECT state, acc_type, credit_score FROM customer WHERE no_of_loans = 0 |
What is the Revenues during Tenure 1854-1855? | CREATE TABLE table_name_43 (revenues VARCHAR,tenure VARCHAR) | SELECT revenues FROM table_name_43 WHERE tenure = "1854-1855" |
Which Poles has a Wins larger than 0, and a Podiums smaller than 17? | CREATE TABLE table_name_94 (poles VARCHAR,fastest_laps VARCHAR,wins VARCHAR,podiums VARCHAR) | SELECT poles FROM table_name_94 WHERE wins > 0 AND podiums < 17 AND fastest_laps = 0 |
Who was the opponent when the fight had a time of 2:01? | CREATE TABLE table_name_71 (opponent VARCHAR,time VARCHAR) | SELECT opponent FROM table_name_71 WHERE time = "2:01" |
show DL flights from JFK to MIAMI | CREATE TABLE restriction (restriction_code text,advance_purchase int,stopovers text,saturday_stay_required text,minimum_stay int,maximum_stay int,application text,no_discounts text)CREATE TABLE flight_stop (flight_id int,stop_number int,stop_days text,stop_airport text,arrival_time int,arrival_airline text,arrival_flig... | SELECT DISTINCT flight.flight_id FROM airport, airport_service, city, flight WHERE (airport.airport_code = 'JFK' AND city.city_code = airport_service.city_code AND city.city_name = 'MIAMI' AND flight.from_airport = airport.airport_code AND flight.to_airport = airport_service.airport_code) AND flight.airline_code = 'DL' |
Show the number of assets and group by asset make in a bar chart, and could you display in ascending by the X-axis? | CREATE TABLE Engineer_Skills (engineer_id INTEGER,skill_id INTEGER)CREATE TABLE Engineer_Visits (engineer_visit_id INTEGER,contact_staff_id INTEGER,engineer_id INTEGER,fault_log_entry_id INTEGER,fault_status VARCHAR(10),visit_start_datetime DATETIME,visit_end_datetime DATETIME,other_visit_details VARCHAR(255))CREATE TA... | SELECT asset_make, COUNT(asset_make) FROM Assets GROUP BY asset_make ORDER BY asset_make |
What was the time of the bout that ended in a TKO (strikes)? | CREATE TABLE table_42554 ("Res." text,"Record" text,"Opponent" text,"Method" text,"Event" text,"Round" real,"Time" text,"Location" text) | SELECT "Time" FROM table_42554 WHERE "Method" = 'tko (strikes)' |
How man players checked out at 84? | CREATE TABLE table_24549777_1 (player VARCHAR,high_checkout VARCHAR) | SELECT COUNT(player) FROM table_24549777_1 WHERE high_checkout = 84 |
What year was the team Club of atl tico de san juan fc who plays at hiram bithorn stadium founded. | CREATE TABLE table_48357 ("Club" text,"Home city" text,"Stadium" text,"Founded" real,"Seasons in PRSL" text) | SELECT SUM("Founded") FROM table_48357 WHERE "Stadium" = 'hiram bithorn stadium' AND "Club" = 'atlético de san juan fc' |
What was the record when they played in the Miami Arena, before game 24? | CREATE TABLE table_47342 ("Game" real,"Date" text,"Opponent" text,"Score" text,"Location" text,"Record" text) | SELECT "Record" FROM table_47342 WHERE "Game" < '24' AND "Location" = 'miami arena' |
What is the total in the case where theere are 6 lecturers and fewer than 48 professors? | CREATE TABLE table_name_96 (total INTEGER,lecturers VARCHAR,professors VARCHAR) | SELECT AVG(total) FROM table_name_96 WHERE lecturers = 6 AND professors < 48 |
since 2100, what are the three most frequently prescribed drugs to female patients aged 30s within the same hospital visit after they have been diagnosed with atrial fibrillation? | CREATE TABLE d_icd_diagnoses (row_id number,icd9_code text,short_title text,long_title text)CREATE TABLE d_items (row_id number,itemid number,label text,linksto text)CREATE TABLE procedures_icd (row_id number,subject_id number,hadm_id number,icd9_code text,charttime time)CREATE TABLE d_icd_procedures (row_id number,icd... | 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_... |
Top SO Users from KZ. | CREATE TABLE Users (Id number,Reputation number,CreationDate time,DisplayName text,LastAccessDate time,WebsiteUrl text,Location text,AboutMe text,Views number,UpVotes number,DownVotes number,ProfileImageUrl text,EmailHash text,AccountId number)CREATE TABLE Comments (Id number,PostId number,Score number,Text text,Creati... | SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation FROM Users WHERE LOWER(Location) LIKE '%kazakhstan%' OR UPPER(Location) LIKE '%KZ' ORDER BY Reputation DESC |
when was the first time during their first hospital encounter that patient 027-25994 had a surgical drains - jackson-pratt procedure? | CREATE TABLE allergy (allergyid number,patientunitstayid number,drugname text,allergyname text,allergytime time)CREATE TABLE lab (labid number,patientunitstayid number,labname text,labresult number,labresulttime time)CREATE TABLE treatment (treatmentid number,patientunitstayid number,treatmentname text,treatmenttime ti... | SELECT treatment.treatmenttime FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '027-25994' AND NOT patient.hospitaldischargetime IS NULL ORDER BY... |
What was the population of the area that was formerly under the authority of the Audenshaw Urban District? | CREATE TABLE table_name_65 (population VARCHAR,former_local_authority VARCHAR) | SELECT population FROM table_name_65 WHERE former_local_authority = "audenshaw urban district" |
when was the first time that patient 65401 has the minimum chloride in 10/this year? | CREATE TABLE d_icd_procedures (row_id number,icd9_code text,short_title text,long_title text)CREATE TABLE procedures_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... | SELECT labevents.charttime FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 65401) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'chloride') AND DATETIME(labevents.charttime, 'start of year') = DATETIME(CURREN... |
For those employees whose salary is in the range of 8000 and 12000 and commission is not null or department number does not equal to 40, return a scatter chart about the correlation between employee_id and commission_pct . | CREATE TABLE jobs (JOB_ID varchar(10),JOB_TITLE varchar(35),MIN_SALARY decimal(6,0),MAX_SALARY decimal(6,0))CREATE TABLE regions (REGION_ID decimal(5,0),REGION_NAME varchar(25))CREATE TABLE employees (EMPLOYEE_ID decimal(6,0),FIRST_NAME varchar(20),LAST_NAME varchar(25),EMAIL varchar(25),PHONE_NUMBER varchar(20),HIRE_D... | SELECT EMPLOYEE_ID, COMMISSION_PCT FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 |
Find out the number of patients with s/p fall as their primary disease who had delta abnormal lab test status. | 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 lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.diagnosis = "S/P FALL" AND lab.flag = "delta" |
What is the Week of the game against Green Bay Packers? | CREATE TABLE table_64794 ("Week" real,"Date" text,"Opponent" text,"Result" text,"Attendance" text) | SELECT AVG("Week") FROM table_64794 WHERE "Opponent" = 'green bay packers' |
How many songs have a lead vocal? | CREATE TABLE vocals (songid VARCHAR)CREATE TABLE songs (songid VARCHAR) | SELECT COUNT(DISTINCT title) FROM vocals AS T1 JOIN songs AS T2 ON T1.songid = T2.songid WHERE TYPE = "lead" |
What is the boat builder for a boat built in 1910/11 and a number of 39? | CREATE TABLE table_name_42 (boat_builder VARCHAR,year_built VARCHAR,number VARCHAR) | SELECT boat_builder FROM table_name_42 WHERE year_built = "1910/11" AND number = 39 |
List the name and the number of stations for all the cities that have at least 15 stations Show bar chart, and order by the x axis in desc. | CREATE TABLE weather (date TEXT,max_temperature_f INTEGER,mean_temperature_f INTEGER,min_temperature_f INTEGER,max_dew_point_f INTEGER,mean_dew_point_f INTEGER,min_dew_point_f INTEGER,max_humidity INTEGER,mean_humidity INTEGER,min_humidity INTEGER,max_sea_level_pressure_inches NUMERIC,mean_sea_level_pressure_inches NUM... | SELECT city, COUNT(*) FROM station GROUP BY city ORDER BY city DESC |
When Kansas State had a pick of over 35, what's the highest Overall pick found? | CREATE TABLE table_name_71 (overall INTEGER,college VARCHAR,pick VARCHAR) | SELECT MAX(overall) FROM table_name_71 WHERE college = "kansas state" AND pick > 35 |
Create a bar chart showing manager_id across last name | 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 varchar(10),JOB_TITLE varchar(35),MIN_SALARY decimal(6,0),MAX_SALARY decimal(6,0))CREATE TABLE locations (LOCATION_ID decimal(4,0),STREET_ADDRESS varchar(40),POSTAL_CO... | SELECT LAST_NAME, MANAGER_ID FROM employees |
What are the names of catalog entries with level number 8, and count them by a bar chart | CREATE TABLE Catalogs (catalog_id INTEGER,catalog_name VARCHAR(50),catalog_publisher VARCHAR(80),date_of_publication DATETIME,date_of_latest_revision DATETIME)CREATE TABLE Attribute_Definitions (attribute_id INTEGER,attribute_name VARCHAR(30),attribute_data_type VARCHAR(10))CREATE TABLE Catalog_Structure (catalog_level... | SELECT catalog_entry_name, COUNT(catalog_entry_name) FROM Catalog_Contents AS t1 JOIN Catalog_Contents_Additional_Attributes AS t2 ON t1.catalog_entry_id = t2.catalog_entry_id WHERE t2.catalog_level_number = "8" GROUP BY catalog_entry_name |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.