instruction stringlengths 0 1.06k | input stringlengths 11 5.3k | response stringlengths 2 4.44k |
|---|---|---|
What type of motorsport has a session of pre-race test? | CREATE TABLE table_8534 ("Discipline" text,"Championship" text,"Circuit" text,"Event" text,"Session" text,"Cause" text) | SELECT "Discipline" FROM table_8534 WHERE "Session" = 'pre-race test' |
List every album ordered by album title in ascending order. | CREATE TABLE media_types (id number,name text)CREATE TABLE invoices (id number,customer_id number,invoice_date time,billing_address text,billing_city text,billing_state text,billing_country text,billing_postal_code text,total number)CREATE TABLE albums (id number,title text,artist_id number)CREATE TABLE employees (id n... | SELECT title FROM albums ORDER BY title |
What is the average age of players from USA? | CREATE TABLE player (player_id text,birth_year text,birth_month text,birth_day text,birth_country text,birth_state text,birth_city text,death_year text,death_month text,death_day text,death_country text,death_state text,death_city text,name_first text,name_last text,name_given text,weight text)CREATE TABLE hall_of_fame... | SELECT AVG(death_year - birth_year) FROM player WHERE birth_country = "USA" |
Find the maximum capacity among rooms in each building with a bar chart. | CREATE TABLE takes (ID varchar(5),course_id varchar(8),sec_id varchar(8),semester varchar(6),year numeric(4,0),grade varchar(2))CREATE TABLE instructor (ID varchar(5),name varchar(20),dept_name varchar(20),salary numeric(8,2))CREATE TABLE prereq (course_id varchar(8),prereq_id varchar(8))CREATE TABLE section (course_id... | SELECT building, MAX(capacity) FROM classroom GROUP BY building |
Who was the home team in the game where North Melbourne was the away team? | CREATE TABLE table_78417 ("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_78417 WHERE "Away team" = 'north melbourne' |
Which zone had m d lina gojnea monica niculescu as the opponent? | CREATE TABLE table_56730 ("Edition" real,"Zone" text,"Round" text,"Date" text,"Against" text,"Surface" text,"Partner" text,"Opponents" text,"Result" text) | SELECT "Zone" FROM table_56730 WHERE "Opponents" = 'mădălina gojnea monica niculescu' |
What is Pronunciation Spelled Free, when Pronunciation Spelled Checked is ' '? | CREATE TABLE table_name_24 (pronunciation_spelled_free VARCHAR,pronunciation_spelled_checked VARCHAR) | SELECT pronunciation_spelled_free FROM table_name_24 WHERE pronunciation_spelled_checked = "ɑ" |
Return a bar chart about the distribution of meter_200 and the amount of meter_200 , and group by attribute meter_200, and list by the bar in descending. | CREATE TABLE record (ID int,Result text,Swimmer_ID int,Event_ID int)CREATE TABLE stadium (ID int,name text,Capacity int,City text,Country text,Opening_year int)CREATE TABLE swimmer (ID int,name text,Nationality text,meter_100 real,meter_200 text,meter_300 text,meter_400 text,meter_500 text,meter_600 text,meter_700 text... | SELECT meter_200, COUNT(meter_200) FROM swimmer GROUP BY meter_200 ORDER BY meter_200 DESC |
How many times are listed for 31 May for the rider ranked 5? | CREATE TABLE table_27462 ("Rank" real,"Rider" text,"Sat 29 May" text,"Mon 31 May" text,"Tues 1 June" text,"Wed 2 June" text,"Thurs 3 June" text,"Fri 4 June" text) | SELECT COUNT("Mon 31 May") FROM table_27462 WHERE "Rank" = '5' |
Most common badges by count. | CREATE TABLE PendingFlags (Id number,FlagTypeId number,PostId number,CreationDate time,CloseReasonTypeId number,CloseAsOffTopicReasonTypeId number,DuplicateOfQuestionId number,BelongsOnBaseHostAddress text)CREATE TABLE PostsWithDeleted (Id number,PostTypeId number,AcceptedAnswerId number,ParentId number,CreationDate ti... | SELECT COUNT(UserId) AS Earned, Name, CASE WHEN Class = 1 THEN 'Gold' WHEN Class = 2 THEN 'Silver' WHEN Class = 3 THEN 'Bronze' END AS Class FROM Badges WHERE TagBased = 0 GROUP BY Name, Class ORDER BY Earned DESC |
How many assists does cam long average in under 132 games? | CREATE TABLE table_69827 ("Rank" real,"Player" text,"Years" text,"Games" real,"Ast. Avg." real,"Total Assists" real) | SELECT MAX("Ast. Avg.") FROM table_69827 WHERE "Player" = 'cam long' AND "Games" < '132' |
What was the most recent year a height of 2770 m and a HC climb before 1992 was climbed? | CREATE TABLE table_name_56 (most_recent VARCHAR,height__m_ VARCHAR,first_time_as_hc_climb VARCHAR) | SELECT COUNT(most_recent) FROM table_name_56 WHERE height__m_ = "2770" AND first_time_as_hc_climb < 1992 |
Who is the captain of Middlesbrough? | CREATE TABLE table_name_15 (captain VARCHAR,club VARCHAR) | SELECT captain FROM table_name_15 WHERE club = "middlesbrough" |
Number of Tags per day for one tag. | CREATE TABLE Tags (Id number,TagName text,Count number,ExcerptPostId number,WikiPostId 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 numb... | SELECT * FROM Tags LIMIT 20 |
For those records from the products and each product's manufacturer, draw a bar chart about the distribution of name and the average of revenue , and group by attribute name, show x axis in descending order. | 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 T2.Name, T2.Revenue FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name ORDER BY T2.Name DESC |
What is the Thurs 2 June time for the rider with a Fri 3 June time of 17' 36.58 128.554mph? | CREATE TABLE table_74369 ("Rank" real,"Rider" text,"Mon 30 May" text,"Tues 31 May" text,"Wed 1 June" text,"Thurs 2 June" text,"Fri 3 June" text) | SELECT "Thurs 2 June" FROM table_74369 WHERE "Fri 3 June" = '17'' 36.58 128.554mph' |
What is the nickname of the institution from Concordia University, Nebraska? | CREATE TABLE table_28501 ("Institution" text,"Location" text,"Founded" real,"Type" text,"Enrollment" real,"Joined" real,"Nickname" text) | SELECT "Nickname" FROM table_28501 WHERE "Institution" = 'Concordia University, Nebraska' |
count the number of patients who were given a stool microbiology test since 5 years ago. | CREATE TABLE vitalperiodic (vitalperiodicid number,patientunitstayid number,temperature number,sao2 number,heartrate number,respiration number,systemicsystolic number,systemicdiastolic number,systemicmean number,observationtime time)CREATE TABLE lab (labid number,patientunitstayid number,labname text,labresult number,l... | SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE patient.patientunitstayid IN (SELECT microlab.patientunitstayid FROM microlab WHERE microlab.culturesite = 'stool' AND DATETIME(microlab.culturetakentime) >= DATETIME(CURRENT_TIME(), '-5 year')) |
A bar chart shows the distribution of Date_of_Birth and Weight , and order Y-axis in desc order please. | CREATE TABLE candidate (Candidate_ID int,People_ID int,Poll_Source text,Date text,Support_rate real,Consider_rate real,Oppose_rate real,Unsure_rate real)CREATE TABLE people (People_ID int,Sex text,Name text,Date_of_Birth text,Height real,Weight real) | SELECT Date_of_Birth, Weight FROM people ORDER BY Weight DESC |
What is T2 Place Player Steve Flesch's Score? | CREATE TABLE table_78596 ("Place" text,"Player" text,"Country" text,"Score" real,"To par" text) | SELECT MAX("Score") FROM table_78596 WHERE "Place" = 't2' AND "Player" = 'steve flesch' |
What is the Borough for the Seward listing on 1977-11-23? | CREATE TABLE table_47771 ("Name" text,"Built" text,"Listed" text,"Location" text,"Borough" text) | SELECT "Borough" FROM table_47771 WHERE "Location" = 'seward' AND "Listed" = '1977-11-23' |
What are the names of body builders whose total score is higher than 300? | CREATE TABLE body_builder (body_builder_id number,people_id number,snatch number,clean_jerk number,total number)CREATE TABLE people (people_id number,name text,height number,weight number,birth_date text,birth_place text) | SELECT T2.name FROM body_builder AS T1 JOIN people AS T2 ON T1.people_id = T2.people_id WHERE T1.total > 300 |
How many courses are taught by more than 2 professors ? | 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 COUNT(DISTINCT course_offering.course_id) FROM course, course_offering, offering_instructor AS OFFERING_INSTRUCTOR_0, offering_instructor AS OFFERING_INSTRUCTOR_1, offering_instructor AS OFFERING_INSTRUCTOR_2 WHERE course.course_id = course_offering.course_id AND course.department = 'EECS' AND OFFERING_INSTRUCTO... |
What is the Position with a height of less than 183, and a weight of less than 91 kg and born in bloomington, minnesota? | CREATE TABLE table_name_73 (position VARCHAR,birthplace VARCHAR,height__cm_ VARCHAR,weight__kg_ VARCHAR) | SELECT position FROM table_name_73 WHERE height__cm_ < 183 AND weight__kg_ < 91 AND birthplace = "bloomington, minnesota" |
What event was held in Chihuahua, Mexico? | CREATE TABLE table_name_16 (event VARCHAR,venue VARCHAR) | SELECT event FROM table_name_16 WHERE venue = "chihuahua, mexico" |
What is the sum of credit value of courses with more than one prerequisite for each department? Return a bar chart, and show in descending by the dept_name. | CREATE TABLE instructor (ID varchar(5),name varchar(20),dept_name varchar(20),salary numeric(8,2))CREATE TABLE prereq (course_id varchar(8),prereq_id varchar(8))CREATE TABLE time_slot (time_slot_id varchar(4),day varchar(1),start_hr numeric(2),start_min numeric(2),end_hr numeric(2),end_min numeric(2))CREATE TABLE stude... | SELECT dept_name, SUM(credits) FROM course AS T1 JOIN prereq AS T2 ON T1.course_id = T2.course_id GROUP BY dept_name ORDER BY dept_name DESC |
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 the trend about department_id over hire_date with a line chart, and order by the X-axis in asc please. | CREATE TABLE regions (REGION_ID decimal(5,0),REGION_NAME varchar(25))CREATE TABLE employees (EMPLOYEE_ID decimal(6,0),FIRST_NAME varchar(20),LAST_NAME varchar(25),EMAIL varchar(25),PHONE_NUMBER varchar(20),HIRE_DATE date,JOB_ID varchar(10),SALARY decimal(8,2),COMMISSION_PCT decimal(2,2),MANAGER_ID decimal(6,0),DEPARTME... | SELECT HIRE_DATE, DEPARTMENT_ID FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 ORDER BY HIRE_DATE |
If the area is 66.34, what is the minimum (2010 census) population? | CREATE TABLE table_232458_1 (population__2010_census_ INTEGER,area__km²_ VARCHAR) | SELECT MIN(population__2010_census_) FROM table_232458_1 WHERE area__km²_ = "66.34" |
In the match where south melbourne was the away team, who was the home team? | CREATE TABLE table_56850 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Venue" text,"Crowd" real,"Date" text) | SELECT "Home team" FROM table_56850 WHERE "Away team" = 'south melbourne' |
what is the marital status of Stephane Suchan? | 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 diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title ... | SELECT demographic.marital_status FROM demographic WHERE demographic.name = "Stephanie Suchan" |
Name the party with end date of 22 november 1980 | CREATE TABLE table_14844 ("Minister" text,"Party" text,"Start date" text,"End date" text,"Prime Minister" text) | SELECT "Party" FROM table_14844 WHERE "End date" = '22 november 1980' |
Which competition did not qualify for UEFA competitions in the 1970-71 season? | CREATE TABLE table_name_67 (competition VARCHAR,lost VARCHAR,season VARCHAR) | SELECT competition FROM table_name_67 WHERE lost = "did not qualify for uefa competitions" AND season = "1970-71" |
total races in 2003 season | CREATE TABLE table_204_283 (id number,"season" text,"series" text,"team" text,"races" number,"wins" number,"poles" number,"f/laps" number,"podiums" number,"points" number,"position" text) | SELECT SUM("races") FROM table_204_283 WHERE "season" = 2003 |
How many events have each participants attended? Show their average number by each participant type code using a bar chart, and list by the x axis in desc. | CREATE TABLE Participants_in_Events (Event_ID INTEGER,Participant_ID INTEGER)CREATE TABLE Events (Event_ID INTEGER,Service_ID INTEGER,Event_Details VARCHAR(255))CREATE TABLE Participants (Participant_ID INTEGER,Participant_Type_Code CHAR(15),Participant_Details VARCHAR(255))CREATE TABLE Services (Service_ID INTEGER,Ser... | SELECT T1.Participant_Type_Code, AVG(COUNT(*)) FROM Participants AS T1 JOIN Participants_in_Events AS T2 ON T1.Participant_ID = T2.Participant_ID GROUP BY T1.Participant_Type_Code ORDER BY T1.Participant_Type_Code DESC |
What was the score for the player from Scotland? | CREATE TABLE table_48693 ("Place" text,"Player" text,"Country" text,"Score" text,"To par" text) | SELECT "Score" FROM table_48693 WHERE "Country" = 'scotland' |
How many in attendance with a loss of volquez (1 4)? | CREATE TABLE table_52845 ("Date" text,"Opponent" text,"Score" text,"Loss" text,"Attendance" real,"Record" text) | SELECT "Attendance" FROM table_52845 WHERE "Loss" = 'volquez (1–4)' |
What was the Series in 2009? | CREATE TABLE table_name_67 (series VARCHAR,season VARCHAR) | SELECT series FROM table_name_67 WHERE season = 2009 |
What was the record on March 27? | CREATE TABLE table_name_40 (record VARCHAR,date VARCHAR) | SELECT record FROM table_name_40 WHERE date = "march 27" |
How many members are in each party. Show bar chart. | CREATE TABLE party_events (Event_ID int,Event_Name text,Party_ID int,Member_in_charge_ID int)CREATE TABLE region (Region_ID int,Region_name text,Date text,Label text,Format text,Catalogue text)CREATE TABLE party (Party_ID int,Minister text,Took_office text,Left_office text,Region_ID int,Party_name text)CREATE TABLE mem... | SELECT Party_name, COUNT(*) FROM member AS T1 JOIN party AS T2 ON T1.Party_ID = T2.Party_ID GROUP BY T1.Party_ID |
what is the score when the runner-up is richard krajicek? | CREATE TABLE table_53890 ("Tournament" text,"Winner" text,"Runner-up" text,"Score" text,"Third Place" text) | SELECT "Score" FROM table_53890 WHERE "Runner-up" = 'richard krajicek' |
Show me a pie chart for how many documents are there of each type? | CREATE TABLE Accounts (Account_ID INTEGER,Statement_ID INTEGER,Account_Details VARCHAR(255))CREATE TABLE Projects (Project_ID INTEGER,Project_Details VARCHAR(255))CREATE TABLE Ref_Document_Types (Document_Type_Code CHAR(15),Document_Type_Name VARCHAR(255),Document_Type_Description VARCHAR(255))CREATE TABLE Documents_wi... | SELECT Document_Type_Code, COUNT(*) FROM Documents GROUP BY Document_Type_Code |
Wh owas the captian of the north east stars? | CREATE TABLE table_25794138_1 (captain VARCHAR,team VARCHAR) | SELECT captain FROM table_25794138_1 WHERE team = "North East Stars" |
Who was the GTU winning team when the TO winning team was #3 Camaro? | CREATE TABLE table_13642023_2 (gtu_winning_team VARCHAR,to_winning_team VARCHAR) | SELECT gtu_winning_team FROM table_13642023_2 WHERE to_winning_team = "#3 Camaro" |
give me the number of patients whose age is less than 86 and days of hospital stay is greater than 34? | 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 demographic (subject_id text,hadm_id t... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.age < "86" AND demographic.days_stay > "34" |
For those employees who was hired before 2002-06-21, a bar chart shows the distribution of job_id and the average of department_id , and group by attribute job_id, show X in descending order please. | CREATE TABLE jobs (JOB_ID varchar(10),JOB_TITLE varchar(35),MIN_SALARY decimal(6,0),MAX_SALARY decimal(6,0))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 ... | SELECT JOB_ID, AVG(DEPARTMENT_ID) FROM employees WHERE HIRE_DATE < '2002-06-21' GROUP BY JOB_ID ORDER BY JOB_ID DESC |
What is the home teams score at Victoria Park? | CREATE TABLE table_78276 ("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_78276 WHERE "Venue" = 'victoria park' |
What is the name of the home team that played against Collingwood? | CREATE TABLE table_name_17 (home_team VARCHAR,away_team VARCHAR) | SELECT home_team FROM table_name_17 WHERE away_team = "collingwood" |
Almost AbandonedClosed questions (one vote missing in question and/or answer). This query aims to identify borderline questions to the RemoveAbandonedClosed script described in https://meta.stackexchange.com/help/roomba. All criteria are met except score from question and/or answers(s) which are one vote off from autom... | CREATE TABLE ReviewTaskTypes (Id number,Name text,Description text)CREATE TABLE ReviewTasks (Id number,ReviewTaskTypeId number,CreationDate time,DeletionDate time,ReviewTaskStateId number,PostId number,SuggestedEditId number,CompletedByReviewTaskId number)CREATE TABLE ReviewTaskResults (Id number,ReviewTaskId number,Re... | SELECT q.Id AS "post_link" FROM Posts AS q INNER JOIN PostHistory AS ph ON ph.PostId = q.Id WHERE q.ClosedDate < CURRENT_TIMESTAMP() - 9 AND ph.PostHistoryTypeId = 10 AND ph.Comment NOT IN ('1', '101') AND NOT EXISTS(SELECT * FROM PostHistory AS ph WHERE ph.PostId = q.Id AND ph.PostHistoryTypeId = 14) AND q.Score <= 1 ... |
What was the score of the Washington tournament? | CREATE TABLE table_31550 ("Outcome" text,"Date" text,"Tournament" text,"Surface" text,"Opponent" text,"Score" text) | SELECT "Score" FROM table_31550 WHERE "Tournament" = 'washington' |
which team did they play first during this season ? | CREATE TABLE table_204_971 (id number,"m" number,"date" text,"tournament" text,"round" text,"ground" text,"opponent" text,"score" text,"attendance" number,"dinamo scorers" text,"report" text) | SELECT "opponent" FROM table_204_971 WHERE "m" = 1 |
How many cuts did he make in the tournament with 3 top 25s and under 13 events? | CREATE TABLE table_name_44 (cuts_made INTEGER,top_25 VARCHAR,events VARCHAR) | SELECT MAX(cuts_made) FROM table_name_44 WHERE top_25 = 3 AND events < 13 |
Which Opponent had a Surface of hard, and a Partner of maria elena camerin? | CREATE TABLE table_6703 ("Outcome" text,"Date" text,"Tournament" text,"Surface" text,"Partner" text,"Opponent" text,"Score" text) | SELECT "Opponent" FROM table_6703 WHERE "Surface" = 'hard' AND "Partner" = 'maria elena camerin' |
what is diagnoses long title of subject name paul edwards? | 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,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 t... | SELECT diagnoses.long_title FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.name = "Paul Edwards" |
what was the name of the procedure that patient 4718 received two times until 08/2102. | CREATE TABLE admissions (row_id number,subject_id number,hadm_id number,admittime time,dischtime time,admission_type text,admission_location text,discharge_location text,insurance text,language text,marital_status text,ethnicity text,age number)CREATE TABLE d_icd_diagnoses (row_id number,icd9_code text,short_title text... | SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT t1.icd9_code FROM (SELECT procedures_icd.icd9_code, COUNT(procedures_icd.charttime) AS c1 FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 471... |
When was the away team geelong? | CREATE TABLE table_name_13 (date VARCHAR,away_team VARCHAR) | SELECT date FROM table_name_13 WHERE away_team = "geelong" |
What are the fewest losses for a player lower than 3, with wins fewer than 75%, 0 draws and 56 points? | CREATE TABLE table_name_76 (lost INTEGER,points VARCHAR,drawn VARCHAR,played VARCHAR,_percentage_won VARCHAR) | SELECT MIN(lost) FROM table_name_76 WHERE played > 3 AND _percentage_won < 75 AND drawn = 0 AND points = 56 |
What was the score of Game 48? | CREATE TABLE table_63165 ("Game" text,"Date" text,"Opponent" text,"Score" text,"Location/Attendance" text,"Record" text) | SELECT "Score" FROM table_63165 WHERE "Game" = '48' |
Comments that vastly outscore the posts they're under. | CREATE TABLE Comments (Id number,PostId number,Score number,Text text,CreationDate time,UserDisplayName text,UserId number,ContentLicense text)CREATE TABLE CloseAsOffTopicReasonTypes (Id number,IsUniversal boolean,InputTitle text,MarkdownInputGuidance text,MarkdownPostOwnerGuidance text,MarkdownPrivilegedUserGuidance t... | SELECT Comments.Score AS "CS", Posts.Score AS "PS", ROUND(CAST(Comments.Score AS FLOAT) / CAST(Posts.Score AS FLOAT), 0.001) AS r, Comments.Id AS "comment_link", Users.Id AS "user_link", Posts.Id AS "post_link", Comments.CreationDate FROM Comments JOIN Posts ON Comments.PostId = Posts.Id LEFT JOIN Users ON Comments.Use... |
What is the To par of the Player with a Score of 70-72-73=215? | CREATE TABLE table_name_7 (to_par VARCHAR,score VARCHAR) | SELECT to_par FROM table_name_7 WHERE score = 70 - 72 - 73 = 215 |
For all employees who have the letters D or S in their first name, show me about the correlation between manager_id and department_id in a scatter chart. | 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 countries (COUNTRY_ID varchar(2),COUNTRY_NAME varchar(40),REGION_ID decimal(10,0))CREATE TABLE employees (EMPLOYEE_ID decimal(6,0),FIRST_NAME... | SELECT MANAGER_ID, DEPARTMENT_ID FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' |
what is the number of patients on base type drug prescription who have diagnoses icd9 code 70715? | 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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.icd9_code = "70715" AND prescriptions.drug_type = "BASE" |
What is RJCM's IATA? | CREATE TABLE table_67884 ("City" text,"Province/Region" text,"Country" text,"IATA" text,"ICAO" text,"Airport" text) | SELECT "IATA" FROM table_67884 WHERE "ICAO" = 'rjcm' |
How many different play-by-play announcers also had pregame analysis by Darren Flutie, Eric Tillman and Greg Frers? | CREATE TABLE table_17628022_2 (play_by_play VARCHAR,pregame_analysts VARCHAR) | SELECT COUNT(play_by_play) FROM table_17628022_2 WHERE pregame_analysts = "Darren Flutie, Eric Tillman and Greg Frers" |
What is the percentage of growth in 2000-2008 in ethiopia? | CREATE TABLE table_72124 ("Nation" text,"Population (thousands)" real,"Internet subscriptions (2000) (thousands of users)" real,"Internet subscriptions (2008) (thousands of users)" real,"% growth (2000\u20132008)" real,"% Internet users" real) | SELECT "% growth (2000\u20132008)" FROM table_72124 WHERE "Nation" = 'Ethiopia' |
Name the 2004 which has a 2003 of 36,026? | CREATE TABLE table_name_19 (Id VARCHAR) | SELECT 2004 FROM table_name_19 WHERE 2003 = "36,026" |
What is the minimum ends lost record when the stolen ends records is 6 and the loss record is bigger than 5.0? | CREATE TABLE table_29545993_3 (Ends INTEGER,stolen_ends VARCHAR,l VARCHAR) | SELECT MIN(Ends) AS lost FROM table_29545993_3 WHERE stolen_ends = 6 AND l > 5.0 |
What draft pick number was Ric Jackman? | CREATE TABLE table_74266 ("Pick" real,"Player" text,"Position" text,"Nationality" text,"NHL team" text,"College/junior/club team" text) | SELECT MIN("Pick") FROM table_74266 WHERE "Player" = 'Ric Jackman' |
Draw a bar chart of meter 200 versus the average of id, show from high to low by the Y. | CREATE TABLE stadium (ID int,name text,Capacity int,City text,Country text,Opening_year int)CREATE TABLE swimmer (ID int,name text,Nationality text,meter_100 real,meter_200 text,meter_300 text,meter_400 text,meter_500 text,meter_600 text,meter_700 text,Time text)CREATE TABLE record (ID int,Result text,Swimmer_ID int,Ev... | SELECT meter_200, AVG(ID) FROM swimmer GROUP BY meter_200 ORDER BY AVG(ID) DESC |
what's the total number of singles w-l with doubles w-l of 0 0 and total w-l of 3 1 | CREATE TABLE table_15892 ("Player" text,"Years Played" text,"Total W-L" text,"Singles W-L" text,"Doubles W-L" text) | SELECT COUNT("Singles W-L") FROM table_15892 WHERE "Doubles W-L" = '0–0' AND "Total W-L" = '3–1' |
what is the ships name that is a twin screw ro-ro motorship and entered service on 11 february 1983? | CREATE TABLE table_55400 ("Ship's name" text,"Date entered service" text,"Date withdrawn" text,"Tonnage" real,"Type of Ship" text) | SELECT "Ship's name" FROM table_55400 WHERE "Type of Ship" = 'twin screw ro-ro motorship' AND "Date entered service" = '11 february 1983' |
Which season has the Werder Bremen Club and is in Round 2r? | CREATE TABLE table_name_50 (season VARCHAR,club VARCHAR,round VARCHAR) | SELECT season FROM table_name_50 WHERE club = "werder bremen" AND round = "2r" |
What was the date when the attendance was n/a and the Man of the Match was unknown? | CREATE TABLE table_name_32 (date VARCHAR,attendance VARCHAR,man_of_the_match VARCHAR) | SELECT date FROM table_name_32 WHERE attendance = "n/a" AND man_of_the_match = "unknown" |
what is the time/retired when the driver is toulo de graffenried? | CREATE TABLE table_name_81 (time_retired VARCHAR,driver VARCHAR) | SELECT time_retired FROM table_name_81 WHERE driver = "toulo de graffenried" |
What is the 4wi when the economy is 7.82? | CREATE TABLE table_27268238_5 (economy VARCHAR) | SELECT 4 AS wi FROM table_27268238_5 WHERE economy = "7.82" |
had there been a microbiology test done until 35 months ago for patient 46330? | CREATE TABLE procedures_icd (row_id number,subject_id number,hadm_id number,icd9_code text,charttime time)CREATE TABLE diagnoses_icd (row_id number,subject_id number,hadm_id number,icd9_code text,charttime time)CREATE TABLE d_items (row_id number,itemid number,label text,linksto text)CREATE TABLE d_icd_diagnoses (row_i... | SELECT COUNT(*) > 0 FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 46330) AND DATETIME(microbiologyevents.charttime) <= DATETIME(CURRENT_TIME(), '-35 month') |
When the incumbent was William Elliott, what was the result? | CREATE TABLE table_35755 ("District" text,"Incumbent" text,"Party" text,"First elected" text,"Result" text) | SELECT "Result" FROM table_35755 WHERE "Incumbent" = 'william elliott' |
What was the score of the game at Great Western Forum? | CREATE TABLE table_name_54 (score VARCHAR,location_attendance VARCHAR) | SELECT score FROM table_name_54 WHERE location_attendance = "great western forum" |
Which Draws has Points smaller than 15, and a Conceded larger than 10, and a Position larger than 8, and Wins of 1? | CREATE TABLE table_name_91 (draws INTEGER,wins VARCHAR,position VARCHAR,points VARCHAR,conceded VARCHAR) | SELECT MIN(draws) FROM table_name_91 WHERE points < 15 AND conceded > 10 AND position > 8 AND wins = 1 |
Show each county along with the number of schools, and display in ascending by the the total number . | CREATE TABLE School (School_id text,School_name text,Location text,Mascot text,Enrollment int,IHSAA_Class text,IHSAA_Football_Class text,County text)CREATE TABLE budget (School_id int,Year int,Budgeted int,total_budget_percent_budgeted real,Invested int,total_budget_percent_invested real,Budget_invested_percent text)CR... | SELECT County, COUNT(*) FROM School GROUP BY County ORDER BY COUNT(*) |
give me the number of widow patients who were admitted before 2150. | 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.marital_status = "WIDOWED" AND demographic.admityear < "2150" |
On what Week was the Result W 17-14? | CREATE TABLE table_34497 ("Week" real,"Date" text,"Opponent" text,"Result" text,"Attendance" real) | SELECT AVG("Week") FROM table_34497 WHERE "Result" = 'w 17-14' |
What is Finish, when Country is 'South Africa'? | CREATE TABLE table_49417 ("Player" text,"Country" text,"Year(s) won" text,"Total" real,"To par" text,"Finish" text) | SELECT "Finish" FROM table_49417 WHERE "Country" = 'south africa' |
in this month, the temperature c (calc) of patient 14467 had been normal? | 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 d_items (row_id number,itemid number,label text,linksto text)CREATE TABLE chartevents (row_id number,subject_id number,hadm_id number,icustay_id numbe... | SELECT COUNT(*) > 0 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 = 14467)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'temperature c (ca... |
What country is Stephen Ames from with a place value of t9? | CREATE TABLE table_name_20 (country VARCHAR,place VARCHAR,player VARCHAR) | SELECT country FROM table_name_20 WHERE place = "t9" AND player = "stephen ames" |
What is the rank of Israel? | CREATE TABLE table_name_97 (rank INTEGER,country VARCHAR) | SELECT MAX(rank) FROM table_name_97 WHERE country = "israel" |
What Round was the Winning Team Engstler Motorsport Maurer Motorsport? | CREATE TABLE table_74901 ("Round" text,"Circuit" text,"Date" text,"Winning driver" text,"Winning team" text) | SELECT "Round" FROM table_74901 WHERE "Winning team" = 'engstler motorsport maurer motorsport' |
Find all the male members of club 'Hopkins Student Enterprises'. Show the first name and last name. | CREATE TABLE student (stuid number,lname text,fname text,age number,sex text,major number,advisor number,city_code text)CREATE TABLE member_of_club (stuid number,clubid number,position text)CREATE TABLE club (clubid number,clubname text,clubdesc text,clublocation text) | SELECT t3.fname, t3.lname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubname = "Hopkins Student Enterprises" AND t3.sex = "M" |
What school did the player that is 6-6 go to? | CREATE TABLE table_name_69 (school VARCHAR,height VARCHAR) | SELECT school FROM table_name_69 WHERE height = "6-6" |
what was the name of the procedure performed to patient 030-52327, two times during this month? | CREATE TABLE diagnosis (diagnosisid number,patientunitstayid number,diagnosisname text,diagnosistime time,icd9code text)CREATE TABLE cost (costid number,uniquepid text,patienthealthsystemstayid number,eventtype text,eventid number,chargetime time,cost number)CREATE TABLE treatment (treatmentid number,patientunitstayid ... | SELECT t1.treatmentname FROM (SELECT treatment.treatmentname, COUNT(treatment.treatmenttime) AS c1 FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid ... |
Who did mark eaton play for? | CREATE TABLE table_11489 ("Player" text,"Nationality" text,"Position" text,"Years for Jazz" text,"School/Club Team" text) | SELECT "School/Club Team" FROM table_11489 WHERE "Player" = 'mark eaton' |
pregnant female with known type i or type ii diabetes mellitus. | CREATE TABLE table_train_253 ("id" int,"pregnancy_or_lactation" bool,"pre_eclampsia" bool,"acute_ischemia" bool,"pre_gestational_hypertension" bool,"diabetic" string,"smoking" bool,"coronary_artery_disease_cad" bool,"NOUSE" float) | SELECT * FROM table_train_253 WHERE pregnancy_or_lactation = 1 AND (diabetic = 'i' OR diabetic = 'ii') |
What was the production code for episode #1? | CREATE TABLE table_20726262_2 (production_code VARCHAR,no_in_series VARCHAR) | SELECT production_code FROM table_20726262_2 WHERE no_in_series = 1 |
count the number of patients whose diagnoses long title is personal history of transient ischemic attack (tia), and cerebral infarction without residual deficits? | 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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE diagnoses.long_title = "Personal history of transient ischemic attack (TIA), and cerebral infarction without residual deficits" |
what is the college/junior/club team (league) when the position is (c) and the round is higher than 2? | CREATE TABLE table_62232 ("Round" real,"Player" text,"Position" text,"Nationality" text,"College/Junior/Club Team (League)" text) | SELECT "College/Junior/Club Team (League)" FROM table_62232 WHERE "Position" = '(c)' AND "Round" > '2' |
what is the rank number of stefan shalamanov in the slalom event | CREATE TABLE table_204_169 (id number,"athlete" text,"event" text,"race 1\ntime" text,"race 2\ntime" text,"total\ntime" text,"total\nrank" number) | SELECT "total\nrank" FROM table_204_169 WHERE "athlete" = 'stefan shalamanov' AND "event" = 'slalom' |
who is the first opposition in rank 27 ? | CREATE TABLE table_204_525 (id number,"rank" number,"player" text,"county" text,"tally" text,"total" number,"opposition" text) | SELECT "opposition" FROM table_204_525 WHERE "rank" = 27 LIMIT 1 |
Who was the opponent at Lindsey Nelson Stadium? | CREATE TABLE table_11885 ("Date" text,"Opponent" text,"Score" text,"Site/Stadium" text,"Loss" text,"Attendance" text,"Record" text) | SELECT "Opponent" FROM table_11885 WHERE "Site/Stadium" = 'lindsey nelson stadium' |
What is the name of the car manufactured by Letecke Zavody N.P., Jinonice? | CREATE TABLE table_name_11 (automobile_name VARCHAR,manufacturer VARCHAR) | SELECT automobile_name FROM table_name_11 WHERE manufacturer = "letecke zavody n.p., jinonice" |
Which Constructor has a Grid smaller than 24, more than 77 laps, and a Driver of jean-pierre beltoise? | CREATE TABLE table_name_53 (constructor VARCHAR,driver VARCHAR,grid VARCHAR,laps VARCHAR) | SELECT constructor FROM table_name_53 WHERE grid < 24 AND laps > 77 AND driver = "jean-pierre beltoise" |
has there been any record of a microbiology test for patient 20603's sputum during this year? | CREATE TABLE labevents (row_id number,subject_id number,hadm_id number,itemid number,charttime time,valuenum number,valueuom text)CREATE TABLE d_icd_diagnoses (row_id number,icd9_code text,short_title text,long_title text)CREATE TABLE diagnoses_icd (row_id number,subject_id number,hadm_id number,icd9_code text,charttim... | SELECT COUNT(*) > 0 FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 20603) AND microbiologyevents.spec_type_desc = 'sputum' AND DATETIME(microbiologyevents.charttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 yea... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.