instruction stringlengths 0 1.06k | input stringlengths 11 5.3k | response stringlengths 2 4.44k |
|---|---|---|
Which player is from Tampa, Florida? | CREATE TABLE table_name_68 (player VARCHAR,hometown VARCHAR) | SELECT player FROM table_name_68 WHERE hometown = "tampa, florida" |
what is the average age of patients whose marital status is single and primary disease is sepsis? | 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 AVG(demographic.age) FROM demographic WHERE demographic.marital_status = "SINGLE" AND demographic.diagnosis = "SEPSIS" |
What are the names of the people who are older 40 but no friends under age 30? | CREATE TABLE person (name text,age number,city text,gender text,job text)CREATE TABLE personfriend (name text,friend text,year number) | SELECT T1.name FROM person AS T1 JOIN personfriend AS T2 ON T1.name = T2.name WHERE T2.friend IN (SELECT name FROM person WHERE age > 40) EXCEPT SELECT T1.name FROM person AS T1 JOIN personfriend AS T2 ON T1.name = T2.name WHERE T2.friend IN (SELECT name FROM person WHERE age < 30) |
Highly viewed questions with no accepted answer. | CREATE TABLE SuggestedEditVotes (Id number,SuggestedEditId number,UserId number,VoteTypeId number,CreationDate time,TargetUserId number,TargetRepChange number)CREATE TABLE TagSynonyms (Id number,SourceTagName text,TargetTagName text,CreationDate time,OwnerUserId number,AutoRenameCount number,LastAutoRename time,Score n... | SELECT p.ViewCount, p.Id AS "Post Id", p.Title, p.AnswerCount FROM Posts AS p WHERE p.PostTypeId = 1 AND p.AcceptedAnswerId IS NULL AND p.ClosedDate IS NULL AND p.CommunityOwnedDate IS NULL AND p.AnswerCount = 0 ORDER BY p.ViewCount DESC LIMIT 100 |
Which term in office has an Electorate of hinkler? | CREATE TABLE table_name_65 (term_in_office VARCHAR,electorate VARCHAR) | SELECT term_in_office FROM table_name_65 WHERE electorate = "hinkler" |
What is the appointment day for 4 December 2008 vacancy? | CREATE TABLE table_name_40 (date_of_appointment VARCHAR,date_of_vacancy VARCHAR) | SELECT date_of_appointment FROM table_name_40 WHERE date_of_vacancy = "4 december 2008" |
What is the lowest Lane, when Mark is 7.66? | CREATE TABLE table_50081 ("Lane" real,"Name" text,"Country" text,"Mark" text,"React" real) | SELECT MIN("Lane") FROM table_50081 WHERE "Mark" = '7.66' |
How many winning scores were there in the rr donnelley lpga founders cup? | CREATE TABLE table_17335602_1 (winning_score VARCHAR,tournament VARCHAR) | SELECT COUNT(winning_score) FROM table_17335602_1 WHERE tournament = "RR Donnelley LPGA Founders Cup" |
how many patients whose lab test chart time is 2151-12-28 15:30:00? | 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 prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text,formulary_drug_cd t... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE lab.charttime = "2151-12-28 15:30:00" |
i want to know the cheapest way to fly from DENVER to OAKLAND | CREATE TABLE month (month_number int,month_name text)CREATE TABLE city (city_code varchar,city_name varchar,state_code varchar,country_name varchar,time_zone_code varchar)CREATE TABLE airline (airline_code varchar,airline_name text,note text)CREATE TABLE ground_service (city_code text,airport_code text,transport_type t... | 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, fare, flight, flight_fare WHERE (CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'DENVER' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.... |
What is the availability of section MILSCI 301 between 11:00 and 1:00 ? | CREATE TABLE instructor (instructor_id int,name varchar,uniqname varchar)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_assi... | SELECT DISTINCT course_offering.end_time, course_offering.section_number, course_offering.start_time FROM course, course_offering, semester WHERE course_offering.end_time <= '1:00' AND course_offering.start_time >= '11:00' AND course.course_id = course_offering.course_id AND course.department = 'MILSCI' AND course.numb... |
count the number of patients whose diagnosis short title is status autm crd dfbrltr and drug route is im. | 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 procedures (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 INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.short_title = "Status autm crd dfbrltr" AND prescriptions.route = "IM" |
What team has a national league in 2001? | CREATE TABLE table_name_31 (team VARCHAR,league VARCHAR,year VARCHAR) | SELECT team FROM table_name_31 WHERE league = "national" AND year = 2001 |
How many parks are called mt. olympus | CREATE TABLE table_2665085_1 (name VARCHAR,park VARCHAR) | SELECT COUNT(name) FROM table_2665085_1 WHERE park = "Mt. Olympus" |
How many players were the running back draft pick for the New England Patriots? | CREATE TABLE table_2508633_9 (player VARCHAR,nfl_team VARCHAR,position VARCHAR) | SELECT COUNT(player) FROM table_2508633_9 WHERE nfl_team = "New England Patriots" AND position = "Running back" |
Who was the Centerfold model in the issue in which the Interview subject was Paul Simon? | CREATE TABLE table_40079 ("Date" text,"Cover model" text,"Centerfold model" text,"Interview subject" text,"Pictorials" text) | SELECT "Centerfold model" FROM table_40079 WHERE "Interview subject" = 'paul simon' |
what is the yearly maximum intake of pe 24 fs ng that patient 3677 is getting until 11/04/2100? | 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 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)CREA... | SELECT MAX(inputevents_cv.amount) FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 3677)) AND inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.labe... |
Tag badges per question for each year (all classes, combined score). | CREATE TABLE TagSynonyms (Id number,SourceTagName text,TargetTagName text,CreationDate time,OwnerUserId number,AutoRenameCount number,LastAutoRename time,Score number,ApprovedByUserId number,ApprovalDate time)CREATE TABLE ReviewTaskResults (Id number,ReviewTaskId number,ReviewTaskResultTypeId number,CreationDate time,R... | SELECT YearBadges.Y, CAST(NumQuestions AS FLOAT) / CAST(BadgeScore AS FLOAT) AS Ratio FROM (SELECT SUM(CASE B.Class WHEN 1 THEN 10 WHEN 2 THEN 4 WHEN 3 THEN 1 END) AS BadgeScore, YEAR(Date) AS Y FROM Badges AS B WHERE B.TagBased = 1 AND B.Name = '##TagName##' AND YEAR(B.Date) < 2017 AND YEAR(B.Date) > 2008 GROUP BY YEA... |
Which classes do n't have any labs ? | CREATE TABLE requirement (requirement_id int,requirement varchar,college varchar)CREATE TABLE offering_instructor (offering_instructor_id int,offering_id int,instructor_id int)CREATE TABLE program_requirement (program_id int,category varchar,min_credit int,additional_req varchar)CREATE TABLE comment_instructor (instruc... | SELECT DISTINCT name, number FROM course WHERE department = 'EECS' AND has_lab = 'N' |
In the Fall or Winter , what courses meet the Core requirement ? | CREATE TABLE jobs (job_id int,job_title varchar,description varchar,requirement varchar,city varchar,state varchar,country varchar,zip int)CREATE TABLE ta (campus_job_id int,student_id int,location varchar)CREATE TABLE program_requirement (program_id int,category varchar,min_credit int,additional_req varchar)CREATE TAB... | SELECT DISTINCT course.department, course.name, course.number, semester.semester FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester INNER JOIN program_course ON program_course.course_id = course_offering.course_id... |
What Opponent has a Site of razorback stadium fayetteville, ar, and a Date of october 7, 1967? | CREATE TABLE table_61508 ("Date" text,"Opponent" text,"Site" text,"Result" text,"Attendance" text) | SELECT "Opponent" FROM table_61508 WHERE "Site" = 'razorback stadium • fayetteville, ar' AND "Date" = 'october 7, 1967' |
What was the To par when the Score was 67-68=135? | CREATE TABLE table_7267 ("Place" text,"Player" text,"Country" text,"Score" text,"To par" text) | SELECT "To par" FROM table_7267 WHERE "Score" = '67-68=135' |
What is the score of match 15? | CREATE TABLE table_40525 ("Match No." text,"Home Team" text,"Score" text,"Away Team" text,"Attendance" text) | SELECT "Score" FROM table_40525 WHERE "Match No." = '15' |
What is the value of D 45 O, when the value of D 41 is r 41 ? | CREATE TABLE table_name_60 (d_45_o VARCHAR,d_41_√ VARCHAR) | SELECT d_45_o FROM table_name_60 WHERE d_41_√ = "r 41 √" |
which is the only device to have the flash memory array note ? | CREATE TABLE table_204_152 (id number,"device" text,"type" text,"iops" text,"interface" text,"notes" text) | SELECT "device" FROM table_204_152 WHERE "notes" = 'flash memory array' |
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, give me the comparison about the sum of manager_id over the hire_date bin hire_date by time, and sort in descending by the total number. | CREATE TABLE regions (REGION_ID decimal(5,0),REGION_NAME varchar(25))CREATE TABLE jobs (JOB_ID varchar(10),JOB_TITLE varchar(35),MIN_SALARY decimal(6,0),MAX_SALARY decimal(6,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 dep... | SELECT HIRE_DATE, SUM(MANAGER_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 ORDER BY SUM(MANAGER_ID) DESC |
Bar graph to show meter_100 from different meter 700, and display x axis in desc order. | CREATE TABLE stadium (ID int,name text,Capacity int,City text,Country text,Opening_year int)CREATE TABLE event (ID int,Name text,Stadium_ID int,Year text)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 ... | SELECT meter_700, meter_100 FROM swimmer ORDER BY meter_700 DESC |
How many sets of marks does Tonioli get in week 3? | CREATE TABLE table_18595004_7 (tonioli VARCHAR,week__number VARCHAR) | SELECT COUNT(tonioli) FROM table_18595004_7 WHERE week__number = 3 |
What Norwegian title has 218 pages and Translated Title of Breaking Dawn? | CREATE TABLE table_name_37 (norwegian_title VARCHAR,pages VARCHAR,translated_title VARCHAR) | SELECT norwegian_title FROM table_name_37 WHERE pages = 218 AND translated_title = "breaking dawn" |
What was the date of the game that had a result of Army 16, SMU 14? | CREATE TABLE table_28719193_19 (date VARCHAR,matchups_results VARCHAR) | SELECT date FROM table_28719193_19 WHERE matchups_results = "Army 16, SMU 14" |
What was the latest number in series that was directed by Skip Sudduth? | CREATE TABLE table_3769 ("No. in series" real,"No. in season" real,"Title" text,"Directed by" text,"Written by" text,"Original air date" text,"U.S. viewers (millions)" text) | SELECT MAX("No. in series") FROM table_3769 WHERE "Directed by" = 'Skip Sudduth' |
What was the score of the home team in the match at Western Oval? | CREATE TABLE table_55576 ("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_55576 WHERE "Venue" = 'western oval' |
What was the team's league in 2010? | CREATE TABLE table_16636344_1 (league VARCHAR,year VARCHAR) | SELECT league FROM table_16636344_1 WHERE year = "2010" |
How many games has number 61 played in? | CREATE TABLE table_37375 ("Position" text,"Number" real,"Name" text,"Height" text,"Weight" real,"Class" text,"Hometown" text,"Games\u2191" real) | SELECT MIN("Games\u2191") FROM table_37375 WHERE "Number" = '61' |
Name the number of date for 1-0 record | CREATE TABLE table_21091157_1 (date VARCHAR,record VARCHAR) | SELECT COUNT(date) FROM table_21091157_1 WHERE record = "1-0" |
Where is channel 83 broadcasted? | CREATE TABLE table_name_86 (territory VARCHAR,channel VARCHAR) | SELECT territory FROM table_name_86 WHERE channel = 83 |
What was the Date of Week 16? | CREATE TABLE table_name_43 (date VARCHAR,week VARCHAR) | SELECT date FROM table_name_43 WHERE week = 16 |
You can give me a bar chart, that groups and counts the country name, list in descending by the the number of country name. | 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 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,... | SELECT COUNTRY_NAME, COUNT(COUNTRY_NAME) FROM countries GROUP BY COUNTRY_NAME ORDER BY COUNT(COUNTRY_NAME) DESC |
What is the End of term of the President with an Age at inauguration of 78years, 160days? | CREATE TABLE table_name_89 (end_of_term VARCHAR,age_at_inauguration VARCHAR) | SELECT end_of_term FROM table_name_89 WHERE age_at_inauguration = "78years, 160days" |
What is the average Attendance at a game with a Result of w 30-23? | CREATE TABLE table_39817 ("Date" text,"Opponent" text,"Location" text,"Result" text,"Attendance" real) | SELECT AVG("Attendance") FROM table_39817 WHERE "Result" = 'w 30-23' |
how many times has patient 022-20829 been at the intensive care unit until 3 years ago? | CREATE TABLE allergy (allergyid number,patientunitstayid number,drugname text,allergyname text,allergytime time)CREATE TABLE treatment (treatmentid number,patientunitstayid number,treatmentname text,treatmenttime time)CREATE TABLE cost (costid number,uniquepid text,patienthealthsystemstayid number,eventtype text,eventi... | SELECT COUNT(DISTINCT patient.patientunitstayid) FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '022-20829') AND DATETIME(patient.unitadmittime) <= DATETIME(CURRENT_TIME(), '-3 year') |
When Mark O'meara was the senior player champion in a year greater than 1998, who was the tradition? | CREATE TABLE table_name_14 (the_tradition VARCHAR,year VARCHAR,senior_players_championship VARCHAR) | SELECT the_tradition FROM table_name_14 WHERE year > 1998 AND senior_players_championship = "mark o'meara" |
how many patients whose age is less than 74 and procedure short title is form cutan ileoureterost? | 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.age < "74" AND procedures.short_title = "Form cutan ileoureterost" |
For those employees who do not work in departments with managers that have ids between 100 and 200, return a bar chart about the distribution of email and department_id , and order from low to high by the y-axis please. | CREATE TABLE regions (REGION_ID decimal(5,0),REGION_NAME varchar(25))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 locations (LOCATION_ID decimal(4,0),STREET_ADDRESS varchar(40),POSTAL_CODE varchar(12),CITY varchar(30),STATE_P... | SELECT EMAIL, DEPARTMENT_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY DEPARTMENT_ID |
Which competition in Budapest, Hungary gave a result of 8th? | CREATE TABLE table_36822 ("Year" real,"Competition" text,"Venue" text,"Position" text,"Notes" text) | SELECT "Competition" FROM table_36822 WHERE "Position" = '8th' AND "Venue" = 'budapest, hungary' |
Which Position in 2000 has a Capacity larger than 10,080, and a Venue of central, rechytsa? | CREATE TABLE table_36240 ("Team" text,"Location" text,"Venue" text,"Capacity" real,"Position in 2000" text) | SELECT "Position in 2000" FROM table_36240 WHERE "Capacity" > '10,080' AND "Venue" = 'central, rechytsa' |
What was the finishing time of the Stage that featured a distance of 24.00km and a start time of 21:27? | CREATE TABLE table_name_78 (time VARCHAR,distance VARCHAR,start_time VARCHAR) | SELECT time FROM table_name_78 WHERE distance = "24.00km" AND start_time = "21:27" |
What label released a record on December 19, 2001? | CREATE TABLE table_name_83 (label VARCHAR,date VARCHAR) | SELECT label FROM table_name_83 WHERE date = "december 19, 2001" |
What year was holly hunter a nominee? | CREATE TABLE table_name_30 (year__ceremony_ VARCHAR,result VARCHAR,actor_actress VARCHAR) | SELECT year__ceremony_ FROM table_name_30 WHERE result = "nominee" AND actor_actress = "holly hunter" |
list the number of patients under the age of 81 whose drug route is ivpca. | 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.age < "81" AND prescriptions.route = "IVPCA" |
at which location has the east west game been played the most ? | CREATE TABLE table_203_636 (id number,"#" number,"date" text,"winner" text,"score" text,"location" text,"notes" text) | SELECT "location" FROM table_203_636 GROUP BY "location" ORDER BY COUNT(*) DESC LIMIT 1 |
what's the result with candidates being billy tauzin (d) unopposed | CREATE TABLE table_1341586_19 (result VARCHAR,candidates VARCHAR) | SELECT result FROM table_1341586_19 WHERE candidates = "Billy Tauzin (D) Unopposed" |
How many times has the Cornwall HC team, that has scored more than 18 goals, lost ? | CREATE TABLE table_67667 ("Team" text,"Games Played" real,"Wins" real,"Losses" real,"Ties" real,"Goals For" real,"Goals Against" real) | SELECT COUNT("Losses") FROM table_67667 WHERE "Team" = 'cornwall hc' AND "Goals For" > '18' |
In the Fall or Winter term are there 500 -level courses ? | CREATE TABLE program_course (program_id int,course_id int,workload int,category varchar)CREATE TABLE student_record (student_id int,course_id int,semester int,grade varchar,how varchar,transfer_source varchar,earn_credit varchar,repeat_term varchar,test_id varchar)CREATE TABLE course_prerequisite (pre_course_id int,cou... | SELECT DISTINCT course.department, course.name, course.number, semester.semester FROM course, course_offering, semester WHERE ((semester.semester = 'FA' AND semester.year = 2016) OR (semester.semester = 'WN' AND semester.year = 2017)) AND course.course_id = course_offering.course_id AND course.department = 'department0... |
Number of questions and answers by year. | CREATE TABLE ReviewTaskStates (Id number,Name text,Description text)CREATE TABLE Votes (Id number,PostId number,VoteTypeId number,UserId number,CreationDate time,BountyAmount number)CREATE TABLE VoteTypes (Id number,Name text)CREATE TABLE Tags (Id number,TagName text,Count number,ExcerptPostId number,WikiPostId number)... | SELECT YEAR(p.CreationDate) AS Year, COUNT(CASE WHEN PostTypeId = 1 THEN p.Id ELSE NULL END) AS Questions, COUNT(CASE WHEN PostTypeId = 2 THEN p.Id ELSE NULL END) AS Answers FROM Posts AS p WHERE PostTypeId IN (1, 2) GROUP BY YEAR(p.CreationDate) |
Which district is jamie l. whitten from? | CREATE TABLE table_1342233_24 (district VARCHAR,incumbent VARCHAR) | SELECT district FROM table_1342233_24 WHERE incumbent = "Jamie L. Whitten" |
What is the total number of years that have divisions greater than 4? | CREATE TABLE table_37506 ("Year" real,"Division" real,"League" text,"Regular Season" text,"Playoffs" text) | SELECT COUNT("Year") FROM table_37506 WHERE "Division" > '4' |
Who has rank 5? | CREATE TABLE table_65596 ("Rank" real,"Lane" real,"Name" text,"Nationality" text,"Time" text) | SELECT "Name" FROM table_65596 WHERE "Rank" = '5' |
Name the team that has a song writer named larry spokes. | CREATE TABLE table_28243323_1 (club_name VARCHAR,writer_composer VARCHAR) | SELECT club_name FROM table_28243323_1 WHERE writer_composer = "Larry Spokes" |
What is the country that the player is from with +3 to par and score of 74-73=147? | CREATE TABLE table_46933 ("Place" text,"Player" text,"Country" text,"Score" text,"To par" text) | SELECT "Country" FROM table_46933 WHERE "To par" = '+3' AND "Score" = '74-73=147' |
Tell me the declination for consellaion of ophiuchus and apparent magnitude less than 8.6 with right ascension of 16h47m14.5s | CREATE TABLE table_name_55 (declination___j2000__ VARCHAR,right_ascension___j2000__ VARCHAR,constellation VARCHAR,apparent_magnitude VARCHAR) | SELECT declination___j2000__ FROM table_name_55 WHERE constellation = "ophiuchus" AND apparent_magnitude < 8.6 AND right_ascension___j2000__ = "16h47m14.5s" |
Name the runners for longchamp | CREATE TABLE table_80449 ("Race" text,"Dist (f)" real,"Course" text,"Class" text,"Prize (\u00a3K)" real,"Odds" text,"Runners" real,"Placing" real,"Margin" text,"Time" text,"Jockey" text,"Trainer" text) | SELECT "Runners" FROM table_80449 WHERE "Course" = 'longchamp' |
What was the score for 1911? | CREATE TABLE table_37713 ("Score" text,"Opposition" text,"Venue" text,"City" text,"Year" real) | SELECT "Score" FROM table_37713 WHERE "Year" = '1911' |
Among patients admitted before 2148, how many of them had pressure ulcer, buttock? | 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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admityear < "2148" AND diagnoses.long_title = "Pressure ulcer, buttock" |
Which city has frequency under 106.5MHz and a callsign of w218ck? | CREATE TABLE table_70196 ("Call sign" text,"Frequency MHz" real,"City of license" text,"ERP W" real,"Class" text,"FCC info" text) | SELECT "City of license" FROM table_70196 WHERE "Frequency MHz" < '106.5' AND "Call sign" = 'w218ck' |
how many of the patients with icd9 code 9229 were discharged for long term care hospital? | 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 procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.discharge_location = "LONG TERM CARE HOSPITAL" AND procedures.icd9_code = "9229" |
What is the status of the county that has a 17.3% poverty rate? | CREATE TABLE table_73444 ("County" text,"Population" real,"Unemployment Rate" text,"Market Income Per Capita" text,"Poverty Rate" text,"Status" text) | SELECT "Status" FROM table_73444 WHERE "Poverty Rate" = '17.3%' |
what is the last flight from DALLAS to BOSTON | CREATE TABLE time_zone (time_zone_code text,time_zone_name text,hours_from_gmt int)CREATE TABLE food_service (meal_code text,meal_number int,compartment text,meal_description varchar)CREATE TABLE state (state_code text,state_name text,country_name text)CREATE TABLE code_description (code varchar,description text)CREATE... | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE (CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'DALLAS' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BOSTON... |
For those employees who did not have any job in the past, find hire_date and the sum of employee_id bin hire_date by time, and visualize them by a bar chart, and rank in asc by the sum employee id please. | 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, SUM(EMPLOYEE_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) ORDER BY SUM(EMPLOYEE_ID) |
What is the score of the hard court Ramat Hasharon tournament? | CREATE TABLE table_79660 ("Date" text,"Tournament" text,"Surface" text,"Opponent in final" text,"Score" text,"Prize Money" text) | SELECT "Score" FROM table_79660 WHERE "Surface" = 'hard' AND "Tournament" = 'ramat hasharon' |
Where is the school whose students are nicknamed Panthers located? | CREATE TABLE table_23182 ("Institution" text,"Location" text,"Nickname" text,"Founded" real,"Type" text,"Enrollment" real,"Joined" real) | SELECT "Location" FROM table_23182 WHERE "Nickname" = 'Panthers' |
Find those themes and years for all exhibitions with ticket prices lower than 15, group by themes, count year, and the x-axis is Year, show from low to high by the y-axis. | CREATE TABLE artist (Artist_ID int,Name text,Country text,Year_Join int,Age int)CREATE TABLE exhibition_record (Exhibition_ID int,Date text,Attendance int)CREATE TABLE exhibition (Exhibition_ID int,Year int,Theme text,Artist_ID int,Ticket_Price real) | SELECT Year, COUNT(Year) FROM exhibition WHERE Ticket_Price < 15 GROUP BY Theme ORDER BY COUNT(Year) |
What lane is David Carry in heat 1? | CREATE TABLE table_name_80 (lane VARCHAR,heat VARCHAR,name VARCHAR) | SELECT COUNT(lane) FROM table_name_80 WHERE heat = 1 AND name = "david carry" |
Recommend human computer interaction courses which are easier than HISTORY 195 . | CREATE TABLE student (student_id int,lastname varchar,firstname varchar,program_id int,declare_major varchar,total_credit int,total_gpa float,entered_as varchar,admit_term int,predicted_graduation_semester int,degree varchar,minor varchar,internship varchar)CREATE TABLE course_prerequisite (pre_course_id int,course_id ... | SELECT DISTINCT course.department, course.name, course.number, program_course.workload FROM course INNER JOIN area ON course.course_id = area.course_id INNER JOIN program_course ON program_course.course_id = course.course_id WHERE area.area LIKE '%human computer interaction%' AND program_course.workload < (SELECT MIN(P... |
Visualize a bar chart about the distribution of name and ID . | CREATE TABLE record (ID int,Result text,Swimmer_ID int,Event_ID int)CREATE TABLE event (ID int,Name text,Stadium_ID int,Year text)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 stadiu... | SELECT name, ID FROM swimmer |
Which Manufacturer has a Laps of 21, a Grid larger than 16, and a Rider of akira ry ? | CREATE TABLE table_49829 ("Rider" text,"Manufacturer" text,"Laps" real,"Time/Retired" text,"Grid" real) | SELECT "Manufacturer" FROM table_49829 WHERE "Laps" = '21' AND "Grid" > '16' AND "Rider" = 'akira ryō' |
Date of october 10, 1965 had what lowest attendance? | CREATE TABLE table_36261 ("Week" real,"Date" text,"Opponent" text,"Result" text,"Venue" text,"Attendance" real) | SELECT MIN("Attendance") FROM table_36261 WHERE "Date" = 'october 10, 1965' |
for patients who received spinal struct repair nec until 3 years ago, what are the top four most frequent specimens tested afterwards within 2 months? | 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 diagnoses_icd (row_id number,subject_id number,hadm_id number,icd9_code text... | SELECT t3.spec_type_desc FROM (SELECT t2.spec_type_desc, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, procedures_icd.charttime FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FR... |
how many townships have no water area ? | CREATE TABLE table_203_459 (id number,"township" text,"fips" number,"population\ncenter" text,"population" number,"population\ndensity\n/km2 (/sq mi)" text,"land area\nkm2 (sq mi)" text,"water area\nkm2 (sq mi)" text,"water %" text,"geographic coordinates" text) | SELECT COUNT("township") FROM table_203_459 WHERE "water area\nkm2 (sq mi)" = 0 |
what is the years when playoffs is 115? | CREATE TABLE table_76763 ("Name" text,"Years" text,"Regular season" real,"Playoffs" real,"Total" real) | SELECT "Years" FROM table_76763 WHERE "Playoffs" = '115' |
For those employees who do not work in departments with managers that have ids between 100 and 200, show me about the distribution of first_name and salary in a bar chart, could you sort by the names in asc? | 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 varchar(10),JOB_TITLE varchar(35),MIN_SALARY decimal(6,0),MAX_SALARY decimal(6,0))CREATE TABLE regions (REGION_ID decimal(5,0),REGION_NAME varchar(25))CREATE TABLE dep... | SELECT FIRST_NAME, SALARY FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY FIRST_NAME |
What pick was roger holdinsky? | CREATE TABLE table_name_26 (pick VARCHAR,player VARCHAR) | SELECT pick FROM table_name_26 WHERE player = "roger holdinsky" |
When the result was l 13-7 ot, who was the opponent? | CREATE TABLE table_name_27 (opponent VARCHAR,result VARCHAR) | SELECT opponent FROM table_name_27 WHERE result = "l 13-7 ot" |
What country was the Pegasus, build by Royal Dockyard, from? | CREATE TABLE table_65524 ("Country" text,"Builder" text,"Location" text,"Ship" text,"Class / type" text) | SELECT "Country" FROM table_65524 WHERE "Builder" = 'royal dockyard' AND "Ship" = 'pegasus' |
Can you draw a bar chart to show the number of positions of the pilots? | CREATE TABLE aircraft (Aircraft_ID int,Order_Year int,Manufacturer text,Model text,Fleet_Series text,Powertrain text,Fuel_Propulsion text)CREATE TABLE pilot (Pilot_ID int,Pilot_name text,Rank int,Age int,Nationality text,Position text,Join_Year int,Team text)CREATE TABLE pilot_record (Record_ID int,Pilot_ID int,Aircraf... | SELECT Position, COUNT(Position) FROM pilot GROUP BY Position |
What are the names of the all-female dorms? | CREATE TABLE dorm_amenity (amenid number,amenity_name text)CREATE TABLE has_amenity (dormid number,amenid number)CREATE TABLE student (stuid number,lname text,fname text,age number,sex text,major number,advisor number,city_code text)CREATE TABLE lives_in (stuid number,dormid number,room_number number)CREATE TABLE dorm ... | SELECT dorm_name FROM dorm WHERE gender = 'F' |
For all employees who have the letters D or S in their first name, visualize a bar chart about the distribution of hire_date and the sum of department_id bin hire_date by weekday, and display by the y-axis from high to low. | 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, SUM(DEPARTMENT_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' ORDER BY SUM(DEPARTMENT_ID) DESC |
For each user, return the name and the average rating of reviews given by them. Plot them as pie chart. | CREATE TABLE review (a_id integer,u_id integer,i_id integer,rating integer,rank integer)CREATE TABLE item (i_id integer,title varchar(20))CREATE TABLE useracct (u_id integer,name varchar(128))CREATE TABLE trust (source_u_id integer,target_u_id integer,trust integer) | SELECT name, AVG(T2.rating) FROM useracct AS T1 JOIN review AS T2 ON T1.u_id = T2.u_id GROUP BY T2.u_id |
What college did john sullivan attend? | CREATE TABLE table_name_28 (college VARCHAR,player VARCHAR) | SELECT college FROM table_name_28 WHERE player = "john sullivan" |
What NHL team picked richard borgo? | CREATE TABLE table_2897457_2 (nhl_team VARCHAR,player VARCHAR) | SELECT nhl_team FROM table_2897457_2 WHERE player = "Richard Borgo" |
What is the lowest ERP W of w223bp? | CREATE TABLE table_name_6 (erp_w INTEGER,call_sign VARCHAR) | SELECT MIN(erp_w) FROM table_name_6 WHERE call_sign = "w223bp" |
Which position did David Nugent play with an overall small than 187? | CREATE TABLE table_name_79 (position VARCHAR,overall VARCHAR,player VARCHAR) | SELECT position FROM table_name_79 WHERE overall > 187 AND player = "david nugent" |
Name the year that Birds of a feather category for most popular actress was nominated | CREATE TABLE table_name_57 (year INTEGER,category VARCHAR,nominated_for VARCHAR) | SELECT AVG(year) FROM table_name_57 WHERE category = "most popular actress" AND nominated_for = "birds of a feather" |
what is average age of patients whose admission type is emergency and primary disease is bladder cancer/sda? | 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 lab (subject_id text,hadm_id text,itemid text,charttime te... | SELECT AVG(demographic.age) FROM demographic WHERE demographic.admission_type = "EMERGENCY" AND demographic.diagnosis = "BLADDER CANCER/SDA" |
Which satellite was launched from Vandenberg? | CREATE TABLE table_name_5 (satellite VARCHAR,launch_site VARCHAR) | SELECT satellite FROM table_name_5 WHERE launch_site = "vandenberg" |
Name the awardees for best special effects | CREATE TABLE table_3058 ("Name of Award" text,"Name of Film" text,"Language" text,"Awardee(s)" text,"Cash Prize" text) | SELECT "Awardee(s)" FROM table_3058 WHERE "Name of Award" = 'Best Special Effects' |
Count questions not answered per tag count. | 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 time,LastActivityDate time,Title text,Tags text,Ans... | 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) 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 = 1 GROUP BY Q.Id) AS x GROUP BY ... |
What is the most wins with 0 byes? | CREATE TABLE table_78975 ("Lexton Plains" text,"Wins" real,"Byes" real,"Losses" real,"Draws" real,"Against" real) | SELECT MAX("Wins") FROM table_78975 WHERE "Byes" > '0' |
What is Tom Kite with a Score of 68's To Par? | CREATE TABLE table_name_92 (to_par VARCHAR,score VARCHAR,player VARCHAR) | SELECT to_par FROM table_name_92 WHERE score = 68 AND player = "tom kite" |
What are the dates in which the mean sea level pressure was between 303 and 31, and count them by a bar chart, and order y axis in descending order please. | CREATE TABLE trip (id INTEGER,duration INTEGER,start_date TEXT,start_station_name TEXT,start_station_id INTEGER,end_date TEXT,end_station_name TEXT,end_station_id INTEGER,bike_id INTEGER,subscription_type TEXT,zip_code INTEGER)CREATE TABLE status (station_id INTEGER,bikes_available INTEGER,docks_available INTEGER,time ... | SELECT date, COUNT(date) FROM weather WHERE mean_sea_level_pressure_inches BETWEEN 30.3 AND 31 ORDER BY COUNT(date) DESC |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.