instruction stringlengths 0 1.06k | input stringlengths 11 5.3k | response stringlengths 2 4.44k |
|---|---|---|
What is the Mecha of the Japanese voice actor Shingo Kanemoto? | CREATE TABLE table_name_39 (mecha VARCHAR,japanese_voice_actor VARCHAR) | SELECT mecha FROM table_name_39 WHERE japanese_voice_actor = "shingo kanemoto" |
what tests are the four most frequently ordered lab tests in this year? | CREATE TABLE procedures_icd (row_id number,subject_id number,hadm_id number,icd9_code text,charttime time)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 ... | SELECT d_labitems.label FROM d_labitems WHERE d_labitems.itemid IN (SELECT t1.itemid FROM (SELECT labevents.itemid, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM labevents WHERE DATETIME(labevents.charttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') GROUP BY labevents.itemid) AS t1... |
Which school has a Player of donte greene? | CREATE TABLE table_51901 ("Player" text,"Height" text,"School" text,"Hometown" text,"College" text,"NBA Draft" text) | SELECT "School" FROM table_51901 WHERE "Player" = 'donte greene' |
number of games in which the starzz scored at most 59 points | CREATE TABLE table_204_73 (id number,"date" text,"opponent" text,"score" text,"result" text,"record" text) | SELECT COUNT(*) FROM table_204_73 WHERE "score" <= 59 |
Who directed El Nido? | CREATE TABLE table_16304 ("Year (Ceremony)" text,"Film title used in nomination" text,"Original title" text,"Director" text,"Result" text) | SELECT "Director" FROM table_16304 WHERE "Original title" = 'El nido' |
Which Year born (Age) has a Current Club of sporting al riyadi beirut, and a Position of pf? | CREATE TABLE table_name_41 (year_born__age_ VARCHAR,current_club VARCHAR,position VARCHAR) | SELECT year_born__age_ FROM table_name_41 WHERE current_club = "sporting al riyadi beirut" AND position = "pf" |
Show me a scatter chart for how many games has each stadium held? | CREATE TABLE stadium (id int,name text,Home_Games int,Average_Attendance real,Total_Attendance real,Capacity_Percentage real)CREATE TABLE injury_accident (game_id int,id int,Player text,Injury text,Number_of_matches text,Source text)CREATE TABLE game (stadium_id int,id int,Season int,Date text,Home_team text,Away_team ... | SELECT T1.id, COUNT(*) FROM stadium AS T1 JOIN game AS T2 ON T1.id = T2.stadium_id GROUP BY T1.id |
show me the flights from PITTSBURGH to SAN FRANCISCO | 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 month (month_number int,month_name text)CREATE TABLE flight_fare (flig... | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'PITTSBURGH' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN... |
How many die sizes have a texture of exactly 34? | CREATE TABLE table_28268 ("Model" text,"Launch" text,"Code name" text,"Transistors (million)" real,"Die size (mm 2)" real,"Bus interface" text,"Memory (MB)" text,"SM count" real,"Core config 1,3" text,"Core (MHz)" real,"Shader (MHz)" real,"Memory (MHz)" text,"Pixel (GP /s)" text,"Texture (GT /s)" text,"Bandwidth (GB /s... | SELECT COUNT("Die size (mm 2 )") FROM table_28268 WHERE "Texture ( GT /s)" = '34' |
Give me the comparison about Team_ID over the All_Home , and group by attribute ACC_Road, and show from high to low by the x axis. | 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_Home, Team_ID FROM basketball_match GROUP BY ACC_Road, All_Home ORDER BY All_Home DESC |
Name the Team which has a Time/Retired of contact, and a Grid smaller than 17? | CREATE TABLE table_46935 ("Driver" text,"Team" text,"Laps" real,"Time/Retired" text,"Grid" real,"Points" text) | SELECT "Team" FROM table_46935 WHERE "Time/Retired" = 'contact' AND "Grid" < '17' |
User and count of answers on closed questions. | CREATE TABLE PendingFlags (Id number,FlagTypeId number,PostId number,CreationDate time,CloseReasonTypeId number,CloseAsOffTopicReasonTypeId number,DuplicateOfQuestionId number,BelongsOnBaseHostAddress text)CREATE TABLE SuggestedEditVotes (Id number,SuggestedEditId number,UserId number,VoteTypeId number,CreationDate tim... | SELECT a.OwnerUserId, COUNT(*) AS "total" FROM Posts AS a JOIN Posts AS q ON q.Id = a.ParentId WHERE NOT q.ClosedDate IS NULL GROUP BY a.OwnerUserId ORDER BY total DESC |
Show the number of the names of editors that are on the committee of journals with sales bigger than 3000, sort Name from high to low order. | CREATE TABLE editor (Editor_ID int,Name text,Age real)CREATE TABLE journal (Journal_ID int,Date text,Theme text,Sales int)CREATE TABLE journal_committee (Editor_ID int,Journal_ID int,Work_Type text) | SELECT Name, COUNT(Name) FROM journal_committee AS T1 JOIN editor AS T2 ON T1.Editor_ID = T2.Editor_ID JOIN journal AS T3 ON T1.Journal_ID = T3.Journal_ID WHERE T3.Sales > 3000 GROUP BY Name ORDER BY Name DESC |
What is the average number of points for an Offenhauser L4 engine with a Trevis chassis? | CREATE TABLE table_name_93 (points INTEGER,engine VARCHAR,chassis VARCHAR) | SELECT AVG(points) FROM table_name_93 WHERE engine = "offenhauser l4" AND chassis = "trevis" |
How many TDs for the player with a long of less than 4 and under 8 yards? | CREATE TABLE table_54123 ("Player" text,"Car." real,"Yards" real,"Avg." real,"TD's" real,"Long" real) | SELECT SUM("TD's") FROM table_54123 WHERE "Long" < '4' AND "Yards" < '8' |
What is the percentage of land area in the ecozone that the percentage protected is 15.28? | CREATE TABLE table_20141 ("Ecozone" text,"Area (km\u00b2)" real,"Percentage of total area" text,"Percentage of land area" text,"Percentage protected" text) | SELECT "Percentage of land area" FROM table_20141 WHERE "Percentage protected" = '15.28' |
What is the description of the service type which offers both the photo product and the film product? | CREATE TABLE services (service_id number,service_type_code text,workshop_group_id number,product_description text,product_name text,product_price number,other_product_service_details text)CREATE TABLE marketing_regions (marketing_region_code text,marketing_region_name text,marketing_region_descriptrion text,other_detai... | SELECT T1.service_type_description FROM ref_service_types AS T1 JOIN services AS T2 ON T1.service_type_code = T2.service_type_code WHERE T2.product_name = 'photo' INTERSECT SELECT T1.service_type_description FROM ref_service_types AS T1 JOIN services AS T2 ON T1.service_type_code = T2.service_type_code WHERE T2.product... |
For each director, return the director's name together with the value of that rating and ignore movies whose director is NULL Could you plot the result with a bar chart?, I want to list by the director in desc. | CREATE TABLE Reviewer (rID int,name text)CREATE TABLE Movie (mID int,title text,year int,director text)CREATE TABLE Rating (rID int,mID int,stars int,ratingDate date) | SELECT director, stars FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID WHERE director <> "null" ORDER BY director DESC |
What engines have the year 1992? | CREATE TABLE table_11400 ("Year" real,"Chassis" text,"Engine(s)" text,"Tyres" text,"Points" real) | SELECT "Engine(s)" FROM table_11400 WHERE "Year" = '1992' |
Give me the names and prices of furnitures which some companies are manufacturing with a bar chart, display y axis from low to high order. | CREATE TABLE furniture_manufacte (Manufacturer_ID int,Furniture_ID int,Price_in_Dollar real)CREATE TABLE manufacturer (Manufacturer_ID int,Open_Year real,Name text,Num_of_Factories int,Num_of_Shops int)CREATE TABLE furniture (Furniture_ID int,Name text,Num_of_Component int,Market_Rate real) | SELECT Name, Price_in_Dollar FROM furniture AS t1 JOIN furniture_manufacte AS t2 ON t1.Furniture_ID = t2.Furniture_ID ORDER BY Price_in_Dollar |
what is the difference in the weight of patient 594's last measured on the last hospital visit compared to the value first measured on the last 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 patients (row_id number,subject_id number,gender text,dob time... | 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 = 594 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime DESC LIMIT 1)) AND char... |
What is the number of totals that have silvers under 2, bronzes over 0, and golds over 1? | CREATE TABLE table_75694 ("Rank" text,"Nation" text,"Gold" real,"Silver" real,"Bronze" real,"Total" real) | SELECT COUNT("Total") FROM table_75694 WHERE "Silver" < '2' AND "Bronze" > '0' AND "Gold" > '1' |
What's Yotam Halperin's position? | CREATE TABLE table_593 ("No" real,"Player" text,"Height" text,"Position" text,"Year born" real,"Current Club" text) | SELECT "Position" FROM table_593 WHERE "Player" = 'Yotam Halperin' |
Which date's opponent was Dender when the tournament was in the Jupiler League and the ground was a? | CREATE TABLE table_53594 ("Date" text,"Tournament" text,"Round" text,"Ground" text,"Opponent" text,"Score 1" text) | SELECT "Date" FROM table_53594 WHERE "Opponent" = 'dender' AND "Tournament" = 'jupiler league' AND "Ground" = 'a' |
What position did the team finish in with a Difference of - 6, 3 losses, and over 4 draws? | CREATE TABLE table_38000 ("Position" real,"Team" text,"Points" real,"Played" real,"Drawn" real,"Lost" real,"Against" real,"Difference" text) | SELECT COUNT("Position") FROM table_38000 WHERE "Difference" = '- 6' AND "Lost" = '3' AND "Drawn" > '4' |
how many times patient 002-4486 has taken per iv flush: forearm r 18 gauge in the previous day? | 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(*) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '002-4486')) AND intakeoutput.cellpath LIKE '%intake%' AND intakeoutput.cel... |
how many patients are admitted before the year 2158 and followed the procedure inject ca chemother nec? | CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text,formulary_drug_cd text,route text,drug_dose text)CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime tex... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admityear < "2158" AND procedures.short_title = "Inject ca chemother NEC" |
in 2105, what are the top four most frequent drugs prescribed to patients in the same month after the prescription of desipramine hcl? | CREATE TABLE labevents (row_id number,subject_id number,hadm_id number,itemid number,charttime time,valuenum number,valueuom text)CREATE TABLE d_items (row_id number,itemid number,label text,linksto text)CREATE TABLE d_labitems (row_id number,itemid number,label text)CREATE TABLE inputevents_cv (row_id number,subject_i... | SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, prescriptions.startdate FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE prescriptions.drug = 'desipramine hcl' AND STRFTIME('%y', prescriptions.startdate) = '2... |
give me the number of patients whose age is less than 50 and diagnoses long title is coronary atherosclerosis of native coronary artery? | CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital_status text,age text,dob text,gender text,language text,religion text,admission_type text,days_stay text,insurance text,ethnicity text,expire_flag... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.age < "50" AND diagnoses.long_title = "Coronary atherosclerosis of native coronary artery" |
what was the daily minimum amount of colostomy given to patient 006-80884 during this hospital visit? | CREATE TABLE intakeoutput (intakeoutputid number,patientunitstayid number,cellpath text,celllabel text,cellvaluenumeric number,intakeoutputtime time)CREATE TABLE lab (labid number,patientunitstayid number,labname text,labresult number,labresulttime time)CREATE TABLE cost (costid number,uniquepid text,patienthealthsyste... | SELECT MIN(intakeoutput.cellvaluenumeric) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-80884' AND patient.hospitaldischargetime IS ... |
how many governors did the union of south africa go through during the reign of george v ? | CREATE TABLE table_203_89 (id number,"#" number,"name\n(birth-death)" text,"took office" text,"left office" text,"monarch" text,"prime minister" text) | SELECT COUNT("name\n(birth-death)") FROM table_203_89 WHERE "monarch" = 'george v' |
What is the name of the team when the stadium is listed as Edward Jones Dome? | CREATE TABLE table_74328 ("Team" text,"Stadium" text,"Home Games" real,"Average Attendance" real,"Total Attendance" real,"Capacity Percentage" text) | SELECT "Team" FROM table_74328 WHERE "Stadium" = 'Edward Jones Dome' |
What is the winning score of the tournament with Charles Coody as the runner-up? | CREATE TABLE table_name_91 (winning_score VARCHAR,runner_s__up VARCHAR) | SELECT winning_score FROM table_name_91 WHERE runner_s__up = "charles coody" |
WHAT IS THE SKIP WITH A THIRD OF DEANNA DOIG? | CREATE TABLE table_name_62 (skip VARCHAR,third VARCHAR) | SELECT skip FROM table_name_62 WHERE third = "deanna doig" |
What is Label, when Date is 1987? | CREATE TABLE table_47951 ("Date" text,"Region" text,"Label" text,"Catalogue" text,"Format" text) | SELECT "Label" FROM table_47951 WHERE "Date" = '1987' |
What constellation has a Declination ( J2000 ) of 32 39 ? | CREATE TABLE table_57107 ("NGC number" real,"Object type" text,"Constellation" text,"Right ascension (J2000)" text,"Declination (J2000)" text) | SELECT "Constellation" FROM table_57107 WHERE "Declination ( J2000 )" = '°32′39″' |
What are the investors that have invested in at least two entrepreneurs? | CREATE TABLE entrepreneur (Investor VARCHAR) | SELECT Investor FROM entrepreneur GROUP BY Investor HAVING COUNT(*) >= 2 |
Which branding has the format of southern country? | CREATE TABLE table_19131921_1 (branding VARCHAR,format VARCHAR) | SELECT branding FROM table_19131921_1 WHERE format = "Southern Country" |
Name the least projected opening | CREATE TABLE table_25294 ("Station" text,"Extension" text,"City/Neighborhood" text,"Projected opening" real,"Transit Connections" text,"Park and ride?" text) | SELECT MIN("Projected opening") FROM table_25294 |
Name the poles for 25th position | CREATE TABLE table_1708050_1 (poles VARCHAR,position VARCHAR) | SELECT poles FROM table_1708050_1 WHERE position = "25th" |
What was the score of the match that took place in the playoff round? | CREATE TABLE table_58510 ("Round" text,"Date" text,"Home Team" text,"Score" text,"Away Team" text,"Crowd" real,"Stadium" text,"Match Details" text) | SELECT "Score" FROM table_58510 WHERE "Round" = 'playoff' |
What is the 1st leg of cs sfaxien? | CREATE TABLE table_6194 ("Team 1" text,"Agg." text,"Team 2" text,"1st leg" text,"2nd leg" text) | SELECT "1st leg" FROM table_6194 WHERE "Team 2" = 'cs sfaxien' |
has patient 26777 had any surgery since 6 years ago? | CREATE TABLE labevents (row_id number,subject_id number,hadm_id number,itemid number,charttime time,valuenum number,valueuom text)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 d_icd_procedures (... | SELECT COUNT(*) > 0 FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 26777) AND DATETIME(procedures_icd.charttime) >= DATETIME(CURRENT_TIME(), '-6 year') |
What is the result for barney frank? | CREATE TABLE table_713 ("District" text,"Incumbent" text,"Party" text,"First elected" real,"Result" text,"Candidates" text) | SELECT "Result" FROM table_713 WHERE "Incumbent" = 'Barney Frank' |
Name the gore number for others % being 5.3% | CREATE TABLE table_23014476_1 (gore__number VARCHAR,others__percentage VARCHAR) | SELECT gore__number FROM table_23014476_1 WHERE others__percentage = "5.3%" |
Which nations have more than 1 gold medal and 4 silver medals? | CREATE TABLE table_43425 ("Rank" text,"Nation" text,"Gold" real,"Silver" real,"Bronze" real,"Total" real) | SELECT "Nation" FROM table_43425 WHERE "Gold" > '1' AND "Silver" = '4' |
What is the language for translators ritah meltser and amatsyah porat? | CREATE TABLE table_55909 ("Year" text,"Language" text,"Title" text,"Translator" text,"Company" text,"Pages" real) | SELECT "Language" FROM table_55909 WHERE "Translator" = 'ritah meltser and amatsyah porat' |
count the number of patients whose primary disease is angioedema and lab test category is blood gas? | 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.diagnosis = "ANGIOEDEMA" AND lab."CATEGORY" = "Blood Gas" |
How many events are in South Africa? | CREATE TABLE table_75332 ("Rank" real,"Player" text,"Country" text,"Earnings ($)" real,"Events" real,"Wins" real) | SELECT SUM("Events") FROM table_75332 WHERE "Country" = 'south africa' |
What Constellation has a Object type of globular cluster and a NGC number of 5986? | CREATE TABLE table_name_17 (constellation VARCHAR,object_type VARCHAR,ngc_number VARCHAR) | SELECT constellation FROM table_name_17 WHERE object_type = "globular cluster" AND ngc_number = 5986 |
Can you tell me the Entrant that has the Laps of 17? | CREATE TABLE table_name_77 (entrant VARCHAR,laps VARCHAR) | SELECT entrant FROM table_name_77 WHERE laps = 17 |
which teams faced off at miller park ? | CREATE TABLE table_203_549 (id number,"player" text,"team" text,"date" text,"opponent" text,"venue" text) | SELECT "team" FROM table_203_549 WHERE "venue" = 'miller park' UNION SELECT "opponent" FROM table_203_549 WHERE "venue" = 'miller park' |
what's the sets won with 140+ being 16 | CREATE TABLE table_18798 ("Player" text,"Played" real,"Sets Won" real,"Sets Lost" real,"Legs Won" real,"Legs Lost" real,"100+" real,"140+" real,"180s" real,"High Checkout" real,"3-dart Average" text) | SELECT "Sets Won" FROM table_18798 WHERE "140+" = '16' |
Which Total has a Finish of t64, and a Year won larger than 2006? | CREATE TABLE table_name_64 (total INTEGER,finish VARCHAR,year_won VARCHAR) | SELECT MAX(total) FROM table_name_64 WHERE finish = "t64" AND year_won > 2006 |
what is the total point difference between the driver who received the most points and the driver who received the least ? | CREATE TABLE table_203_519 (id number,"pos" number,"no" number,"driver" text,"team" text,"laps" number,"time/retired" text,"grid" number,"points" number) | SELECT MAX("points") - MIN("points") FROM table_203_519 |
What is the lowest Opponents, when Raiders Poinsts is greater than 38, and when Attendance is greater than 51,267? | CREATE TABLE table_58787 ("Game" real,"Date" text,"Opponent" text,"Result" text,"Raiders points" real,"Opponents" real,"Raiders first downs" real,"Record" text,"Attendance" real) | SELECT MIN("Opponents") FROM table_58787 WHERE "Raiders points" > '38' AND "Attendance" > '51,267' |
What upper level classes can I take to avoid exams and only do projects ? | CREATE TABLE comment_instructor (instructor_id int,student_id int,score int,comment_text varchar)CREATE TABLE student (student_id int,lastname varchar,firstname varchar,program_id int,declare_major varchar,total_credit int,total_gpa float,entered_as varchar,admit_term int,predicted_graduation_semester int,degree varcha... | SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN program_course ON program_course.course_id = course.course_id WHERE course.has_exams = 'N' AND course.has_projects = 'Y' AND program_course.category LIKE 'ULCS' |
What is the played number with points 1 is 80, and goals for is more than 77? | CREATE TABLE table_46850 ("Position" real,"Team" text,"Played" real,"Drawn" real,"Lost" real,"Goals For" real,"Goals Against" real,"Goal Difference" text,"Points 1" text) | SELECT COUNT("Played") FROM table_46850 WHERE "Points 1" = '80' AND "Goals For" > '77' |
In italy, when the stolen ends were 10 and blank ends were under 14, what's the lowest ends won? | CREATE TABLE table_43950 ("Locale" text,"Skip" text,"Ends Won" real,"Ends Lost" real,"Blank Ends" real,"Stolen Ends" real,"Shot %" text) | SELECT MIN("Ends Won") FROM table_43950 WHERE "Stolen Ends" = '10' AND "Locale" = 'italy' AND "Blank Ends" < '14' |
What was the percentage of safari when internet explorer was 20.27%? | CREATE TABLE table_65408 ("Date" text,"Internet Explorer" text,"Chrome" text,"Firefox" text,"Safari" text) | SELECT "Safari" FROM table_65408 WHERE "Internet Explorer" = '20.27%' |
What chassis is on the car repped by team rahal letterman lanigan racing? | CREATE TABLE table_2503102_2 (chassis VARCHAR,team VARCHAR) | SELECT chassis FROM table_2503102_2 WHERE team = "Rahal Letterman Lanigan Racing" |
What are the number of the descriptions of the categories that products with product descriptions that contain the letter t are in?, I want to display by the names in descending please. | CREATE TABLE Ref_Colors (color_code VARCHAR(15),color_description VARCHAR(80))CREATE TABLE Products (product_id INTEGER,color_code VARCHAR(15),product_category_code VARCHAR(15),product_name VARCHAR(80),typical_buying_price VARCHAR(20),typical_selling_price VARCHAR(20),product_description VARCHAR(255),other_product_deta... | 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 ORDER BY product_category_description DESC |
in 11/last year, when did patient 030-64961 get a first lab test? | CREATE TABLE cost (costid number,uniquepid text,patienthealthsystemstayid number,eventtype text,eventid number,chargetime time,cost number)CREATE TABLE treatment (treatmentid number,patientunitstayid number,treatmentname text,treatmenttime time)CREATE TABLE intakeoutput (intakeoutputid number,patientunitstayid number,c... | 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 = '030-64961')) AND DATETIME(lab.labresulttime, 'start of year') = DATETIME(CURRENT_TI... |
subject states that he / she has end stage organ failure | CREATE TABLE table_dev_2 ("id" int,"nutrient_absorption" bool,"systolic_blood_pressure_sbp" int,"active_metabolic" bool,"hepatic_disease" bool,"surgery" bool,"diastolic_blood_pressure_dbp" int,"gastrointestinal_disease" bool,"organ_failure" bool,"NOUSE" float) | SELECT * FROM table_dev_2 WHERE organ_failure = 1 |
Compute the number of each type of job ids for employees who make more than the highest-earning employee with title PU_MAN, with a bar chart, sort in descending by the names. | 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 jobs (JOB_ID v... | SELECT JOB_ID, COUNT(JOB_ID) FROM employees WHERE SALARY > (SELECT MAX(SALARY) FROM employees WHERE JOB_ID = 'PU_MAN') GROUP BY JOB_ID ORDER BY JOB_ID DESC |
count the number of patients whose age is less than 47 and days of hospital stay is greater than 6? | 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.age < "47" AND demographic.days_stay > "6" |
3rd Runner-up of 2, and a Country/Territory of venezuela has what sum of 4th runner-up? | CREATE TABLE table_39338 ("Rank" real,"Country/Territory" text,"Miss World" real,"1st Runner-up" real,"2nd Runner-up" real,"3rd Runner-up" real,"4th Runner-up" real,"5th Runner-up" real,"6th Runner-up" real,"Semifinalists" real,"Total" real) | SELECT SUM("4th Runner-up") FROM table_39338 WHERE "3rd Runner-up" = '2' AND "Country/Territory" = 'venezuela' |
Return a scatter chart on how many distinct order ids correspond to each product? | CREATE TABLE Invoices (invoice_number INTEGER,order_id INTEGER,invoice_date DATETIME)CREATE TABLE Customers (customer_id INTEGER,customer_first_name VARCHAR(50),customer_middle_initial VARCHAR(1),customer_last_name VARCHAR(50),gender VARCHAR(1),email_address VARCHAR(255),login_name VARCHAR(80),login_password VARCHAR(20... | SELECT product_id, COUNT(DISTINCT order_id) FROM Order_Items |
what is the number of patients whose year of birth is less than 2104 and drug route is td? | CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text,formulary_drug_cd text,route text,drug_dose text)CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital_status text,age text,dob text,gender text,language text,religion text,admission_type text,days_stay ... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.dob_year < "2104" AND prescriptions.route = "TD" |
How many draws did Durham have? | CREATE TABLE table_name_72 (draws VARCHAR,team VARCHAR) | SELECT draws FROM table_name_72 WHERE team = "durham" |
What was the lowest pick number for a united states player picked before round 7? | CREATE TABLE table_45041 ("Round" real,"Pick" real,"Player" text,"Nationality" text,"College/junior/club team" text) | SELECT MIN("Pick") FROM table_45041 WHERE "Round" > '7' AND "Nationality" = 'united states' |
What is the average gold of the winter athlete with 1 bronze, less than 3 silver, and less than 4 total medals? | CREATE TABLE table_name_64 (gold INTEGER,total VARCHAR,silver VARCHAR,bronze VARCHAR,type VARCHAR) | SELECT AVG(gold) FROM table_name_64 WHERE bronze = 1 AND type = "winter" AND silver < 3 AND total < 4 |
Show the number of documents in different ending date and group by ending date with a line chart, and display in desc by the X. | CREATE TABLE Document_Locations (Document_ID INTEGER,Location_Code CHAR(15),Date_in_Location_From DATETIME,Date_in_Locaton_To DATETIME)CREATE TABLE All_Documents (Document_ID INTEGER,Date_Stored DATETIME,Document_Type_Code CHAR(15),Document_Name CHAR(255),Document_Description CHAR(255),Other_Details VARCHAR(255))CREATE... | SELECT Date_in_Locaton_To, COUNT(Date_in_Locaton_To) FROM Document_Locations GROUP BY Date_in_Locaton_To ORDER BY Date_in_Locaton_To DESC |
count the number of patients whose procedure long title is (aorto)coronary bypass of two coronary arteries and lab test fluid is urine. | 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 procedures ON demographic.hadm_id = procedures.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE procedures.long_title = "(Aorto)coronary bypass of two coronary arteries" AND lab.fluid = "Urine" |
Find all users who have written tips for ' Barrio Cafe ' in 2015 | CREATE TABLE user (uid int,user_id varchar,name varchar)CREATE TABLE review (rid int,business_id varchar,user_id varchar,rating float,text longtext,year int,month varchar)CREATE TABLE checkin (cid int,business_id varchar,count int,day varchar)CREATE TABLE tip (tip_id int,business_id varchar,text longtext,user_id varcha... | SELECT user.name FROM business, tip, user WHERE business.name = 'Barrio Cafe' AND tip.business_id = business.business_id AND tip.year = 2015 AND user.user_id = tip.user_id |
What teams has a home of 1-0, in the season 1988-89? | CREATE TABLE table_name_27 (teams VARCHAR,home VARCHAR,season VARCHAR) | SELECT teams FROM table_name_27 WHERE home = "1-0" AND season = "1988-89" |
What is the total number of all football games played by scholarship students? | CREATE TABLE student (stuid number,lname text,fname text,age number,sex text,major number,advisor number,city_code text)CREATE TABLE video_games (gameid number,gname text,gtype text)CREATE TABLE plays_games (stuid number,gameid number,hours_played number)CREATE TABLE sportsinfo (stuid number,sportname text,hoursperweek... | SELECT SUM(gamesplayed) FROM sportsinfo WHERE sportname = "Football" AND onscholarship = 'Y' |
What is the average total for Tiger Woods? | CREATE TABLE table_name_26 (total INTEGER,player VARCHAR) | SELECT AVG(total) FROM table_name_26 WHERE player = "tiger woods" |
Which artist has a Spoofed title in June 1992? | CREATE TABLE table_40255 ("Spoofed Title" text,"Actual Title" text,"Writer" text,"Artist" text,"Issue" real,"Date" text) | SELECT "Artist" FROM table_40255 WHERE "Date" = 'june 1992' |
Which Title has a Type of album in 1983? | CREATE TABLE table_name_34 (title VARCHAR,type VARCHAR,year VARCHAR) | SELECT title FROM table_name_34 WHERE type = "album" AND year = 1983 |
All tags of questions with tag in year and month. | 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 ReviewTaskTypes (Id number,Name text,Description text)CREATE TA... | SELECT PostTags.PostId, Tags.TagName, PostTags.TagId FROM PostTags INNER JOIN Posts ON PostTags.PostId = Posts.Id INNER JOIN Tags ON PostTags.TagId = Tags.Id WHERE PostTags.PostId IN (SELECT Posts.Id FROM Posts INNER JOIN PostTags ON Posts.Id = PostTags.PostId INNER JOIN Tags ON PostTags.TagId = Tags.Id WHERE YEAR(Post... |
Which Mountain Range has a Region of haiti, and a Location of 18.3601 n 71.9764 w? | CREATE TABLE table_77143 ("Rank" real,"Mountain Peak" text,"Region" text,"Mountain Range" text,"Location" text) | SELECT "Mountain Range" FROM table_77143 WHERE "Region" = 'haiti' AND "Location" = '18.3601°n 71.9764°w' |
what is the average amount of hospital cost which includes a ck-mb index testing lab test during this year? | CREATE TABLE patients (row_id number,subject_id number,gender text,dob time,dod time)CREATE TABLE d_labitems (row_id number,itemid number,label text)CREATE TABLE 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... | SELECT AVG(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.hadm_id IN (SELECT labevents.hadm_id FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'ck-mb index')) AND DATETIME(cost.chargetime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of ye... |
For those records from the products and each product's manufacturer, draw a bar chart about the distribution of founder and the average of manufacturer , and group by attribute founder, and could you sort by the X in desc? | 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(Manufacturer) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder ORDER BY Founder DESC |
what stadium has a prior record of 7th? | CREATE TABLE table_name_8 (stadium VARCHAR,past_season VARCHAR) | SELECT stadium FROM table_name_8 WHERE past_season = "7th" |
What are names of patients who made an appointment? | CREATE TABLE trained_in (physician number,treatment number,certificationdate time,certificationexpires time)CREATE TABLE nurse (employeeid number,name text,position text,registered boolean,ssn number)CREATE TABLE block (blockfloor number,blockcode number)CREATE TABLE appointment (appointmentid number,patient number,pre... | SELECT name FROM appointment AS T1 JOIN patient AS T2 ON T1.patient = T2.ssn |
How many golds have a Bronze of 0, a Total larger than 1, a Nation of chad, and a Silver larger than 0? | CREATE TABLE table_name_34 (gold INTEGER,silver VARCHAR,nation VARCHAR,bronze VARCHAR,total VARCHAR) | SELECT SUM(gold) FROM table_name_34 WHERE bronze = 0 AND total > 1 AND nation = "chad" AND silver > 0 |
who is the dudley tuckey medal where leading goalkicker is scott simister (46) | CREATE TABLE table_16999 ("Season" real,"Position" real,"Win/Loss" text,"Coach" text,"Captain" text,"Dudley Tuckey Medal" text,"Leading goalkicker" text) | SELECT "Dudley Tuckey Medal" FROM table_16999 WHERE "Leading goalkicker" = 'Scott Simister (46)' |
Visualize a bar chart for what are the average ages for male and female students? | CREATE TABLE Student (StuID INTEGER,LName VARCHAR(12),Fname VARCHAR(12),Age INTEGER,Sex VARCHAR(1),Major INTEGER,Advisor INTEGER,city_code VARCHAR(3))CREATE TABLE Allergy_Type (Allergy VARCHAR(20),AllergyType VARCHAR(20))CREATE TABLE Has_Allergy (StuID INTEGER,Allergy VARCHAR(20)) | SELECT Sex, AVG(Age) FROM Student GROUP BY Sex |
What is catcher Josh Donaldson's pick number? | CREATE TABLE table_52634 ("Pick" real,"Player" text,"Team" text,"Position" text,"School" text) | SELECT "Pick" FROM table_52634 WHERE "Position" = 'catcher' AND "Player" = 'josh donaldson' |
What team has jordan 193 chassis after 1990? | CREATE TABLE table_name_61 (team VARCHAR,year VARCHAR,chassis VARCHAR) | SELECT team FROM table_name_61 WHERE year > 1990 AND chassis = "jordan 193" |
When does the next 872 taught by Sara Holliday happen ? | CREATE TABLE requirement (requirement_id int,requirement varchar,college varchar)CREATE TABLE offering_instructor (offering_instructor_id int,offering_id int,instructor_id int)CREATE TABLE program_requirement (program_id int,category varchar,min_credit int,additional_req varchar)CREATE TABLE comment_instructor (instruc... | SELECT DISTINCT semester.semester, semester.year FROM course, course_offering, instructor, offering_instructor, semester WHERE course.course_id = course_offering.course_id AND course.number = 872 AND course_offering.semester = semester.semester_id AND instructor.name LIKE '%Sara Holliday%' AND offering_instructor.instr... |
did patient 022-6959 ever excrete any urine during this month? | CREATE TABLE vitalperiodic (vitalperiodicid number,patientunitstayid number,temperature number,sao2 number,heartrate number,respiration number,systemicsystolic number,systemicdiastolic number,systemicmean number,observationtime time)CREATE TABLE intakeoutput (intakeoutputid number,patientunitstayid number,cellpath text... | SELECT COUNT(*) > 0 FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '022-6959')) AND intakeoutput.cellpath LIKE '%output%' AND intakeoutput... |
From how many years did tampa, FL depart? | CREATE TABLE table_8846 ("Year" real,"Ship" text,"Departed From" text,"Departed On" text,"Returned On" text) | SELECT SUM("Year") FROM table_8846 WHERE "Departed From" = 'tampa, fl' |
Which CFL team got pick 34? | CREATE TABLE table_30108930_6 (cfl_team VARCHAR,pick__number VARCHAR) | SELECT cfl_team FROM table_30108930_6 WHERE pick__number = 34 |
retrieve patient ids of individuals who have been diagnosed with cardiac arrest until 4 years ago. | CREATE TABLE vitalperiodic (vitalperiodicid number,patientunitstayid number,temperature number,sao2 number,heartrate number,respiration number,systemicsystolic number,systemicdiastolic number,systemicmean number,observationtime time)CREATE TABLE treatment (treatmentid number,patientunitstayid number,treatmentname text,... | SELECT patient.uniquepid FROM patient WHERE patient.patientunitstayid IN (SELECT diagnosis.patientunitstayid FROM diagnosis WHERE diagnosis.diagnosisname = 'cardiac arrest' AND DATETIME(diagnosis.diagnosistime) <= DATETIME(CURRENT_TIME(), '-4 year')) |
Which district had a first elected in 1882 with a result of re-elected? | CREATE TABLE table_36247 ("District" text,"Incumbent" text,"Party" text,"First elected" real,"Result" text) | SELECT "District" FROM table_36247 WHERE "First elected" = '1882' AND "Result" = 're-elected' |
how many patients are with single marital status and diagnosed with other preterm infants, 2500 grams and over? | CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital_status text,age text,dob text,gender text,language text,religion text,admission_type text,days_stay text,insurance text,ethnicity text,expire_flag... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.marital_status = "SINGLE" AND diagnoses.long_title = "Other preterm infants, 2,500 grams and over" |
Posts and Views by Date Range and Display Name. | CREATE TABLE Badges (Id number,UserId number,Name text,Date time,Class number,TagBased boolean)CREATE TABLE CloseAsOffTopicReasonTypes (Id number,IsUniversal boolean,InputTitle text,MarkdownInputGuidance text,MarkdownPostOwnerGuidance text,MarkdownPrivilegedUserGuidance text,MarkdownConcensusDescription text,CreationDa... | SELECT PostType = pt.Name, Posts = COUNT(*), Views = SUM(COALESCE(p.ViewCount, parent.ViewCount)), Start = TIME_TO_STR(@startDate, '%B'), Finish = TIME_TO_STR(@endDate, '%B') FROM Posts AS p LEFT JOIN Posts AS parent ON p.ParentId = parent.Id JOIN Users AS u ON p.OwnerUserId = u.Id JOIN PostTypes AS pt ON p.PostTypeId ... |
i'm looking for a flight leaving DENVER traveling to ATLANTA and stopping at PITTSBURGH is this possible | CREATE TABLE time_zone (time_zone_code text,time_zone_name text,hours_from_gmt int)CREATE TABLE code_description (code varchar,description text)CREATE TABLE fare (fare_id int,from_airport varchar,to_airport varchar,fare_basis_code text,fare_airline text,restriction_code text,one_direction_cost int,round_trip_cost int,r... | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, 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 = 'ATLANTA' AND CITY_2.ci... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.