instruction stringlengths 0 1.06k | input stringlengths 11 5.3k | response stringlengths 2 4.44k |
|---|---|---|
During the Australian Grand Prix and the fastest lap was driven by Jacques Villeneuve, what's the report recorded? | CREATE TABLE table_10309 ("Round" real,"Grand Prix" text,"Pole Position" text,"Fastest Lap" text,"Winning Driver" text,"Winning Constructor" text,"Report" text) | SELECT "Report" FROM table_10309 WHERE "Fastest Lap" = 'jacques villeneuve' AND "Grand Prix" = 'australian grand prix' |
Which school is in Raleigh, NC? | CREATE TABLE table_name_23 (school VARCHAR,hometown VARCHAR) | SELECT school FROM table_name_23 WHERE hometown = "raleigh, nc" |
Which % GDP has an Expenditure larger than 50.9, and a Year larger than 2009, and an Income of 39.3? | CREATE TABLE table_41809 ("Year" real,"Income" real,"Expenditure" real,"Surplus(Deficit)" text,"% GDP" text) | SELECT "% GDP" FROM table_41809 WHERE "Expenditure" > '50.9' AND "Year" > '2009' AND "Income" = '39.3' |
What is the team 2 for the match with a team 1 of Panathinaikos? | CREATE TABLE table_name_34 (team_2 VARCHAR,team_1 VARCHAR) | SELECT team_2 FROM table_name_34 WHERE team_1 = "panathinaikos" |
Questions and Answers per month. | CREATE TABLE PostHistoryTypes (Id number,Name text)CREATE TABLE SuggestedEditVotes (Id number,SuggestedEditId number,UserId number,VoteTypeId number,CreationDate time,TargetUserId number,TargetRepChange number)CREATE TABLE Comments (Id number,PostId number,Score number,Text text,CreationDate time,UserDisplayName text,U... | SELECT DATEADD(month, DATEDIFF(month, @start, CreationDate), @start) AS "month", SUM(CASE WHEN PostTypeId = 1 THEN 1 ELSE 0 END) AS "questions", SUM(CASE WHEN PostTypeId = 2 THEN 1 ELSE 0 END) AS "answers" FROM Posts WHERE (PostTypeId = 1 OR PostTypeId = 2) AND CreationDate >= @start AND CreationDate < @stop AND Score ... |
What ga date do the models with 1.0, 1.2, 1.4ghz processor frequencies have? | CREATE TABLE table_10818465_1 (ga_date VARCHAR,processor_frequency VARCHAR) | SELECT ga_date FROM table_10818465_1 WHERE processor_frequency = "1.0, 1.2, 1.4GHz" |
Which Entrepreneur(s) first aired on 24 August 2006? | CREATE TABLE table_name_28 (entrepreneur_s_ VARCHAR,first_aired VARCHAR) | SELECT entrepreneur_s_ FROM table_name_28 WHERE first_aired = "24 august 2006" |
What is the rank of the United States player Davis Love III with earnings under $12,487,463? | CREATE TABLE table_35333 ("Rank" real,"Player" text,"Country" text,"Earnings ($)" real,"Wins" real) | SELECT MAX("Rank") FROM table_35333 WHERE "Country" = 'united states' AND "Player" = 'davis love iii' AND "Earnings ( $ )" < '12,487,463' |
Which Date has a Runner(s)-up of bernhard langer, and a Tournament of at&t championship? | CREATE TABLE table_75766 ("Date" text,"Tournament" text,"Winning score" text,"Margin of victory" text,"Runner(s)-up" text) | SELECT "Date" FROM table_75766 WHERE "Runner(s)-up" = 'bernhard langer' AND "Tournament" = 'at&t championship' |
Top 10 answers for year-in-review. | CREATE TABLE PendingFlags (Id number,FlagTypeId number,PostId number,CreationDate time,CloseReasonTypeId number,CloseAsOffTopicReasonTypeId number,DuplicateOfQuestionId number,BelongsOnBaseHostAddress text)CREATE TABLE Badges (Id number,UserId number,Name text,Date time,Class number,TagBased boolean)CREATE TABLE Tags (... | SELECT Id AS "post_link", Score FROM Posts AS p WHERE YEAR(CreationDate) = '##year?2018##' AND p.PostTypeId = 2 ORDER BY Score DESC LIMIT 10 |
December smaller than 14, and a Game smaller than 28, and a Score of 6 - 6 involved what opponent? | CREATE TABLE table_33841 ("Game" real,"December" real,"Opponent" text,"Score" text,"Record" text) | SELECT "Opponent" FROM table_33841 WHERE "December" < '14' AND "Game" < '28' AND "Score" = '6 - 6' |
in how many films did henrik malberg appear ? | CREATE TABLE table_204_91 (id number,"year" number,"original title" text,"english title" text,"role" text,"notes" text) | SELECT COUNT("original title") FROM table_204_91 |
Was ENVIRON 310 ever taught by Craig Wuthrich ? | CREATE TABLE program_requirement (program_id int,category varchar,min_credit int,additional_req varchar)CREATE TABLE offering_instructor (offering_instructor_id int,offering_id int,instructor_id int)CREATE TABLE program (program_id int,name varchar,college varchar,introduction varchar)CREATE TABLE course_prerequisite (... | SELECT COUNT(*) > 0 FROM course, course_offering, instructor, offering_instructor WHERE course.course_id = course_offering.course_id AND course.department = 'ENVIRON' AND course.number = 310 AND instructor.name LIKE '%Craig Wuthrich%' AND offering_instructor.instructor_id = instructor.instructor_id AND offering_instruc... |
If the runner-up is the Fort Lauderdale Strikers, what is the winner (number of titles)? | CREATE TABLE table_237757_3 (winner__number_of_titles_ VARCHAR,runners_up VARCHAR) | SELECT winner__number_of_titles_ FROM table_237757_3 WHERE runners_up = "Fort Lauderdale Strikers" |
For those employees who did not have any job in the past, show me about the distribution of hire_date and the average of department_id bin hire_date by weekday in a bar chart. | CREATE TABLE countries (COUNTRY_ID varchar(2),COUNTRY_NAME varchar(40),REGION_ID decimal(10,0))CREATE TABLE jobs (JOB_ID varchar(10),JOB_TITLE varchar(35),MIN_SALARY decimal(6,0),MAX_SALARY decimal(6,0))CREATE TABLE employees (EMPLOYEE_ID decimal(6,0),FIRST_NAME varchar(20),LAST_NAME varchar(25),EMAIL varchar(25),PHONE... | SELECT HIRE_DATE, AVG(DEPARTMENT_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) |
Who is the rider who did less than 20 laps on a grid number greater than 23? | CREATE TABLE table_5547 ("Rider" text,"Manufacturer" text,"Laps" real,"Time/Retired" text,"Grid" real) | SELECT "Rider" FROM table_5547 WHERE "Laps" < '20' AND "Grid" > '23' |
Please show the most common publication date. | CREATE TABLE publication (Publication_Date VARCHAR) | SELECT Publication_Date FROM publication GROUP BY Publication_Date ORDER BY COUNT(*) DESC LIMIT 1 |
How many where killed under Major-General Jean Victor de Constant Rebecque's command? | CREATE TABLE table_17185 ("Unit" text,"Commander" text,"Complement" text,"Killed" text,"Wounded" text,"Missing" text) | SELECT "Killed" FROM table_17185 WHERE "Commander" = 'Major-General Jean Victor de Constant Rebecque' |
provide the number of patients whose admission type is emergency and year of birth is less than 2197? | 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 prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug tex... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_type = "EMERGENCY" AND demographic.dob_year < "2197" |
Show all the planned delivery dates and actual delivery dates of bookings. | CREATE TABLE invoice_items (invoice_item_id number,invoice_id number,order_id number,order_item_id number,product_id number,order_quantity number,other_item_details text)CREATE TABLE bookings_services (order_id number,product_id number)CREATE TABLE addresses (address_id text,line_1 text,line_2 text,city_town text,state... | SELECT planned_delivery_date, actual_delivery_date FROM bookings |
What game has a 6-12-8 record? | CREATE TABLE table_name_65 (game VARCHAR,record VARCHAR) | SELECT game FROM table_name_65 WHERE record = "6-12-8" |
Show the builder of railways associated with the trains named 'Andaman Exp'. | CREATE TABLE railway (Builder VARCHAR,Railway_ID VARCHAR)CREATE TABLE train (Railway_ID VARCHAR,Name VARCHAR) | SELECT T1.Builder FROM railway AS T1 JOIN train AS T2 ON T1.Railway_ID = T2.Railway_ID WHERE T2.Name = "Andaman Exp" |
what is the number of patients whose death status is 1 and drug code is ns100cg? | 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 text,flag text,value_unit text,label text,fluid text)CREATE TABLE diagnoses (subject_id text,hadm_id tex... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.expire_flag = "1" AND prescriptions.formulary_drug_cd = "NS100CG" |
How big was the crowd when Geelong was the home team? | CREATE TABLE table_33067 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Venue" text,"Crowd" real,"Date" text) | SELECT COUNT("Crowd") FROM table_33067 WHERE "Home team" = 'geelong' |
What is the Title when the winner was suntory sungoliath, and a Season of 2011-12 details? | CREATE TABLE table_76144 ("Title" text,"Season" text,"Winner" text,"Score" text,"Runner-up" text,"Venue" text,"Attendance" text) | SELECT "Title" FROM table_76144 WHERE "Winner" = 'suntory sungoliath' AND "Season" = '2011-12 details' |
Who was the host team at Louisiana Superdome when the final score was 10-20? | CREATE TABLE table_name_21 (host_team VARCHAR,stadium VARCHAR,final_score VARCHAR) | SELECT host_team FROM table_name_21 WHERE stadium = "louisiana superdome" AND final_score = "10-20" |
Show average of budget in each year and bin creation time by year in a line chart, order by the x-axis in ascending. | CREATE TABLE head (head_ID int,name text,born_state text,age real)CREATE TABLE management (department_ID int,head_ID int,temporary_acting text)CREATE TABLE department (Department_ID int,Name text,Creation text,Ranking int,Budget_in_Billions real,Num_Employees real) | SELECT Creation, AVG(Budget_in_Billions) FROM department ORDER BY Creation |
What's the time/retired for a grid of 14? | CREATE TABLE table_78486 ("Driver" text,"Constructor" text,"Laps" text,"Time/Retired" text,"Grid" text) | SELECT "Time/Retired" FROM table_78486 WHERE "Grid" = '14' |
Among patients to whom drug was administered in both eyes, how many of them were born before the year 2170. | 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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.dob_year < "2170" AND prescriptions.route = "BOTH EYES" |
What number is shown for november 3 where january 15-16 is 151? | CREATE TABLE table_25252080_3 (november_3 VARCHAR,january_15_16 VARCHAR) | SELECT november_3 FROM table_25252080_3 WHERE january_15_16 = "151" |
Find tags with no excerpt. | 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 t.Id, t.TagName, t.Count FROM Posts AS p, Tags AS t WHERE p.PostTypeId = 4 AND LENGTH(p.Body) = 0 AND p.Id = t.ExcerptPostId ORDER BY t.Count DESC |
Amount of user grouped by hundreds of their questions. | CREATE TABLE PostHistoryTypes (Id number,Name text)CREATE TABLE FlagTypes (Id number,Name text,Description text)CREATE TABLE Posts (Id number,PostTypeId number,AcceptedAnswerId number,ParentId number,CreationDate time,DeletionDate time,Score number,ViewCount number,Body text,OwnerUserId number,OwnerDisplayName text,Las... | SELECT ((userQuestions.QuestionCount / 100) * 100) AS "questions_count", COUNT(UserQuestions.userId) AS "users_count" FROM (SELECT soUser.Id AS userId, COUNT(post.Id) AS QuestionCount FROM Posts AS post INNER JOIN Users AS soUser ON soUser.Id = post.OwnerUserId WHERE post.PostTypeId = 1 GROUP BY soUser.Id) AS userQuest... |
Bar chart x axis date y axis total number of cloud cover, and sort by the total number of cloud cover in ascending please. | CREATE TABLE station (id INTEGER,name TEXT,lat NUMERIC,long NUMERIC,dock_count INTEGER,city TEXT,installation_date TEXT)CREATE TABLE weather (date TEXT,max_temperature_f INTEGER,mean_temperature_f INTEGER,min_temperature_f INTEGER,max_dew_point_f INTEGER,mean_dew_point_f INTEGER,min_dew_point_f INTEGER,max_humidity INT... | SELECT date, SUM(cloud_cover) FROM weather ORDER BY SUM(cloud_cover) |
What are the fleet number for the 4-6-4t locomotive? | CREATE TABLE table_name_19 (fleet_numbers VARCHAR,type VARCHAR) | SELECT fleet_numbers FROM table_name_19 WHERE type = "4-6-4t" |
Show me about the distribution of Team_Name and ACC_Percent in a bar chart, and show by the Y-axis in desc. | CREATE TABLE university (School_ID int,School text,Location text,Founded real,Affiliation text,Enrollment real,Nickname text,Primary_conference text)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_Perce... | SELECT Team_Name, ACC_Percent FROM basketball_match ORDER BY ACC_Percent DESC |
when was patient 4900's arterial bp mean last measured less than 108.0 until 12/26/2105? | CREATE TABLE diagnoses_icd (row_id number,subject_id number,hadm_id number,icd9_code text,charttime time)CREATE TABLE d_items (row_id number,itemid number,label text,linksto text)CREATE TABLE labevents (row_id number,subject_id number,hadm_id number,itemid number,charttime time,valuenum number,valueuom text)CREATE TABL... | 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 = 4900)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'arterial ... |
How many employees do we have? | CREATE TABLE aircraft (aid number,name text,distance number)CREATE TABLE flight (flno number,origin text,destination text,distance number,departure_date time,arrival_date time,price number,aid number)CREATE TABLE certificate (eid number,aid number)CREATE TABLE employee (eid number,name text,salary number) | SELECT COUNT(*) FROM employee |
Which country has a score of 70-71-72=213? | CREATE TABLE table_name_76 (country VARCHAR,score VARCHAR) | SELECT country FROM table_name_76 WHERE score = 70 - 71 - 72 = 213 |
Which Metropolitan area has Passengers larger than 130,903, and a Rank of 4? | CREATE TABLE table_35782 ("Rank" real,"Airport" text,"Metropolitan area" text,"Passengers" real,"Carriers" text) | SELECT "Metropolitan area" FROM table_35782 WHERE "Passengers" > '130,903' AND "Rank" = '4' |
what nation received 6 gold medals other than bulgaria | CREATE TABLE table_204_822 (id number,"rank" number,"nation" text,"gold" number,"silver" number,"bronze" number,"total" number) | SELECT "nation" FROM table_204_822 WHERE "gold" = 6 AND "nation" <> 'bulgaria' |
Name the steals for season 2007/2008 | CREATE TABLE table_17309500_1 (steals VARCHAR,season VARCHAR) | SELECT steals FROM table_17309500_1 WHERE season = "2007/2008" |
what is the highest wickets when the best bowling is 2/32 and matches is less than 5? | CREATE TABLE table_8455 ("Player" text,"Team" text,"Matches" real,"Wickets" real,"Average" real,"Best Bowling" text) | SELECT MAX("Wickets") FROM table_8455 WHERE "Best Bowling" = '2/32' AND "Matches" < '5' |
What is the Pick # for brent meeke? | CREATE TABLE table_name_45 (pick__number VARCHAR,player VARCHAR) | SELECT pick__number FROM table_name_45 WHERE player = "brent meeke" |
what is the maximum total hospital cost that includes the carcinoembyronic antigen (cea) lab test until 1 year ago? | CREATE TABLE cost (row_id number,subject_id number,hadm_id number,event_type text,event_id number,chargetime time,cost number)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)CRE... | SELECT MAX(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 = 'carcinoembyronic antigen (cea)')) AND DATETIME(cost.chargetime) <= DATETIME(CURRENT_TIME(), '-1 year'... |
Count questions without accepted answer marked per tag count. | CREATE TABLE PostLinks (Id number,CreationDate time,PostId number,RelatedPostId number,LinkTypeId number)CREATE TABLE ReviewTaskResults (Id number,ReviewTaskId number,ReviewTaskResultTypeId number,CreationDate time,RejectionReasonId number,Comment text)CREATE TABLE Tags (Id number,TagName text,Count number,ExcerptPostI... | SELECT x.total, COUNT(x.Id), CAST(COUNT(x.Id) AS FLOAT) / (SELECT COUNT(Q.Id) FROM Posts AS Q WHERE Q.AnswerCount > 0 AND Q.PostTypeId = 1 AND Q.AcceptedAnswerId IS NULL) FROM (SELECT Q.Id, COUNT(PT.TagId) AS total FROM Posts AS Q INNER JOIN PostTags AS PT ON Q.Id = PT.PostId WHERE Q.AnswerCount > 0 AND Q.PostTypeId = ... |
Construction start of phase ii has what operation start? | CREATE TABLE table_name_51 (operation_start VARCHAR,construction_start VARCHAR) | SELECT operation_start FROM table_name_51 WHERE construction_start = "phase ii" |
Which Group position has Result F A of 0 1 on 1 november 2006? | CREATE TABLE table_54027 ("Date" text,"Opponents" text,"H / A" text,"Result F\u2013A" text,"Attendance" real,"Group position" text) | SELECT "Group position" FROM table_54027 WHERE "Result F\u2013A" = '0–1' AND "Date" = '1 november 2006' |
What are the titles of all movies that have rating star is between 3 and 5, and count them by a bar chart, and I want to show by the y axis in asc. | CREATE TABLE Rating (rID int,mID int,stars int,ratingDate date)CREATE TABLE Movie (mID int,title text,year int,director text)CREATE TABLE Reviewer (rID int,name text) | SELECT title, COUNT(title) FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID WHERE T1.stars BETWEEN 3 AND 5 GROUP BY title ORDER BY COUNT(title) |
provide the number of patients whose ethnicity is asian and admission year is less than 2111? | 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 WHERE demographic.ethnicity = "ASIAN" AND demographic.admityear < "2111" |
Who was the opponent at the game when the record was 4-5? | CREATE TABLE table_name_69 (opponent VARCHAR,record VARCHAR) | SELECT opponent FROM table_name_69 WHERE record = "4-5" |
How many times were the candidates leven powell (f) 63.8% roger west (dr) 36.4%? | CREATE TABLE table_2668405_17 (first_elected VARCHAR,candidates VARCHAR) | SELECT COUNT(first_elected) FROM table_2668405_17 WHERE candidates = "Leven Powell (F) 63.8% Roger West (DR) 36.4%" |
What's the highest with a capacity of greater than 4,000 and an average of 615? | CREATE TABLE table_name_20 (highest INTEGER,average VARCHAR,capacity VARCHAR) | SELECT MAX(highest) FROM table_name_20 WHERE average = 615 AND capacity > 4 OFFSET 000 |
compared to last measured on the last hospital visit, was the value of the hematocrit from patient 13686 less than the value first measured on the last hospital visit? | 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 microbiologyevents (row_id number,subject_id number,hadm_id number,charttime time,spec_type_desc text,org_name text)CREATE TABLE inputevents_cv (row_i... | SELECT (SELECT labevents.valuenum FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 13686 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime DESC LIMIT 1) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.l... |
what was the point difference of the october 10th game ? | CREATE TABLE table_204_180 (id number,"date" text,"opponent#" text,"rank#" text,"site" text,"result" text,"attendance" number) | SELECT ABS("result" - "result") FROM table_204_180 WHERE "date" = 'october 10' |
Show me a line chart of how the number of creation change over the creation, sort by the Creation in descending. | CREATE TABLE management (department_ID int,head_ID int,temporary_acting text)CREATE TABLE department (Department_ID int,Name text,Creation text,Ranking int,Budget_in_Billions real,Num_Employees real)CREATE TABLE head (head_ID int,name text,born_state text,age real) | SELECT Creation, COUNT(Creation) FROM department ORDER BY Creation DESC |
Which Episode has a Viewers (millions) larger than 11.26, a Weekly Rank of #8, and a Share of 12? | CREATE TABLE table_50044 ("Episode" text,"Rating" real,"Share" real,"Viewers (millions)" real,"Weekly Rank" text) | SELECT "Episode" FROM table_50044 WHERE "Viewers (millions)" > '11.26' AND "Weekly Rank" = '#8' AND "Share" = '12' |
What is the type of glycosylase that has an E. coli of Muty? | CREATE TABLE table_49140 ("E. coli" text,"Yeast (S. cerevisiae)" text,"Human" text,"Type" text,"Substrates" text) | SELECT "Type" FROM table_49140 WHERE "E. coli" = 'muty' |
what is drug name of drug code piog15? | 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 FROM prescriptions WHERE prescriptions.formulary_drug_cd = "PIOG15" |
Which Goals have a Player of david mcllwain, and Games larger than 52? | CREATE TABLE table_name_7 (goals INTEGER,player VARCHAR,games VARCHAR) | SELECT MAX(goals) FROM table_name_7 WHERE player = "david mcllwain" AND games > 52 |
Provide me the number of patients diagnosed with hypoxemia who had a blood test done. | 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 INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.long_title = "Hypoxemia" AND lab.fluid = "Blood" |
What is the highest number of laps for the driver with 5 points? | CREATE TABLE table_name_41 (laps INTEGER,points VARCHAR) | SELECT MAX(laps) FROM table_name_41 WHERE points = "5" |
What is the Japanese title for the episode bigger than 10 on TBS with average ratings of 14.8%? | CREATE TABLE table_name_70 (japanese_title VARCHAR,average_ratings VARCHAR,episodes VARCHAR,tv_station VARCHAR) | SELECT japanese_title FROM table_name_70 WHERE episodes > 10 AND tv_station = "tbs" AND average_ratings = "14.8%" |
Which Condition has a Bleeding time of unaffected and a Prothrombin time of prolonged? | CREATE TABLE table_name_75 (condition VARCHAR,bleeding_time VARCHAR,prothrombin_time VARCHAR) | SELECT condition FROM table_name_75 WHERE bleeding_time = "unaffected" AND prothrombin_time = "prolonged" |
Which lead had a season of 2009-10? | CREATE TABLE table_48425 ("Season" text,"Skip" text,"Third" text,"Second" text,"Lead" text,"Alternate" text,"Events" text) | SELECT "Lead" FROM table_48425 WHERE "Season" = '2009-10' |
Which venue had a score of 734-5d? | CREATE TABLE table_name_8 (venue VARCHAR,score VARCHAR) | SELECT venue FROM table_name_8 WHERE score = "734-5d" |
what is the country when the nots is sa/b, the rank is more than 1 and the athlete is zhang xiuyun? | CREATE TABLE table_66215 ("Rank" real,"Athlete" text,"Country" text,"Time" text,"Notes" text) | SELECT "Country" FROM table_66215 WHERE "Notes" = 'sa/b' AND "Rank" > '1' AND "Athlete" = 'zhang xiuyun' |
what is the number of relapsing fever when malaria is 3000 | CREATE TABLE table_15909 ("Year" text,"Typhus" real,"Typhoid fever" real,"Relapsing fever" real,"Smallpox" real,"Malaria" text) | SELECT MIN("Relapsing fever") FROM table_15909 WHERE "Malaria" = '3000' |
Find the three most expensive procedures. | CREATE TABLE appointment (appointmentid number,patient number,prepnurse number,physician number,start time,end time,examinationroom text)CREATE TABLE affiliated_with (physician number,department number,primaryaffiliation boolean)CREATE TABLE prescribes (physician number,patient number,medication number,date time,appoin... | SELECT name FROM procedures ORDER BY cost LIMIT 3 |
Which Number of electorates (2009) has a District of sheopur, and a Constituency number of 1? | CREATE TABLE table_name_94 (number_of_electorates__2009_ VARCHAR,district VARCHAR,constituency_number VARCHAR) | SELECT COUNT(number_of_electorates__2009_) FROM table_name_94 WHERE district = "sheopur" AND constituency_number = "1" |
Name the total losses for 4 place and ties less than 0 | CREATE TABLE table_32066 ("Place" real,"Team" text,"Wins" real,"Ties" real,"Losses" real,"Points" text) | SELECT COUNT("Losses") FROM table_32066 WHERE "Place" = '4' AND "Ties" < '0' |
Give me a stacked bar chart for showing the total number of each ship type and categorize it by ship nationality, and rank Y from low to high order. | CREATE TABLE mission (Mission_ID int,Ship_ID int,Code text,Launched_Year int,Location text,Speed_knots int,Fate text)CREATE TABLE ship (Ship_ID int,Name text,Type text,Nationality text,Tonnage int) | SELECT Type, COUNT(Type) FROM ship GROUP BY Nationality, Type ORDER BY COUNT(Type) |
Show me a bar chart for what are the draft pick numbers and draft classes for players who play the Defender position?, display in descending by the Draft_Class. | CREATE TABLE match_season (Season real,Player text,Position text,Country int,Team int,Draft_Pick_Number int,Draft_Class text,College text)CREATE TABLE player (Player_ID int,Player text,Years_Played text,Total_WL text,Singles_WL text,Doubles_WL text,Team int)CREATE TABLE team (Team_id int,Name text)CREATE TABLE country ... | SELECT Draft_Class, Draft_Pick_Number FROM match_season WHERE Position = "Defender" ORDER BY Draft_Class DESC |
Questions Closed, Edited by No User Other Than OP, and Reopened. | CREATE TABLE CloseReasonTypes (Id number,Name text,Description text)CREATE TABLE PostTypes (Id number,Name text)CREATE TABLE Badges (Id number,UserId number,Name text,Date time,Class number,TagBased boolean)CREATE TABLE ReviewTaskResults (Id number,ReviewTaskId number,ReviewTaskResultTypeId number,CreationDate time,Rej... | SELECT i.PostId AS "post_link" FROM PostHistory AS i INNER JOIN PostHistory AS c ON i.PostId = c.PostId AND i.PostHistoryTypeId = 1 AND c.PostHistoryTypeId = 10 INNER JOIN PostHistory AS r ON c.PostId = r.PostId AND r.PostHistoryTypeId = 11 LEFT OUTER JOIN PostHistory AS e ON r.PostId = e.PostId AND e.PostHistoryTypeId... |
What are the names of all the reviewers and movie names? | CREATE TABLE rating (rid number,mid number,stars number,ratingdate time)CREATE TABLE reviewer (rid number,name text)CREATE TABLE movie (mid number,title text,year number,director text) | SELECT name FROM reviewer UNION SELECT title FROM movie |
When mega pass* (senior/disabled) is the type of fare what is the day pass? | CREATE TABLE table_23944 ("Type of Fare" text,"Cash Fare" text,"Day Pass" text,"31-Day Pass" text,"Monthly Pass" text) | SELECT "Day Pass" FROM table_23944 WHERE "Type of Fare" = 'Mega Pass* (Senior/Disabled)' |
What is the largest caps value for Glen Moss? | CREATE TABLE table_name_50 (caps INTEGER,player VARCHAR) | SELECT MAX(caps) FROM table_name_50 WHERE player = "glen moss" |
Which class has a peak named fountains fell south top? | CREATE TABLE table_55023 ("Peak" text,"Height (m)" real,"Prom. (m)" real,"Class" text,"Parent" text) | SELECT "Class" FROM table_55023 WHERE "Peak" = 'fountains fell south top' |
How many total episodes aired over all seasons with 7.79 million viewers? | CREATE TABLE table_37889 ("Season" real,"Network" text,"Time slot" text,"Season premiere" text,"Season finale" text,"Episode count" real,"TV season" text,"Season rank" text,"Viewers (in millions)" real) | SELECT COUNT("Episode count") FROM table_37889 WHERE "Viewers (in millions)" = '7.79' |
How many tickets were available at Halle Tony Garnier on June 15, 2009? | CREATE TABLE table_name_75 (tickets_available_since VARCHAR,venue VARCHAR,date VARCHAR) | SELECT tickets_available_since FROM table_name_75 WHERE venue = "halle tony garnier" AND date = "june 15, 2009" |
How many workshops did each author submit to? Return the author name and the number of workshops by a pie chart. | CREATE TABLE submission (Submission_ID int,Scores real,Author text,College text)CREATE TABLE workshop (Workshop_ID int,Date text,Venue text,Name text)CREATE TABLE Acceptance (Submission_ID int,Workshop_ID int,Result text) | SELECT Author, COUNT(DISTINCT T1.Workshop_ID) FROM Acceptance AS T1 JOIN submission AS T2 ON T1.Submission_ID = T2.Submission_ID |
on tuesday i'd like to find a flight from DETROIT to ST. PETERSBURG that arrives before 2200 | CREATE TABLE flight_leg (flight_id int,leg_number int,leg_flight int)CREATE TABLE compartment_class (compartment varchar,class_type varchar)CREATE TABLE class_of_service (booking_class varchar,rank int,class_description text)CREATE TABLE fare (fare_id int,from_airport varchar,to_airport varchar,fare_basis_code text,far... | 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 = 22 AND date_day.month_number = 3 AND date_day.year = 1991 AND days.day_name = date_day.day_name AND flight.arrival_time <... |
Return the names and ids of customers who have TN in their address. Show a pie chart. | CREATE TABLE Department_Stores (dept_store_id INTEGER,dept_store_chain_id INTEGER,store_name VARCHAR(80),store_address VARCHAR(255),store_phone VARCHAR(80),store_email VARCHAR(80))CREATE TABLE Staff (staff_id INTEGER,staff_gender VARCHAR(1),staff_name VARCHAR(80))CREATE TABLE Departments (department_id INTEGER,dept_sto... | SELECT customer_name, customer_id FROM Customers WHERE customer_address LIKE "%TN%" |
What is the status of the membership application on 2008-12-15? | CREATE TABLE table_12597 ("State" text,"Status" text,"Association Agreement" text,"Membership Application" text,"Candidate status" text,"Negotiations start" text,"Screening completed" text,"Acquis Chapters open/closed" text) | SELECT "Status" FROM table_12597 WHERE "Membership Application" = '2008-12-15' |
Which body tackle has yes for the diving tackle and the sliding tackle classified as a trip? | CREATE TABLE table_33079 ("sliding tackle" text,"spear tackle" text,"dump tackle" text,"body tackle" text,"ankle tap" text,"diving tackle" text,"bumping/blocking" text,"shoulder charge" text,"steal/intercept ball" text,"Chicken wing" text) | SELECT "body tackle" FROM table_33079 WHERE "diving tackle" = 'yes' AND "sliding tackle" = 'classified as a trip' |
List the names and emails of customers who payed by Visa card. | CREATE TABLE order_deliveries (location_code text,actual_order_id number,delivery_status_code text,driver_employee_id number,truck_id number,delivery_date time)CREATE TABLE trucks (truck_id number,truck_licence_number text,truck_details text)CREATE TABLE products (product_id number,product_name text,product_price numbe... | SELECT customer_email, customer_name FROM customers WHERE payment_method = 'Visa' |
what is the number of newborn admitted patients who are diagnosed with loss of weight? | 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.admission_type = "NEWBORN" AND diagnoses.long_title = "Loss of weight" |
Find the id and city of the student address with the highest average monthly rental. | CREATE TABLE students_in_detention (student_id number,detention_id number,incident_id number)CREATE TABLE ref_address_types (address_type_code text,address_type_description text)CREATE TABLE teachers (teacher_id number,address_id number,first_name text,middle_name text,last_name text,gender text,cell_mobile_number text... | SELECT T2.address_id, T1.city FROM addresses AS T1 JOIN student_addresses AS T2 ON T1.address_id = T2.address_id GROUP BY T2.address_id ORDER BY AVG(monthly_rental) DESC LIMIT 1 |
Anuya Bhagvath was nominated for what award? | CREATE TABLE table_name_60 (award VARCHAR,outcome VARCHAR,name VARCHAR) | SELECT award FROM table_name_60 WHERE outcome = "nominated" AND name = "anuya bhagvath" |
Which Grid is the lowest one that has a Team of germany, and Laps smaller than 45? | CREATE TABLE table_name_42 (grid INTEGER,team VARCHAR,laps VARCHAR) | SELECT MIN(grid) FROM table_name_42 WHERE team = "germany" AND laps < 45 |
has patient 010-37499's sao2 been normal since 182 days ago? | CREATE TABLE microlab (microlabid number,patientunitstayid number,culturesite text,organism text,culturetakentime time)CREATE TABLE patient (uniquepid text,patienthealthsystemstayid number,patientunitstayid number,gender text,age text,ethnicity text,hospitalid number,wardid number,admissionheight number,admissionweight... | SELECT COUNT(*) > 0 FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '010-37499')) AND vitalperiodic.sao2 BETWEEN sao2_lower AND sao2_uppe... |
what were the three most frequent lab tests? | 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 d_items (row_id number,itemid number,label text,lin... | 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 GROUP BY labevents.itemid) AS t1 WHERE t1.c1 <= 3) |
What was the away team's score when Collingwood was the home team? | CREATE TABLE table_51839 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Venue" text,"Crowd" real,"Date" text) | SELECT "Away team score" FROM table_51839 WHERE "Home team" = 'collingwood' |
what is the last power rating on the chart ? | CREATE TABLE table_204_794 (id number,"iec\nworld plugs\nType" text,"standard" text,"power\nrating" text,"earthed" text,"polarised" text,"fused" text,"insulated\npins" text,"europlug\ncompatible" text) | SELECT "power\nrating" FROM table_204_794 ORDER BY id DESC LIMIT 1 |
Name the gt winning car for #88 team mitsubishi 88 mitsubishi starion | CREATE TABLE table_27965906_2 (gt_winning_car VARCHAR,a_winning_car VARCHAR) | SELECT gt_winning_car FROM table_27965906_2 WHERE a_winning_car = "#88 Team Mitsubishi 88 Mitsubishi Starion" |
show all imported samples? | CREATE TABLE resultsdata15 (sample_pk number,commod text,commtype text,lab text,pestcode text,testclass text,concen number,lod number,conunit text,confmethod text,confmethod2 text,annotate text,quantitate text,mean text,extract text,determin text)CREATE TABLE sampledata15 (sample_pk number,state text,year text,month te... | SELECT sample_pk FROM sampledata15 WHERE origin = "2" |
What is the administration when the division was Ykk nen (first division), and they were in the 1st position in 1996? | CREATE TABLE table_name_21 (administration VARCHAR,season VARCHAR,division VARCHAR,position VARCHAR) | SELECT administration FROM table_name_21 WHERE division = "ykkönen (first division)" AND position = "1st" AND season = 1996 |
Name the Latest stable release that has a Price in USD of free / negotiable? | CREATE TABLE table_name_36 (latest_stable_release VARCHAR,price_in_usd VARCHAR) | SELECT latest_stable_release FROM table_name_36 WHERE price_in_usd = "free / negotiable" |
Where did they play on their bye week? | CREATE TABLE table_33107 ("Week" real,"Kickoff" text,"Date" text,"Opponent" text,"Result" text,"Record" text,"Game Site" text,"NFL.com Recap" text) | SELECT "Game Site" FROM table_33107 WHERE "Record" = 'bye' |
Which tourist attractions are related to royal family? Tell me their details and how we can get there. | CREATE TABLE locations (location_id number,location_name text,address text,other_details text)CREATE TABLE staff (staff_id number,tourist_attraction_id number,name text,other_details text)CREATE TABLE theme_parks (theme_park_id number,theme_park_details text)CREATE TABLE ref_attraction_types (attraction_type_code text,... | SELECT T1.royal_family_details, T2.how_to_get_there FROM royal_family AS T1 JOIN tourist_attractions AS T2 ON T1.royal_family_id = T2.tourist_attraction_id |
What is the end date for the artist s. moldoff/j. giella/c. infantino? | CREATE TABLE table_2560677_1 (end_date VARCHAR,artist_s_ VARCHAR) | SELECT end_date FROM table_2560677_1 WHERE artist_s_ = "S. Moldoff/J. Giella/C. Infantino" |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.