instruction stringlengths 0 1.06k | input stringlengths 11 5.3k | response stringlengths 2 4.44k |
|---|---|---|
What is the round for the Norisring circuit? | CREATE TABLE table_name_43 (round INTEGER,circuit VARCHAR) | SELECT AVG(round) FROM table_name_43 WHERE circuit = "norisring" |
What Song is by the Artist 'mor ve tesi'? | CREATE TABLE table_55633 ("Draw" real,"Language" text,"Artist" text,"Song" text,"Place" text,"Points" real) | SELECT "Song" FROM table_55633 WHERE "Artist" = 'mor ve ötesi' |
tell me the number of male patients who have drug code clop75. | 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 demographic (subject_id text,hadm_id text,name text,marital_status text,age text,dob... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.gender = "M" AND prescriptions.formulary_drug_cd = "CLOP75" |
Which Rank has a Name of tsvetelina kirilova, and a Result smaller than 55.97? | CREATE TABLE table_name_73 (rank INTEGER,name VARCHAR,result VARCHAR) | SELECT MAX(rank) FROM table_name_73 WHERE name = "tsvetelina kirilova" AND result < 55.97 |
Tell me the surface of 2 december 1974 | CREATE TABLE table_4322 ("Date" text,"Location" text,"Surface" text,"Opponent in the final" text,"Score in the final" text) | SELECT "Surface" FROM table_4322 WHERE "Date" = '2 december 1974' |
Which Result has a District of pennsylvania 13? | CREATE TABLE table_name_5 (result VARCHAR,district VARCHAR) | SELECT result FROM table_name_5 WHERE district = "pennsylvania 13" |
Who were the candidates when Sid Simpson was the incumbent? | CREATE TABLE table_18589 ("District" text,"Incumbent" text,"Party" text,"First elected" real,"Result" text,"Candidates" text) | SELECT "Candidates" FROM table_18589 WHERE "Incumbent" = 'Sid Simpson' |
What is Event, when Viewers is 2.4 Million, and when Rating is 1.4? | CREATE TABLE table_name_49 (event VARCHAR,viewers VARCHAR,rating VARCHAR) | SELECT event FROM table_name_49 WHERE viewers = "2.4 million" AND rating = "1.4" |
What are the names of representatives in descending order of votes? | CREATE TABLE representative (Name VARCHAR,Representative_ID VARCHAR)CREATE TABLE election (Representative_ID VARCHAR) | SELECT T2.Name FROM election AS T1 JOIN representative AS T2 ON T1.Representative_ID = T2.Representative_ID ORDER BY votes DESC |
did tommy armor place above or below denny shute ? | CREATE TABLE table_203_864 (id number,"place" text,"player" text,"country" text,"score" text,"to par" number,"money ($)" number) | SELECT (SELECT "place" FROM table_203_864 WHERE "player" = 'tommy armour') < (SELECT "place" FROM table_203_864 WHERE "player" = 'denny shute') |
Who directed the epsiode with production number 109? | CREATE TABLE table_2400842_1 (directed_by VARCHAR,prod__number VARCHAR) | SELECT directed_by FROM table_2400842_1 WHERE prod__number = 109 |
Top users from Pune, India. Top users from Pune, India | CREATE TABLE PostHistoryTypes (Id number,Name text)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 VoteTypes (Id number,Name text)CREATE TABLE Comments (Id number,Po... | SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation FROM Users WHERE LOWER(Location) LIKE '%pune%' OR UPPER(Location) LIKE '%PUNE%' OR Location LIKE '%Pune%' AND Reputation >= 1000 ORDER BY Reputation DESC |
If the episode number is 2-01 what is the original UK air date? | CREATE TABLE table_3385 ("Episode #" text,"Original Air Date (UK)" text,"Episode Title" text,"Director" text,"Writer" text,"Cast" text) | SELECT "Original Air Date (UK)" FROM table_3385 WHERE "Episode #" = '2-01' |
Help users who are close to achieving the Pundit badge. | CREATE TABLE PostsWithDeleted (Id number,PostTypeId number,AcceptedAnswerId number,ParentId number,CreationDate time,DeletionDate time,Score number,ViewCount number,Body text,OwnerUserId number,OwnerDisplayName text,LastEditorUserId number,LastEditorDisplayName text,LastEditDate time,LastActivityDate time,Title text,Ta... | SELECT DISTINCT Comments.Id AS "comment_link", Comments.CreationDate, Comments.UserId FROM Comments WHERE Comments.Score = 4 AND (SELECT COUNT(Badges.UserId) FROM Badges WHERE Badges.Name = 'Pundit' AND Badges.UserId = Comments.UserId) < 1 ORDER BY Comments.CreationDate DESC |
calculate the total number of female patients who had endovascular (total) embolization or occlusion of head and neck vessels | 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 demographic (subject_id text,hadm_id text,name text,marital... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.gender = "F" AND procedures.long_title = "Endovascular (total) embolization or occlusion of head and neck vessels" |
For those employees who did not have any job in the past, return a bar chart about the distribution of hire_date and the average of manager_id bin hire_date by weekday, and show by the y-axis from high to low. | CREATE TABLE countries (COUNTRY_ID varchar(2),COUNTRY_NAME varchar(40),REGION_ID decimal(10,0))CREATE TABLE departments (DEPARTMENT_ID decimal(4,0),DEPARTMENT_NAME varchar(30),MANAGER_ID decimal(6,0),LOCATION_ID decimal(4,0))CREATE TABLE locations (LOCATION_ID decimal(4,0),STREET_ADDRESS varchar(40),POSTAL_CODE varchar... | SELECT HIRE_DATE, AVG(MANAGER_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) ORDER BY AVG(MANAGER_ID) DESC |
What was the home team with a 4-6-0 record? | CREATE TABLE table_name_13 (home VARCHAR,record VARCHAR) | SELECT home FROM table_name_13 WHERE record = "4-6-0" |
how many days has it been since the last stay of patient 9566 in the ward 14 during the current hospital encounter? | CREATE TABLE d_labitems (row_id number,itemid number,label text)CREATE TABLE procedures_icd (row_id number,subject_id number,hadm_id number,icd9_code text,charttime time)CREATE TABLE patients (row_id number,subject_id number,gender text,dob time,dod time)CREATE TABLE microbiologyevents (row_id number,subject_id number,... | SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', transfers.intime)) FROM transfers WHERE transfers.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 9566 AND admissions.dischtime IS NULL)) AND transfers.w... |
What was the location and attendance for game 41? | CREATE TABLE table_29619 ("Game" real,"January" real,"Opponent" text,"Score" text,"Location/Attendance" text,"Record" text,"Points" real) | SELECT "Location/Attendance" FROM table_29619 WHERE "Game" = '41' |
What team is in the city of Rock Island? | CREATE TABLE table_27961684_1 (team_name VARCHAR,city VARCHAR) | SELECT team_name FROM table_27961684_1 WHERE city = "Rock Island" |
what is the number of patients whose days of hospital stay is greater than 0 and procedure long title is partial glossectomy? | 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 INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.days_stay > "0" AND procedures.long_title = "Partial glossectomy" |
what's the capacity with team being berwick rangers | CREATE TABLE table_14003108_1 (capacity VARCHAR,team VARCHAR) | SELECT capacity FROM table_14003108_1 WHERE team = "Berwick Rangers" |
What is the lowest #? | CREATE TABLE table_17330 ("#" real,"Date" text,"Visitor" text,"Score" text,"Home" text,"Leading scorer" text,"Attendance" text,"Record" text,"Streak" text) | SELECT MIN("#") FROM table_17330 |
List the number of games in each season and group by away team in a group line chart, could you list x axis from low to high order? | CREATE TABLE injury_accident (game_id int,id int,Player text,Injury text,Number_of_matches text,Source text)CREATE TABLE stadium (id int,name text,Home_Games int,Average_Attendance real,Total_Attendance real,Capacity_Percentage real)CREATE TABLE game (stadium_id int,id int,Season int,Date text,Home_team text,Away_team ... | SELECT Season, COUNT(Season) FROM game GROUP BY Away_team, Season ORDER BY Season |
what was robert doornbos ' total time for this race ? | CREATE TABLE table_203_452 (id number,"pos" number,"no" number,"driver" text,"team" text,"laps" number,"time/retired" text,"grid" number,"points" number) | SELECT "time/retired" FROM table_203_452 WHERE "driver" = 'robert doornbos' |
What was the 1999 Tournament at the US Open? | CREATE TABLE table_60355 ("Tournament" text,"1988" text,"1990" text,"1991" text,"1992" text,"1993" text,"1995" text,"1996" text,"1997" text,"1998" text,"1999" text,"2000" text,"2001" text,"Career SR" text,"Career Win-Loss" text) | SELECT "1999" FROM table_60355 WHERE "Tournament" = 'us open' |
when was the patient jerry deberry admitted? specify time and his age | 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 procedures (subject_id text,hadm_id text,icd9_code text,sho... | SELECT demographic.age, demographic.admittime FROM demographic WHERE demographic.name = "Jerry Deberry" |
on the earliest flight from SAN FRANCISCO to ATLANTA on DL is a meal being served | CREATE TABLE class_of_service (booking_class varchar,rank int,class_description text)CREATE TABLE flight_leg (flight_id int,leg_number int,leg_flight int)CREATE TABLE month (month_number int,month_name text)CREATE TABLE ground_service (city_code text,airport_code text,transport_type text,ground_fare int)CREATE TABLE fa... | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight, food_service WHERE (((flight.departure_time = (SELECT MIN(FLIGHTalias1.departure_time) FROM airport_service AS AIRPORT_SERVICEalias2, airport_service AS AIRPORT_SERVI... |
what are the title in japanese where the reference is kids-430? | CREATE TABLE table_10979230_5 (japanese_title VARCHAR,reference VARCHAR) | SELECT japanese_title FROM table_10979230_5 WHERE reference = "KIDS-430" |
what are the four most often ordered procedures for patients who have previously been diagnosed with abrasion nec within the same month? | CREATE TABLE chartevents (row_id number,subject_id number,hadm_id number,icustay_id number,itemid number,charttime time,valuenum number,valueuom text)CREATE TABLE 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 TABL... | SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT t3.icd9_code FROM (SELECT t2.icd9_code, 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 = admissi... |
What day did they play cambridge united? | CREATE TABLE table_69969 ("Match" real,"Date" text,"Competition or tour" text,"Ground" text,"Opponent" text,"Score1" text) | SELECT "Date" FROM table_69969 WHERE "Opponent" = 'cambridge united' |
How many production stage managers worked with Gabriel di Chiara as the Male Rep? | CREATE TABLE table_22410780_1 (production_stagemanager VARCHAR,male_rep VARCHAR) | SELECT COUNT(production_stagemanager) FROM table_22410780_1 WHERE male_rep = "Gabriel Di Chiara" |
What game has a score of 89-91? | CREATE TABLE table_name_27 (game INTEGER,score VARCHAR) | SELECT AVG(game) FROM table_name_27 WHERE score = "89-91" |
Which Player had a Long of 5 and Yards of 6? | CREATE TABLE table_53511 ("Player" text,"Car." real,"Yards" text,"Avg." text,"TD's" real,"Long" text) | SELECT "Player" FROM table_53511 WHERE "Long" = '5' AND "Yards" = '6' |
Show the number of date account opened from each date account opened, and I want to rank by the y axis in desc. | CREATE TABLE Products (product_id INTEGER,parent_product_id INTEGER,production_type_code VARCHAR(15),unit_price DECIMAL(19,4),product_name VARCHAR(80),product_color VARCHAR(20),product_size VARCHAR(20))CREATE TABLE Order_Items (order_item_id INTEGER,order_id INTEGER,product_id INTEGER,product_quantity VARCHAR(50),other... | SELECT date_account_opened, COUNT(date_account_opened) FROM Accounts ORDER BY COUNT(date_account_opened) DESC |
Who was the away team when the home team was Sunderland? | CREATE TABLE table_name_48 (away_team VARCHAR,home_team VARCHAR) | SELECT away_team FROM table_name_48 WHERE home_team = "sunderland" |
What is the name and detail of each staff member? | CREATE TABLE museums (museum_id number,museum_details text)CREATE TABLE street_markets (market_id number,market_details text)CREATE TABLE theme_parks (theme_park_id number,theme_park_details text)CREATE TABLE ref_hotel_star_ratings (star_rating_code text,star_rating_description text)CREATE TABLE royal_family (royal_fam... | SELECT name, other_details FROM staff |
What is the highest place of the song with 38 votes and a draw great than 3? | CREATE TABLE table_71597 ("Draw" real,"Artist" text,"Song" text,"Votes" real,"Place" real) | SELECT MAX("Place") FROM table_71597 WHERE "Votes" = '38' AND "Draw" > '3' |
What Career has a Parallel of , a Combined of , and a Giant Slalom of 5? | CREATE TABLE table_78832 ("Country" text,"Career" text,"Victories" real,"Super G" text,"Giant Slalom" text,"Slalom" text,"Combined" text,"Parallel" text) | SELECT "Career" FROM table_78832 WHERE "Parallel" = '–' AND "Combined" = '–' AND "Giant Slalom" = '5' |
What is the Tenure of the Officer with a Date of death of 2001-08-31? | CREATE TABLE table_9577 ("Name" text,"Rank" text,"Tenure" text,"Date of death" text,"Cause of death" text) | SELECT "Tenure" FROM table_9577 WHERE "Date of death" = '2001-08-31' |
Which engine is used by Team Lemans with Hiroaki Ishiura driving? | CREATE TABLE table_name_65 (engine VARCHAR,team VARCHAR,driver VARCHAR) | SELECT engine FROM table_name_65 WHERE team = "team lemans" AND driver = "hiroaki ishiura" |
How many bronze medals for the United Kingdom when the silver was less than 0? | CREATE TABLE table_64872 ("Rank" text,"Nation" text,"Gold" real,"Silver" real,"Bronze" real,"Total" real) | SELECT AVG("Bronze") FROM table_64872 WHERE "Nation" = 'united kingdom' AND "Silver" < '0' |
What was the away team when the venue was Lake Oval? | CREATE TABLE table_name_30 (away_team VARCHAR,venue VARCHAR) | SELECT away_team FROM table_name_30 WHERE venue = "lake oval" |
For those employees whose salary is in the range of 8000 and 12000 and commission is not null or department number does not equal to 40, show me about the distribution of job_id and the sum of manager_id , and group by attribute job_id in a bar chart, order in asc by the Y. | CREATE TABLE regions (REGION_ID decimal(5,0),REGION_NAME varchar(25))CREATE TABLE countries (COUNTRY_ID varchar(2),COUNTRY_NAME varchar(40),REGION_ID decimal(10,0))CREATE TABLE job_history (EMPLOYEE_ID decimal(6,0),START_DATE date,END_DATE date,JOB_ID varchar(10),DEPARTMENT_ID decimal(4,0))CREATE TABLE jobs (JOB_ID var... | SELECT JOB_ID, SUM(MANAGER_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 GROUP BY JOB_ID ORDER BY SUM(MANAGER_ID) |
What was the home team's score at the match in front of 19,115 at Punt Road Oval? | CREATE TABLE table_32299 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Venue" text,"Crowd" real,"Date" text) | SELECT "Home team score" FROM table_32299 WHERE "Crowd" > '19,115' AND "Venue" = 'punt road oval' |
Which entry has the highest laps of those with constructor Minardi - Fondmetal, driver Marc Gen , and a grid larger than 20? | CREATE TABLE table_58302 ("Driver" text,"Constructor" text,"Laps" real,"Time/Retired" text,"Grid" real) | SELECT MAX("Laps") FROM table_58302 WHERE "Constructor" = 'minardi - fondmetal' AND "Driver" = 'marc gené' AND "Grid" > '20' |
how many patients whose insurance is government and lab test name is alkaline phosphatase? | 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 procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,sho... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.insurance = "Government" AND lab.label = "Alkaline Phosphatase" |
What Partner has a Score of 3 6, 2 6? | CREATE TABLE table_59599 ("Outcome" text,"Date" real,"Tournament" text,"Surface" text,"Partner" text,"Opponents" text,"Score" text) | SELECT "Partner" FROM table_59599 WHERE "Score" = '3–6, 2–6' |
get me the number of hispanic or latino ethnic background patients born before 2107. | 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 = "HISPANIC OR LATINO" AND demographic.dob_year < "2107" |
what is the value when the british name is quaver? | CREATE TABLE table_name_23 (value VARCHAR,british_name VARCHAR) | SELECT value FROM table_name_23 WHERE british_name = "quaver" |
return me the keywords in VLDB conference . | CREATE TABLE writes (aid int,pid int)CREATE TABLE author (aid int,homepage varchar,name varchar,oid int)CREATE TABLE domain_keyword (did int,kid int)CREATE TABLE domain_journal (did int,jid int)CREATE TABLE publication (abstract varchar,cid int,citation_num int,jid int,pid int,reference_num int,title varchar,year int)C... | SELECT keyword.keyword FROM conference, keyword, publication, publication_keyword WHERE conference.name = 'VLDB' AND publication_keyword.kid = keyword.kid AND publication.cid = conference.cid AND publication.pid = publication_keyword.pid |
How many wins when points are more than 51, goals against are more than 23 and losses are 5? | CREATE TABLE table_60060 ("Position" real,"Club" text,"Played" real,"Wins" real,"Draws" real,"Losses" real,"Goals for" real,"Goals against" real,"Points" real,"Goal Difference" real) | SELECT COUNT("Wins") FROM table_60060 WHERE "Points" > '51' AND "Goals against" > '23' AND "Losses" = '5' |
When was there a development rate of 4.92? | CREATE TABLE table_54909 ("From" text,"Adult Rate" text,"Development Rate" text,"16-17 Year Olds Rate" text,"Apprentice Rate" text) | SELECT "From" FROM table_54909 WHERE "Development Rate" = '£4.92' |
Who was the player with a 36.74 average? | CREATE TABLE table_28289 ("Rank" real,"Average" text,"Player" text,"Matches" real,"Innings" real,"Period" text) | SELECT "Player" FROM table_28289 WHERE "Average" = '36.74' |
What is the population if the city is Gilroy? | CREATE TABLE table_27436 ("City" text,"Population" real,"Registered voters" text,"Democratic" text,"Republican" text,"D\u2013R spread" text,"Other" text,"No party preference" text) | SELECT "Population" FROM table_27436 WHERE "City" = 'Gilroy' |
For those employees who did not have any job in the past, for employee_id, hire_date, visualize the trend, I want to display in desc by the x-axis. | CREATE TABLE countries (COUNTRY_ID varchar(2),COUNTRY_NAME varchar(40),REGION_ID decimal(10,0))CREATE TABLE regions (REGION_ID decimal(5,0),REGION_NAME varchar(25))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 v... | SELECT HIRE_DATE, EMPLOYEE_ID FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) ORDER BY HIRE_DATE DESC |
What season shows podium 7? | CREATE TABLE table_4198 ("Season" real,"Series" text,"Team" text,"Races" real,"Wins" real,"Poles" real,"F/Laps" real,"Podiums" real,"Points" real,"Position" text) | SELECT MIN("Season") FROM table_4198 WHERE "Podiums" = '7' |
What is the lowest year when the city is casablanca? | CREATE TABLE table_66098 ("Continent" text,"Location" text,"City" text,"Date" text,"Year" real) | SELECT MIN("Year") FROM table_66098 WHERE "City" = 'casablanca' |
What was the highest number of lose for a player named Santos with more than 45 points? | CREATE TABLE table_name_88 (lose INTEGER,name VARCHAR,point VARCHAR) | SELECT MAX(lose) FROM table_name_88 WHERE name = "santos" AND point > 45 |
Name the record for l 106 116 (ot) | CREATE TABLE table_25875 ("Game" real,"Date" text,"Team" text,"Score" text,"High points" text,"High rebounds" text,"High assists" text,"Location Attendance" text,"Record" text) | SELECT "Record" FROM table_25875 WHERE "Score" = 'L 106–116 (OT)' |
What is the lowest number of games drawn associated with over 39 games played? | CREATE TABLE table_71080 ("First game" real,"Played" real,"Drawn" real,"Lost" real,"Percentage" text) | SELECT MIN("Drawn") FROM table_71080 WHERE "Played" > '39' |
What was the maximum finish position of the car whose constructor was Joe Gibbs Racing, driven by Denny Hamlin? | CREATE TABLE table_27396005_2 (pos INTEGER,constructor VARCHAR,driver VARCHAR) | SELECT MAX(pos) FROM table_27396005_2 WHERE constructor = "Joe Gibbs Racing" AND driver = "Denny Hamlin" |
Name the date for q ngyu n y m | CREATE TABLE table_16162581_1 (date__ce_ VARCHAR,pinyin VARCHAR) | SELECT date__ce_ FROM table_16162581_1 WHERE pinyin = "qíngyuán … yìmǎ" |
Who was the away team when the home team scored 18.20 (128)? | CREATE TABLE table_11534 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Venue" text,"Crowd" real,"Date" text) | SELECT "Away team" FROM table_11534 WHERE "Home team score" = '18.20 (128)' |
what is the total number of patients with diseases of tricuspid valve who remained admitted in the hosiptal for more than 1 day? | 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.days_stay > "1" AND diagnoses.long_title = "Diseases of tricuspid valve" |
What is the latitude of the 0 diameter? | CREATE TABLE table_45117 ("Name" text,"Latitude" text,"Longitude" text,"Diameter (km)" real,"Year named" text) | SELECT "Latitude" FROM table_45117 WHERE "Diameter (km)" = '0' |
For all employees who have the letters D or S in their first name, a bar chart shows the distribution of job_id and the average of department_id , and group by attribute job_id, and I want to order x-axis in ascending order please. | CREATE TABLE regions (REGION_ID decimal(5,0),REGION_NAME varchar(25))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_... | SELECT JOB_ID, AVG(DEPARTMENT_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' GROUP BY JOB_ID ORDER BY JOB_ID |
On which day did the Chicago Cubs have a loss of trout (4-2)? | CREATE TABLE table_name_23 (date VARCHAR,loss VARCHAR) | SELECT date FROM table_name_23 WHERE loss = "trout (4-2)" |
Return a pie chart on what is the average base price of rooms, for each bed type? | CREATE TABLE Rooms (RoomId TEXT,roomName TEXT,beds INTEGER,bedType TEXT,maxOccupancy INTEGER,basePrice INTEGER,decor TEXT)CREATE TABLE Reservations (Code INTEGER,Room TEXT,CheckIn TEXT,CheckOut TEXT,Rate REAL,LastName TEXT,FirstName TEXT,Adults INTEGER,Kids INTEGER) | SELECT bedType, AVG(basePrice) FROM Rooms GROUP BY bedType |
what's the score with date oct 1 | CREATE TABLE table_16938 ("Date" text,"Tournament" text,"Location" text,"Purse($)" real,"Winner" text,"Score" text,"1st Prize($)" real) | SELECT "Score" FROM table_16938 WHERE "Date" = 'Oct 1' |
What years does milt palacio play? | CREATE TABLE table_56296 ("Player" text,"Nationality" text,"Position" text,"Years for Jazz" text,"School/Club Team" text) | SELECT "Years for Jazz" FROM table_56296 WHERE "Player" = 'milt palacio' |
flights from KANSAS CITY to CLEVELAND on wednesday arriving before 1700 | CREATE TABLE airport (airport_code varchar,airport_name text,airport_location text,state_code varchar,country_name varchar,time_zone_code varchar,minimum_connect_time int)CREATE TABLE code_description (code varchar,description text)CREATE TABLE airline (airline_code varchar,airline_name text,note text)CREATE TABLE date... | 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.arrival_time <... |
Bar chart x axis date moved in y axis how many date moved in, order from high to low by the Y-axis. | CREATE TABLE Organizations (organization_id INTEGER,parent_organization_id INTEGER,organization_details VARCHAR(255))CREATE TABLE Timed_Locations_of_Things (thing_id INTEGER,Date_and_Time DATETIME,Location_Code CHAR(15))CREATE TABLE Properties (property_id INTEGER,property_type_code CHAR(15),property_address VARCHAR(25... | SELECT date_moved_in, COUNT(date_moved_in) FROM Customer_Events ORDER BY COUNT(date_moved_in) DESC |
What is the minimum number of starts for the players having a best finish of T18? | CREATE TABLE table_73695 ("Player" text,"Starts" real,"Cuts made" real,"Best finish" text,"Money list rank" real,"Earnings ($)" real) | SELECT MIN("Starts") FROM table_73695 WHERE "Best finish" = 'T18' |
What is the lowest number of events the Open Championship has with a less than 0 top-10? | CREATE TABLE table_name_30 (events INTEGER,tournament VARCHAR,top_10 VARCHAR) | SELECT MIN(events) FROM table_name_30 WHERE tournament = "the open championship" AND top_10 < 0 |
Which Team 1 faced Dynamos FC? | CREATE TABLE table_71673 ("Team 1" text,"Agg." text,"Team 2" text,"1st leg" text,"2nd leg" text) | SELECT "Team 1" FROM table_71673 WHERE "Team 2" = 'dynamos fc' |
what was the drawn when the tries for was 46? | CREATE TABLE table_12792876_3 (drawn VARCHAR,tries_for VARCHAR) | SELECT drawn FROM table_12792876_3 WHERE tries_for = "46" |
What is Height, when Rank is less than 20, when Floors is greater than 9, when Built is 2005, and when Name is The Edge (C)? | CREATE TABLE table_75911 ("Rank" real,"Name" text,"Built" real,"Height" text,"Floors" real) | SELECT "Height" FROM table_75911 WHERE "Rank" < '20' AND "Floors" > '9' AND "Built" = '2005' AND "Name" = 'the edge (c)' |
How many stages were won by Robbie McEwen? | CREATE TABLE table_17672470_19 (stage VARCHAR,winner VARCHAR) | SELECT COUNT(stage) FROM table_17672470_19 WHERE winner = "Robbie McEwen" |
How many years was the operating profit (s$m) 717.1? | CREATE TABLE table_20572 ("Year ended" text,"Revenue (S$m)" text,"Expenditure (S$m)" text,"Operating profit (S$m)" text,"Profit before taxation (S$m)" text,"Profit attributable to equity holders (S$m)" text,"EPS after tax \u2013 diluted (cents)" text) | SELECT COUNT("Profit before taxation (S$m)") FROM table_20572 WHERE "Operating profit (S$m)" = '717.1' |
Show me a stacked bar graph, the x-axis is the nationality of ship, and the y-axis is their total number of different nationality and split by ship type, order from low to high by the total number. | 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 Nationality, COUNT(Nationality) FROM ship GROUP BY Type, Nationality ORDER BY COUNT(Nationality) |
Matlab and Python questions per Month. | 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 *, COUNT(*) AS count FROM (SELECT DATEADD(MONTH, DATEDIFF(MONTH, 0, CreationDate), 0) AS "month", t.TagName AS "tag" FROM Posts AS p JOIN PostTags AS pt ON pt.PostId = p.Id JOIN Tags AS t ON t.Id = pt.TagId WHERE t.TagName IN ('python', 'matlab', 'simulink')) AS X GROUP BY 'tag', month ORDER BY 'tag', month |
how much has patient 003-17096 changed in ast (sgot) levels last measured on the first hospital visit compared to the first value measured on the first hospital visit? | CREATE TABLE medication (medicationid number,patientunitstayid number,drugname text,dosage text,routeadmin text,drugstarttime time,drugstoptime time)CREATE TABLE vitalperiodic (vitalperiodicid number,patientunitstayid number,temperature number,sao2 number,heartrate number,respiration number,systemicsystolic number,syst... | SELECT (SELECT lab.labresult FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '003-17096' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospi... |
What is the Weight of the person born 1981-02-24 from the Uralochka Zlatoust club ? | CREATE TABLE table_58679 ("Name" text,"Pos." text,"Height" text,"Weight" text,"Date of Birth" text,"Club" text) | SELECT "Weight" FROM table_58679 WHERE "Club" = 'uralochka zlatoust' AND "Date of Birth" = '1981-02-24' |
List the total number of records from Lambeau Field. | CREATE TABLE table_1070 ("Week" real,"Date" text,"Opponent" text,"Location" text,"Time (ET)" text,"TV" text,"Result" text,"Record" text) | SELECT COUNT("Record") FROM table_1070 WHERE "Location" = 'Lambeau Field' |
Name the class for makoto tamada and races is 17 | CREATE TABLE table_1221 ("Year" real,"Class" text,"Team name" text,"Bike" text,"Riders" text,"Races" text,"Wins" real,"Podiums" real,"Poles" real,"F.laps" real,"Points" text,"Pos." text) | SELECT "Class" FROM table_1221 WHERE "Riders" = 'Makoto Tamada' AND "Races" = '17' |
which city has only 5 barangays ? | CREATE TABLE table_204_987 (id number,"city/municipality" text,"no. of\nbarangays" number,"area\n(km2)" number,"population\n(2010 census)" number,"pop. density\n(per km2)" number) | SELECT "city/municipality" FROM table_204_987 WHERE "no. of\nbarangays" = 5 |
count the number of patients whose admission location is transfer from hosp/extram and drug name is gentamicin? | CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital_status text,age text,dob text,gender text,la... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admission_location = "TRANSFER FROM HOSP/EXTRAM" AND prescriptions.drug = "Gentamicin" |
Return a bar chart on what are the names and average prices of products for manufacturers whose products cost on average 150 or more?, and sort total number in descending order. | 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, AVG(T1.Price) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name ORDER BY AVG(T1.Price) DESC |
what's the % with total value of 249887 and queens value of 6.8% | CREATE TABLE table_16453 ("1932 (before recount)" text,"party" text,"Manhattan" text,"The Bronx" text,"Brooklyn" text,"Queens" text,"Richmond [Staten Is.]" text,"Total" real,"%" text) | SELECT "%" FROM table_16453 WHERE "Total" = '249887' AND "Queens" = '6.8%' |
What Combined has a 100 yard Freestyle of cody miller (palo verde)? | CREATE TABLE table_59614 ("Combined" text,"50 yard Freestyle" text,"100 yard Freestyle" text,"200 yard Freestyle" text,"500 yard Freestyle" text,"100 yard Backstroke" text,"100 yard Butterfly" text) | SELECT "Combined" FROM table_59614 WHERE "100 yard Freestyle" = 'cody miller (palo verde)' |
What is the date of birth of the person who started their reign in 1986? | CREATE TABLE table_name_61 (Birth VARCHAR,start_of_reign VARCHAR) | SELECT Birth AS name FROM table_name_61 WHERE start_of_reign = 1986 |
Plot the total number by grouped by competition type as a bar graph, and order X in ascending order. | CREATE TABLE player (Player_ID int,name text,Position text,Club_ID int,Apps real,Tries real,Goals text,Points real)CREATE TABLE competition_result (Competition_ID int,Club_ID_1 int,Club_ID_2 int,Score text)CREATE TABLE club (Club_ID int,name text,Region text,Start_year text)CREATE TABLE club_rank (Rank real,Club_ID int... | SELECT Competition_type, COUNT(*) FROM competition GROUP BY Competition_type ORDER BY Competition_type |
How many faculty members do we have for each rank? Show bar chart, rank X-axis from high to low order please. | CREATE TABLE Faculty (FacID INTEGER,Lname VARCHAR(15),Fname VARCHAR(15),Rank VARCHAR(15),Sex VARCHAR(1),Phone INTEGER,Room VARCHAR(5),Building VARCHAR(13))CREATE TABLE Faculty_Participates_in (FacID INTEGER,actid INTEGER)CREATE TABLE Activity (actid INTEGER,activity_name varchar(25))CREATE TABLE Participates_in (stuid ... | SELECT Rank, COUNT(Rank) FROM Faculty GROUP BY Rank ORDER BY Rank DESC |
give me the number of urgent type hospital admission patients who were ordered aspartate aminotransferase (ast) lab test. | 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.admission_type = "URGENT" AND lab.label = "Asparate Aminotransferase (AST)" |
Most Common Names with Jon. | CREATE TABLE PostTags (PostId number,TagId number)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,LastEditorUserId number,LastEditorDisplayName text,LastEditDate t... | SELECT DisplayName, COUNT(*) AS total FROM Users WHERE DisplayName LIKE 'Jon %' GROUP BY DisplayName ORDER BY DisplayName DESC LIMIT 10 |
what flights go from NEWARK to BOSTON after 1024 in the morning | CREATE TABLE fare_basis (fare_basis_code text,booking_class text,class_type text,premium text,economy text,discounted text,night text,season text,basis_days text)CREATE TABLE dual_carrier (main_airline varchar,low_flight_number int,high_flight_number int,dual_airline varchar,service_name text)CREATE TABLE code_descript... | 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_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BOSTON' AND flight.departure_time > 1024 AND flight.to_airport = AIRPORT_SERVICE_1.airpor... |
what day did the team go to toronto | CREATE TABLE table_5202 ("Date" text,"Visitor" text,"Score" text,"Home" text,"Record" text) | SELECT "Date" FROM table_5202 WHERE "Visitor" = 'toronto' |
What is the quantity preserved to the locomotive with a quantity made of 6? | CREATE TABLE table_name_11 (quantity_preserved VARCHAR,quantity_made VARCHAR) | SELECT quantity_preserved FROM table_name_11 WHERE quantity_made = "6" |
wich spokesperson talked on luxembourg | CREATE TABLE table_184803_4 (spokespersons VARCHAR,country VARCHAR) | SELECT spokespersons FROM table_184803_4 WHERE country = "Luxembourg" |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.