instruction stringlengths 0 1.06k | input stringlengths 11 5.3k | response stringlengths 2 4.44k |
|---|---|---|
Show different types of ships and the average tonnage of ships of each type in a bar chart, and could you sort by the x-axis in ascending please? | CREATE TABLE ship (Ship_ID int,Name text,Type text,Nationality text,Tonnage int)CREATE TABLE mission (Mission_ID int,Ship_ID int,Code text,Launched_Year int,Location text,Speed_knots int,Fate text) | SELECT Type, AVG(Tonnage) FROM ship GROUP BY Type ORDER BY Type |
what were the three most frequent drugs prescribed in the same month to the male patients aged 40s after they had been diagnosed with late ef-hemplga side nos until 4 years ago. | CREATE TABLE diagnoses_icd (row_id number,subject_id number,hadm_id number,icd9_code text,charttime 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 d_icd_proce... | SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime 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_icd_diagnoses WHERE ... |
With the Romaji title of Hanayome Wa Yakudoshi!, what is the Japanese title? | CREATE TABLE table_64493 ("Japanese Title" text,"Romaji Title" text,"TV Station" text,"Episodes" real,"Average Ratings" text) | SELECT "Japanese Title" FROM table_64493 WHERE "Romaji Title" = 'hanayome wa yakudoshi!' |
How many languages have elles as the film title used in nomination? | CREATE TABLE table_22073745_1 (languages VARCHAR,film_title_used_in_nomination VARCHAR) | SELECT COUNT(languages) FROM table_22073745_1 WHERE film_title_used_in_nomination = "Elles" |
Name the most first elected | CREATE TABLE table_2668347_17 (first_elected INTEGER) | SELECT MAX(first_elected) FROM table_2668347_17 |
Which urban area has a 2011 population of 5010? | CREATE TABLE table_22979 ("Rank 2011" real,"Change since 2006" text,"Urban Area" text,"County" text,"Population 2011" real,"Increase since 2006" text) | SELECT "Urban Area" FROM table_22979 WHERE "Population 2011" = '5010' |
How many rounds did the event rings: king of kings 2000 block a have with a record of 6-1? | CREATE TABLE table_name_82 (round VARCHAR,event VARCHAR,record VARCHAR) | SELECT round FROM table_name_82 WHERE event = "rings: king of kings 2000 block a" AND record = "6-1" |
give me the number of patients whose discharge location is home health care and diagnoses long title is acute venous embolism and thrombosis of deep vessels of proximal lower extremity? | CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid 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 diagnoses (subject_id text,hadm_id tex... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.discharge_location = "HOME HEALTH CARE" AND diagnoses.long_title = "Acute venous embolism and thrombosis of deep vessels of proximal lower extremity" |
What version of iWork was released on October 22, 2013 with a pages version greater than 2? | CREATE TABLE table_75472 ("iWork version" text,"Keynote version" real,"Pages version" real,"Numbers version" text,"Release date" text) | SELECT "iWork version" FROM table_75472 WHERE "Release date" = 'october 22, 2013' AND "Pages version" > '2' |
What is the total number of grids for peter gethin? | CREATE TABLE table_78426 ("Driver" text,"Constructor" text,"Laps" real,"Time/Retired" text,"Grid" real) | SELECT SUM("Grid") FROM table_78426 WHERE "Driver" = 'peter gethin' |
Of all the upper level classes , which ones are 8 credits ? | 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,tough_tests int,heavy_papers int,cares_for_students int,heavy_assignments int,respected int,participation int,heavy_reading int,tough_grade... | SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN program_course ON program_course.course_id = course.course_id WHERE course.credits = 8 AND program_course.category LIKE 'ULCS' |
what is the race where the pole position is niki lauda and the date is 27 april? | CREATE TABLE table_1140085_2 (race VARCHAR,pole_position VARCHAR,date VARCHAR) | SELECT race FROM table_1140085_2 WHERE pole_position = "Niki Lauda" AND date = "27 April" |
what is the number of patients whose marital status is widowed and diagnoses icd9 code is 4295? | 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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.marital_status = "WIDOWED" AND diagnoses.icd9_code = "4295" |
Top 10 Iranian GameDeveloper In Stackoverflow. | CREATE TABLE Badges (Id number,UserId number,Name text,Date time,Class number,TagBased boolean)CREATE TABLE SuggestedEdits (Id number,PostId number,CreationDate time,ApprovalDate time,RejectionDate time,OwnerUserId number,Comment text,Text text,Title text,Tags text,RevisionGUID other)CREATE TABLE PostHistory (Id number... | SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation, Location, age FROM Users WHERE LOWER(Location) LIKE '%iran%' OR UPPER(Location) LIKE '%ir' ORDER BY Reputation DESC LIMIT 10 |
For each company id, what are the companies and how many gas stations does each one operate Plot them as bar chart, and order bars in descending order. | CREATE TABLE station_company (Station_ID int,Company_ID int,Rank_of_the_Year int)CREATE TABLE company (Company_ID int,Rank int,Company text,Headquarters text,Main_Industry text,Sales_billion real,Profits_billion real,Assets_billion real,Market_Value real)CREATE TABLE gas_station (Station_ID int,Open_Year int,Location t... | SELECT Company, COUNT(*) FROM station_company AS T1 JOIN company AS T2 ON T1.Company_ID = T2.Company_ID GROUP BY T1.Company_ID ORDER BY Company DESC |
What is the capacity with 2.7v volts and a power-to-weight ratio of 5.44 w/kg c/1 (1.875a)? | CREATE TABLE table_name_11 (capacity VARCHAR,volts VARCHAR,power_to_weight_ratio VARCHAR) | SELECT capacity FROM table_name_11 WHERE volts = "2.7v" AND power_to_weight_ratio = "5.44 w/kg c/1 (1.875a)" |
Name the samurai for stampede of t. mask | CREATE TABLE table_51799 ("Block A" text,"Goto" text,"Jado" text,"Kakihara" text,"Kanemoto" text,"Minoru" text,"Samurai" text,"Stampede" text) | SELECT "Samurai" FROM table_51799 WHERE "Stampede" = 't. mask' |
How many team franchises are active, with active value 'Y'? | CREATE TABLE player_award_vote (award_id text,year number,league_id text,player_id text,points_won number,points_max number,votes_first number)CREATE TABLE player (player_id text,birth_year number,birth_month number,birth_day number,birth_country text,birth_state text,birth_city text,death_year number,death_month numbe... | SELECT COUNT(*) FROM team_franchise WHERE active = 'Y' |
Computer Model papers | CREATE TABLE cite (citingpaperid int,citedpaperid int)CREATE TABLE paper (paperid int,title varchar,venueid int,year int,numciting int,numcitedby int,journalid int)CREATE TABLE journal (journalid int,journalname varchar)CREATE TABLE dataset (datasetid int,datasetname varchar)CREATE TABLE paperkeyphrase (paperid int,key... | SELECT DISTINCT paper.paperid FROM keyphrase, paper, paperkeyphrase WHERE keyphrase.keyphrasename = 'Computer Model' AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paper.paperid = paperkeyphrase.paperid |
Which Particulate size approaching 100% retention has a Usage of semi hepa and a Class of h12? | CREATE TABLE table_44093 ("Usage" text,"Class" text,"Performance" text,"Performance test" text,"Particulate size approaching 100% retention" text,"Test Standard" text) | SELECT "Particulate size approaching 100% retention" FROM table_44093 WHERE "Usage" = 'semi hepa' AND "Class" = 'h12' |
What percentage did Walker win in Calumet county? | CREATE TABLE table_21046399_3 (walker__percentage VARCHAR,county VARCHAR) | SELECT walker__percentage FROM table_21046399_3 WHERE county = "Calumet" |
Find ACC_Road and Team_ID , and group by attribute All_Home, and visualize them by a bar chart, and could you sort by the bar in descending? | CREATE TABLE basketball_match (Team_ID int,School_ID int,Team_Name text,ACC_Regular_Season text,ACC_Percent text,ACC_Home text,ACC_Road text,All_Games text,All_Games_Percent int,All_Home text,All_Road text,All_Neutral text)CREATE TABLE university (School_ID int,School text,Location text,Founded real,Affiliation text,En... | SELECT ACC_Road, Team_ID FROM basketball_match GROUP BY All_Home, ACC_Road ORDER BY ACC_Road DESC |
Who is the developer when the pre-release is no*? | CREATE TABLE table_name_70 (kinka_developer VARCHAR,kinka_pre_release VARCHAR) | SELECT kinka_developer FROM table_name_70 WHERE kinka_pre_release = "no*" |
count the number of patients whose age is less than 70 and diagnoses short title is hemochromatos-rbc trans? | 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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.age < "70" AND diagnoses.short_title = "Hemochromatos-rbc trans" |
What is the Score of the Halifax Town Home game? | CREATE TABLE table_62994 ("Tie no" text,"Home team" text,"Score" text,"Away team" text,"Date" text) | SELECT "Score" FROM table_62994 WHERE "Home team" = 'halifax town' |
What rank is Vaud with the lowest point is Lake Geneva? | CREATE TABLE table_name_19 (rank INTEGER,lowest_point VARCHAR,canton VARCHAR) | SELECT SUM(rank) FROM table_name_19 WHERE lowest_point = "lake geneva" AND canton = "vaud" |
when was the first time patient 17435's heart rate was greater than 41.0 until 05/27/2101. | CREATE TABLE diagnoses_icd (row_id number,subject_id number,hadm_id number,icd9_code text,charttime time)CREATE TABLE procedures_icd (row_id number,subject_id number,hadm_id number,icd9_code text,charttime time)CREATE TABLE prescriptions (row_id number,subject_id number,hadm_id number,startdate time,enddate time,drug t... | SELECT chartevents.charttime 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 = 17435)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'heart ra... |
Which class has a power output larger than 700 and a class of 48? | CREATE TABLE table_name_75 (class VARCHAR,power_output__kw_ VARCHAR,number_in_class VARCHAR) | SELECT class FROM table_name_75 WHERE power_output__kw_ > 700 AND number_in_class = 48 |
What is the upstream with a 150 gb monthly cap? | CREATE TABLE table_9040 ("Plan" text,"Downstream" text,"Upstream" text,"Up:Down Ratio" real,"Monthly Cap" text,"Price" text) | SELECT "Upstream" FROM table_9040 WHERE "Monthly Cap" = '150 gb' |
Name the pole position at the german grand prix | CREATE TABLE table_name_3 (pole_position VARCHAR,grand_prix VARCHAR) | SELECT pole_position FROM table_name_3 WHERE grand_prix = "german grand prix" |
How many patients discharge location is disch-tran to psych hosp and primary diagnosis is ruq pain? | CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid text)CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title ... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.discharge_location = "DISCH-TRAN TO PSYCH HOSP" AND demographic.diagnosis = "RUQ PAIN" |
What is the D 46 when the D 44 is majority? | CREATE TABLE table_name_3 (d_46_√ VARCHAR,d_44_√ VARCHAR) | SELECT d_46_√ FROM table_name_3 WHERE d_44_√ = "← majority" |
Who are the foreign players representing Ekaterinburg? | CREATE TABLE table_14015965_1 (foreign_players__max_2_ VARCHAR,town VARCHAR) | SELECT foreign_players__max_2_ FROM table_14015965_1 WHERE town = "Ekaterinburg" |
Which supercentenarians were born in Manitoba? | CREATE TABLE table_37732 ("Name" text,"Birth date" text,"Age as of 1 February 2014" text,"Province or Country of birth" text,"Province of residence" text) | SELECT "Name" FROM table_37732 WHERE "Province or Country of birth" = 'manitoba' |
What was the location the fight was held at that lasted 5 rounds? | CREATE TABLE table_50637 ("Res." text,"Record" text,"Opponent" text,"Method" text,"Round" text,"Location" text) | SELECT "Location" FROM table_50637 WHERE "Round" = '5' |
Which Pick # is the highest one that has an Overall larger than 21, and a College of north carolina, and a Round smaller than 3? | CREATE TABLE table_name_14 (pick__number INTEGER,round VARCHAR,overall VARCHAR,college VARCHAR) | SELECT MAX(pick__number) FROM table_name_14 WHERE overall > 21 AND college = "north carolina" AND round < 3 |
Which T.C. has a Win of 1, and a Race of 21? | CREATE TABLE table_name_40 (tc VARCHAR,wins VARCHAR,races VARCHAR) | SELECT tc FROM table_name_40 WHERE wins = 1 AND races = 21 |
How many times was obamacare: fed/ state/ partnership recorded for Louisiana? | CREATE TABLE table_19505 ("Rank" real,"State" text,"Revenue (millions)" text,"Population" real,"Revenue per capita" text,"Spending (millions)" text,"Spending per capita" text,"Net contribution per capita" text,"Presidential majority 2000/2004" text,"Presidential majority 2008" text,"Presidential majority 2012" text,"Ob... | SELECT COUNT("Obamacare: Fed/ State/ Partnership") FROM table_19505 WHERE "State" = 'Louisiana' |
WHich Province of Silla has a Modern equivalent of south jeolla, and a Administrative district of seungju? | CREATE TABLE table_7762 ("Province of Silla" text,"Administrative district" text,"Pre-1009 province" text,"Post-1009 province" text,"Modern equivalent" text) | SELECT "Province of Silla" FROM table_7762 WHERE "Modern equivalent" = 'south jeolla' AND "Administrative district" = 'seungju' |
For those records from the products and each product's manufacturer, return a bar chart about the distribution of founder and the sum of revenue , and group by attribute founder, could you display by the total number from low to high please? | 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 Founder, SUM(Revenue) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder ORDER BY SUM(Revenue) |
which political party has the most people in office ? | CREATE TABLE table_204_293 (id number,"district" number,"name" text,"party" text,"district office" text,"first elected" number) | SELECT "party" FROM table_204_293 GROUP BY "party" ORDER BY COUNT(*) DESC LIMIT 1 |
What is the largest attendance on august 10, 1963, and a week larger than 1? | CREATE TABLE table_33563 ("Week" real,"Date" text,"Opponent" text,"Result" text,"Attendance" real) | SELECT MAX("Attendance") FROM table_33563 WHERE "Date" = 'august 10, 1963' AND "Week" > '1' |
What is the title of the story published on October 19, 2011? | CREATE TABLE table_name_42 (story VARCHAR,date VARCHAR) | SELECT story FROM table_name_42 WHERE date = "october 19, 2011" |
WHAT IS THE PLAYER WITH A PICK OF 219? | CREATE TABLE table_48551 ("Round" real,"Pick" real,"Player" text,"Nationality" text,"College" text) | SELECT "Player" FROM table_48551 WHERE "Pick" = '219' |
provide the number of patients whose procedure icd9 code is 4105 and drug type is base? | 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 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 tex... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE procedures.icd9_code = "4105" AND prescriptions.drug_type = "BASE" |
how many networks have more affiliates than canal de las estrellas ? | CREATE TABLE table_204_796 (id number,"network name" text,"flagship" text,"programming type" text,"owner" text,"affiliates" number) | SELECT COUNT("network name") FROM table_204_796 WHERE "affiliates" > (SELECT "affiliates" FROM table_204_796 WHERE "network name" = 'canal de las estrellas') |
What is Game, when Road Team is 'Syracuse', and when Result is '109-82'? | CREATE TABLE table_60403 ("Game" text,"Date" text,"Home Team" text,"Result" text,"Road Team" text) | SELECT "Game" FROM table_60403 WHERE "Road Team" = 'syracuse' AND "Result" = '109-82' |
How many debut years have Years at club of 1950 1951, and Games larger than 14? | CREATE TABLE table_64234 ("Debut year" real,"Player" text,"Games" real,"Goals" real,"Years at club" text) | SELECT SUM("Debut year") FROM table_64234 WHERE "Years at club" = '1950–1951' AND "Games" > '14' |
What is Title, when Studio is 'Embassy Pictures'? | CREATE TABLE table_name_48 (title VARCHAR,studio VARCHAR) | SELECT title FROM table_name_48 WHERE studio = "embassy pictures" |
Please return me a bar chart show what are the total smallest rating of different movie title?, and list in ascending by the X. | CREATE TABLE Movie (mID int,title text,year int,director text)CREATE TABLE Rating (rID int,mID int,stars int,ratingDate date)CREATE TABLE Reviewer (rID int,name text) | SELECT T2.title, SUM(MIN(T1.stars)) FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID GROUP BY T2.title ORDER BY T2.title |
Saint-Jacques has what as the area km 2? | CREATE TABLE table_48639 ("Official Name" text,"Status" text,"Area km 2" real,"Population" real,"Census Ranking" text) | SELECT "Area km 2" FROM table_48639 WHERE "Official Name" = 'saint-jacques' |
How many departments for each building? Draw a bar chart, and show by the bar in ascending. | CREATE TABLE classroom (building varchar(15),room_number varchar(7),capacity numeric(4,0))CREATE TABLE advisor (s_ID varchar(5),i_ID varchar(5))CREATE TABLE section (course_id varchar(8),sec_id varchar(8),semester varchar(6),year numeric(4,0),building varchar(15),room_number varchar(7),time_slot_id varchar(4))CREATE TA... | SELECT building, COUNT(building) FROM department GROUP BY building ORDER BY building |
Who directed the episode with a production code greater than 4301103.585233785 that was written by Curtis Kheel? | CREATE TABLE table_21312845_1 (directed_by VARCHAR,production_code VARCHAR,written_by VARCHAR) | SELECT directed_by FROM table_21312845_1 WHERE production_code > 4301103.585233785 AND written_by = "Curtis Kheel" |
How many times was Jillian Grace the centerfold model? | CREATE TABLE table_1566852_6 (date VARCHAR,centerfold_model VARCHAR) | SELECT COUNT(date) FROM table_1566852_6 WHERE centerfold_model = "Jillian Grace" |
Name the type and dosage of Phenazopyridine HCl. | 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 prescriptions.drug_type, prescriptions.drug_dose FROM prescriptions WHERE prescriptions.drug = "Phenazopyridine HCl" |
What name has 50 as the number? | CREATE TABLE table_name_54 (name VARCHAR,number VARCHAR) | SELECT name FROM table_name_54 WHERE number = "50" |
Which 2003 has a 2013 of 1r, and a 2007 of 2r? | CREATE TABLE table_name_99 (Id VARCHAR) | SELECT 2003 FROM table_name_99 WHERE 2013 = "1r" AND 2007 = "2r" |
Compare the prices of each manufacturer's most expensive product with a bar chart, and list in descending by the price. | 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 T2.Name, MAX(T1.Price) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name ORDER BY MAX(T1.Price) DESC |
What is the socket when the sSpec number is standard power? | CREATE TABLE table_name_96 (socket VARCHAR,sspec_number VARCHAR) | SELECT socket FROM table_name_96 WHERE sspec_number = "standard power" |
During what weak of the season was the game played on october 4, 1987? | CREATE TABLE table_13258806_2 (week INTEGER,date VARCHAR) | SELECT MAX(week) FROM table_13258806_2 WHERE date = "October 4, 1987" |
Which style led to a score given by Tor Floysvik of 8? | CREATE TABLE table_30679 ("Couple" text,"Style" text,"Music" text,"Trine Dehli Cleve" real,"Tor Fl\u00f8ysvik" real,"Karianne Gulliksen" real,"Christer Tornell" real,"Total" real) | SELECT "Style" FROM table_30679 WHERE "Tor Fl\u00f8ysvik" = '8' |
What is Motherwell Team's manner of departure? | CREATE TABLE table_name_57 (manner_of_departure VARCHAR,team VARCHAR) | SELECT manner_of_departure FROM table_name_57 WHERE team = "motherwell" |
What is the to par of player tom weiskopf, who has a 71-74=145 score? | CREATE TABLE table_77461 ("Place" text,"Player" text,"Country" text,"Score" text,"To par" text) | SELECT "To par" FROM table_77461 WHERE "Score" = '71-74=145' AND "Player" = 'tom weiskopf' |
how many patients whose admission location is clinic referral/premature and primary disease is newborn? | CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid 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 WHERE demographic.admission_location = "CLINIC REFERRAL/PREMATURE" AND demographic.diagnosis = "NEWBORN" |
Give me the dates when the max temperature was higher than 85, and count them by a line chart, order X in desc order. | CREATE TABLE trip (id INTEGER,duration INTEGER,start_date TEXT,start_station_name TEXT,start_station_id INTEGER,end_date TEXT,end_station_name TEXT,end_station_id INTEGER,bike_id INTEGER,subscription_type TEXT,zip_code INTEGER)CREATE TABLE status (station_id INTEGER,bikes_available INTEGER,docks_available INTEGER,time ... | SELECT date, COUNT(date) FROM weather WHERE max_temperature_f > 85 GROUP BY date ORDER BY date DESC |
list all flights going from BOSTON to ATLANTA on wednesday after 1800 o'clock pm on wednesday | CREATE TABLE code_description (code varchar,description text)CREATE TABLE flight_leg (flight_id int,leg_number int,leg_flight int)CREATE TABLE aircraft (aircraft_code varchar,aircraft_description varchar,manufacturer varchar,basic_type varchar,engines int,propulsion varchar,wide_body varchar,wing_span int,length int,we... | 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 ((date_day.day_number = 23 AND date_day.month_number = 4 AND date_day.year = 1991 AND days.day_name = date_day.day_name AND flight.departure_time... |
what is the time/retired when the laps is 52? | CREATE TABLE table_77794 ("Driver" text,"Constructor" text,"Laps" real,"Time/Retired" text,"Grid" real) | SELECT "Time/Retired" FROM table_77794 WHERE "Laps" = '52' |
What is the sum of Year, when Publication is 'VH1', and when Rank is greater than 11? | CREATE TABLE table_44202 ("Publication" text,"Country" text,"Accolade" text,"Year" real,"Rank" real) | SELECT SUM("Year") FROM table_44202 WHERE "Publication" = 'vh1' AND "Rank" > '11' |
Which pick did Michel Larocque receive? | CREATE TABLE table_2840500_6 (pick VARCHAR,player VARCHAR) | SELECT pick FROM table_2840500_6 WHERE player = "Michel Larocque" |
what is the number of patients whose days of hospital stay is greater than 11 and lab test name is potassium? | 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 lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.days_stay > "11" AND lab.label = "Potassium" |
Name the males for language of persons that didn't name their native language | CREATE TABLE table_71006 ("Language" text,"Number" text,"percentage (%)" text,"males" text,"females" text) | SELECT "males" FROM table_71006 WHERE "Language" = 'persons that didn''t name their native language' |
Which Venue has a Home team of essendon? | CREATE TABLE table_name_47 (venue VARCHAR,home_team VARCHAR) | SELECT venue FROM table_name_47 WHERE home_team = "essendon" |
What is Time/Retired, when Team is 'Team Vodafone', and when Grid is greater than 4? | CREATE TABLE table_name_16 (time_retired VARCHAR,team VARCHAR,grid VARCHAR) | SELECT time_retired FROM table_name_16 WHERE team = "team vodafone" AND grid > 4 |
On what date was the result Wi by 1 run? | CREATE TABLE table_67800 ("Date" text,"Home captain" text,"Away captain" text,"Venue" text,"Result" text) | SELECT "Date" FROM table_67800 WHERE "Result" = 'wi by 1 run' |
What is the total population of American Samoa (US) that has less than 16,280 km arable land, less than 240 km land area, and has a population density of more than 291? | CREATE TABLE table_46090 ("Country" text,"Population (July 2005 est.)" real,"Land Area (km\u00b2)" real,"% of arable land (2005 est.)" text,"Arable Land (km\u00b2)" real,"Population Density (pop per km\u00b2)" real) | SELECT COUNT("Population (July 2005 est.)") FROM table_46090 WHERE "Arable Land (km\u00b2)" < '16,280' AND "Land Area (km\u00b2)" < '240' AND "Country" = 'american samoa (us)' AND "Population Density (pop per km\u00b2)" > '291' |
Name the location of ufc 98 | CREATE TABLE table_32124 ("Res." text,"Record" text,"Opponent" text,"Method" text,"Event" text,"Round" real,"Time" text,"Location" text) | SELECT "Location" FROM table_32124 WHERE "Event" = 'ufc 98' |
What are the names and ids of customers whose address contains TN? | CREATE TABLE customers (customer_name VARCHAR,customer_id VARCHAR,customer_address VARCHAR) | SELECT customer_name, customer_id FROM customers WHERE customer_address LIKE "%TN%" |
what was the minimum daily number of patients diagnosed with bipol i currnt manic nos? | CREATE TABLE diagnoses_icd (row_id number,subject_id number,hadm_id number,icd9_code text,charttime 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 d_icd_proce... | SELECT MIN(t1.c1) FROM (SELECT COUNT(DISTINCT diagnoses_icd.hadm_id) AS c1 FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'bipol i currnt manic nos') GROUP BY STRFTIME('%y-%m-%d', diagnoses_icd.charttime)) AS t1 |
List the number of long range shors where the score is 171. | CREATE TABLE table_27176 ("Player" text,"Minutes" real,"Field Goals" real,"Rebounds" real,"Assists" real,"Steals" real,"Blocks" real,"Points" real) | SELECT COUNT("Field Goals") FROM table_27176 WHERE "Points" = '171' |
Which country has Hydra Head Records on February 2005? | CREATE TABLE table_39026 ("Country" text,"Date" text,"Label" text,"Format" text,"Catalogue #" text) | SELECT "Country" FROM table_39026 WHERE "Label" = 'hydra head records' AND "Date" = 'february 2005' |
What county is in isolation of 29? | CREATE TABLE table_17584 ("Rank" real,"Peak" text,"Elevation (m)" real,"Prominence (m)" real,"Isolation (km)" real,"Municipality" text,"County" text) | SELECT "County" FROM table_17584 WHERE "Isolation (km)" = '29' |
What was the highest number of starts in 2007 when the average start was over 17.6? | CREATE TABLE table_50059 ("Year" real,"Starts" real,"Wins" real,"Top 5" real,"Top 10" real,"Poles" real,"Avg. Start" real,"Avg. Finish" real,"Winnings" text,"Position" text,"Team(s)" text) | SELECT MAX("Starts") FROM table_50059 WHERE "Year" = '2007' AND "Avg. Start" > '17.6' |
what are the original air dates with a title of 'spare Parts | CREATE TABLE table_17279 ("Series #" real,"Season #" real,"Title" text,"Directed by" text,"Written by" text,"Original air date" text,"Production code" text) | SELECT "Original air date" FROM table_17279 WHERE "Title" = 'Spare Parts' |
When the Away team is melbourne, what's the lowest Crowd attended? | CREATE TABLE table_name_42 (crowd INTEGER,away_team VARCHAR) | SELECT MIN(crowd) FROM table_name_42 WHERE away_team = "melbourne" |
What questions are marked as favorite by a user?. | CREATE TABLE ReviewTasks (Id number,ReviewTaskTypeId number,CreationDate time,DeletionDate time,ReviewTaskStateId number,PostId number,SuggestedEditId number,CompletedByReviewTaskId number)CREATE TABLE Votes (Id number,PostId number,VoteTypeId number,UserId number,CreationDate time,BountyAmount number)CREATE TABLE Revi... | SELECT Posts.OwnerUserId AS "user_link", Posts.Id AS "post_link" FROM Posts JOIN Votes ON Posts.Id = Votes.PostId WHERE Votes.VoteTypeId = 5 AND Posts.PostTypeId = 1 AND Votes.UserId = '##UserId##' |
Who did the Raptors play when their record was 45-36? | CREATE TABLE table_13619135_8 (team VARCHAR,record VARCHAR) | SELECT team FROM table_13619135_8 WHERE record = "45-36" |
Which game did rudy gay (12) have the highest points? | CREATE TABLE table_27756474_2 (game VARCHAR,high_points VARCHAR) | SELECT game FROM table_27756474_2 WHERE high_points = "Rudy Gay (12)" |
Who's the director of Buddy of the Apes? | CREATE TABLE table_name_80 (director VARCHAR,title VARCHAR) | SELECT director FROM table_name_80 WHERE title = "buddy of the apes" |
tell me the amount of output patient 015-58787 has had today? | CREATE TABLE intakeoutput (intakeoutputid number,patientunitstayid number,cellpath text,celllabel text,cellvaluenumeric number,intakeoutputtime time)CREATE TABLE medication (medicationid number,patientunitstayid number,drugname text,dosage text,routeadmin text,drugstarttime time,drugstoptime time)CREATE TABLE diagnosis... | SELECT SUM(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 = '015-58787')) AND intakeoutput.cellpath LIKE '%ou... |
what are the three most frequent drugs that were prescribed to the endocarditis - native valve female patients 50s during this year in the same month after being diagnosed with endocarditis - native valve? | 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 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 = 'endocarditis - native valve' AND DATETIME(diagnosi... |
what is total number of bronze medals for slovakia ? | CREATE TABLE table_203_653 (id number,"rank" number,"nation" text,"gold" number,"silver" number,"bronze" number,"total" number) | SELECT "bronze" FROM table_203_653 WHERE "nation" = 'slovakia' |
Who was the home team when the record was 2-3? | CREATE TABLE table_50367 ("Date" text,"Visitor" text,"Score" text,"Home" text,"Record" text) | SELECT "Home" FROM table_50367 WHERE "Record" = '2-3' |
For those records from the products and each product's manufacturer, draw a bar chart about the distribution of name and the amount of name , and group by attribute name, and rank in ascending by the Y-axis. | 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.Name, COUNT(T1.Name) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name ORDER BY COUNT(T1.Name) |
Find All_Neutral and Team_ID , and visualize them by a bar chart, list in ascending by the names. | 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 All_Neutral |
What is the Class AAAAA when the Class AAA is Gonzales? | CREATE TABLE table_35669 ("School Year" text,"Class A" text,"Class AA" text,"Class AAA" text,"Class AAAA" text,"Class AAAAA" text) | SELECT "Class AAAA" FROM table_35669 WHERE "Class AAA" = 'gonzales' |
Average views for a scored question. | CREATE TABLE Votes (Id number,PostId number,VoteTypeId number,UserId number,CreationDate time,BountyAmount number)CREATE TABLE PostNoticeTypes (Id number,ClassId number,Name text,Body text,IsHidden boolean,Predefined boolean,PostNoticeDurationId number)CREATE TABLE Comments (Id number,PostId number,Score number,Text te... | SELECT AVG(CAST(p1.ViewCount AS FLOAT)) AS avgViews FROM Posts AS p1 WHERE p1.PostTypeId = 1 AND p1.Score > 0 |
Which Nationality has a Name of igor koleda? | CREATE TABLE table_67226 ("Rank" real,"Lane" real,"Name" text,"Nationality" text,"Time" text) | SELECT "Nationality" FROM table_67226 WHERE "Name" = 'igor koleda' |
What's the position of the player from Germantown, TN? | CREATE TABLE table_17049 ("Player" text,"Position" text,"School" text,"Hometown" text,"MLB Draft" text) | SELECT "Position" FROM table_17049 WHERE "Hometown" = 'Germantown, TN' |
Who is the candidate in Race for State representative, hd18? | CREATE TABLE table_name_57 (candidate VARCHAR,race VARCHAR) | SELECT candidate FROM table_name_57 WHERE race = "state representative, hd18" |
Which FA Cup Goals have League Cup Apps larger than 0, and a Name of trevor cherry? | CREATE TABLE table_name_55 (fa_cup_goals INTEGER,league_cup_apps VARCHAR,name VARCHAR) | SELECT MAX(fa_cup_goals) FROM table_name_55 WHERE league_cup_apps > 0 AND name = "trevor cherry" |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.