instruction stringlengths 0 1.06k | input stringlengths 11 5.3k | response stringlengths 2 4.44k |
|---|---|---|
On which date was the opponent ireland and the status Five Nations? | CREATE TABLE table_13168 ("Opposing Teams" text,"Against" real,"Date" text,"Venue" text,"Status" text) | SELECT "Date" FROM table_13168 WHERE "Status" = 'five nations' AND "Opposing Teams" = 'ireland' |
Which record has a Boxscore of w2, and a Loss of kline (2 3)? | CREATE TABLE table_name_89 (record VARCHAR,boxscore VARCHAR,loss VARCHAR) | SELECT record FROM table_name_89 WHERE boxscore = "w2" AND loss = "kline (2–3)" |
A bar chart for showing the number of the names of editors that are on the committee of journals with sales bigger than 3000, sort Name in asc order. | CREATE TABLE journal_committee (Editor_ID int,Journal_ID int,Work_Type text)CREATE TABLE journal (Journal_ID int,Date text,Theme text,Sales int)CREATE TABLE editor (Editor_ID int,Name text,Age real) | SELECT Name, COUNT(Name) FROM journal_committee AS T1 JOIN editor AS T2 ON T1.Editor_ID = T2.Editor_ID JOIN journal AS T3 ON T1.Journal_ID = T3.Journal_ID WHERE T3.Sales > 3000 GROUP BY Name ORDER BY Name |
since 02/2104 had patient 16472 been prescribed albumin 25% (12.5g / 50ml), tacrolimus or sodium bicarbonate? | 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 d_labitems (r... | SELECT COUNT(*) > 0 FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 16472) AND prescriptions.drug IN ('albumin 25% (12.5g / 50ml)', 'tacrolimus', 'sodium bicarbonate') AND STRFTIME('%y-%m', prescriptions.startdate) >= '2104-02' |
How many Silver medals did nation who is ranked greater than 1 and has 4 Gold medals have? | CREATE TABLE table_32001 ("Rank" real,"Nation" text,"Gold" real,"Silver" real,"Bronze" real,"Total" real) | SELECT SUM("Silver") FROM table_32001 WHERE "Rank" > '1' AND "Gold" = '4' |
how many players have a total above 10 ? | CREATE TABLE table_204_525 (id number,"rank" number,"player" text,"county" text,"tally" text,"total" number,"opposition" text) | SELECT COUNT(DISTINCT "player") FROM table_204_525 WHERE "total" > 10 |
Tell me the version for 1940-45 | CREATE TABLE table_name_71 (version VARCHAR,year VARCHAR) | SELECT version FROM table_name_71 WHERE year = "1940-45" |
How many activities do we have? | CREATE TABLE Activity (Id VARCHAR) | SELECT COUNT(*) FROM Activity |
What is the 2011 entry for the row with a 2007 entry of 558? | CREATE TABLE table_12921 ("Tournament" text,"2007" text,"2008" text,"2009" text,"2010" text,"2011" text,"2012" text) | SELECT "2011" FROM table_12921 WHERE "2007" = '558' |
Which Away team has a Venue of mcg? | CREATE TABLE table_name_82 (away_team VARCHAR,venue VARCHAR) | SELECT away_team FROM table_name_82 WHERE venue = "mcg" |
What was the record of Game 43? | CREATE TABLE table_name_68 (record VARCHAR,game VARCHAR) | SELECT record FROM table_name_68 WHERE game = 43 |
Name the 2012 for 2011 being 1r | CREATE TABLE table_70330 ("Tournament" text,"2008" text,"2010" text,"2011" text,"2012" text,"2013" text) | SELECT "2012" FROM table_70330 WHERE "2011" = '1r' |
What is the least september 1943 when late 1943 is 78000 | CREATE TABLE table_1115992_1 (sept_1943 INTEGER,late_1943 VARCHAR) | SELECT MIN(sept_1943) FROM table_1115992_1 WHERE late_1943 = 78000 |
If the product code is 2t6267, who was the director? | CREATE TABLE table_17467447_1 (directed_by VARCHAR,production_code VARCHAR) | SELECT directed_by FROM table_17467447_1 WHERE production_code = "2T6267" |
How many games have a Score of 3 0, and a January larger than 12? | CREATE TABLE table_name_16 (game VARCHAR,score VARCHAR,january VARCHAR) | SELECT COUNT(game) FROM table_name_16 WHERE score = "3–0" AND january > 12 |
select id from posts where ViewCount>100000. | 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 Id, Title FROM Posts WHERE ViewCount > 100000 |
Name the location when control is private and founded is 1870 | CREATE TABLE table_20338 ("School" text,"Location" text,"Control" text,"Type" text,"Enrollment" real,"Founded" real) | SELECT "Location" FROM table_20338 WHERE "Control" = 'Private' AND "Founded" = '1870' |
How many airports' names have the word Interanation in them? | CREATE TABLE airports (apid number,name text,city text,country text,x number,y number,elevation number,iata text,icao text)CREATE TABLE routes (rid number,dst_apid number,dst_ap text,src_apid number,src_ap text,alid number,airline text,codeshare text)CREATE TABLE airlines (alid number,name text,iata text,icao text,call... | SELECT COUNT(*) FROM airports WHERE name LIKE '%International%' |
What venue was the game played in when the winner was the atlanta hawks (11)? | CREATE TABLE table_name_81 (venue VARCHAR,winner VARCHAR) | SELECT venue FROM table_name_81 WHERE winner = "atlanta hawks (11)" |
For those employees who did not have any job in the past, visualize a bar chart about the distribution of hire_date and the amount of hire_date bin hire_date by weekday, sort by the how many hire date in ascending please. | 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 employees (EMPLOYEE_ID decimal(6,0),FIRST_NAME varchar(20),LAST_NAME ... | SELECT HIRE_DATE, COUNT(HIRE_DATE) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) ORDER BY COUNT(HIRE_DATE) |
report the number of patients who died on or before 2183 and had atrial fibrillation/thoracoscopic maze procedure bilateral/sda primary disease. | CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital_status text,age text,dob text,gender text,la... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "ATRIAL FIBRILLATION\THORACOSCOPIC MAZE PROCEDURE BILATERAL/SDA" AND demographic.dod_year <= "2183.0" |
Number of questions for a moon tag. | CREATE TABLE PostHistoryTypes (Id number,Name text)CREATE TABLE SuggestedEditVotes (Id number,SuggestedEditId number,UserId number,VoteTypeId number,CreationDate time,TargetUserId number,TargetRepChange number)CREATE TABLE ReviewRejectionReasons (Id number,Name text,Description text,PostTypeId number)CREATE TABLE Users... | SELECT COUNT(*) FROM Posts WHERE Id IN (SELECT DISTINCT (PostId) FROM PostTags WHERE TagId IN (SELECT Id FROM Tags WHERE TagName LIKE '%moon%')) |
provide the number of patients whose year of death is less than or equal to 2148 and procedure long title is arteriography of cerebral arteries? | 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 demographic.dod_year <= "2148.0" AND procedures.long_title = "Arteriography of cerebral arteries" |
Who wrote an episode watched by 19.01 million US viewers? | CREATE TABLE table_11411026_2 (written_by VARCHAR,us_viewers__millions_ VARCHAR) | SELECT written_by FROM table_11411026_2 WHERE us_viewers__millions_ = "19.01" |
What is the Record when Buffalo is at Home? | CREATE TABLE table_name_36 (record VARCHAR,home VARCHAR) | SELECT record FROM table_name_36 WHERE home = "buffalo" |
Which Game has a Record of 8 2 0, and Points larger than 16? | CREATE TABLE table_name_43 (game INTEGER,record VARCHAR,points VARCHAR) | SELECT SUM(game) FROM table_name_43 WHERE record = "8–2–0" AND points > 16 |
What counties represented have a democratic committee, and a committee of ways and means? | CREATE TABLE table_15819 ("District" text,"Counties Represented" text,"Party" text,"First Elected" real,"Committee" text) | SELECT "Counties Represented" FROM table_15819 WHERE "Party" = 'democratic' AND "Committee" = 'ways and means' |
How many draft pick positions did Matt Bradley have? | CREATE TABLE table_2840500_4 (position VARCHAR,player VARCHAR) | SELECT COUNT(position) FROM table_2840500_4 WHERE player = "Matt Bradley" |
provide the number of patients whose ethnicity is black/african american and diagnoses is below knee amputation status. | 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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.ethnicity = "BLACK/AFRICAN AMERICAN" AND diagnoses.long_title = "Below knee amputation status" |
How many stations own Bounce TV? | CREATE TABLE table_19100 ("Call sign" text,"Analog channel" text,"Digital channel" text,"Virtual channel" text,"Network" text,"Station Ownership" text) | SELECT COUNT("Station Ownership") FROM table_19100 WHERE "Network" = 'Bounce TV' |
uncontrolled hypertension ( systolic bp > 170 or diastolic bp > 100 ) | CREATE TABLE table_train_105 ("id" int,"mini_mental_state_examination_mmse" int,"systolic_blood_pressure_sbp" int,"diastolic_blood_pressure_dbp" int,"body_mass_index_bmi" float,"hypertension" bool,"age" float,"NOUSE" float) | SELECT * FROM table_train_105 WHERE hypertension = 1 OR (systolic_blood_pressure_sbp > 170 OR diastolic_blood_pressure_dbp > 100) |
Which Ratio has a Similar ISO A size of a3? | CREATE TABLE table_name_76 (ratio INTEGER,similar_iso_a_size VARCHAR) | SELECT AVG(ratio) FROM table_name_76 WHERE similar_iso_a_size = "a3" |
How many tries against were there when there was 961 points against? | CREATE TABLE table_name_29 (tries_against VARCHAR,points_against VARCHAR) | SELECT tries_against FROM table_name_29 WHERE points_against = "961" |
Find distinct cities of address of students? | CREATE TABLE students (student_id VARCHAR)CREATE TABLE addresses (city VARCHAR,address_id VARCHAR)CREATE TABLE people_addresses (address_id VARCHAR,person_id VARCHAR) | SELECT DISTINCT T1.city FROM addresses AS T1 JOIN people_addresses AS T2 ON T1.address_id = T2.address_id JOIN students AS T3 ON T2.person_id = T3.student_id |
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, visualize a scatter chart about the correlation between commission_pct and department_id . | 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 regions (REGION_ID decimal(5,0),REGION_NAME varchar(25))CREATE TABLE locations (LOCATION_ID decimal(4,0)... | SELECT COMMISSION_PCT, DEPARTMENT_ID FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 |
What is the total gold that has bronze less than 2, a silver of 1 and total more than 4? | CREATE TABLE table_name_32 (gold INTEGER,total VARCHAR,bronze VARCHAR,silver VARCHAR) | SELECT SUM(gold) FROM table_name_32 WHERE bronze < 2 AND silver = 1 AND total > 4 |
What is the premiere date of the american disney xd tron uprising site? | CREATE TABLE table_29487895_2 (series_premiere VARCHAR,source_s_ VARCHAR) | SELECT series_premiere FROM table_29487895_2 WHERE source_s_ = "American Disney XD Tron Uprising Site" |
A bar chart about what is the average price of the products for each category?, and rank from low to high by the y axis. | CREATE TABLE Staff (staff_id INTEGER,gender VARCHAR(1),first_name VARCHAR(80),last_name VARCHAR(80),email_address VARCHAR(255),phone_number VARCHAR(80))CREATE TABLE Complaints (complaint_id INTEGER,product_id INTEGER,customer_id INTEGER,complaint_outcome_code VARCHAR(20),complaint_status_code VARCHAR(20),complaint_type... | SELECT product_category_code, AVG(product_price) FROM Products GROUP BY product_category_code ORDER BY AVG(product_price) |
What are the notes for Ford when the total is 5? | CREATE TABLE table_79346 ("Year" text,"Builder" text,"Model" text,"Length (ft)" real,"Propulsion" text,"Fleet series" text,"Total" text,"Notes" text) | SELECT "Notes" FROM table_79346 WHERE "Builder" = 'ford' AND "Total" = '5' |
count the number of patients whose ethnicity is black/cape verdean and drug name is bumetanide? | 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.ethnicity = "BLACK/CAPE VERDEAN" AND prescriptions.drug = "Bumetanide" |
For all employees who have the letters D or S in their first name, a bar chart shows the distribution of job_id and the sum of department_id , and group by attribute job_id, and I want to show by the Y-axis in ascending. | 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 decimal(10,0))CREATE TABLE employees (EMPLOYEE_ID decimal(6,0),FIRST_NAME varchar(20),LAST_NAME varchar(25),E... | SELECT JOB_ID, SUM(DEPARTMENT_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' GROUP BY JOB_ID ORDER BY SUM(DEPARTMENT_ID) |
what is the average rank when the cyclist is alexandr pliuschin? | CREATE TABLE table_14259 ("Rank" real,"Heat" real,"Cyclist" text,"Nation" text,"Result" text) | SELECT AVG("Rank") FROM table_14259 WHERE "Cyclist" = 'alexandr pliuschin' |
What is the Home with a Time that is 12:00? | CREATE TABLE table_name_34 (home VARCHAR,time VARCHAR) | SELECT home FROM table_name_34 WHERE time = "12:00" |
What is Money ( $ ), when Player is Greg Norman? | CREATE TABLE table_name_1 (money___$__ VARCHAR,player VARCHAR) | SELECT money___$__ FROM table_name_1 WHERE player = "greg norman" |
Which Lead has a Skip of pavol pitonak? | CREATE TABLE table_39135 ("Nation" text,"Skip" text,"Third" text,"Second" text,"Lead" text) | SELECT "Lead" FROM table_39135 WHERE "Skip" = 'pavol pitonak' |
what team has the most winners ? | CREATE TABLE table_204_409 (id number,"date" text,"race name" text,"location" text,"uci rating" number,"winner" text,"team" text) | SELECT "team" FROM table_204_409 GROUP BY "team" ORDER BY COUNT("winner") DESC LIMIT 1 |
For each party, return the name of the party and the number of delegates from that party Plot them as bar chart, and rank in asc by the Y. | CREATE TABLE party (Party_ID int,Year real,Party text,Governor text,Lieutenant_Governor text,Comptroller text,Attorney_General text,US_Senate text)CREATE TABLE county (County_Id int,County_name text,Population real,Zip_code text)CREATE TABLE election (Election_ID int,Counties_Represented text,District int,Delegate text... | SELECT T2.Party, SUM(COUNT(*)) FROM election AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID GROUP BY T2.Party ORDER BY SUM(COUNT(*)) |
What was the round 5 score if the team's total points where 212? | CREATE TABLE table_21099 ("Rank" real,"Team" text,"Round1" real,"Round2" real,"Round3" real,"Round4" real,"Round5" real,"Total Points" real) | SELECT "Round5" FROM table_21099 WHERE "Total Points" = '212' |
What country won in 1993? | CREATE TABLE table_43215 ("Player" text,"Country" text,"Year(s) won" text,"Total" real,"To par" text,"Finish" text) | SELECT "Country" FROM table_43215 WHERE "Year(s) won" = '1993' |
return me the papers written by ' H. V. Jagadish ' and ' Yunyao Li ' after 2005 . | CREATE TABLE domain_conference (cid int,did int)CREATE TABLE domain_author (aid int,did int)CREATE TABLE domain_publication (did int,pid int)CREATE TABLE organization (continent varchar,homepage varchar,name varchar,oid int)CREATE TABLE cite (cited int,citing int)CREATE TABLE domain (did int,name varchar)CREATE TABLE p... | SELECT publication.title FROM author AS AUTHOR_0, author AS AUTHOR_1, publication, writes AS WRITES_0, writes AS WRITES_1 WHERE AUTHOR_0.name = 'H. V. Jagadish' AND AUTHOR_1.name = 'Yunyao Li' AND publication.year > 2005 AND WRITES_0.aid = AUTHOR_0.aid AND WRITES_0.pid = publication.pid AND WRITES_1.aid = AUTHOR_1.aid ... |
i would like a schedule of flights from SAN FRANCISCO to BOSTON on wednesday | CREATE TABLE fare_basis (fare_basis_code text,booking_class text,class_type text,premium text,economy text,discounted text,night text,season text,basis_days text)CREATE TABLE flight_leg (flight_id int,leg_number int,leg_flight int)CREATE TABLE compartment_class (compartment varchar,class_type varchar)CREATE TABLE airli... | SELECT DISTINCT FLIGHT_0.arrival_time, FLIGHT_0.departure_time FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight AS FLIGHT_0, flight AS FLIGHT_1, flight_leg WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = ... |
When is the earliest year with a Torque of 330n m (243lb ft) @ 2000-2500? | CREATE TABLE table_69442 ("Engine" text,"Displacement" text,"Power" text,"Torque" text,"Year" real) | SELECT MIN("Year") FROM table_69442 WHERE "Torque" = '330n·m (243lb·ft) @ 2000-2500' |
Which player has a score of 71-69-71-67=278? | CREATE TABLE table_14238 ("Place" text,"Player" text,"Country" text,"Score" text,"To par" text,"Money (US$)" real) | SELECT "Player" FROM table_14238 WHERE "Score" = '71-69-71-67=278' |
Who is the GamePlan when Arabella Lazenby is the RolePlay actor? | CREATE TABLE table_name_29 (gameplan VARCHAR,roleplay VARCHAR) | SELECT gameplan FROM table_name_29 WHERE roleplay = "arabella lazenby" |
What is easiest EECS 530 or EECS 413 ? | CREATE TABLE course_offering (offering_id int,course_id int,semester int,section_number int,start_time time,end_time time,monday varchar,tuesday varchar,wednesday varchar,thursday varchar,friday varchar,saturday varchar,sunday varchar,has_final_project varchar,has_final_exam varchar,textbook varchar,class_address varch... | SELECT DISTINCT course.number FROM course INNER JOIN program_course ON program_course.course_id = course.course_id WHERE (course.number = 530 OR course.number = 413) AND program_course.workload = (SELECT MIN(PROGRAM_COURSEalias1.workload) FROM program_course AS PROGRAM_COURSEalias1 INNER JOIN course AS COURSEalias1 ON ... |
How many San Jose wins have an LA goals larger than 6, and an LA wins smaller than 21? | CREATE TABLE table_name_43 (san_jose_wins VARCHAR,la_goals VARCHAR,la_wins VARCHAR) | SELECT COUNT(san_jose_wins) FROM table_name_43 WHERE la_goals > 6 AND la_wins < 21 |
return me the keywords of ' Making database systems usable ' . | CREATE TABLE writes (aid int,pid int)CREATE TABLE publication_keyword (kid int,pid int)CREATE TABLE keyword (keyword varchar,kid int)CREATE TABLE domain_author (aid int,did int)CREATE TABLE domain_publication (did int,pid int)CREATE TABLE publication (abstract varchar,cid int,citation_num int,jid int,pid int,reference_... | SELECT keyword.keyword FROM keyword, publication, publication_keyword WHERE publication_keyword.kid = keyword.kid AND publication.pid = publication_keyword.pid AND publication.title = 'Making database systems usable' |
what is the format of catalog 865 821-1? | CREATE TABLE table_name_25 (format VARCHAR,catalog VARCHAR) | SELECT format FROM table_name_25 WHERE catalog = "865 821-1" |
Which 2012 has a 2008 of grand slam tournaments? | CREATE TABLE table_41030 ("Tournament" text,"2002" text,"2003" text,"2004" text,"2005" text,"2006" text,"2007" text,"2008" text,"2009" text,"2010" text,"2011" text,"2012" text,"Win %" text) | SELECT "2012" FROM table_41030 WHERE "2008" = 'grand slam tournaments' |
Who directed the episode with production code 208? | CREATE TABLE table_23403578_3 (directed_by VARCHAR,prod_code VARCHAR) | SELECT directed_by FROM table_23403578_3 WHERE prod_code = "208" |
A line chart shows the change of monthly_rental over date_address_from | CREATE TABLE Behavior_Incident (incident_id INTEGER,incident_type_code VARCHAR(10),student_id INTEGER,date_incident_start DATETIME,date_incident_end DATETIME,incident_summary VARCHAR(255),recommendations VARCHAR(255),other_details VARCHAR(255))CREATE TABLE Ref_Detention_Type (detention_type_code VARCHAR(10),detention_t... | SELECT date_address_from, monthly_rental FROM Student_Addresses ORDER BY monthly_rental DESC |
Return a pie on what is the average base price of different bed type? List bed type and average base price. | CREATE TABLE Reservations (Code INTEGER,Room TEXT,CheckIn TEXT,CheckOut TEXT,Rate REAL,LastName TEXT,FirstName TEXT,Adults INTEGER,Kids INTEGER)CREATE TABLE Rooms (RoomId TEXT,roomName TEXT,beds INTEGER,bedType TEXT,maxOccupancy INTEGER,basePrice INTEGER,decor TEXT) | SELECT bedType, AVG(basePrice) FROM Rooms GROUP BY bedType |
Who is the player associated with the Esher venue? | CREATE TABLE table_32795 ("Player" text,"Tries" text,"Conv" text,"Pens" text,"Drop" text,"Venue" text,"Date" text) | SELECT "Player" FROM table_32795 WHERE "Venue" = 'esher' |
What date was the Tigullio Circuit? | CREATE TABLE table_12105 ("Name" text,"Circuit" text,"Date" text,"Winning driver" text,"Winning constructor" text,"Report" text) | SELECT "Date" FROM table_12105 WHERE "Circuit" = 'tigullio' |
count the number of patients whose ethnicity is white - russian and admission year is less than 2148? | 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 lab (subject_id text,hadm_id text,itemid text,charttime tex... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "WHITE - RUSSIAN" AND demographic.admityear < "2148" |
anemia ( hemoglobin less than 12 mg / dl ) | CREATE TABLE table_train_156 ("id" int,"anemia" bool,"abnormal_bilirubin" bool,"hemoglobin_a1c_hba1c" float,"body_mass_index_bmi" float,"bilirubin" float,"NOUSE" float) | SELECT * FROM table_train_156 WHERE anemia = 1 OR hemoglobin_a1c_hba1c < 12 |
What is the average Pct value when state champions is less than 1, MRC Championships is 10, and co-champions are greater than 4? | CREATE TABLE table_5744 ("Records" text,"Pct." real,"MRC Championships" real,"Solo" real,"Co-Champions" real,"State Champions" real) | SELECT AVG("Pct.") FROM table_5744 WHERE "State Champions" < '1' AND "MRC Championships" = '10' AND "Co-Champions" > '4' |
known allergy or intolerance to hcq | CREATE TABLE table_train_222 ("id" int,"autoimmune_disease" bool,"diabetic" string,"allergy_to_hcq" bool,"fasting_plasma_glucose" int,"fasting_serum_insulin" int,"NOUSE" float) | SELECT * FROM table_train_222 WHERE allergy_to_hcq = 1 |
female with a hemoglobin < 11.5 g / dl, and male with a hemoglobin < 13.5 g / dl | CREATE TABLE table_dev_26 ("id" int,"gender" string,"hemoglobin_a1c_hba1c" float,"dyslipidemia" bool,"body_weight" float,"hba1c" float,"body_mass_index_bmi" float,"hypertension" bool,"NOUSE" float) | SELECT * FROM table_dev_26 WHERE (gender = 'female' AND hemoglobin_a1c_hba1c < 11.5) OR (gender = 'male' AND hemoglobin_a1c_hba1c < 13.5) |
Who is the director and what number is the episode for episode #1 of Are You Afraid of the Dark season 3? | CREATE TABLE table_10470082_4 (director VARCHAR,_number VARCHAR) | SELECT COUNT(director) FROM table_10470082_4 WHERE _number = 1 |
JanitorTags: posts that contain two specified tags. 2 user-inputtable tags, with defaults;
post must have a score > 1;
post must not be closed | 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", Score, ViewCount, CreationDate, LastEditDate, LastActivityDate, AnswerCount, FavoriteCount FROM Posts AS p WHERE p.Id IN (SELECT pt1.PostId FROM PostTags AS pt1 JOIN PostTags AS pt2 ON pt2.PostId = pt1.PostId WHERE pt1.TagId = (SELECT Id FROM Tags WHERE TagName = '##Tag1:string?centos##') AND ... |
What is the date of the match with arnaud di pasquale as the opponent in the final? | CREATE TABLE table_name_69 (date VARCHAR,opponent_in_the_final VARCHAR) | SELECT date FROM table_name_69 WHERE opponent_in_the_final = "arnaud di pasquale" |
Deepak Vaid's Physics.SE posts. | CREATE TABLE PostLinks (Id number,CreationDate time,PostId number,RelatedPostId number,LinkTypeId number)CREATE TABLE PostNoticeTypes (Id number,ClassId number,Name text,Body text,IsHidden boolean,Predefined boolean,PostNoticeDurationId number)CREATE TABLE PostHistory (Id number,PostHistoryTypeId number,PostId number,R... | SELECT p.Id AS "post_link" FROM Posts AS p WHERE OwnerDisplayName = 'user346' |
When did the DC Comics title that debuted in 1937 end? | CREATE TABLE table_55140 ("Title" text,"Publisher" text,"First Year" text,"Last Year" text,"Genre" text) | SELECT "Last Year" FROM table_55140 WHERE "First Year" = '1937' AND "Publisher" = 'dc comics' |
What is Player, when To Par is greater than 6, and when Year(s) Won is '1962 , 1967'? | CREATE TABLE table_45852 ("Player" text,"Country" text,"Year(s) won" text,"Total" real,"To par" real,"Finish" text) | SELECT "Player" FROM table_45852 WHERE "To par" > '6' AND "Year(s) won" = '1962 , 1967' |
Display Posts By Votes For Tag in Timerange. | CREATE TABLE SuggestedEditVotes (Id number,SuggestedEditId number,UserId number,VoteTypeId number,CreationDate time,TargetUserId number,TargetRepChange number)CREATE TABLE PostNoticeTypes (Id number,ClassId number,Name text,Body text,IsHidden boolean,Predefined boolean,PostNoticeDurationId number)CREATE TABLE Comments ... | SELECT RANK() OVER (ORDER BY Score DESC, ViewCount DESC), Title, b.DisplayName AS UserName, Score, ViewCount, CAST(TIME_TO_STR(a.CreationDate, '%d/%m/%Y') AS TEXT(30)) AS Date, Tags FROM Posts AS a INNER JOIN Users AS b ON a.OwnerUserId = b.Id WHERE a.CreationDate BETWEEN '03-09-2015' AND '03-22-2015' AND PostTypeId = ... |
Name the result for 13 october 2004 | CREATE TABLE table_58401 ("Date" text,"Venue" text,"Score" text,"Result" text,"Competition" text) | SELECT "Result" FROM table_58401 WHERE "Date" = '13 october 2004' |
Who had an Ipsos of 27%? | CREATE TABLE table_55579 ("Party" text,"Results 2004" text,"CSA 5/28/09" text,"Ifop 5/30/09" text,"Ipsos 5/30/09" text,"BVA 6/1/09" text,"TNS-Sofres 6/2/09" text,"OpinionWay 6/3/09" text,"Ipsos 6/3/09" text,"TNS-Sofres 6/4/09" text,"CSA 6/4/09" text,"Ifop 6/4/09" text) | SELECT "Party" FROM table_55579 WHERE "Ipsos 6/3/09" = '27%' |
Show the number of documents for different budget type code in a bar chart, order by the names from high to low. | CREATE TABLE Documents (Document_ID INTEGER,Document_Type_Code CHAR(15),Project_ID INTEGER,Document_Date DATETIME,Document_Name VARCHAR(255),Document_Description VARCHAR(255),Other_Details VARCHAR(255))CREATE TABLE Documents_with_Expenses (Document_ID INTEGER,Budget_Type_Code CHAR(15),Document_Details VARCHAR(255))CREA... | SELECT T1.Budget_Type_Code, COUNT(T1.Budget_Type_Code) FROM Documents_with_Expenses AS T1 JOIN Ref_Budget_Codes AS T2 ON T1.Budget_Type_Code = T2.Budget_Type_Code GROUP BY T1.Budget_Type_Code ORDER BY T1.Budget_Type_Code DESC |
What is the D 48 with a D 49 with r 9? | CREATE TABLE table_52303 ("D 49 \u221a" text,"D 48 \u221a" text,"D 47 \u221a" text,"D 46 \u221a" text,"D 45 \u221a" text,"D 44 \u221a" text,"D 43 \u221a" text,"D 42 \u221a" text,"D 41 \u221a" text) | SELECT "D 48 \u221a" FROM table_52303 WHERE "D 49 \u221a" = 'r 9' |
Which round 1 has a from prior to 1984, double as round 3, with a goal lwss than 300? | CREATE TABLE table_40351 ("From" real,"Goal" real,"Round 1" text,"Round 2" text,"Round 3" text,"Round 4" text,"Round 5" text,"Round 6+" text) | SELECT "Round 1" FROM table_40351 WHERE "From" < '1984' AND "Round 3" = 'double' AND "Goal" < '300' |
how many patients whose primary disease is hypoxia and year of death is less than or equal to 2164? | CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text,formulary_drug_cd text,route text,drug_dose text)CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "HYPOXIA" AND demographic.dod_year <= "2164.0" |
Which player belongs to deerfield academy (Massachusetts) college/junior/club team? | CREATE TABLE table_21721351_18 (player VARCHAR,college_junior_club_team VARCHAR) | SELECT player FROM table_21721351_18 WHERE college_junior_club_team = "Deerfield Academy (Massachusetts)" |
What is the relationship between Credits and Instructor ? | CREATE TABLE Member_of (FacID INTEGER,DNO INTEGER,Appt_Type VARCHAR(15))CREATE TABLE Course (CID VARCHAR(7),CName VARCHAR(40),Credits INTEGER,Instructor INTEGER,Days VARCHAR(5),Hours VARCHAR(11),DNO INTEGER)CREATE TABLE Faculty (FacID INTEGER,Lname VARCHAR(15),Fname VARCHAR(15),Rank VARCHAR(15),Sex VARCHAR(1),Phone INT... | SELECT Credits, Instructor FROM Course ORDER BY Credits |
display the users ordered by decreasing reputation. | CREATE TABLE SuggestedEdits (Id number,PostId number,CreationDate time,ApprovalDate time,RejectionDate time,OwnerUserId number,Comment text,Text text,Title text,Tags text,RevisionGUID other)CREATE TABLE ReviewTaskResults (Id number,ReviewTaskId number,ReviewTaskResultTypeId number,CreationDate time,RejectionReasonId nu... | SELECT Badges.Class, COUNT(DISTINCT Badges.Id) AS BadgeCount, Users.DisplayName, Users.Location, Users.Reputation FROM Users JOIN Badges ON Users.Id = Badges.UserId WHERE YEAR(Date) = 2016 AND MONTH(Date) = 01 GROUP BY Badges.Class, Users.DisplayName, Users.Location, Users.Reputation ORDER BY BadgeCount DESC |
What tournament has yvonne vermaak as the opponent? | CREATE TABLE table_name_5 (tournament VARCHAR,opponent VARCHAR) | SELECT tournament FROM table_name_5 WHERE opponent = "yvonne vermaak" |
Let me know the lab test category and primary disease of the patient with patient id 2560. | 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 demographic (subject_id text,hadm_id text,name text,marita... | SELECT demographic.diagnosis, lab."CATEGORY" FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.subject_id = "2560" |
For those records from the products and each product's manufacturer, give me the comparison about the sum of code over the name , and group by attribute name. | CREATE TABLE Manufacturers (Code INTEGER,Name VARCHAR(255),Headquarter VARCHAR(255),Founder VARCHAR(255),Revenue REAL)CREATE TABLE Products (Code INTEGER,Name VARCHAR(255),Price DECIMAL,Manufacturer INTEGER) | SELECT T1.Name, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name |
What is the rank of Lee Trevino, who had less than 27 wins? | CREATE TABLE table_52667 ("Rank" real,"Player" text,"Country" text,"Earnings($)" real,"Wins" real) | SELECT SUM("Rank") FROM table_52667 WHERE "Player" = 'lee trevino' AND "Wins" < '27' |
What numbered pick was the player from texas? | CREATE TABLE table_75477 ("Round" real,"Pick #" real,"Overall" real,"Name" text,"Position" text,"College" text) | SELECT COUNT("Pick #") FROM table_75477 WHERE "College" = 'texas' |
count the number of patients with procedure icd9 code 3615 who died on or before 2158. | 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 procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.dod_year <= "2158.0" AND procedures.icd9_code = "3615" |
what is the number of blocks made by moses malone ? | CREATE TABLE table_203_532 (id number,"rebounds" number,"off" number,"def" number,"player" text,"team" text,"date" text,"opponent" text,"score" text,"minutes played" text,"points" number,"assists" number,"steals" number,"blocks" number,"20-20" text,"led the league in rebounding" text,"notes" text) | SELECT SUM("rebounds") FROM table_203_532 WHERE "player" = 'moses malone' |
when did patient 027-4309 get discharged from the hospital until 1 year ago for the first time? | 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 patient.hospitaldischargetime FROM patient WHERE patient.uniquepid = '027-4309' AND DATETIME(patient.hospitaldischargetime) <= DATETIME(CURRENT_TIME(), '-1 year') ORDER BY patient.hospitaldischargetime LIMIT 1 |
Name the representing for englar alheimsins | CREATE TABLE table_57013 ("Year" real,"Author" text,"English title" text,"Original title" text,"Representing" text) | SELECT "Representing" FROM table_57013 WHERE "Original title" = 'englar alheimsins' |
When classic hits 102.1 cjcy is the branding who is the owner? | CREATE TABLE table_22414 ("Frequency" text,"Call sign" text,"Branding" text,"Format" text,"Owner" text,"Language/Rebroadcast" text) | SELECT "Owner" FROM table_22414 WHERE "Branding" = 'Classic Hits 102.1 CJCY' |
1950 larger than 80, and a 1960 of 196, and a 1990 larger than 131 what is the lowest 1996[2]? | CREATE TABLE table_name_80 (Id VARCHAR) | SELECT MIN(1996) AS "2" FROM table_name_80 WHERE 1950 > 80 AND 1960 = 196 AND 1990 > 131 |
What is the average bike availability in stations that are not located in Palo Alto? | CREATE TABLE station (bikes_available INTEGER,station_id VARCHAR,id VARCHAR,city VARCHAR)CREATE TABLE status (bikes_available INTEGER,station_id VARCHAR,id VARCHAR,city VARCHAR) | SELECT AVG(bikes_available) FROM status WHERE NOT station_id IN (SELECT id FROM station WHERE city = "Palo Alto") |
What is the status for 07/01/1961? | CREATE TABLE table_59604 ("Opposing Teams" text,"Against" real,"Date" text,"Venue" text,"Status" text) | SELECT "Status" FROM table_59604 WHERE "Date" = '07/01/1961' |
What is the lowest number of goals scored for the entry with goals conceded larger than 30, lost larger than 3, and fewer than 6 draws? | CREATE TABLE table_12412 ("Place" real,"Team" text,"Played" real,"Draw" real,"Lost" real,"Goals Scored" real,"Goals Conceded" real,"Points" text) | SELECT MIN("Goals Scored") FROM table_12412 WHERE "Draw" < '6' AND "Lost" > '3' AND "Goals Conceded" > '30' |
What is the date for the home detroit and visitor was chicago? | CREATE TABLE table_74986 ("Date" text,"Visitor" text,"Score" text,"Home" text,"Record" text) | SELECT "Date" FROM table_74986 WHERE "Home" = 'detroit' AND "Visitor" = 'chicago' |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.