instruction stringlengths 0 1.06k | input stringlengths 11 5.3k | response stringlengths 2 4.44k |
|---|---|---|
For those employees who did not have any job in the past, return a line chart about the change of manager_id over hire_date , and could you order X-axis in ascending order? | CREATE TABLE jobs (JOB_ID varchar(10),JOB_TITLE varchar(35),MIN_SALARY decimal(6,0),MAX_SALARY decimal(6,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 countries (COUNTRY_ID varchar(2),COUNTRY_NAME varchar(40),REGION_ID d... | SELECT HIRE_DATE, MANAGER_ID FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) ORDER BY HIRE_DATE |
who was running where the winner is daniel montgomery | CREATE TABLE table_2668378_13 (candidates VARCHAR,incumbent VARCHAR) | SELECT candidates FROM table_2668378_13 WHERE incumbent = "Daniel Montgomery" |
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, return a bar chart about the distribution of job_id and the amount of job_id , and group by attribute job_id. | 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 locations (LOCATION_ID decimal(4,0),STREET_ADDRESS varchar(40),POSTAL_CO... | SELECT JOB_ID, COUNT(JOB_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 GROUP BY JOB_ID |
What is the lowest week number for the game that was at milwaukee county stadium? | CREATE TABLE table_name_18 (week INTEGER,game_site VARCHAR) | SELECT MIN(week) FROM table_name_18 WHERE game_site = "milwaukee county stadium" |
What was the decision in Minnesota? | CREATE TABLE table_name_12 (decision VARCHAR,home VARCHAR) | SELECT decision FROM table_name_12 WHERE home = "minnesota" |
obvious severe non traumatic bleeding | CREATE TABLE table_train_25 ("id" int,"bleeding" int,"acute_cerebrovascular_accident_cva" bool,"heart_disease" bool,"trauma" bool,"st_segment_elevation_myocardial_infarction_stemi" bool,"NOUSE" float) | SELECT * FROM table_train_25 WHERE bleeding = 1 |
When Hamilton Academical is the Opponent, what is the total Attendance? | CREATE TABLE table_name_26 (attendance VARCHAR,opponent VARCHAR) | SELECT COUNT(attendance) FROM table_name_26 WHERE opponent = "hamilton academical" |
tell me what is the top three most common procedures? | CREATE TABLE d_icd_diagnoses (row_id number,icd9_code text,short_title text,long_title text)CREATE TABLE procedures_icd (row_id number,subject_id number,hadm_id number,icd9_code text,charttime time)CREATE TABLE labevents (row_id number,subject_id number,hadm_id number,itemid number,charttime time,valuenum number,valueu... | 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, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM procedures_icd GROUP BY procedures_icd.icd9_code) AS t1 WHERE t1.c1 <= 3) |
what is the name of the jeremy guest for the episode 1x01 | CREATE TABLE table_1685 ("Episode" text,"First broadcast" text,"Graemes guest" text,"Jeremys guest" text,"Votes (%)" text) | SELECT "Jeremys guest" FROM table_1685 WHERE "Episode" = '1x01' |
what is the name of the diagnosis patient 028-70851 last was received until 4 years ago? | CREATE TABLE allergy (allergyid number,patientunitstayid number,drugname text,allergyname text,allergytime time)CREATE TABLE lab (labid number,patientunitstayid number,labname text,labresult number,labresulttime time)CREATE TABLE vitalperiodic (vitalperiodicid number,patientunitstayid number,temperature number,sao2 num... | SELECT diagnosis.diagnosisname FROM diagnosis WHERE diagnosis.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '028-70851')) AND DATETIME(diagnosis.diagnosistime) <= DATETIME(CU... |
each four aces win is a multiple of what number ? | CREATE TABLE table_203_564 (id number,"hand" text,"1 credit" number,"2 credits" number,"3 credits" number,"4 credits" number,"5 credits" number) | SELECT "1 credit" FROM table_203_564 WHERE "hand" = 'four aces' |
Find the average age of male students (with sex M) from each city, and rank Y from low to high order. | CREATE TABLE Student (StuID INTEGER,LName VARCHAR(12),Fname VARCHAR(12),Age INTEGER,Sex VARCHAR(1),Major INTEGER,Advisor INTEGER,city_code VARCHAR(3))CREATE TABLE Lives_in (stuid INTEGER,dormid INTEGER,room_number INTEGER)CREATE TABLE Has_amenity (dormid INTEGER,amenid INTEGER)CREATE TABLE Dorm (dormid INTEGER,dorm_nam... | SELECT city_code, AVG(Age) FROM Student WHERE Sex = 'M' GROUP BY city_code ORDER BY AVG(Age) |
My answers to questions with no accepted answer. | 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 a.Score, a.Id AS "post_link", q.AnswerCount AS Answers, q.OwnerUserId AS "user_link", a.CreationDate AS "answered_on", a.PostTypeId FROM Posts AS a INNER JOIN Posts AS q ON q.Id = a.ParentId WHERE q.AcceptedAnswerId IS NULL AND a.OwnerUserId = '##MyID##' ORDER BY a.CreationDate DESC |
How many rooms cost more than 120, for each different decor Plot them as bar chart, and list by the Y from low to high. | 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 decor, COUNT(*) FROM Rooms WHERE basePrice > 120 GROUP BY decor ORDER BY COUNT(*) |
What is the result of the game on October 17, 1965? | CREATE TABLE table_40980 ("Week" real,"Date" text,"Opponent" text,"Result" text,"Attendance" text) | SELECT "Result" FROM table_40980 WHERE "Date" = 'october 17, 1965' |
WHAT POSITION DOES PATRICK WIERCIOCH PLAY? | CREATE TABLE table_11803648_17 (position VARCHAR,player VARCHAR) | SELECT position FROM table_11803648_17 WHERE player = "Patrick Wiercioch" |
How much was a Reverse of guitar of agust n p o barrios before 1998? | CREATE TABLE table_name_1 (value VARCHAR,first_issued VARCHAR,reverse VARCHAR) | SELECT value FROM table_name_1 WHERE first_issued < 1998 AND reverse = "guitar of agustín pío barrios" |
What is 2006/07, when 2008/09 is LQ, and when 2010/11 is Not Held? | CREATE TABLE table_76584 ("2006/ 07" text,"2008/ 09" text,"2010/ 11" text,"2011/ 12" text,"2012/ 13" text) | SELECT "2006/ 07" FROM table_76584 WHERE "2008/ 09" = 'lq' AND "2010/ 11" = 'not held' |
What's Curtis Painter's position? | CREATE TABLE table_20861261_4 (position VARCHAR,player VARCHAR) | SELECT position FROM table_20861261_4 WHERE player = "Curtis Painter" |
Name the number of date for stephen curry , dorell wright (27) | CREATE TABLE table_29933 ("Game" real,"Date" text,"Team" text,"Score" text,"High points" text,"High rebounds" text,"High assists" text,"Location Attendance" text,"Record" text) | SELECT COUNT("Date") FROM table_29933 WHERE "High points" = 'Stephen Curry , Dorell Wright (27)' |
tell me the top four most common diagnoses of patients with an age of 60 or above during the last year? | 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 procedures_icd (row_id number,subject_id number,hadm_id number,icd9_code text,charttime time)CREATE TABLE outputevents (row_id number,subject_id number,hadm_... | SELECT d_icd_diagnoses.short_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.icd9_code IN (SELECT t1.icd9_code FROM (SELECT diagnoses_icd.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM diagnoses_icd WHERE diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.age >= 60) ... |
what is the position when the pick is higher than 32 and the team is atlanta braves? | CREATE TABLE table_name_8 (position VARCHAR,pick VARCHAR,team VARCHAR) | SELECT position FROM table_name_8 WHERE pick > 32 AND team = "atlanta braves" |
What is Muzzle energy, when Source is hornady? | CREATE TABLE table_name_16 (muzzle_energy VARCHAR,source VARCHAR) | SELECT muzzle_energy FROM table_name_16 WHERE source = "hornady" |
what's the chroma format with scalable modes being snr- or spatial-scalable and intra dc precbeingion being 8, 9, 10 | CREATE TABLE table_1376890_2 (chroma_format VARCHAR,scalable_modes VARCHAR,intra_dc_precision VARCHAR) | SELECT chroma_format FROM table_1376890_2 WHERE scalable_modes = "SNR- or spatial-scalable" AND intra_dc_precision = "8, 9, 10" |
Who coached for al farwaniyah? | CREATE TABLE table_59460 ("Club" text,"Coach" text,"City" text,"Stadium" text,"2007-2008 season" text) | SELECT "Coach" FROM table_59460 WHERE "City" = 'al farwaniyah' |
How many times were the candidates leven powell (f) 63.8% roger west (dr) 36.4%? | CREATE TABLE table_28946 ("District" text,"Incumbent" text,"Party" text,"First elected" real,"Result" text,"Candidates" text) | SELECT COUNT("First elected") FROM table_28946 WHERE "Candidates" = 'Leven Powell (F) 63.8% Roger West (DR) 36.4%' |
Find the name of the activity that has the largest number of student participants. | CREATE TABLE participates_in (stuid number,actid number)CREATE TABLE student (stuid number,lname text,fname text,age number,sex text,major number,advisor number,city_code text)CREATE TABLE faculty_participates_in (facid number,actid number)CREATE TABLE activity (actid number,activity_name text)CREATE TABLE faculty (fac... | SELECT T1.activity_name FROM activity AS T1 JOIN participates_in AS T2 ON T1.actid = T2.actid GROUP BY T1.actid ORDER BY COUNT(*) DESC LIMIT 1 |
how many games were played ? | CREATE TABLE table_203_67 (id number,"place" number,"team" text,"played" number,"won" number,"draw" number,"lost" number,"goals\nscored" number,"goals\nconceded" number,"+/-" number,"points" number) | SELECT SUM("played") FROM table_203_67 |
How many silver medals did Estonia, which won more than 1 gold and less than 97 medals total, win? | CREATE TABLE table_66254 ("Rank" text,"Nation" text,"Gold" real,"Silver" real,"Bronze" real,"Total" real) | SELECT "Silver" FROM table_66254 WHERE "Gold" > '1' AND "Total" < '97' AND "Nation" = 'estonia' |
What is the score where the opponent was Mardy Fish? | CREATE TABLE table_41298 ("Outcome" text,"Date" text,"Surface" text,"Opponent" text,"Score" text) | SELECT "Score" FROM table_41298 WHERE "Opponent" = 'mardy fish' |
Location of the school with the nickname Mountaineers | CREATE TABLE table_20804 ("Institution" text,"Location" text,"Nickname" text,"Enrollment" real,"Established" real) | SELECT "Location" FROM table_20804 WHERE "Nickname" = 'Mountaineers' |
Find tag wikis with an image inside them.. | CREATE TABLE PostNotices (Id number,PostId number,PostNoticeTypeId number,CreationDate time,DeletionDate time,ExpiryDate time,Body text,OwnerUserId number,DeletionUserId number)CREATE TABLE Comments (Id number,PostId number,Score number,Text text,CreationDate time,UserDisplayName text,UserId number,ContentLicense text)... | SELECT * FROM Posts WHERE Posts.PostTypeId = 5 AND 'Tag Name' LIKE '%sql%' |
What was the loss of the Brewers game when the record was 46-48? | CREATE TABLE table_80391 ("Date" text,"Opponent" text,"Score" text,"Loss" text,"Attendance" real,"Record" text) | SELECT "Loss" FROM table_80391 WHERE "Record" = '46-48' |
What country was the woman from who was born 1976-07-23 and became a grandmaster in 1991? | CREATE TABLE table_name_83 (country VARCHAR,date VARCHAR,birth_date VARCHAR) | SELECT country FROM table_name_83 WHERE date = 1991 AND birth_date = "1976-07-23" |
Which Game is the average one that has a February larger than 20, and a Record of 41 17 4, and Points smaller than 86? | CREATE TABLE table_39505 ("Game" real,"February" real,"Opponent" text,"Score" text,"Record" text,"Points" real) | SELECT AVG("Game") FROM table_39505 WHERE "February" > '20' AND "Record" = '41–17–4' AND "Points" < '86' |
how many FIRST class flights does UA have leaving from all cities today | CREATE TABLE state (state_code text,state_name text,country_name text)CREATE TABLE restriction (restriction_code text,advance_purchase int,stopovers text,saturday_stay_required text,minimum_stay int,maximum_stay int,application text,no_discounts text)CREATE TABLE airport_service (city_code varchar,airport_code varchar,... | SELECT COUNT(DISTINCT flight.flight_id) FROM airport_service, city, date_day AS DATE_DAY_0, date_day AS DATE_DAY_1, days AS DAYS_0, days AS DAYS_1, fare, fare_basis AS FARE_BASIS_0, fare_basis AS FARE_BASIS_1, flight, flight_fare WHERE ((DATE_DAY_0.day_number = 29 AND DATE_DAY_0.month_number = 4 AND DATE_DAY_0.year = 1... |
2 ml : furosemide 10 mg/ml ij soln what is the price? | CREATE TABLE patient (uniquepid text,patienthealthsystemstayid number,patientunitstayid number,gender text,age text,ethnicity text,hospitalid number,wardid number,admissionheight number,admissionweight number,dischargeweight number,hospitaladmittime time,hospitaladmitsource text,unitadmittime time,unitdischargetime tim... | SELECT DISTINCT cost.cost FROM cost WHERE cost.eventtype = 'medication' AND cost.eventid IN (SELECT medication.medicationid FROM medication WHERE medication.drugname = '2 ml : furosemide 10 mg/ml ij soln') |
What format was released April 16, 2009? | CREATE TABLE table_65415 ("Region" text,"Date" text,"Format" text,"Label" text,"Edition" text) | SELECT "Format" FROM table_65415 WHERE "Date" = 'april 16, 2009' |
What is High Rebounds, when Date is 'March 13'? | CREATE TABLE table_50541 ("Game" real,"Date" text,"Team" text,"Score" text,"High points" text,"High rebounds" text,"High assists" text,"Location Attendance" text,"Record" text) | SELECT "High rebounds" FROM table_50541 WHERE "Date" = 'march 13' |
Who was the winner in the match that had John Higgins as runner-up? | CREATE TABLE table_78603 ("Date" text,"Venue" text,"Winner" text,"Runner-up" text,"Score" text) | SELECT "Winner" FROM table_78603 WHERE "Runner-up" = 'john higgins' |
Stacked bar chart of how many away team for with each Home_team in each away team | 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 text,Score text,Competition text)CREATE TABLE injury_accident (game_id int,id int,Player text,Injury text,Nu... | SELECT Away_team, COUNT(Away_team) FROM game GROUP BY Home_team, Away_team |
For the Player playing for the College of Kentucky and a Height of 6-7 what was their corresponding School? | CREATE TABLE table_51716 ("Player" text,"Height" text,"School" text,"Hometown" text,"College" text,"NBA Draft" text) | SELECT "School" FROM table_51716 WHERE "College" = 'kentucky' AND "Height" = '6-7' |
What is the second leg that Valencia was on? | CREATE TABLE table_68891 ("Team 1" text,"Agg." text,"Team 2" text,"1st leg" text,"2nd leg" text) | SELECT "2nd leg" FROM table_68891 WHERE "Team 2" = 'valencia' |
What is the Opponent of the game in Week 3? | CREATE TABLE table_name_21 (opponent VARCHAR,week VARCHAR) | SELECT opponent FROM table_name_21 WHERE week = 3 |
give me the number of patients whose admission type is emergency and procedure short title is vaccination nec? | 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 text,route text,drug_dose text)CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,sho... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_type = "EMERGENCY" AND procedures.short_title = "Vaccination NEC" |
What is the average Game with a Date that is june 14? | CREATE TABLE table_name_24 (game INTEGER,date VARCHAR) | SELECT AVG(game) FROM table_name_24 WHERE date = "june 14" |
How many episodes are 122 in the series? | CREATE TABLE table_30972 ("No. in series" real,"No. in season" real,"Title" text,"Directed by" text,"Written by" text,"Original air date" text,"Production code" text,"U.S. viewers (millions)" text) | SELECT COUNT("No. in season") FROM table_30972 WHERE "No. in series" = '122' |
What is the Position of Pick #77? | CREATE TABLE table_53186 ("Round" real,"Pick #" real,"Player" text,"Position" text,"College" text) | SELECT "Position" FROM table_53186 WHERE "Pick #" = '77' |
How many total medals for germany with under 56 bronzes? | CREATE TABLE table_39703 ("Rank" text,"Nation" text,"Gold" real,"Silver" real,"Bronze" real,"Total" real) | SELECT SUM("Total") FROM table_39703 WHERE "Nation" = 'germany' AND "Bronze" < '56' |
What is the density of yushan county? | CREATE TABLE table_1300525_1 (density VARCHAR,english_name VARCHAR) | SELECT COUNT(density) FROM table_1300525_1 WHERE english_name = "Yushan County" |
What frequency is First Nations Community? | CREATE TABLE table_66601 ("Frequency" text,"Call sign" text,"Branding" text,"Format" text,"Owner" text) | SELECT "Frequency" FROM table_66601 WHERE "Format" = 'first nations community' |
In what location was a stadium built for the St Kilda Football Club? | CREATE TABLE table_28885977_1 (location VARCHAR,built_for VARCHAR) | SELECT location FROM table_28885977_1 WHERE built_for = "St Kilda Football Club" |
tell me the age and health insurance of patient with patient id 17595. | 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 text,gender text,language text,religion text,admission_type text,days_stay text,insurance text,ethnicity text,expire_flag... | SELECT demographic.age, demographic.insurance FROM demographic WHERE demographic.subject_id = "17595" |
What is the nationality with a lane larger than 1, and a rank larger than 5, for Hsu Chi-Chieh? | CREATE TABLE table_63709 ("Rank" real,"Lane" real,"Name" text,"Nationality" text,"Time" text) | SELECT "Nationality" FROM table_63709 WHERE "Lane" > '1' AND "Rank" > '5' AND "Name" = 'hsu chi-chieh' |
What is the average pjehun measured by female enrollment? | CREATE TABLE table_60569 ("Measure" text,"Bombali" real,"Bonthe" real,"Kailahun" real,"Kambia" text,"Kenema" real,"Koinadugu" real,"Kono" real,"Moyamba" text,"Port Loko" text,"Pujehun" real,"Tonkolili" real) | SELECT AVG("Pujehun") FROM table_60569 WHERE "Measure" = 'female enrollment' |
provide the number of patients whose procedure short title is percutan liver aspirat? | 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 procedures ON demographic.hadm_id = procedures.hadm_id WHERE procedures.short_title = "Percutan liver aspirat" |
On average, when were vineyard schools founded? | CREATE TABLE table_name_13 (founded INTEGER,suburb_town VARCHAR) | SELECT AVG(founded) FROM table_name_13 WHERE suburb_town = "vineyard" |
Name the lead for institute of election results and social democratic of 31.7% 8 seats | CREATE TABLE table_name_95 (lead VARCHAR,institute VARCHAR,social_democratic VARCHAR) | SELECT lead FROM table_name_95 WHERE institute = "election results" AND social_democratic = "31.7% 8 seats" |
How many points when under 17,197 attended against the wild? | CREATE TABLE table_57739 ("Date" text,"Opponent" text,"Score" text,"Loss" text,"Attendance" real,"Record" text,"Arena" text,"Points" real) | SELECT AVG("Points") FROM table_57739 WHERE "Attendance" < '17,197' AND "Opponent" = 'wild' |
who is the opponent when norway is against? | CREATE TABLE table_name_67 (opponent VARCHAR,against VARCHAR) | SELECT opponent FROM table_name_67 WHERE against = "norway" |
Which category does the product named 'flax' belong to? | CREATE TABLE product_characteristics (product_id number,characteristic_id number,product_characteristic_value text)CREATE TABLE products (product_id number,color_code text,product_category_code text,product_name text,typical_buying_price text,typical_selling_price text,product_description text,other_product_details tex... | SELECT product_category_code FROM products WHERE product_name = "flax" |
What is the Outcome of the game with a Score of 6 4, 6 4? | CREATE TABLE table_48684 ("Outcome" text,"Date" text,"Tournament" text,"Surface" text,"Opponent" text,"Score" text) | SELECT "Outcome" FROM table_48684 WHERE "Score" = '6–4, 6–4' |
What is the most points recorded for a right halfback? | CREATE TABLE table_25711913_8 (points INTEGER,position VARCHAR) | SELECT MAX(points) FROM table_25711913_8 WHERE position = "Right halfback" |
TOP 1000 users from Bhubaneswar & Cuttack, India. Lists the top 1000 users (ranked by reputation) that are located in Bangalore, Karnataka, India according to their profile information.
Thanks to http://data.stackexchange.com/stackoverflow/query/60933/top-50-users-from-india
Edited by GNKeshava | CREATE TABLE PostLinks (Id number,CreationDate time,PostId number,RelatedPostId number,LinkTypeId number)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... | SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id, DisplayName, Reputation, WebsiteUrl, Location FROM Users WHERE LOWER(Location) LIKE '%Bhubaneswar%' OR UPPER(Location) LIKE '%Bhubaneswar%' OR Location LIKE '%Bhubaneswar%' OR LOWER(Location) LIKE '%Bhubaneshwar%' OR UPPER(Location) LIKE '%Bhubaneshwar%' O... |
Whose course were students minoring in STRATEGY in when they got B- 's ? | CREATE TABLE ta (campus_job_id int,student_id int,location varchar)CREATE TABLE course (course_id int,name varchar,department varchar,number varchar,credits varchar,advisory_requirement varchar,enforced_requirement varchar,description varchar,num_semesters int,num_enrolled int,has_discussion varchar,has_lab varchar,has... | SELECT DISTINCT instructor.name FROM instructor INNER JOIN offering_instructor ON offering_instructor.instructor_id = instructor.instructor_id INNER JOIN student_record ON student_record.offering_id = offering_instructor.offering_id INNER JOIN student ON student.student_id = student_record.student_id WHERE (student_rec... |
What is the highest number of Played games with a Position smaller than 2 and Drawn games less than 4? | CREATE TABLE table_40121 ("Position" real,"Team" text,"Points" real,"Played" real,"Drawn" real,"Lost" real,"Against" real,"Difference" text) | SELECT MAX("Played") FROM table_40121 WHERE "Position" < '2' AND "Drawn" < '4' |
what is the average total cost of a hospital which involves the cortisol since 2104? | 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 microlab (microlabid number,patientunitstayid number,culturesite text,orga... | SELECT AVG(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.patientunitstayid IN (SELECT lab.patientunitstayid FROM lab WHERE lab.labname = 'cortisol')) AND STRFTIME('%y', cost.chargetime) >= '2104' GROUP BY c... |
give the primary disease and procedure icd9 code for subject id 18077. | 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 lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid ... | SELECT demographic.diagnosis, procedures.icd9_code FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.subject_id = "18077" |
Which player played for the Grizzlies from 1997-1998? | CREATE TABLE table_8684 ("Player" text,"Nationality" text,"Position" text,"Years for Grizzlies" text,"School/Club Team" text) | SELECT "Player" FROM table_8684 WHERE "Years for Grizzlies" = '1997-1998' |
What is the minimum mundubbera when biggenden is 1882 | CREATE TABLE table_12526990_1 (mundubbera INTEGER,biggenden VARCHAR) | SELECT MIN(mundubbera) FROM table_12526990_1 WHERE biggenden = 1882 |
What is the ground of the game where the home team was Adelaide? | CREATE TABLE table_name_88 (ground VARCHAR,home_team VARCHAR) | SELECT ground FROM table_name_88 WHERE home_team = "adelaide" |
What is the total number of wins of the central murray of koondrook-barham, which has more than 0 draws? | CREATE TABLE table_12573 ("Central Murray" text,"Wins" real,"Byes" real,"Losses" real,"Draws" real,"Against" real) | SELECT COUNT("Wins") FROM table_12573 WHERE "Central Murray" = 'koondrook-barham' AND "Draws" > '0' |
what is diagnoses long title of subject id 3343? | 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 diagnoses.long_title FROM diagnoses WHERE diagnoses.subject_id = "3343" |
until 1 year ago, what are the three most frequently prescribed drugs? | 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 t1.drugname FROM (SELECT medication.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM medication WHERE DATETIME(medication.drugstarttime) <= DATETIME(CURRENT_TIME(), '-1 year') GROUP BY medication.drugname) AS t1 WHERE t1.c1 <= 3 |
what is the 1406 komppa of asteroid which 1405 sibelius is 2737 kotka | CREATE TABLE table_21568 ("1391 Carelia" text,"1398 Donnera" text,"1405 Sibelius" text,"1406 Komppa" text,"1407 Lindel\u00f6f" text) | SELECT "1406 Komppa" FROM table_21568 WHERE "1405 Sibelius" = '2737 Kotka' |
What rank has andy bichel (qld) as the player? | CREATE TABLE table_39836 ("Rank" text,"s Wicket" text,"Player" text,"Matches" text,"Average" text) | SELECT "Rank" FROM table_39836 WHERE "Player" = 'andy bichel (qld)' |
What was the result of Declan Donnellan's nomination? | CREATE TABLE table_name_23 (result VARCHAR,nominee VARCHAR) | SELECT result FROM table_name_23 WHERE nominee = "declan donnellan" |
Which Award Ceremony in 2009 has a Role of Glinda? | CREATE TABLE table_name_2 (award_ceremony VARCHAR,role VARCHAR,year VARCHAR) | SELECT award_ceremony FROM table_name_2 WHERE role = "glinda" AND year = 2009 |
What's the listed Hand has 3 credits of 6? | CREATE TABLE table_35136 ("Hand" text,"1 credit" text,"2 credits" text,"3 credits" text,"4 credits" text,"5 credits" text) | SELECT "Hand" FROM table_35136 WHERE "3 credits" = '6' |
Visualize a bar chart about the distribution of Name and Weight , and I want to sort in descending by the Y. | 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 Name, Weight FROM people ORDER BY Weight DESC |
When is Part 6, when Part 4 is on March 2, 2008? | CREATE TABLE table_68691 ("Episode #" real,"Title" text,"Part 1" text,"Part 2" text,"Part 3" text,"Part 4" text,"Part 5" text,"Part 6" text) | SELECT "Part 6" FROM table_68691 WHERE "Part 4" = 'march 2, 2008' |
How many days had a score of 4 6, 4 6? | CREATE TABLE table_60932 ("Outcome" text,"Date" real,"Tournament" text,"Surface" text,"Partner" text,"Opponents in the final" text,"Score in the final" text) | SELECT COUNT("Date") FROM table_60932 WHERE "Score in the final" = '4–6, 4–6' |
What is the money list rank for 1966? | CREATE TABLE table_17942 ("Year" real,"Starts" real,"Wins (Majors)" text,"2nd" real,"3rd" real,"Earnings ($)" real,"Money list rank" text,"Scoring average" text) | SELECT "Money list rank" FROM table_17942 WHERE "Year" = '1966' |
what aircraft has the largest seating capacity | 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 date_day (month_number int,day_number int,year int,day_name varchar)CREATE TABLE flight_stop (flight_id int,stop_number int,... | SELECT DISTINCT aircraft_code FROM aircraft WHERE capacity = (SELECT MAX(AIRCRAFTalias1.capacity) FROM aircraft AS AIRCRAFTalias1) |
What are the names of the artists who released a song that has the word love in its title, and where are the artists from? | CREATE TABLE song (song_name text,artist_name text,country text,f_id number,genre_is text,rating number,languages text,releasedate time,resolution number)CREATE TABLE files (f_id number,artist_name text,file_size text,duration text,formats text)CREATE TABLE genre (g_name text,rating text,most_popular_in text)CREATE TAB... | SELECT T1.artist_name, T1.country FROM artist AS T1 JOIN song AS T2 ON T1.artist_name = T2.artist_name WHERE T2.song_name LIKE "%love%" |
How many cup goals for the season with more than 34 league apps? | CREATE TABLE table_name_9 (cup_goals INTEGER,league_apps INTEGER) | SELECT AVG(cup_goals) FROM table_name_9 WHERE league_apps > 34 |
for icd9 code 29690, specify the diagnosis short title. | CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid text)CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title ... | SELECT diagnoses.short_title FROM diagnoses WHERE diagnoses.icd9_code = "29690" |
who had high points on march 14? | CREATE TABLE table_27700375_10 (high_points VARCHAR,date VARCHAR) | SELECT high_points FROM table_27700375_10 WHERE date = "March 14" |
name the species that has the longest years since divergence from human . | CREATE TABLE table_204_358 (id number,"species" text,"common name" text,"ncbi accession #" text,"ncbi name" text,"length" text,"sequence identity" text,"sequence similarity" text,"years since divergence from human (mya)" number) | SELECT "species" FROM table_204_358 ORDER BY "years since divergence from human (mya)" DESC LIMIT 1 |
Can you tell me the average Against thaylt has the Date of 23/03/2002? | CREATE TABLE table_60874 ("Opposing Teams" text,"Against" real,"Date" text,"Venue" text,"Status" text) | SELECT AVG("Against") FROM table_60874 WHERE "Date" = '23/03/2002' |
What is the average Game, when Team is 'Milwaukee'? | CREATE TABLE table_name_78 (game INTEGER,team VARCHAR) | SELECT AVG(game) FROM table_name_78 WHERE team = "milwaukee" |
How many parks is Zippin Pippin located in | CREATE TABLE table_2665085_1 (park VARCHAR,name VARCHAR) | SELECT COUNT(park) FROM table_2665085_1 WHERE name = "Zippin Pippin" |
Keywords for Qt posts Jan-March 2015. | CREATE TABLE Votes (Id number,PostId number,VoteTypeId number,UserId number,CreationDate time,BountyAmount 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,L... | SELECT TIME_TO_STR(p.CreationDate, '%YEAR') AS Year, TIME_TO_STR(p.CreationDate, '%-mONT%-H') AS Month, COUNT(*) AS Questions, SUM(p.AnswerCount) AS Answers, SUM(p.Score) AS QuestionUpvotes, SUM(p.ViewCount) AS "views", SUM(CASE WHEN p.Score > 1 THEN 1 ELSE 0 END) AS "upvotedquestions", SUM(CASE WHEN NOT p.AcceptedAnsw... |
What was the attendance at the game with a record of 4-5? | CREATE TABLE table_name_92 (attendance VARCHAR,record VARCHAR) | SELECT attendance FROM table_name_92 WHERE record = "4-5" |
What is Roy Hall's highest round? | CREATE TABLE table_39723 ("Round" real,"Pick #" real,"Overall" real,"Name" text,"Position" text,"College" text) | SELECT MAX("Round") FROM table_39723 WHERE "Name" = 'roy hall' |
Which conference held at School of whiting? | CREATE TABLE table_80168 ("School" text,"Location" text,"Mascot" text,"County" text,"Joined" text,"Previous Conference" text,"Left" text,"Conference joined" text) | SELECT "Previous Conference" FROM table_80168 WHERE "School" = 'whiting' |
how many stadiums have a capacity of more than 70,000 ? | CREATE TABLE table_204_392 (id number,"#" number,"stadium" text,"capacity" number,"city" text,"country" text,"domed or retractable roof" text) | SELECT COUNT("stadium") FROM table_204_392 WHERE "capacity" > 70000 |
What game was in 2001? | CREATE TABLE table_79383 ("Year" real,"Game" text,"Genre" text,"Platform(s)" text,"Developer(s)" text) | SELECT "Game" FROM table_79383 WHERE "Year" = '2001' |
What position is played by farmar, jordan jordan farmar? | CREATE TABLE table_name_29 (position VARCHAR,player VARCHAR) | SELECT position FROM table_name_29 WHERE player = "farmar, jordan jordan farmar" |
what are the four most commonly used procedures for patients who had received antiemetic - anticholinergic previously during the same month, until 1 year ago? | CREATE TABLE treatment (treatmentid number,patientunitstayid number,treatmentname text,treatmenttime time)CREATE TABLE vitalperiodic (vitalperiodicid number,patientunitstayid number,temperature number,sao2 number,heartrate number,respiration number,systemicsystolic number,systemicdiastolic number,systemicmean number,ob... | SELECT t3.treatmentname FROM (SELECT t2.treatmentname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, treatment.treatmenttime FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'antiemetic - anticholinergic' AND DATETI... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.