instruction stringlengths 0 1.06k | input stringlengths 11 5.3k | response stringlengths 2 4.44k |
|---|---|---|
How much Area (km 2) has a Common of collegno, and a Population smaller than 50137? | CREATE TABLE table_name_60 (area__km_2__ VARCHAR,common_of VARCHAR,population VARCHAR) | SELECT COUNT(area__km_2__) FROM table_name_60 WHERE common_of = "collegno" AND population < 50137 |
What 7:00 has a 10:00 of dirty sexy money? | CREATE TABLE table_67978 ("7:00" text,"7:30" text,"8:00" text,"8:30" text,"9:00" text,"9:30" text,"10:00" text,"10:30" text) | SELECT "7:00" FROM table_67978 WHERE "10:00" = 'dirty sexy money' |
Did I mark all my questions as accepted?. | CREATE TABLE Users (Id number,Reputation number,CreationDate time,DisplayName text,LastAccessDate time,WebsiteUrl text,Location text,AboutMe text,Views number,UpVotes number,DownVotes number,ProfileImageUrl text,EmailHash text,AccountId number)CREATE TABLE FlagTypes (Id number,Name text,Description text)CREATE TABLE Re... | SELECT Id AS "post_link", * FROM Posts WHERE PostTypeId = 1 AND AcceptedAnswerId IS NULL AND ClosedDate IS NULL AND AnswerCount > 0 AND OwnerUserId = '##ownerid##' |
If the driver is Milka Duno, what is the name of the team? | CREATE TABLE table_21872 ("Fin. Pos" real,"Car No." real,"Driver" text,"Team" text,"Laps" real,"Time/Retired" text,"Grid" real,"Laps Led" real,"Points" text) | SELECT "Team" FROM table_21872 WHERE "Driver" = 'Milka Duno' |
In what place did Dave Barr score? | CREATE TABLE table_8817 ("Place" text,"Player" text,"Country" text,"Score" text,"To par" text) | SELECT "Place" FROM table_8817 WHERE "Player" = 'dave barr' |
What is the average laps for a grid larger than 2, for a ferrari that got in an accident? | CREATE TABLE table_name_87 (laps INTEGER,constructor VARCHAR,grid VARCHAR,time_retired VARCHAR) | SELECT AVG(laps) FROM table_name_87 WHERE grid > 2 AND time_retired = "accident" AND constructor = "ferrari" |
how many patients are diagnosed with primary disease copd exacerbation? | CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid text)CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital_status text,age text,dob text,gender text,language text,religion text,admission_type text,days_stay text,insurance text,ethni... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "COPD EXACERBATION" |
What Country's Content is TV Locale? | CREATE TABLE table_40678 ("Television service" text,"Country" text,"Language" text,"Content" text,"HDTV" text,"Package/Option" text) | SELECT "Country" FROM table_40678 WHERE "Content" = 'tv locale' |
Who had the high rebounds when the record was 14 7? | CREATE TABLE table_29843 ("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_29843 WHERE "Record" = '14–7' |
Name the money for p draig harrington | CREATE TABLE table_68355 ("Place" text,"Player" text,"Country" text,"Score" text,"To par" text,"Money (\u00a3)" text) | SELECT "Money ( \u00a3 )" FROM table_68355 WHERE "Player" = 'pádraig harrington' |
Which Date has a Record of 19 16 8? | CREATE TABLE table_64405 ("Date" text,"Opponent" text,"Score" text,"Loss" text,"Attendance" real,"Record" text,"Arena" text,"Points" real) | SELECT "Date" FROM table_64405 WHERE "Record" = '19–16–8' |
Which Monday Mona/Mani also had a Thursday Thunor/Thor of Tongersdei? | CREATE TABLE table_66876 ("Sunday Sunna/S\u00f3l" text,"Monday Mona/ M\u00e1ni" text,"Tuesday Tiw/ Tyr" text,"Wednesday Woden / Odin" text,"Thursday Thunor / Thor" text,"Friday Frige or Freya" text,"Saturday Saturn" text) | SELECT "Monday Mona/ M\u00e1ni" FROM table_66876 WHERE "Thursday Thunor / Thor" = 'tongersdei' |
What's the loss for September 16? | CREATE TABLE table_79725 ("Date" text,"Opponent" text,"Score" text,"Loss" text,"Record" text) | SELECT "Loss" FROM table_79725 WHERE "Date" = 'september 16' |
Name the number of week for game site being memorial stadium for buffalo bills | CREATE TABLE table_14940519_1 (week VARCHAR,game_site VARCHAR,opponent VARCHAR) | SELECT COUNT(week) FROM table_14940519_1 WHERE game_site = "Memorial Stadium" AND opponent = "Buffalo Bills" |
Where did the Vit ria de Set bal club place in the 2006-2007 season? | CREATE TABLE table_51904 ("Club" text,"Head Coach" text,"City" text,"Stadium" text,"2006-2007 season" text) | SELECT "2006-2007 season" FROM table_51904 WHERE "Club" = 'vitória de setúbal' |
How many students does each advisor have. Show scatter chart. | 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 Has_Allergy (StuID INTEGER,Allergy VARCHAR(20))CREATE TABLE Allergy_Type (Allergy VARCHAR(20),AllergyType VARCHAR(20)) | SELECT Advisor, COUNT(*) FROM Student GROUP BY Advisor |
tell me the maximum hospital cost if there is a gstr/ddnts nos w hmrhg this year? | CREATE TABLE outputevents (row_id number,subject_id number,hadm_id number,icustay_id number,charttime time,itemid number,value number)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,l... | SELECT MAX(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.hadm_id IN (SELECT diagnoses_icd.hadm_id FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'gstr/ddnts nos w hmrhg')) AND DATETIME(cost.chargetime, 'start ... |
Name the birth of the person married 24 may 1935 | CREATE TABLE table_68311 ("Name" text,"Birth" text,"Marriage" text,"Became Consort" text,"Ceased to be Consort" text,"Spouse" text) | SELECT "Birth" FROM table_68311 WHERE "Marriage" = '24 may 1935' |
How many attended during the game with a score of 80-94? | CREATE TABLE table_name_52 (attendance INTEGER,score VARCHAR) | SELECT SUM(attendance) FROM table_name_52 WHERE score = "80-94" |
Draw a bar chart of asset make versus the number of asset make, and display in asc by the X. | CREATE TABLE Asset_Parts (asset_id INTEGER,part_id INTEGER)CREATE TABLE Skills (skill_id INTEGER,skill_code VARCHAR(20),skill_description VARCHAR(255))CREATE TABLE Fault_Log_Parts (fault_log_entry_id INTEGER,part_fault_id INTEGER,fault_status VARCHAR(10))CREATE TABLE Staff (staff_id INTEGER,staff_name VARCHAR(255),gend... | SELECT asset_make, COUNT(asset_make) FROM Assets GROUP BY asset_make ORDER BY asset_make |
How many cop apps in the season with fewer than 12 league apps? | CREATE TABLE table_32374 ("Season" text,"Team" text,"League Apps" real,"League Goals" real,"Cup Apps" real,"Cup Goals" real) | SELECT SUM("Cup Apps") FROM table_32374 WHERE "League Apps" < '12' |
What competition has the club villareal? | CREATE TABLE table_name_89 (competition VARCHAR,club VARCHAR) | SELECT competition FROM table_name_89 WHERE club = "villareal" |
when was joe clark first elected ? | CREATE TABLE table_203_214 (id number,"member" text,"party" text,"electorate" text,"state" text,"first elected" text) | SELECT "first elected" FROM table_203_214 WHERE "member" = 'joe clark' |
Bar graph to show how many nationality from different nationality, list in desc by the total number. | CREATE TABLE mission (Mission_ID int,Ship_ID int,Code text,Launched_Year int,Location text,Speed_knots int,Fate text)CREATE TABLE ship (Ship_ID int,Name text,Type text,Nationality text,Tonnage int) | SELECT Nationality, COUNT(Nationality) FROM ship GROUP BY Nationality ORDER BY COUNT(Nationality) DESC |
what are the top five frequent prescribed drugs that were prescribed to patients aged 20s in the same hospital encounter after they had been diagnosed with quadriplegia-partial until 2104? | CREATE TABLE intakeoutput (intakeoutputid number,patientunitstayid number,cellpath text,celllabel text,cellvaluenumeric number,intakeoutputtime time)CREATE TABLE cost (costid number,uniquepid text,patienthealthsystemstayid number,eventtype text,eventid number,chargetime time,cost number)CREATE TABLE treatment (treatmen... | SELECT t3.drugname FROM (SELECT t2.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime, patient.patienthealthsystemstayid FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'quadriplegia-pa... |
In which venue did the competition on 11 October 2008 take place? | CREATE TABLE table_14524 ("Date" text,"Venue" text,"Score" text,"Result" text,"Competition" text) | SELECT "Venue" FROM table_14524 WHERE "Date" = '11 october 2008' |
Display a bar chart for what are the different card types, and how many cards are there of each? | CREATE TABLE Accounts (account_id INTEGER,customer_id INTEGER,account_name VARCHAR(50),other_account_details VARCHAR(255))CREATE TABLE Customers_Cards (card_id INTEGER,customer_id INTEGER,card_type_code VARCHAR(15),card_number VARCHAR(80),date_valid_from DATETIME,date_valid_to DATETIME,other_card_details VARCHAR(255))C... | SELECT card_type_code, COUNT(*) FROM Customers_Cards GROUP BY card_type_code |
count the number of patients whose days of hospital stay is greater than 17 and diagnoses long title is diabetes with renal manifestations, type i [juvenile type], not stated as uncontrolled? | CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid text)CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital_status text,age text,dob text,gender text,language text,religion text,admission_type text,days_stay text,insurance text,ethni... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.days_stay > "17" AND diagnoses.long_title = "Diabetes with renal manifestations, type I [juvenile type], not stated as uncontrolled" |
give me the number of patients less than 45 years who were hospitalized for more than 20 days. | 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 lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid ... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.age < "45" AND demographic.days_stay > "20" |
Which venue does Mardan sponsor? | CREATE TABLE table_17356873_1 (venue VARCHAR,shirt_sponsor VARCHAR) | SELECT venue FROM table_17356873_1 WHERE shirt_sponsor = "Mardan" |
Who was the runner-up in season five? | CREATE TABLE table_16331144_1 (runner_up VARCHAR,season VARCHAR) | SELECT runner_up FROM table_16331144_1 WHERE season = "Five" |
what's the transmission where turbo is yes (mitsubishi td04-16t ) | CREATE TABLE table_16484 ("Trim" text,"Engine" text,"Turbo" text,"Fuel Delivery" text,"Power" text,"Torque" text,"Transmission" text,"Performance" text) | SELECT "Transmission" FROM table_16484 WHERE "Turbo" = 'Yes (Mitsubishi TD04-16t )' |
What is the lowest round of Ed Smith, who had a pick lower than 19? | CREATE TABLE table_35935 ("Round" real,"Pick" real,"Player" text,"Position" text,"School/Club Team" text) | SELECT MIN("Round") FROM table_35935 WHERE "Player" = 'ed smith' AND "Pick" > '19' |
count the number of patients whose primary disease is coronary artery disease\coronary artery bypass graft; myomectomy/sda and lab test fluid is urine? | CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid text)CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug tex... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.diagnosis = "CORONARY ARTERY DISEASE\CORONARY ARTERY BYPASS GRAFT; MYOMECTOMY/SDA" AND lab.fluid = "Urine" |
The plural abbreviation of ll. uses what plural word? | CREATE TABLE table_name_94 (plural_word VARCHAR,plural_abbreviation VARCHAR) | SELECT plural_word FROM table_name_94 WHERE plural_abbreviation = "ll." |
list flights from INDIANAPOLIS to MEMPHIS with fares on monday | CREATE TABLE fare (fare_id int,from_airport varchar,to_airport varchar,fare_basis_code text,fare_airline text,restriction_code text,one_direction_cost int,round_trip_cost int,round_trip_required varchar)CREATE TABLE food_service (meal_code text,meal_number int,compartment text,meal_description varchar)CREATE TABLE clas... | SELECT DISTINCT flight.flight_id FROM fare, flight, flight_fare WHERE ((flight.flight_days IN (SELECT DAYSalias0.days_code FROM days AS DAYSalias0 WHERE DAYSalias0.day_name IN (SELECT DATE_DAYalias0.day_name FROM date_day AS DATE_DAYalias0 WHERE DATE_DAYalias0.day_number = 21 AND DATE_DAYalias0.month_number = 2 AND DAT... |
What date is the 1:00 pm game at arrowhead stadium? | CREATE TABLE table_name_37 (date VARCHAR,time___et__ VARCHAR,game_site VARCHAR) | SELECT date FROM table_name_37 WHERE time___et__ = "1:00 pm" AND game_site = "arrowhead stadium" |
What is draft detail of the document with id 7? | CREATE TABLE addresses (address_id number,address_details text)CREATE TABLE circulation_history (document_id number,draft_number number,copy_number number,employee_id number)CREATE TABLE ref_document_status (document_status_code text,document_status_description text)CREATE TABLE roles (role_code text,role_description t... | SELECT draft_details FROM document_drafts WHERE document_id = 7 |
What is the Jump 2 of the person that has a Jump 3 of 7.77? | CREATE TABLE table_32520 ("Athlete Name" text,"Jump 1" text,"Jump 2" text,"Jump 3" text,"Best Jump" text) | SELECT "Jump 2" FROM table_32520 WHERE "Jump 3" = '7.77' |
Give me a pie to show how many directed by from different directed by. | CREATE TABLE cinema (Cinema_ID int,Name text,Openning_year int,Capacity int,Location text)CREATE TABLE film (Film_ID int,Rank_in_series int,Number_in_season int,Title text,Directed_by text,Original_air_date text,Production_code text)CREATE TABLE schedule (Cinema_ID int,Film_ID int,Date text,Show_times_per_day int,Price... | SELECT Directed_by, COUNT(Directed_by) FROM film GROUP BY Directed_by |
What is Ariel 3's COSPAR ID? | CREATE TABLE table_name_3 (cospar_id VARCHAR,satellite VARCHAR) | SELECT cospar_id FROM table_name_3 WHERE satellite = "ariel 3" |
in a year before d5 1/2ns, labetalol or insulin were prescribed for patient 10266? | 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 inputevents_cv (row_id number,subject_id number,hadm_id number,icustay_id number,charttime time,itemid number,amount number)CREATE TABLE chartevents (... | SELECT COUNT(*) > 0 FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 10266) AND prescriptions.drug IN ('d5 1/2ns', 'labetalol', 'insulin') AND DATETIME(prescriptions.startdate, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year... |
Top 100 posts by view count. | CREATE TABLE CloseReasonTypes (Id number,Name text,Description text)CREATE TABLE Comments (Id number,PostId number,Score number,Text text,CreationDate time,UserDisplayName text,UserId number,ContentLicense text)CREATE TABLE PostHistory (Id number,PostHistoryTypeId number,PostId number,RevisionGUID other,CreationDate ti... | SELECT CONCAT('id', 'post_link'), ViewCount, CreationDate, Score FROM Posts ORDER BY ViewCount DESC LIMIT 100 |
What Chassis has g Tyres before 1987? | CREATE TABLE table_71124 ("Year" real,"Entrant" text,"Chassis" text,"Engine" text,"Tyres" text,"Points" real) | SELECT "Chassis" FROM table_71124 WHERE "Tyres" = 'g' AND "Year" < '1987' |
Which channel comes out of Israel? | CREATE TABLE table_name_83 (channel VARCHAR,country VARCHAR) | SELECT channel FROM table_name_83 WHERE country = "israel" |
how many patients are diagnosed with nb obsrv suspct infect and tested under hematology category in lab? | 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 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 lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.short_title = "NB obsrv suspct infect" AND lab."CATEGORY" = "Hematology" |
In what Year was 1st Division El Salvador with a Finish of Champion and a Team of Fas? | CREATE TABLE table_name_83 (year VARCHAR,team VARCHAR,tournament VARCHAR,finish VARCHAR) | SELECT year FROM table_name_83 WHERE tournament = "1st division el salvador" AND finish = "champion" AND team = "fas" |
What is Accolade, when Year is less than 2002, when Publication is 'Rolling Stone', and when Rank is '48'? | CREATE TABLE table_name_76 (accolade VARCHAR,rank VARCHAR,year VARCHAR,publication VARCHAR) | SELECT accolade FROM table_name_76 WHERE year < 2002 AND publication = "rolling stone" AND rank = 48 |
For those employees who did not have any job in the past, return a bar chart about the distribution of hire_date and the sum of salary bin hire_date by time. | 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 employees (EMPLOYEE_ID decimal(6,0),FIRST_NAME varchar(20),LAST_NAME var... | SELECT HIRE_DATE, SUM(SALARY) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) |
what are the flights and fares from BOSTON to PHILADELPHIA | CREATE TABLE food_service (meal_code text,meal_number int,compartment text,meal_description varchar)CREATE TABLE aircraft (aircraft_code varchar,aircraft_description varchar,manufacturer varchar,basic_type varchar,engines int,propulsion varchar,wide_body varchar,wing_span int,length int,weight int,capacity int,pay_load... | SELECT DISTINCT fare.fare_id, flight.airline_code, 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 = 'BOSTON' AND CITY_1.city_code = AIRPO... |
what is the last treaty morocco ratified ? | CREATE TABLE table_203_109 (id number,"treaty" text,"organization" text,"introduced" number,"signed" number,"ratified" number) | SELECT "treaty" FROM table_203_109 ORDER BY "ratified" DESC LIMIT 1 |
had patient 13806 been prescribed vancomycin hcl, phenylephrine or d5w (excel bag) until 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_labitems (row_id number,itemid number,label text)CREATE TABL... | SELECT COUNT(*) > 0 FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 13806) AND prescriptions.drug IN ('vancomycin hcl', 'phenylephrine', 'd5w (excel bag)') AND STRFTIME('%y', prescriptions.startdate) <= '2102' |
Name the 2012 for 2009 of 1r | CREATE TABLE table_58551 ("Tournament" text,"2009" text,"2011" text,"2012" text,"2013" text) | SELECT "2012" FROM table_58551 WHERE "2009" = '1r' |
What nurses are on call with block floor 1 and block code 1? Tell me their names. | CREATE TABLE on_call (nurse VARCHAR,blockfloor VARCHAR,blockcode VARCHAR) | SELECT nurse FROM on_call WHERE blockfloor = 1 AND blockcode = 1 |
Find posts with broken MathJax (single dollar sign). | CREATE TABLE PostsWithDeleted (Id number,PostTypeId number,AcceptedAnswerId number,ParentId number,CreationDate time,DeletionDate time,Score number,ViewCount number,Body text,OwnerUserId number,OwnerDisplayName text,LastEditorUserId number,LastEditorDisplayName text,LastEditDate time,LastActivityDate time,Title text,Ta... | SELECT Id AS "post_link", Body, CreationDate AS "date" FROM Posts WHERE Body LIKE '%$%' AND NOT Body LIKE '%$%$%' |
how many patients whose admission type is urgent and primary disease is mesenteric ischemia? | CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text,formulary_drug_cd text,route text,drug_dose text)CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_type = "URGENT" AND demographic.diagnosis = "MESENTERIC ISCHEMIA" |
What is the Right ascension of the Object type spiral galaxy that has an Apparent magnitude larger that 12.2 | CREATE TABLE table_name_15 (right_ascension___j2000__ VARCHAR,object_type VARCHAR,apparent_magnitude VARCHAR) | SELECT right_ascension___j2000__ FROM table_name_15 WHERE object_type = "spiral galaxy" AND apparent_magnitude > 12.2 |
Who was the young rider classification when Alessandro Petacchi won? | CREATE TABLE table_30586 ("Stage" real,"Winner" text,"General classification" text,"Points classification" text,"Mountains classification" text,"Young rider classification" text) | SELECT "Young rider classification" FROM table_30586 WHERE "Winner" = 'Alessandro Petacchi' |
Total number of posts by months. | CREATE TABLE ReviewTaskResultTypes (Id number,Name text,Description text)CREATE TABLE CloseAsOffTopicReasonTypes (Id number,IsUniversal boolean,InputTitle text,MarkdownInputGuidance text,MarkdownPostOwnerGuidance text,MarkdownPrivilegedUserGuidance text,MarkdownConcensusDescription text,CreationDate time,CreationModera... | SELECT COUNT(*) FROM Posts |
what are the four most frequently ordered lab tests for patients who had previously received ven cath renal dialysis within the same month, in 2104? | CREATE TABLE d_icd_procedures (row_id number,icd9_code text,short_title text,long_title text)CREATE TABLE d_items (row_id number,itemid number,label text,linksto text)CREATE TABLE inputevents_cv (row_id number,subject_id number,hadm_id number,icustay_id number,charttime time,itemid number,amount number)CREATE TABLE lab... | SELECT d_labitems.label FROM d_labitems WHERE d_labitems.itemid IN (SELECT t3.itemid FROM (SELECT t2.itemid, 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_i... |
What is Status, when Newspaper/Magazine is Al-Thawra? | CREATE TABLE table_name_24 (status VARCHAR,newspaper_magazine VARCHAR) | SELECT status FROM table_name_24 WHERE newspaper_magazine = "al-thawra" |
Where Date is september 13, 1998 what is result? | CREATE TABLE table_name_89 (result VARCHAR,date VARCHAR) | SELECT result FROM table_name_89 WHERE date = "september 13, 1998" |
If the Country of Origin is Denmark and the year of introduction is 1962, what is the primary cartridge? | CREATE TABLE table_28657 ("Name / designation" text,"Year of introduction" text,"Country of origin" text,"Primary cartridge" text,"primary user" text) | SELECT "Primary cartridge" FROM table_28657 WHERE "Year of introduction" = '1962' AND "Country of origin" = 'Denmark' |
Which 3rd run has rank of 8? | CREATE TABLE table_79697 ("Rank" real,"Name" text,"1st run" text,"2nd run" text,"3rd run" text,"Total" real) | SELECT "3rd run" FROM table_79697 WHERE "Rank" = '8' |
For all employees who have the letters D or S in their first name, a bar chart shows the distribution of hire_date and the amount of hire_date bin hire_date by time. | 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 departments (DEPARTMENT_ID decimal(4,0),DEPARTMENT_NAME varchar(30),MANAGER_ID decimal(6,0),LOCATION_ID ... | SELECT HIRE_DATE, COUNT(HIRE_DATE) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' |
What is the type of allergy Cat? | CREATE TABLE allergy_type (allergy text,allergytype text)CREATE TABLE has_allergy (stuid number,allergy text)CREATE TABLE student (stuid number,lname text,fname text,age number,sex text,major number,advisor number,city_code text) | SELECT allergytype FROM allergy_type WHERE allergy = "Cat" |
Which venue did Luke Blackwell serve as captain? | CREATE TABLE table_18796 ("Season" real,"Premiers" text,"Runners Up" text,"Score" text,"Captain" text,"Coach" text,"Simpson Medal" text,"Venue" text,"Attendance" real,"Umpires" text) | SELECT "Venue" FROM table_18796 WHERE "Captain" = 'Luke Blackwell' |
When the driver peter gethin has a grid less than 25, what is the average number of laps? | CREATE TABLE table_55351 ("Driver" text,"Constructor" text,"Laps" real,"Time/Retired" text,"Grid" real) | SELECT AVG("Laps") FROM table_55351 WHERE "Driver" = 'peter gethin' AND "Grid" < '25' |
How many people attended the game when Larry Hughes(33) was the leading scorer and cleveland was visiting? | CREATE TABLE table_35910 ("Date" text,"Visitor" text,"Score" text,"Home" text,"Leading scorer" text,"Attendance" real,"Record" text) | SELECT SUM("Attendance") FROM table_35910 WHERE "Visitor" = 'cleveland' AND "Leading scorer" = 'larry hughes(33)' |
What is the original team of the celebrity who had the result 08 fired in week 10 (2008-03-06) | CREATE TABLE table_489 ("Celebrity" text,"Background" text,"Original Team" text,"Age" real,"Hometown" text,"Charity" text,"Result" text,"Raised" text) | SELECT "Original Team" FROM table_489 WHERE "Result" = '08 Fired in week 10 (2008-03-06)' |
what is the total number of title ? | CREATE TABLE table_204_265 (id number,"no." number,"title (latin)" text,"title (english translation)" text,"subject" text,"date" text) | SELECT COUNT("subject") FROM table_204_265 |
who won the south after esc geretsried did during the 2006-07 season ? | CREATE TABLE table_204_1 (id number,"season" text,"north" text,"south" text,"east" text,"west" text) | SELECT "south" FROM table_204_1 WHERE id = (SELECT id FROM table_204_1 WHERE "south" = 'esc geretsried') + 1 |
Where is the home ground for the club coached by nick pantsaras and founded before 1946? | CREATE TABLE table_44900 ("Team" text,"Coach" text,"Home Ground" text,"Location" text,"Founded" real) | SELECT "Home Ground" FROM table_44900 WHERE "Founded" < '1946' AND "Coach" = 'nick pantsaras' |
How many years were g Tyres and Minardi m187 used? | CREATE TABLE table_name_82 (year INTEGER,tyres VARCHAR,chassis VARCHAR) | SELECT AVG(year) FROM table_name_82 WHERE tyres = "g" AND chassis = "minardi m187" |
What was the result of the game against the Miami Dolphins held at the Riverfront Stadium? | CREATE TABLE table_78664 ("Week" text,"Date" text,"Opponent" text,"Result" text,"Location" text) | SELECT "Result" FROM table_78664 WHERE "Location" = 'riverfront stadium' AND "Opponent" = 'miami dolphins' |
Who directed the totle 'tjockare n vatten'? | CREATE TABLE table_20709 ("Number in series" real,"Broadcast Order" text,"Title" text,"Directed by" text,"Written by" text,"Original airdate" text,"Production Code" real) | SELECT "Directed by" FROM table_20709 WHERE "Title" = 'Tjockare än vatten' |
When did the archbishop that was ordained a bishop on July 25, 1902 die? | CREATE TABLE table_44491 ("Archbishop" text,"Born" text,"Ordained Priest" text,"Ordained Bishop" text,"Appointed Archbishop" text,"Vacated throne" text,"Died" text) | SELECT "Died" FROM table_44491 WHERE "Ordained Bishop" = 'july 25, 1902' |
How many rain figures are provided for sunlight hours in 1966? | CREATE TABLE table_17829 ("City/Town" text,"July av. T" text,"Rain" text,"Days with rain (year/summer)" text,"Days with frost" real,"Sunlight hours" real) | SELECT COUNT("Rain") FROM table_17829 WHERE "Sunlight hours" = '1966' |
Show the different countries and the number of members from each with a bar chart, rank by the bar in ascending. | CREATE TABLE round (Round_ID int,Member_ID int,Decoration_Theme text,Rank_in_Round int)CREATE TABLE member (Member_ID int,Name text,Country text,College_ID int)CREATE TABLE college (College_ID int,Name text,Leader_Name text,College_Location text) | SELECT Country, COUNT(*) FROM member GROUP BY Country ORDER BY Country |
Bar chart of total number of height from each sex | 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 Sex, SUM(Height) FROM people GROUP BY Sex |
what was the first time until 05/2100 patient 002-52932 was prescribed a medication via a misc route? | CREATE TABLE diagnosis (diagnosisid number,patientunitstayid number,diagnosisname text,diagnosistime time,icd9code text)CREATE TABLE microlab (microlabid number,patientunitstayid number,culturesite text,organism text,culturetakentime time)CREATE TABLE lab (labid number,patientunitstayid number,labname text,labresult nu... | SELECT medication.drugstarttime FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '002-52932')) AND medication.routeadmin = 'misc' AND STRFTIME('... |
how many times have there been helps by damon stoudamire (13) | CREATE TABLE table_802 ("Game" real,"Date" text,"Team" text,"Score" text,"High points" text,"High rebounds" text,"High assists" text,"Location Attendance" text,"Record" text) | SELECT COUNT("Record") FROM table_802 WHERE "High assists" = 'Damon Stoudamire (13)' |
Show all payment method codes and the number of orders for each code. Visualize by pie chart. | CREATE TABLE Products (Product_ID VARCHAR(100),Product_Name VARCHAR(255),Product_Price DECIMAL(20,4),Product_Description VARCHAR(255),Other_Product_Service_Details VARCHAR(255))CREATE TABLE Customer_Orders (Order_ID INTEGER,Customer_ID INTEGER,Store_ID INTEGER,Order_Date DATETIME,Planned_Delivery_Date DATETIME,Actual_D... | SELECT payment_method_code, COUNT(*) FROM Invoices GROUP BY payment_method_code |
For all employees who have the letters D or S in their first name, return a bar chart about the distribution of job_id and the sum of employee_id , and group by attribute job_id, and sort y axis in ascending order. | CREATE TABLE countries (COUNTRY_ID varchar(2),COUNTRY_NAME varchar(40),REGION_ID decimal(10,0))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)... | SELECT JOB_ID, SUM(EMPLOYEE_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' GROUP BY JOB_ID ORDER BY SUM(EMPLOYEE_ID) |
When was the film directed by Pen-Ek Ratanaruang released? | CREATE TABLE table_name_13 (date VARCHAR,director VARCHAR) | SELECT date FROM table_name_13 WHERE director = "pen-ek ratanaruang" |
Which rider had a speed of 104.630mph? | CREATE TABLE table_52741 ("Rank" real,"Rider" text,"Team" text,"Speed" text,"Time" text) | SELECT "Rider" FROM table_52741 WHERE "Speed" = '104.630mph' |
what is the total number of apps and goals for luther blissett ? | CREATE TABLE table_204_340 (id number,"name" text,"year inducted" number,"position" text,"apps" number,"goals" number) | SELECT "apps" + "goals" FROM table_204_340 WHERE "name" = 'luther blissett' |
Parts Plus sponsors what driver? | CREATE TABLE table_name_21 (driver_s_ VARCHAR,primary_sponsor_s_ VARCHAR) | SELECT driver_s_ FROM table_name_21 WHERE primary_sponsor_s_ = "parts plus" |
What is the place when the performance is 60.73m? | CREATE TABLE table_name_65 (place VARCHAR,performance VARCHAR) | SELECT place FROM table_name_65 WHERE performance = "60.73m" |
What year was Sam Kazman a producer? | CREATE TABLE table_name_35 (year VARCHAR,producer VARCHAR) | SELECT year FROM table_name_35 WHERE producer = "sam kazman" |
which team had the largest goal difference ? | CREATE TABLE table_203_254 (id number,"position" number,"team" text,"points" number,"played" number,"won" number,"drawn" number,"lost" number,"for" number,"against" number,"difference" number) | SELECT "team" FROM table_203_254 ORDER BY ABS("difference") DESC LIMIT 1 |
how many days have elapsed since the first time patient 30826 stayed in the ward 12 during this hospital encounter? | CREATE TABLE d_labitems (row_id number,itemid number,label text)CREATE TABLE microbiologyevents (row_id number,subject_id number,hadm_id number,charttime time,spec_type_desc text,org_name text)CREATE TABLE d_icd_diagnoses (row_id number,icd9_code text,short_title text,long_title text)CREATE TABLE transfers (row_id numb... | SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', transfers.intime)) FROM transfers WHERE transfers.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 30826 AND admissions.dischtime IS NULL)) AND transfers.... |
What loan expires date has a Date of 29 december 2003? | CREATE TABLE table_13239 ("Position" text,"Player" text,"Loaned to" text,"Date" text,"Loan expires" text) | SELECT "Loan expires" FROM table_13239 WHERE "Date" = '29 december 2003' |
Who was the partner that played against Serena Williams Venus Williams? | CREATE TABLE table_9885 ("Outcome" text,"Year" real,"Championship" text,"Surface" text,"Partner" text,"Opponents in the final" text,"Score in the final" text) | SELECT "Partner" FROM table_9885 WHERE "Opponents in the final" = 'serena williams venus williams' |
What is the name of party with most number of members? | CREATE TABLE party (party_name VARCHAR,party_id VARCHAR)CREATE TABLE Member (party_id VARCHAR) | SELECT T2.party_name FROM Member AS T1 JOIN party AS T2 ON T1.party_id = T2.party_id GROUP BY T1.party_id ORDER BY COUNT(*) DESC LIMIT 1 |
What is the call sign for channel 6? | CREATE TABLE table_28631 ("Channel" real,"Channel name" text,"Callsign" text,"Signal power" text,"Broadcast area" text) | SELECT "Callsign" FROM table_28631 WHERE "Channel" = '6' |
What date has a set 4 of 25-19? | CREATE TABLE table_42037 ("Date" text,"Score" text,"Set 1" text,"Set 2" text,"Set 3" text,"Set 4" text,"Set 5" text,"Total" text) | SELECT "Date" FROM table_42037 WHERE "Set 4" = '25-19' |
how many patients were admitted before the year 2135 under procedure icd9 code 3893? | CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid 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 tex... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admityear < "2135" AND procedures.icd9_code = "3893" |
What was the total effic for the quarterbacks? | CREATE TABLE table_9027 ("Name" text,"GP-GS" text,"Effic" real,"Att-Cmp-Int" text,"Avg/G" real) | SELECT MIN("Effic") FROM table_9027 WHERE "Name" = 'total' |
When the president was Yoweri Museveni, and the year was 1993, with rank of 6 under political rights, what was the total of civil liberties? | CREATE TABLE table_name_78 (civil_liberties INTEGER,year VARCHAR,political_rights VARCHAR,president VARCHAR) | SELECT SUM(civil_liberties) FROM table_name_78 WHERE political_rights = 6 AND president = "yoweri museveni" AND year = 1993 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.