instruction stringlengths 0 1.06k | input stringlengths 11 5.3k | response stringlengths 2 4.44k |
|---|---|---|
Which Body Length/mm has a Lead Pitch/mm smaller than 0.5? | CREATE TABLE table_name_9 (body_length_mm INTEGER,lead_pitch_mm INTEGER) | SELECT AVG(body_length_mm) FROM table_name_9 WHERE lead_pitch_mm < 0.5 |
What was the H/A/N for the game that ended in a score of 108-102? | CREATE TABLE table_name_12 (h_a_n VARCHAR,score VARCHAR) | SELECT h_a_n FROM table_name_12 WHERE score = "108-102" |
What is the total Level with 27 Apps after 2006? | CREATE TABLE table_62308 ("Season" real,"Team" text,"Country" text,"League" text,"Level" real,"Apps" real,"Goals" real) | SELECT SUM("Level") FROM table_62308 WHERE "Apps" = '27' AND "Season" > '2006' |
number of patients who have had a bronchial lavage microbiology test until 2103. | CREATE TABLE treatment (treatmentid number,patientunitstayid number,treatmentname text,treatmenttime time)CREATE TABLE intakeoutput (intakeoutputid number,patientunitstayid number,cellpath text,celllabel text,cellvaluenumeric number,intakeoutputtime time)CREATE TABLE vitalperiodic (vitalperiodicid number,patientunitsta... | SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE patient.patientunitstayid IN (SELECT microlab.patientunitstayid FROM microlab WHERE microlab.culturesite = 'bronchial lavage' AND STRFTIME('%y', microlab.culturetakentime) <= '2103') |
Find the student ID and login name of the student with the most course enrollments | CREATE TABLE student_tests_taken (registration_id number,date_test_taken time,test_result text)CREATE TABLE students (student_id number,date_of_registration time,date_of_latest_logon time,login_name text,password text,personal_name text,middle_name text,family_name text)CREATE TABLE student_course_enrolment (registrati... | SELECT T1.student_id, T2.login_name FROM student_course_enrolment AS T1 JOIN students AS T2 ON T1.student_id = T2.student_id GROUP BY T1.student_id ORDER BY COUNT(*) DESC LIMIT 1 |
What are the number of the descriptions of the categories that products with product descriptions that contain the letter t are in? | CREATE TABLE Ref_Colors (color_code VARCHAR(15),color_description VARCHAR(80))CREATE TABLE Characteristics (characteristic_id INTEGER,characteristic_type_code VARCHAR(15),characteristic_data_type VARCHAR(10),characteristic_name VARCHAR(80),other_characteristic_details VARCHAR(255))CREATE TABLE Ref_Characteristic_Types ... | SELECT product_category_description, COUNT(product_category_description) FROM Ref_Product_Categories AS T1 JOIN Products AS T2 ON T1.product_category_code = T2.product_category_code WHERE T2.product_description LIKE '%t%' GROUP BY product_category_description |
What date did the episode air that had a ranking of 17 for cable? | CREATE TABLE table_24399615_4 (airdate VARCHAR,cable_rank VARCHAR) | SELECT airdate FROM table_24399615_4 WHERE cable_rank = "17" |
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, a bar chart shows the distribution of job_id and the average of manager_id , and group by attribute job_id, and rank names in desc order please. | 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 regions (REGION_ID decimal(5,0),REGION_NAME varchar(25))CREATE TABLE jobs (JOB_ID varchar(10),JOB_TITLE varchar(35),MIN_SALARY decimal(6,0),MAX_SALARY decimal(6,0))CREATE TABLE cou... | SELECT JOB_ID, AVG(MANAGER_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 GROUP BY JOB_ID ORDER BY JOB_ID DESC |
how many destinations does air florida have at this airport ? | CREATE TABLE table_204_215 (id number,"airline" text,"destination(s)" text,"aircraft scheduled" text,"service date(s)" text,"comments" text) | SELECT "destination(s)" FROM table_204_215 WHERE "airline" = 'air florida' |
What is the lowest number of bronze a short track athlete with 0 gold medals has? | CREATE TABLE table_name_47 (bronze INTEGER,sport VARCHAR,gold VARCHAR) | SELECT MIN(bronze) FROM table_name_47 WHERE sport = "short track" AND gold = 0 |
What league apps with 1 flt apps, 0 goals, and more than 1 league goals? | CREATE TABLE table_65388 ("Name" text,"Position" text,"League Apps" text,"League Goals" real,"FA Cup Apps" text,"FA Cup Goals" real,"League Cup Apps" text,"League Cup Goals" real,"FLT Apps" text,"FLT Goals" real,"Total Apps" text,"Total Goals" real) | SELECT "League Apps" FROM table_65388 WHERE "FLT Apps" = '1' AND "Total Goals" > '0' AND "League Goals" > '1' |
Name the 1970 film for when 1968 being neil mcdermott | CREATE TABLE table_19189 ("Cast" text,"1951 (BBC)" text,"1957 (BBC)" text,"1968 (BBC)" text,"1970 (film)" text,"2000 (Carlton Television)" text) | SELECT "1970 (film)" FROM table_19189 WHERE "1968 (BBC)" = 'Neil McDermott' |
Please show the most common reigns of wrestlers. | CREATE TABLE elimination (elimination_id text,wrestler_id text,team text,eliminated_by text,elimination_move text,time text)CREATE TABLE wrestler (wrestler_id number,name text,reign text,days_held text,location text,event text) | SELECT reign FROM wrestler GROUP BY reign ORDER BY COUNT(*) DESC LIMIT 1 |
Which loss had a player lower than 18? | CREATE TABLE table_52101 ("Team" text,"Points" real,"Played" real,"Drawn" real,"Lost" real,"Against" real,"Diff" real) | SELECT MIN("Lost") FROM table_52101 WHERE "Played" < '18' |
What is the highest earnings for the golfer who has more than 37 wins? | CREATE TABLE table_5485 ("Rank" real,"Player" text,"Country" text,"Earnings ($)" real,"Wins" real) | SELECT MAX("Earnings ( $ )") FROM table_5485 WHERE "Wins" > '37' |
Can you tell me the sum of Wins that has the Club of abuls smiltene, and the Goals smaller than 18? | CREATE TABLE table_60852 ("Position" real,"Club" text,"Played" real,"Wins" real,"Draws" real,"Losses" real,"Goals for" real,"Goals against" real,"Points" real,"Goal Difference" real) | SELECT SUM("Wins") FROM table_60852 WHERE "Club" = 'abuls smiltene' AND "Goals for" < '18' |
What is the sum of silver medals for the entry with rank 3 and a total of 4 medals? | CREATE TABLE table_name_43 (silver INTEGER,total VARCHAR,rank VARCHAR) | SELECT SUM(silver) FROM table_name_43 WHERE total = 4 AND rank = "3" |
How many points have pittsburgh as the visitor, and philadelphia as the home? | CREATE TABLE table_name_38 (points VARCHAR,visitor VARCHAR,home VARCHAR) | SELECT COUNT(points) FROM table_name_38 WHERE visitor = "pittsburgh" AND home = "philadelphia" |
What season has an episode written by john o'bryan and directed by ethan spaulding? | CREATE TABLE table_15185133_1 (no_in_season VARCHAR,written_by VARCHAR,directed_by VARCHAR) | SELECT no_in_season FROM table_15185133_1 WHERE written_by = "John O'Bryan" AND directed_by = "Ethan Spaulding" |
give me the number of patients whose diagnoses short title is chronic sinusitis nos and drug route is inhalation? | 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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.short_title = "Chronic sinusitis NOS" AND prescriptions.route = "INHALATION" |
What was the score when the Tie no was 6? | CREATE TABLE table_name_89 (score VARCHAR,tie_no VARCHAR) | SELECT score FROM table_name_89 WHERE tie_no = 6 |
What is the highest rank for a 6:52.70 time and notes of sa/b? | CREATE TABLE table_name_56 (rank INTEGER,notes VARCHAR,time VARCHAR) | SELECT MAX(rank) FROM table_name_56 WHERE notes = "sa/b" AND time = "6:52.70" |
What is the highest game with team @ l.a. clippers? | CREATE TABLE table_27756314_8 (game INTEGER,team VARCHAR) | SELECT MAX(game) FROM table_27756314_8 WHERE team = "@ L.A. Clippers" |
during the last month was calcium gluconate prescribed to patient 57023? | CREATE TABLE d_labitems (row_id number,itemid number,label text)CREATE TABLE labevents (row_id number,subject_id number,hadm_id number,itemid number,charttime time,valuenum number,valueuom text)CREATE TABLE cost (row_id number,subject_id number,hadm_id number,event_type text,event_id number,chargetime time,cost number)... | SELECT COUNT(*) > 0 FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 57023) AND prescriptions.drug = 'calcium gluconate' AND DATETIME(prescriptions.startdate, 'start of month') = DATETIME(CURRENT_TIME(), 'start of month', '-1 month') |
How many players made 4 touchdowns? | CREATE TABLE table_14342210_14 (player VARCHAR,touchdowns__5_points_ VARCHAR) | SELECT COUNT(player) FROM table_14342210_14 WHERE touchdowns__5_points_ = 4 |
Which badges that Jon Skeet doesn't have, have I ?. | CREATE TABLE SuggestedEditVotes (Id number,SuggestedEditId number,UserId number,VoteTypeId number,CreationDate time,TargetUserId number,TargetRepChange number)CREATE TABLE PostFeedback (Id number,PostId number,IsAnonymous boolean,VoteTypeId number,CreationDate time)CREATE TABLE Users (Id number,Reputation number,Creati... | SELECT DISTINCT Name FROM Badges AS b WHERE UserId = 22656 |
provide the number of patients whose year of death is less than or equal to 2148 and procedure short title is percu endosc gastrostomy? | 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 demographic (subject_id text,hadm_id text,name text,marital_status text,age text,do... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.dod_year <= "2148.0" AND procedures.short_title = "Percu endosc gastrostomy" |
what were the top five frequent input events until 2101? | 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 diagnoses_icd (row_id number,subject_id number,hadm_id number,... | SELECT d_items.label FROM d_items WHERE d_items.itemid IN (SELECT t1.itemid FROM (SELECT inputevents_cv.itemid, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM inputevents_cv WHERE STRFTIME('%y', inputevents_cv.charttime) <= '2101' GROUP BY inputevents_cv.itemid) AS t1 WHERE t1.c1 <= 5) |
Pick # of 203 went to which college? | CREATE TABLE table_name_16 (college VARCHAR,pick__number VARCHAR) | SELECT college FROM table_name_16 WHERE pick__number = 203 |
What was the school for the player who was a DL? | CREATE TABLE table_66741 ("Round" real,"Pick" real,"Player" text,"Position" text,"School/Club Team" text) | SELECT "School/Club Team" FROM table_66741 WHERE "Position" = 'dl' |
What's the average Grid with Laps of 88? | CREATE TABLE table_name_66 (grid INTEGER,laps VARCHAR) | SELECT AVG(grid) FROM table_name_66 WHERE laps = 88 |
Vetrans Query Tag combinations Counts. | CREATE TABLE ReviewRejectionReasons (Id number,Name text,Description text,PostTypeId number)CREATE TABLE Tags (Id number,TagName text,Count number,ExcerptPostId number,WikiPostId number)CREATE TABLE ReviewTasks (Id number,ReviewTaskTypeId number,CreationDate time,DeletionDate time,ReviewTaskStateId number,PostId number... | SELECT COUNT(QuestionPost.Id) AS size, QuestionPost.Tags AS tagName FROM Posts AS QuestionPost WHERE (QuestionPost.Tags LIKE '%<string>%') AND QuestionPost.PostTypeId = (SELECT Id FROM PostTypes WHERE Name = 'Question') AND NOT QuestionPost.Tags LIKE '%<%<%<%' GROUP BY (QuestionPost.Tags) ORDER BY size DESC |
What is the prothrombin time of von willebrand disease? | CREATE TABLE table_238124_1 (prothrombin_time VARCHAR,condition VARCHAR) | SELECT COUNT(prothrombin_time) FROM table_238124_1 WHERE condition = "Von Willebrand disease" |
To take HUMGEN 553 , is the prerequisite HUMGEN 632 ? | CREATE TABLE requirement (requirement_id int,requirement varchar,college varchar)CREATE TABLE semester (semester_id int,semester varchar,year int)CREATE TABLE program_requirement (program_id int,category varchar,min_credit int,additional_req varchar)CREATE TABLE student (student_id int,lastname varchar,firstname varcha... | SELECT COUNT(*) > 0 FROM course AS COURSE_0, course AS COURSE_1, course_prerequisite WHERE COURSE_0.course_id = course_prerequisite.pre_course_id AND COURSE_0.department = 'HUMGEN' AND COURSE_0.number = 632 AND COURSE_1.course_id = course_prerequisite.course_id AND COURSE_1.department = 'HUMGEN' AND COURSE_1.number = 5... |
What's the title in the number 10 in the season? | CREATE TABLE table_29320 ("No. in series" real,"No. in season" real,"Title" text,"Directed by" text,"Written by" text,"Original air date" text,"Production code" text,"U.S. viewers (million)" text) | SELECT "Title" FROM table_29320 WHERE "No. in season" = '10' |
Who was the home team that had a replay of Tie Number and played against the Bolton Wanderers? | CREATE TABLE table_45072 ("Tie no" text,"Home team" text,"Score" text,"Away team" text,"Date" text) | SELECT "Home team" FROM table_45072 WHERE "Tie no" = 'replay' AND "Away team" = 'bolton wanderers' |
was the potassium value last measured on the first hospital visit of patient 7073 less than second to last measured on the first hospital visit? | CREATE TABLE patients (row_id number,subject_id number,gender text,dob time,dod time)CREATE TABLE icustays (row_id number,subject_id number,hadm_id number,icustay_id number,first_careunit text,last_careunit text,first_wardid number,last_wardid number,intime time,outtime time)CREATE TABLE admissions (row_id number,subje... | SELECT (SELECT labevents.valuenum FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 7073 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label =... |
For each tourist attraction, return its name and the date when the tourists named Vincent or Vivian visited there. | CREATE TABLE locations (location_id number,location_name text,address text,other_details text)CREATE TABLE museums (museum_id number,museum_details text)CREATE TABLE staff (staff_id number,tourist_attraction_id number,name text,other_details text)CREATE TABLE features (feature_id number,feature_details text)CREATE TABL... | SELECT T1.name, T3.visit_date FROM tourist_attractions AS T1 JOIN visitors AS T2 JOIN visits AS T3 ON T1.tourist_attraction_id = T3.tourist_attraction_id AND T2.tourist_id = T3.tourist_id WHERE T2.tourist_details = "Vincent" OR T2.tourist_details = "Vivian" |
During what years did the tallest building, located at 211 Union Street, have less than 31 floors? | CREATE TABLE table_name_95 (years_as_tallest VARCHAR,floors VARCHAR,street_address VARCHAR) | SELECT years_as_tallest FROM table_name_95 WHERE floors < 31 AND street_address = "211 union street" |
calculate the number of patients who have received a non-invasive mech vent two or more times until 4 years ago. | 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 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 ... | SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, COUNT(*) AS c1 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 = 'non-invasive mech ven... |
What is the Martin McGuinness with a David Norris that is 10.3%? | CREATE TABLE table_40450 ("Constituency" text,"Michael D. Higgins" text,"Se\u00e1n Gallagher" text,"Martin McGuinness" text,"Gay Mitchell" text,"David Norris" text,"Dana Rosemary Scallon" text,"Mary Davis" text) | SELECT "Martin McGuinness" FROM table_40450 WHERE "David Norris" = '10.3%' |
For those records from the products and each product's manufacturer, return a bar chart about the distribution of name and code , and group by attribute founder, and rank from low to high by the Y. | 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 T1.Name, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder, T1.Name ORDER BY T1.Code |
so, what was the last heart rate of patient 28443 in the previous day? | CREATE TABLE cost (row_id number,subject_id number,hadm_id number,event_type text,event_id number,chargetime time,cost number)CREATE TABLE labevents (row_id number,subject_id number,hadm_id number,itemid number,charttime time,valuenum number,valueuom text)CREATE TABLE admissions (row_id number,subject_id number,hadm_id... | 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 chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'heart rat... |
list seating capacities of DL flights from SEATTLE to SALT LAKE CITY | 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 airline (airline_code varchar,airline_name text,note text)CREATE TABLE flight_fare (flight_id int,fare_id int)CREATE TABLE air... | SELECT DISTINCT aircraft_code FROM aircraft WHERE aircraft_code IN (SELECT EQUIPMENT_SEQUENCEalias0.aircraft_code FROM equipment_sequence AS EQUIPMENT_SEQUENCEalias0 WHERE EQUIPMENT_SEQUENCEalias0.aircraft_code_sequence IN (SELECT FLIGHTalias0.aircraft_code_sequence FROM flight AS FLIGHTalias0 WHERE ((FLIGHTalias0.from... |
Which courses in Radiat Shield are 1 credits ? | CREATE TABLE jobs (job_id int,job_title varchar,description varchar,requirement varchar,city varchar,state varchar,country varchar,zip int)CREATE TABLE course_tags_count (course_id int,clear_grading int,pop_quiz int,group_projects int,inspirational int,long_lectures int,extra_credit int,few_tests int,good_feedback int,... | SELECT DISTINCT department, name, number FROM course WHERE (description LIKE '%Radiat Shield%' OR name LIKE '%Radiat Shield%') AND credits = 1 |
What is the Kana of the Province with a Korean name of Chungcheong-Namdo? | CREATE TABLE table_40625 ("Japanese name" text,"Kana" text,"Hanja / Kanji" text,"Korean name" text,"Hangul" text) | SELECT "Kana" FROM table_40625 WHERE "Korean name" = 'chungcheong-namdo' |
Length of posts over time. | CREATE TABLE CloseAsOffTopicReasonTypes (Id number,IsUniversal boolean,InputTitle text,MarkdownInputGuidance text,MarkdownPostOwnerGuidance text,MarkdownPrivilegedUserGuidance text,MarkdownConcensusDescription text,CreationDate time,CreationModeratorId number,ApprovalDate time,ApprovalModeratorId number,DeactivationDat... | SELECT DATE(CreationDate), SUM(LENGTH(Body)) FROM Posts WHERE PostTypeId = 1 OR PostTypeId = 2 GROUP BY DATE(CreationDate) ORDER BY DATE(CreationDate) |
What is the Cardinalatial order and title that Pedro Mart nez de Luna y Gotor elevated? | CREATE TABLE table_65559 ("Elector" text,"Nationality" text,"Cardinalatial order and title" text,"Elevated" text,"Elevator" text) | SELECT "Cardinalatial order and title" FROM table_65559 WHERE "Elector" = 'pedro martínez de luna y gotor' |
what is the first flight that goes from ATLANTA to BALTIMORE that serves BREAKFAST | CREATE TABLE flight_stop (flight_id int,stop_number int,stop_days text,stop_airport text,arrival_time int,arrival_airline text,arrival_flight_number int,departure_time int,departure_airline text,departure_flight_number int,stop_time int)CREATE TABLE date_day (month_number int,day_number int,year int,day_name varchar)CR... | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight, food_service WHERE ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BALTIMORE' AND flight.to_airport = AIRPORT_SERVICE_1.airport_code AND food... |
What is the mpg-UK urban (cold) for a fuel type of diesel, extraurban MPG in the UK over 68.9, engine capacity of 1422, and L/100km urban (cold) over 5.1? | CREATE TABLE table_14145 ("Manufacturer" text,"Transmission" text,"Engine Capacity" real,"Fuel Type" text,"L/100km Urban (Cold)" real,"L/100km Extra-Urban" real,"L/100km Combined" real,"mpg-UK Urban (Cold)" real,"mpg-UK Extra-Urban" real,"mpg-UK Combined" real,"mpg-US Urban" real,"mpg-US Extra-Urban" real,"mpg-US Combi... | SELECT "mpg-UK Urban (Cold)" FROM table_14145 WHERE "Fuel Type" = 'diesel' AND "mpg-UK Extra-Urban" > '68.9' AND "Engine Capacity" = '1422' AND "L/100km Urban (Cold)" > '5.1' |
what pitcher scored 4 | CREATE TABLE table_6025 ("Letter" text,"Players" text,"Pitch" text,"Ret#" text,"Records" text) | SELECT "Ret#" FROM table_6025 WHERE "Records" = '4' |
Who was the opponent at the game at Sullivan Stadium before week 11? | CREATE TABLE table_name_30 (opponent VARCHAR,week VARCHAR,game_site VARCHAR) | SELECT opponent FROM table_name_30 WHERE week < 11 AND game_site = "sullivan stadium" |
What is the Mecha of the Japanese voice actor Shingo Kanemoto? | CREATE TABLE table_48539 ("Gatchaman" text,"Eagle Riders" text,"Rank" text,"Bird Uniform" text,"Weapon" text,"Mecha" text,"Japanese voice actor" text,"Voice actor (Eagle Riders)" text) | SELECT "Mecha" FROM table_48539 WHERE "Japanese voice actor" = 'shingo kanemoto' |
What is the imperfect stem of the word that means 'take away, remove'? | CREATE TABLE table_14598 ("Perfect stem" text,"Future stem" text,"Imperfect stem" text,"Short stem" text,"Meaning" text) | SELECT "Imperfect stem" FROM table_14598 WHERE "Meaning" = 'take away, remove' |
find the average days of hospital stay for patients who died before the year 2174. | 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 AVG(demographic.days_stay) FROM demographic WHERE demographic.dod_year < "2174.0" |
For each record in schedule, show average of the price for each day in a bar chart. | CREATE TABLE cinema (Cinema_ID int,Name text,Openning_year int,Capacity int,Location text)CREATE TABLE schedule (Cinema_ID int,Film_ID int,Date text,Show_times_per_day int,Price float)CREATE TABLE film (Film_ID int,Rank_in_series int,Number_in_season int,Title text,Directed_by text,Original_air_date text,Production_cod... | SELECT Date, AVG(Price) FROM schedule AS T1 JOIN film AS T2 ON T1.Film_ID = T2.Film_ID JOIN cinema AS T3 ON T1.Cinema_ID = T3.Cinema_ID GROUP BY Date |
What is the record at the neutral site for when the overall record is ui, 27-16? | CREATE TABLE table_20607 ("Missouri vs." text,"Overall Record" text,"at Columbia" text,"at Opponents Venue" text,"at Neutral Site" text,"Last 5 Meetings" text,"Last 10 Meetings" text,"Current Streak" text) | SELECT "at Neutral Site" FROM table_20607 WHERE "Overall Record" = 'UI, 27-16' |
are there any flights from BOSTON to SAN FRANCISCO which stop in WASHINGTON | CREATE TABLE time_interval (period text,begin_time int,end_time int)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 airport_service (city_code varchar,airport_code varchar,mi... | 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 = 'SAN FRANCISCO' AND CIT... |
What are the first names and last names of students with address in Wisconsin state? | CREATE TABLE Students (first_name VARCHAR,last_name VARCHAR,address_id VARCHAR)CREATE TABLE Addresses (address_id VARCHAR,state_province_county VARCHAR) | SELECT T2.first_name, T2.last_name FROM Addresses AS T1 JOIN Students AS T2 ON T1.address_id = T2.address_id WHERE T1.state_province_county = "Wisconsin" |
Which Livery has a Description of 20t tanker, with a date later than 1941? | CREATE TABLE table_name_32 (livery VARCHAR,description VARCHAR,date VARCHAR) | SELECT livery FROM table_name_32 WHERE description = "20t tanker" AND date > 1941 |
Give me a bar chart for team_id of each all neutral, and sort in descending by the Team_ID. | CREATE TABLE basketball_match (Team_ID int,School_ID int,Team_Name text,ACC_Regular_Season text,ACC_Percent text,ACC_Home text,ACC_Road text,All_Games text,All_Games_Percent int,All_Home text,All_Road text,All_Neutral text)CREATE TABLE university (School_ID int,School text,Location text,Founded real,Affiliation text,En... | SELECT All_Neutral, Team_ID FROM basketball_match ORDER BY Team_ID DESC |
When the carrier is idc, what are the frequencies? | CREATE TABLE table_22909 ("Carrier" text,"Standard" text,"Frequency" text,"Connection speed" text,"Launch date (dd.mm.yyyy)" text) | SELECT "Frequency" FROM table_22909 WHERE "Carrier" = 'IDC' |
count the number of patients whose admission year is less than 2187 and procedure icd9 code is 3806? | 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.admityear < "2187" AND procedures.icd9_code = "3806" |
Which week had an attendance of 51,265? | CREATE TABLE table_69933 ("Week" real,"Date" text,"Opponent" text,"Result" text,"Attendance" text) | SELECT "Week" FROM table_69933 WHERE "Attendance" = '51,265' |
what are the names and ids of customers whose address contains TN?, I want to sort by the total number in desc. | CREATE TABLE Addresses (address_id INTEGER,address_details VARCHAR(255))CREATE TABLE Products (product_id INTEGER,product_type_code VARCHAR(10),product_name VARCHAR(80),product_price DECIMAL(19,4))CREATE TABLE Suppliers (supplier_id INTEGER,supplier_name VARCHAR(80),supplier_phone VARCHAR(80))CREATE TABLE Staff_Departm... | SELECT customer_name, customer_id FROM Customers WHERE customer_address LIKE "%TN%" ORDER BY customer_id DESC |
What is the name of the ship that had a Pennant number of h55? | CREATE TABLE table_58224 ("Ship" text,"Pennant number" text,"Laid down" text,"Launched" text,"Completed" text) | SELECT "Ship" FROM table_58224 WHERE "Pennant number" = 'h55' |
Which Shooter has Score points of olympic silver medalist? | CREATE TABLE table_61403 ("Shooter" text,"Event" text,"Rank points" text,"Score points" text,"Total" text) | SELECT "Shooter" FROM table_61403 WHERE "Score points" = 'olympic silver medalist' |
how many days have elapsed since patient 010-16572's first stay in the ward 498 in the current hospital visit? | 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 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', patient.unitadmittime)) FROM patient WHERE patient.uniquepid = '010-16572' AND patient.wardid = 498 AND patient.hospitaldischargetime IS NULL ORDER BY patient.unitadmittime LIMIT 1 |
calculate the number of times that morphine sulfate was prescribed to patient 007-849 during this hospital visit. | CREATE TABLE microlab (microlabid number,patientunitstayid number,culturesite text,organism text,culturetakentime time)CREATE TABLE lab (labid number,patientunitstayid number,labname text,labresult number,labresulttime time)CREATE TABLE vitalperiodic (vitalperiodicid number,patientunitstayid number,temperature number,s... | SELECT COUNT(*) FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '007-849' AND patient.hospitaldischargetime IS NULL)) AND medication.drugname =... |
For her classes , does Prof. Thomas Nalepa always set exams ? | CREATE TABLE requirement (requirement_id int,requirement varchar,college varchar)CREATE TABLE program_requirement (program_id int,category varchar,min_credit int,additional_req varchar)CREATE TABLE course_offering (offering_id int,course_id int,semester int,section_number int,start_time time,end_time time,monday varcha... | SELECT COUNT(*) = 0 FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN offering_instructor ON offering_instructor.offering_id = course_offering.offering_id INNER JOIN instructor ON offering_instructor.instructor_id = instructor.instructor_id WHERE course.has_exams = 'N' AN... |
What is the lowest first prize of the Mercedes Championships tournament in California? | CREATE TABLE table_name_18 (location VARCHAR,tournament VARCHAR) | SELECT MIN(1 AS st_prize___) AS $__ FROM table_name_18 WHERE location = "california" AND tournament = "mercedes championships" |
Who won the series when the San Francisco Giants lost? | CREATE TABLE table_name_92 (winning_team VARCHAR,losing_team VARCHAR) | SELECT winning_team FROM table_name_92 WHERE losing_team = "san francisco giants" |
Compute how many attributes in each name of the attribute definitions with attribute value 0 Show the result with a bar chart, list from high to low by the x axis. | 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 Catalog_Contents (catalog_entry_id INTEGER,catalog_level_number INTEGER,parent_entry_id INTEGER,previous_entry_id INTEGER,next_entry_id INTEGER,cata... | SELECT attribute_name, COUNT(attribute_name) FROM Attribute_Definitions AS t1 JOIN Catalog_Contents_Additional_Attributes AS t2 ON t1.attribute_id = t2.attribute_id WHERE t2.attribute_value = 0 GROUP BY attribute_name ORDER BY attribute_name DESC |
Name the rank for laps less than 130 and year of 1951 | CREATE TABLE table_80344 ("Year" text,"Start" text,"Qual" text,"Rank" text,"Finish" text,"Laps" real) | SELECT "Rank" FROM table_80344 WHERE "Laps" < '130' AND "Year" = '1951' |
What is the smallest Year with a Binibining Pilipinas-International of jessie alice salones dixson? | CREATE TABLE table_58707 ("Year" real,"Binibining Pilipinas-Universe" text,"Binibining Pilipinas-International" text,"Miss Maja Pilipinas" text,"Binibining Pilipinas-Tourism" text,"First runner-up" text,"Second runner-up" text) | SELECT MIN("Year") FROM table_58707 WHERE "Binibining Pilipinas-International" = 'jessie alice salones dixson' |
Show the names of customers having an order with shipping method FedEx and order status Paid. | CREATE TABLE customer_orders (customer_id VARCHAR)CREATE TABLE customers (customer_name VARCHAR,customer_id VARCHAR) | SELECT T1.customer_name FROM customers AS T1 JOIN customer_orders AS T2 ON T1.customer_id = T2.customer_id WHERE shipping_method_code = 'FedEx' AND order_status_code = 'Paid' |
What is week 4 if week 3 is 35.40? | CREATE TABLE table_name_26 (week_4 VARCHAR,week_3 VARCHAR) | SELECT week_4 FROM table_name_26 WHERE week_3 = "35.40" |
what are the four commonly ordered drugs for patients diagnosed with acute respiratory failure previously within the same month, until 4 years ago? | CREATE TABLE allergy (allergyid number,patientunitstayid number,drugname text,allergyname text,allergytime time)CREATE TABLE intakeoutput (intakeoutputid number,patientunitstayid number,cellpath text,celllabel text,cellvaluenumeric number,intakeoutputtime time)CREATE TABLE lab (labid number,patientunitstayid number,lab... | SELECT t3.drugname FROM (SELECT t2.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'acute respiratory failure' AND DATETIME(diagnosis.... |
What NFL Team has the player Danny Triplett with the position linebacker? | CREATE TABLE table_2508633_11 (nfl_team VARCHAR,position VARCHAR,player VARCHAR) | SELECT nfl_team FROM table_2508633_11 WHERE position = "Linebacker" AND player = "Danny Triplett" |
which medication has drug code alte1/2l? | CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text,formulary_drug_cd text,route text,drug_dose text)CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime tex... | SELECT prescriptions.drug FROM prescriptions WHERE prescriptions.formulary_drug_cd = "ALTE1/2I" |
Who are the away teams when subiaco oval was the grounds? | CREATE TABLE table_16388506_1 (away_team VARCHAR,ground VARCHAR) | SELECT away_team FROM table_16388506_1 WHERE ground = "Subiaco Oval" |
What club was derrick byfuglien drafted by before 283? | CREATE TABLE table_11172 ("Round" real,"Overall" real,"Player" text,"Nationality" text,"Club team" text) | SELECT "Club team" FROM table_11172 WHERE "Overall" < '283' AND "Player" = 'derrick byfuglien' |
What's the total grid of Bruce Mclaren? | CREATE TABLE table_10650 ("Driver" text,"Constructor" text,"Laps" real,"Time/Retired" text,"Grid" real) | SELECT COUNT("Grid") FROM table_10650 WHERE "Driver" = 'bruce mclaren' |
Name the parent unit for ludwig franzisket | CREATE TABLE table_28342423_1 (parent_unit VARCHAR,commanding_officer VARCHAR) | SELECT parent_unit FROM table_28342423_1 WHERE commanding_officer = "Ludwig Franzisket" |
count the number of patients whose discharge location is rehab/distinct part hosp and lab test name is ptt? | 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 lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.discharge_location = "REHAB/DISTINCT PART HOSP" AND lab.label = "PTT" |
Plot the number of phone by grouped by phone as a bar graph, and I want to show in descending by the y axis. | CREATE TABLE MediaType (MediaTypeId integer,Name varchar(120))CREATE TABLE Playlist (PlaylistId integer,Name varchar(120))CREATE TABLE Album (AlbumId integer,Title varchar(160),ArtistId integer)CREATE TABLE Invoice (InvoiceId integer,CustomerId integer,InvoiceDate datetime,BillingAddress varchar(70),BillingCity varchar... | SELECT Phone, COUNT(Phone) FROM Employee GROUP BY Phone ORDER BY COUNT(Phone) DESC |
What round is player phil graham in? | CREATE TABLE table_12677 ("Tries" real,"Player" text,"Opponent" text,"Score" text,"Venue" text,"Round" text) | SELECT "Round" FROM table_12677 WHERE "Player" = 'phil graham' |
among patients who have been diagnosed with preterm nec 2500+g tell me the two year survival rate. | CREATE TABLE microbiologyevents (row_id number,subject_id number,hadm_id number,charttime time,spec_type_desc text,org_name text)CREATE TABLE cost (row_id number,subject_id number,hadm_id number,event_type text,event_id number,chargetime time,cost number)CREATE TABLE admissions (row_id number,subject_id number,hadm_id ... | SELECT SUM(CASE WHEN patients.dod IS NULL THEN 1 WHEN STRFTIME('%j', patients.dod) - STRFTIME('%j', t2.charttime) > 2 * 365 THEN 1 ELSE 0 END) * 100 / COUNT(*) FROM (SELECT t1.subject_id, t1.charttime FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id... |
What was the result of the election in which the incumbent was first elected in 1984? | CREATE TABLE table_1341453_37 (results VARCHAR,first_elected VARCHAR) | SELECT results FROM table_1341453_37 WHERE first_elected = 1984 |
Which Condition has a Bleeding time of prolonged, a Platelet count of decreased, and Prothrombin time of prolonged? | CREATE TABLE table_42607 ("Condition" text,"Prothrombin time" text,"Partial thromboplastin time" text,"Bleeding time" text,"Platelet count" text) | SELECT "Condition" FROM table_42607 WHERE "Bleeding time" = 'prolonged' AND "Platelet count" = 'decreased' AND "Prothrombin time" = 'prolonged' |
Which authority has a rocket launch called rehbar-ii? | CREATE TABLE table_11869952_1 (institutional_authority VARCHAR,rocket_launch VARCHAR) | SELECT institutional_authority FROM table_11869952_1 WHERE rocket_launch = "Rehbar-II" |
how many times does patient 27463 get a e 24 fs po intake since 08/2103? | CREATE TABLE patients (row_id number,subject_id number,gender text,dob time,dod time)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 number,itemid number,label text,linksto text)CREATE TABLE d_labitems (row_id ... | SELECT COUNT(*) FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 27463)) AND inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'e 24 fs po' ... |
When the skip is Glenn Howard, what the minimum PF? | CREATE TABLE table_21222 ("Province" text,"Skip" text,"W" real,"L" real,"PF" real,"PA" real,"Ends Won" real,"Ends Lost" real,"Blank Ends" real,"Stolen Ends" real,"Shot Pct." real) | SELECT MIN("PF") FROM table_21222 WHERE "Skip" = 'Glenn Howard' |
For those records from the products and each product's manufacturer, visualize a scatter chart about the correlation between manufacturer and revenue , and group by attribute name. | CREATE TABLE Manufacturers (Code INTEGER,Name VARCHAR(255),Headquarter VARCHAR(255),Founder VARCHAR(255),Revenue REAL)CREATE TABLE Products (Code INTEGER,Name VARCHAR(255),Price DECIMAL,Manufacturer INTEGER) | SELECT T1.Manufacturer, T2.Revenue FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Name |
What is the first series number that Adele Lim wrote? | CREATE TABLE table_11694832_1 (no_in_series INTEGER,written_by VARCHAR) | SELECT MIN(no_in_series) FROM table_11694832_1 WHERE written_by = "Adele Lim" |
What is the total number of 3rd place entries that have exactly 8 total placings? | CREATE TABLE table_20823568_2 (third_place_s_ VARCHAR,total_placing_s_ VARCHAR) | SELECT COUNT(third_place_s_) FROM table_20823568_2 WHERE total_placing_s_ = 8 |
What tournament did the Crusaders play in? | CREATE TABLE table_name_98 (tournament VARCHAR,opponent VARCHAR) | SELECT tournament FROM table_name_98 WHERE opponent = "crusaders" |
Name the most attendance whent he record is 45-57 | CREATE TABLE table_14321 ("Date" text,"Opponent" text,"Score" text,"Loss" text,"Attendance" real,"Record" text) | SELECT MAX("Attendance") FROM table_14321 WHERE "Record" = '45-57' |
For all artist names who are not from the United States, show the total number of each year with a bar chart. | CREATE TABLE exhibition_record (Exhibition_ID int,Date text,Attendance int)CREATE TABLE artist (Artist_ID int,Name text,Country text,Year_Join int,Age int)CREATE TABLE exhibition (Exhibition_ID int,Year int,Theme text,Artist_ID int,Ticket_Price real) | SELECT Year_Join, COUNT(Year_Join) FROM artist WHERE Country <> 'United States' GROUP BY Year_Join |
To how many patients with st elevated myocardial infarction or cardiac cath as their primary disease was iv drip administered/presribed? | 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 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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.diagnosis = "ST ELEVATED MYOCARDIAL INFARCTION\CARDIAC CATH" AND prescriptions.route = "IV DRIP" |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.