instruction stringlengths 0 1.06k | input stringlengths 11 5.3k | response stringlengths 2 4.44k |
|---|---|---|
Old questions with a specific tag. Brings up those open question with no accepted answer of a certain time old with a tag. | CREATE TABLE Badges (Id number,UserId number,Name text,Date time,Class number,TagBased boolean)CREATE TABLE PostHistory (Id number,PostHistoryTypeId number,PostId number,RevisionGUID other,CreationDate time,UserId number,UserDisplayName text,Comment text,Text text,ContentLicense text)CREATE TABLE PostFeedback (Id numbe... | SELECT q.Id AS "post_link", q.Score AS "Votes", q.CreationDate AS "Posted", q.LastActivityDate AS "Last Active", q.ViewCount AS "Views", q.CommentCount AS "Comments" FROM Posts AS q JOIN Posts AS a ON a.ParentId = q.Id WHERE q.PostTypeId = 1 AND q.AcceptedAnswerId IS NULL AND q.ClosedDate IS NULL AND q.CreationDate < D... |
Which English name has a Color of green? | CREATE TABLE table_name_54 (english_name VARCHAR,color VARCHAR) | SELECT english_name FROM table_name_54 WHERE color = "green" |
What is the Stadium that hosts the team Jacksonville Jaguars? | CREATE TABLE table_68706 ("Date" text,"Visiting team" text,"Final score" text,"Host team" text,"Stadium" text) | SELECT "Stadium" FROM table_68706 WHERE "Host team" = 'jacksonville jaguars' |
Bar chart x axis open date y axis how many open date | CREATE TABLE church (Church_ID int,Name text,Organized_by text,Open_Date int,Continuation_of text)CREATE TABLE people (People_ID int,Name text,Country text,Is_Male text,Age int)CREATE TABLE wedding (Church_ID int,Male_ID int,Female_ID int,Year int) | SELECT Open_Date, COUNT(Open_Date) FROM church |
Which Catalogue has a Writer(s) of mark james? | CREATE TABLE table_7126 ("Track" real,"Recorded" text,"Catalogue" text,"Release date" text,"Chart peak" text,"Song title" text,"Writer(s)" text,"Time" text) | SELECT "Catalogue" FROM table_7126 WHERE "Writer(s)" = 'mark james' |
what is marital status and admission type of subject name jerry deberry? | 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 demographic.marital_status, demographic.admission_type FROM demographic WHERE demographic.name = "Jerry Deberry" |
What RolePlay actor played the same role Alison Pargeter played in the original production? | CREATE TABLE table_17827271_1 (roleplay VARCHAR,actor_in_original_production VARCHAR) | SELECT roleplay FROM table_17827271_1 WHERE actor_in_original_production = "Alison Pargeter" |
When were the years on which warwick had a population greater than 10,956 and allora had a population bigger than 2,439? | CREATE TABLE table_67959 ("Year" real,"Population (Region total)" real,"Population (Stanthorpe)" real,"Population (Warwick)" real,"Population (Allora)" real,"Population (Glengallan)" real,"Population (Rosenthal)" real) | SELECT SUM("Year") FROM table_67959 WHERE "Population (Warwick)" = '10,956' AND "Population (Allora)" > '2,439' |
What is the Wins of the Top-25 of 1 and 7 Events? | CREATE TABLE table_name_66 (wins VARCHAR,top_25 VARCHAR,events VARCHAR) | SELECT wins FROM table_name_66 WHERE top_25 = 1 AND events = 7 |
how many patients are born before 2170 and lab tested with urine?? | 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 COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dob_year < "2170" AND lab.fluid = "Urine" |
When the record was 4-4, how many people attended? | CREATE TABLE table_name_64 (attendance VARCHAR,record VARCHAR) | SELECT attendance FROM table_name_64 WHERE record = "4-4" |
What's the 1997 if 1993 has a 1R, 1995 has a 3R, and 1999 has a 1R? | CREATE TABLE table_64982 ("Tournament" text,"1986" text,"1988" text,"1989" text,"1990" text,"1991" text,"1992" text,"1993" text,"1994" text,"1995" text,"1996" text,"1997" text,"1998" text,"1999" text) | SELECT "1997" FROM table_64982 WHERE "1999" = '1r' AND "1995" = '3r' AND "1993" = '1r' |
what is admission location and date of death of subject id 7273? | CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text,formulary_drug_cd text,route text,drug_dose text)CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime te... | SELECT demographic.admission_location, demographic.dod FROM demographic WHERE demographic.subject_id = "7273" |
What is the total for the state of new york and a swimsuit less than 9.394? | CREATE TABLE table_11538 ("State" text,"Interview" real,"Swimsuit" real,"Evening Gown" real,"Average" real) | SELECT SUM("Interview") FROM table_11538 WHERE "State" = 'new york' AND "Swimsuit" < '9.394' |
Who was the away team when the home team scored 10.8 (68)? | CREATE TABLE table_10141 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Venue" text,"Crowd" real,"Date" text) | SELECT "Away team" FROM table_10141 WHERE "Home team score" = '10.8 (68)' |
Which college did draft pick #143 attend? | CREATE TABLE table_15582870_1 (college VARCHAR,choice VARCHAR) | SELECT college FROM table_15582870_1 WHERE choice = 143 |
What is the capital of Umbria? | CREATE TABLE table_14532_1 (capital VARCHAR,region VARCHAR) | SELECT capital FROM table_14532_1 WHERE region = "Umbria" |
when was patient 80671 prescribed a drug for the last time until 02/2103? | 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 patients (row_id number,subject_id number,gender text,dob time... | SELECT prescriptions.startdate FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 80671) AND STRFTIME('%y-%m', prescriptions.startdate) <= '2103-02' ORDER BY prescriptions.startdate DESC LIMIT 1 |
which aac school has the most students ? | CREATE TABLE table_203_135 (id number,"institution" text,"location" text,"founded" number,"type" text,"enrollment" number,"joined" number,"nickname" text) | SELECT "institution" FROM table_203_135 ORDER BY "enrollment" DESC LIMIT 1 |
What is the location with enrollment of 316 and county is 68 Randolph? | CREATE TABLE table_name_21 (location VARCHAR,_number___county VARCHAR,enrollment VARCHAR) | SELECT location FROM table_name_21 WHERE _number___county = "68 randolph" AND enrollment = 316 |
Home Team of chicago bulls, and a Result of 81-83 (3-2) involved what game? | CREATE TABLE table_75402 ("Game" text,"Date" text,"Home Team" text,"Result" text,"Road Team" text) | SELECT "Game" FROM table_75402 WHERE "Home Team" = 'chicago bulls' AND "Result" = '81-83 (3-2)' |
What is the lowest Share, when Rating is greater than 1.3, and when Air Date is May 28, 2008? | CREATE TABLE table_8883 ("Episode" text,"Air Date" text,"Timeslot" text,"Rating" real,"Share" real,"18-49" text,"Viewers" text,"Weekly Rank" text) | SELECT MIN("Share") FROM table_8883 WHERE "Rating" > '1.3' AND "Air Date" = 'may 28, 2008' |
was there any microbiology test results for the urine of patient 83182 in 2105? | CREATE TABLE diagnoses_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_id number,icustay_id number,charttime time,itemid number,value number)CREATE TABLE transfers (row_id number,subject_id number,hadm_id number,icustay_id... | SELECT COUNT(*) > 0 FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 83182) AND microbiologyevents.spec_type_desc = 'urine' AND STRFTIME('%y', microbiologyevents.charttime) = '2105' |
What is the average number of goals against with more than 12 wins, 12 losses, and a position greater than 3? | CREATE TABLE table_name_98 (goals_against INTEGER,position VARCHAR,wins VARCHAR,losses VARCHAR) | SELECT AVG(goals_against) FROM table_name_98 WHERE wins > 12 AND losses = 12 AND position > 3 |
When has a Result of l 27-7 and an Opponent of at minnesota vikings? | CREATE TABLE table_34268 ("Week" real,"Date" text,"Opponent" text,"Result" text,"Venue" text,"Attendance" text) | SELECT "Date" FROM table_34268 WHERE "Result" = 'l 27-7' AND "Opponent" = 'at minnesota vikings' |
What are Unit 2's dates of commissioning? | CREATE TABLE table_28672269_1 (date_of_commissioning VARCHAR,unit_number VARCHAR) | SELECT COUNT(date_of_commissioning) FROM table_28672269_1 WHERE unit_number = 2 |
when did patient 97314 have the maximum amount of potassium in 03/this year for the first time? | CREATE TABLE labevents (row_id number,subject_id number,hadm_id number,itemid number,charttime time,valuenum number,valueuom text)CREATE TABLE d_items (row_id number,itemid number,label text,linksto text)CREATE TABLE d_labitems (row_id number,itemid number,label text)CREATE TABLE diagnoses_icd (row_id number,subject_id... | SELECT labevents.charttime FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 97314) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'potassium') AND DATETIME(labevents.charttime, 'start of year') = DATETIME(CURRE... |
How much Overall has a Position of wr, and a College of alberta? | CREATE TABLE table_50977 ("Round" real,"Pick" real,"Overall" real,"Name" text,"Position" text,"College" text) | SELECT SUM("Overall") FROM table_50977 WHERE "Position" = 'wr' AND "College" = 'alberta' |
What was the average score for the couple that had 4 dances? | CREATE TABLE table_23662356_3 (average VARCHAR,number_of_dances VARCHAR) | SELECT average FROM table_23662356_3 WHERE number_of_dances = 4 |
Find the number of students whose age is older than the average age for each gender. | CREATE TABLE Lives_in (stuid INTEGER,dormid INTEGER,room_number INTEGER)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 Dorm_amenity (amenid INTEGER,amenity_name VARCHAR(25))CREATE TABLE Has_amenity (dormi... | SELECT Sex, COUNT(*) FROM Student WHERE Age > (SELECT AVG(Age) FROM Student) GROUP BY Sex |
Which league is for baseball with Laredo Apaches? | CREATE TABLE table_name_31 (league VARCHAR,sport VARCHAR,club VARCHAR) | SELECT league FROM table_name_31 WHERE sport = "baseball" AND club = "laredo apaches" |
Who picked dimitri tsoumpas? | CREATE TABLE table_16575609_1 (cfl_team VARCHAR,player VARCHAR) | SELECT cfl_team FROM table_16575609_1 WHERE player = "Dimitri Tsoumpas" |
What is the final position/round of the UEFA cup? | CREATE TABLE table_name_88 (final_position___round VARCHAR,competition VARCHAR) | SELECT final_position___round FROM table_name_88 WHERE competition = "uefa cup" |
In the match played against Telford United, who was the home team? | CREATE TABLE table_50153 ("Tie no" text,"Home team" text,"Score" text,"Away team" text,"Date" text) | SELECT "Home team" FROM table_50153 WHERE "Away team" = 'telford united' |
What was the score on October 16, 1983? | CREATE TABLE table_33888 ("Outcome" text,"Date" text,"Tournament" text,"Surface" text,"Opponent" text,"Score" text) | SELECT "Score" FROM table_33888 WHERE "Date" = 'october 16, 1983' |
How many number of WJC Jews in the Los Angeles Metro Area has a ARDA rank of more than 2? | CREATE TABLE table_name_73 (number_of_jews__wjc_ INTEGER,metro_area VARCHAR,rank__arda_ VARCHAR) | SELECT SUM(number_of_jews__wjc_) FROM table_name_73 WHERE metro_area = "los angeles" AND rank__arda_ > 2 |
Does Sebens teach upper level courses ? | CREATE TABLE semester (semester_id int,semester varchar,year int)CREATE TABLE gsi (course_offering_id int,student_id int)CREATE TABLE ta (campus_job_id int,student_id int,location varchar)CREATE TABLE comment_instructor (instructor_id int,student_id int,score int,comment_text varchar)CREATE TABLE instructor (instructor... | SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN offering_instructor ON offering_instructor.offering_id = course_offering.offering_id INNER JOIN instructor ON offering_instructor.instructor_id = instructor.ins... |
What is the Notes with a Venue that is venice, italy? | CREATE TABLE table_41087 ("Year" real,"Competition" text,"Venue" text,"Position" text,"Notes" text) | SELECT "Notes" FROM table_41087 WHERE "Venue" = 'venice, italy' |
What number episode had a rating of 4.7? | CREATE TABLE table_23730973_5 (no INTEGER,rating VARCHAR) | SELECT MIN(no) FROM table_23730973_5 WHERE rating = "4.7" |
What is the release date of the mm series, which has the title tom thumb in trouble? | CREATE TABLE table_62780 ("Title" text,"Series" text,"Director" text,"Production Number" text,"Release date" text) | SELECT "Release date" FROM table_62780 WHERE "Series" = 'mm' AND "Title" = 'tom thumb in trouble' |
Draw a bar chart about the distribution of Time and ID , and sort y-axis in ascending order please. | CREATE TABLE event (ID int,Name text,Stadium_ID int,Year text)CREATE TABLE swimmer (ID int,name text,Nationality text,meter_100 real,meter_200 text,meter_300 text,meter_400 text,meter_500 text,meter_600 text,meter_700 text,Time text)CREATE TABLE record (ID int,Result text,Swimmer_ID int,Event_ID int)CREATE TABLE stadiu... | SELECT Time, ID FROM swimmer ORDER BY ID |
Occupational pensions of 7%, and a Working tax credit of 2%, and a Other social security benefits of 6% has what investment income? | CREATE TABLE table_name_39 (investment_income VARCHAR,other_social_security_benefits VARCHAR,occupational_pensions VARCHAR,working_tax_credit VARCHAR) | SELECT investment_income FROM table_name_39 WHERE occupational_pensions = "7%" AND working_tax_credit = "2%" AND other_social_security_benefits = "6%" |
With a Championship of 1959 USAC Championship Car Season what is the event? | CREATE TABLE table_name_32 (event VARCHAR,championship VARCHAR) | SELECT event FROM table_name_32 WHERE championship = "1959 usac championship car season" |
Where was the round 1 race? | CREATE TABLE table_28093 ("Round" real,"Circuit" text,"Location" text,"Date" text,"Pole position" text,"Fastest lap" text,"Winning driver" text,"Winning team" text) | SELECT "Location" FROM table_28093 WHERE "Round" = '1' |
when did patient 23929 receive a lab test in 08/last year last time? | CREATE TABLE d_icd_procedures (row_id number,icd9_code text,short_title text,long_title text)CREATE TABLE prescriptions (row_id number,subject_id number,hadm_id number,startdate time,enddate time,drug text,dose_val_rx text,dose_unit_rx text,route text)CREATE TABLE outputevents (row_id number,subject_id number,hadm_id n... | SELECT labevents.charttime FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 23929) AND DATETIME(labevents.charttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') AND STRFTIME('%m', labevents.charttime) = '08' ORDER BY labevents... |
CMPLXSYS 541 is taught by whom ? | CREATE TABLE offering_instructor (offering_instructor_id int,offering_id int,instructor_id int)CREATE TABLE student_record (student_id int,course_id int,semester int,grade varchar,how varchar,transfer_source varchar,earn_credit varchar,repeat_term varchar,test_id varchar)CREATE TABLE gsi (course_offering_id int,student... | SELECT DISTINCT instructor.name FROM course, course_offering, instructor, offering_instructor WHERE course.course_id = course_offering.course_id AND course.department = 'CMPLXSYS' AND course.number = 541 AND offering_instructor.instructor_id = instructor.instructor_id AND offering_instructor.offering_id = course_offeri... |
Which seaosn had a player of rohan ricketts? | CREATE TABLE table_44484 ("Season" real,"Player" text,"Club" text,"Nationality" text,"Goals" real) | SELECT COUNT("Season") FROM table_44484 WHERE "Player" = 'rohan ricketts' |
Show the number of date account opened from each date account opened | CREATE TABLE Invoice_Line_Items (order_item_id INTEGER,invoice_number INTEGER,product_id INTEGER,product_title VARCHAR(80),product_quantity VARCHAR(50),product_price DECIMAL(19,4),derived_product_cost DECIMAL(19,4),derived_vat_payable DECIMAL(19,4),derived_total_cost DECIMAL(19,4))CREATE TABLE Orders (order_id INTEGER,... | SELECT date_account_opened, COUNT(date_account_opened) FROM Accounts |
Compare all countries with a bar chart, display Y-axis in desc order. | CREATE TABLE artist (Artist_ID int,Name text,Country text,Year_Join int,Age int)CREATE TABLE exhibition (Exhibition_ID int,Year int,Theme text,Artist_ID int,Ticket_Price real)CREATE TABLE exhibition_record (Exhibition_ID int,Date text,Attendance int) | SELECT Country, COUNT(Country) FROM artist GROUP BY Country ORDER BY COUNT(Country) DESC |
Who was the Ole Miss player associated with Chuck Dicus? | CREATE TABLE table_80220 ("Year" real,"Alabama" text,"Arkansas" text,"Auburn" text,"Ole Miss" text,"Mississippi St." text) | SELECT "Ole Miss" FROM table_80220 WHERE "Arkansas" = 'chuck dicus' |
What is the total number of Total with more than 16 rank for the nation of Romania with more than 0 for silver? | CREATE TABLE table_7592 ("Rank" real,"Nation" text,"Gold" real,"Silver" real,"Bronze" real,"Total" real) | SELECT COUNT("Total") FROM table_7592 WHERE "Rank" > '16' AND "Nation" = 'romania' AND "Silver" > '0' |
list DAILY flights from OAKLAND to BOSTON using CO | CREATE TABLE month (month_number int,month_name text)CREATE TABLE flight_leg (flight_id int,leg_number int,leg_flight int)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 var... | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE ((CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'OAKLAND' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BOST... |
On what date was game 3 played? | CREATE TABLE table_name_44 (date VARCHAR,game VARCHAR) | SELECT date FROM table_name_44 WHERE game = 3 |
Which Competition had a Result of 3-0 and VEnue of Suwon? | CREATE TABLE table_52998 ("Date" text,"Venue" text,"Score" text,"Result" text,"Competition" text) | SELECT "Competition" FROM table_52998 WHERE "Result" = '3-0' AND "Venue" = 'suwon' |
What was the score of the home team at junction oval? | CREATE TABLE table_11092 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Venue" text,"Crowd" real,"Date" text) | SELECT "Home team score" FROM table_11092 WHERE "Venue" = 'junction oval' |
how many patients whose year of birth is less than 2060 and lab test fluid is cerebrospinal fluid (csf)? | 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 lab (subject_id text,hadm_id text,itemid text,charttime tex... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dob_year < "2060" AND lab.fluid = "Cerebrospinal Fluid (CSF)" |
Who wrote episode with production code 1.01? | CREATE TABLE table_28089666_1 (written_by VARCHAR,production_code VARCHAR) | SELECT written_by FROM table_28089666_1 WHERE production_code = "1.01" |
What is the highest number of wins when there are more than 2 byes? | CREATE TABLE table_59649 ("Golden Rivers" text,"Wins" real,"Byes" real,"Losses" real,"Draws" real,"Against" real) | SELECT MAX("Wins") FROM table_59649 WHERE "Byes" > '2' |
What is the team with the name Boumediene Abderahmane? | CREATE TABLE table_name_48 (teams VARCHAR,name VARCHAR) | SELECT teams FROM table_name_48 WHERE name = "boumediene abderahmane" |
Who did the most high rebounds in the game where Sales (17) did the high points? | CREATE TABLE table_18904831_5 (high_rebounds VARCHAR,high_points VARCHAR) | SELECT high_rebounds FROM table_18904831_5 WHERE high_points = "Sales (17)" |
What is the number of bulls that has oxen larger than 113.8, and a sheep and goats larger than 4533.4, and a cows smaller than 3987, and a total horses larger than 5056.5? | CREATE TABLE table_60642 ("Year" real,"Total Horses" real,"Working Horses" text,"Total Cattle" real,"Oxen" real,"Bulls" text,"Cows" real,"Pigs" real,"Sheep and Goats" real) | SELECT "Bulls" FROM table_60642 WHERE "Oxen" > '113.8' AND "Sheep and Goats" > '4533.4' AND "Cows" < '3987' AND "Total Horses" > '5056.5' |
Which state get the highest revenue? | CREATE TABLE finrev_fed_key_17 (state_code number,state text,#_records text)CREATE TABLE ndecoreexcel_math_grade8 (year number,state text,all_students text,average_scale_score number)CREATE TABLE finrev_fed_17 (state_code number,idcensus number,school_district text,nces_id text,yr_data number,t_fed_rev number,c14 numbe... | SELECT T2.state FROM finrev_fed_key_17 AS T2 JOIN finrev_fed_17 AS T1 ON T1.state_code = T2.state_code GROUP BY T2.state ORDER BY SUM(t_fed_rev) DESC LIMIT 1 |
Tell me the total number of points with chassis of tf103 | CREATE TABLE table_name_2 (points VARCHAR,chassis VARCHAR) | SELECT COUNT(points) FROM table_name_2 WHERE chassis = "tf103" |
did patient 23930 go through any procedure? | CREATE TABLE transfers (row_id number,subject_id number,hadm_id number,icustay_id number,eventtype text,careunit text,wardid number,intime time,outtime time)CREATE TABLE d_items (row_id number,itemid number,label text,linksto text)CREATE TABLE chartevents (row_id number,subject_id number,hadm_id number,icustay_id numbe... | SELECT COUNT(*) > 0 FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 23930) |
Find the names of bank branches that have provided a loan to any customer whose credit score is below 100. | CREATE TABLE bank (bname VARCHAR,branch_id VARCHAR)CREATE TABLE customer (cust_id VARCHAR,credit_score INTEGER)CREATE TABLE loan (branch_id VARCHAR,cust_id VARCHAR) | SELECT T2.bname FROM loan AS T1 JOIN bank AS T2 ON T1.branch_id = T2.branch_id JOIN customer AS T3 ON T1.cust_id = T3.cust_id WHERE T3.credit_score < 100 |
A pie chart showing the number of customer addresses in each premises type. | CREATE TABLE Premises (premise_id INTEGER,premises_type VARCHAR(15),premise_details VARCHAR(255))CREATE TABLE Customers (customer_id INTEGER,payment_method VARCHAR(15),customer_name VARCHAR(80),customer_phone VARCHAR(80),customer_email VARCHAR(80),customer_address VARCHAR(255),customer_login VARCHAR(80),customer_passwo... | SELECT premises_type, COUNT(premises_type) FROM Customer_Addresses AS T1 JOIN Premises AS T2 ON T1.premise_id = T2.premise_id GROUP BY premises_type |
What is the Club, when the value for Played is 22, and when the value for Tries is 41? | CREATE TABLE table_67684 ("Club" text,"Played" text,"Drawn" text,"Lost" text,"Points for" text,"Points against" text,"Tries for" text,"Tries against" text,"Try bonus" text,"Losing bonus" text,"Points" text) | SELECT "Club" FROM table_67684 WHERE "Played" = '22' AND "Tries for" = '41' |
What district for charlie oliver of the 2012 commission? | CREATE TABLE table_18857 ("District" text,"2012 Commission" text,"2010 Commission" text,"2007 Commission" text,"2002 Commission" text,"1999 Commission" text) | SELECT "District" FROM table_18857 WHERE "2012 Commission" = 'Charlie Oliver' |
What was the score for the game against San Antonio? | CREATE TABLE table_name_97 (score VARCHAR,team VARCHAR) | SELECT score FROM table_name_97 WHERE team = "san antonio" |
Which Lost is the highest one that has a Drawn smaller than 4, and a Played smaller than 9? | CREATE TABLE table_74877 ("Position" real,"Team" text,"Points" real,"Played" real,"Drawn" real,"Lost" real,"Against" real,"Difference" text) | SELECT MAX("Lost") FROM table_74877 WHERE "Drawn" < '4' AND "Played" < '9' |
Leading Scorer of Ian rush is what lowest # of goals? | CREATE TABLE table_name_45 (goals INTEGER,leading_scorer VARCHAR) | SELECT MIN(goals) FROM table_name_45 WHERE leading_scorer = "ian rush" |
Check if owner ID and QID in data dump are linked to API. | CREATE TABLE PostHistory (Id number,PostHistoryTypeId number,PostId number,RevisionGUID other,CreationDate time,UserId number,UserDisplayName text,Comment text,Text text,ContentLicense text)CREATE TABLE SuggestedEdits (Id number,PostId number,CreationDate time,ApprovalDate time,RejectionDate time,OwnerUserId number,Com... | SELECT * FROM Users WHERE Users.Id = 61 |
What is the value for lowest Sacks, when the Team is New Orleans Saints, and when the value for Tackles is 132? | CREATE TABLE table_69748 ("Year" text,"Team" text,"Tackles" text,"Solo" real,"Sacks" real,"INT YDS" real) | SELECT MIN("Sacks") FROM table_69748 WHERE "Team" = 'new orleans saints' AND "Tackles" = '132' |
What is the smallest Pick with Overall of 244? | CREATE TABLE table_name_33 (pick INTEGER,overall VARCHAR) | SELECT MIN(pick) FROM table_name_33 WHERE overall = 244 |
What was the lowest attendance at the game against chicago when conklin made the decision? | CREATE TABLE table_name_21 (attendance INTEGER,decision VARCHAR,visitor VARCHAR) | SELECT MIN(attendance) FROM table_name_21 WHERE decision = "conklin" AND visitor = "chicago" |
How much December has a Score of 5 2, and a Game smaller than 27? | CREATE TABLE table_name_81 (december VARCHAR,score VARCHAR,game VARCHAR) | SELECT COUNT(december) FROM table_name_81 WHERE score = "5–2" AND game < 27 |
What is the percentage of all females that are literate people have a percentage of 68.74? | CREATE TABLE table_14598_9 (females___percentage_ VARCHAR,literate_persons___percentage_ VARCHAR) | SELECT females___percentage_ FROM table_14598_9 WHERE literate_persons___percentage_ = "68.74" |
How many Points have a Score of 3 0? | CREATE TABLE table_39283 ("Game" real,"October" real,"Opponent" text,"Score" text,"Record" text,"Points" real) | SELECT COUNT("Points") FROM table_39283 WHERE "Score" = '3–0' |
What is Against, when Opposing Teams is 'Australia', and when Date is '27/07/1991'? | CREATE TABLE table_name_12 (against VARCHAR,opposing_teams VARCHAR,date VARCHAR) | SELECT against FROM table_name_12 WHERE opposing_teams = "australia" AND date = "27/07/1991" |
How many Wins has a Scored of 27 and Draws smaller than 5? | CREATE TABLE table_name_61 (wins VARCHAR,scored VARCHAR,draws VARCHAR) | SELECT COUNT(wins) FROM table_name_61 WHERE scored = 27 AND draws < 5 |
count the number of patients whose diagnoses short title is pyelonephritis nos? | CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text,formulary_drug_cd text,route text,drug_dose text)CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid text)CREATE TABLE demographic (subject_id text,hadm_id t... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE diagnoses.short_title = "Pyelonephritis NOS" |
What is the Hanzi of Phoenix Television Chinese that launched in 1996? | CREATE TABLE table_74873 ("Name" text,"Hanzi" text,"Origin" text,"Launch" text,"Owner" text) | SELECT "Hanzi" FROM table_74873 WHERE "Launch" = '1996' AND "Name" = 'phoenix television chinese' |
What's the home team for the junction oval venue? | CREATE TABLE table_54273 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Venue" text,"Crowd" real,"Date" text) | SELECT "Home team score" FROM table_54273 WHERE "Venue" = 'junction oval' |
How many jewish patients had a lab test named monocytes? | 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 lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.religion = "JEWISH" AND lab.label = "Monocytes" |
what is the number of patients who died in or before 2168 with lab test item id 51131? | 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_status text,age text,dob text,gender text,language text,religion text,admission_type text,days_stay ... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dod_year <= "2168.0" AND lab.itemid = "51131" |
where is a good arabic restaurant on buchanan in san francisco ? | CREATE TABLE geographic (city_name varchar,county varchar,region varchar)CREATE TABLE restaurant (id int,name varchar,food_type varchar,city_name varchar,rating "decimal)CREATE TABLE location (restaurant_id int,house_number int,street_name varchar,city_name varchar) | SELECT location.house_number, restaurant.name FROM location, restaurant WHERE location.city_name = 'san francisco' AND location.street_name = 'buchanan' AND restaurant.food_type = 'arabic' AND restaurant.id = location.restaurant_id AND restaurant.rating > 2.5 |
Show the dates, places, and names of events in descending order of the attendance. | CREATE TABLE event (Date VARCHAR,Name VARCHAR,venue VARCHAR,Event_Attendance VARCHAR) | SELECT Date, Name, venue FROM event ORDER BY Event_Attendance DESC |
Who is the directed by when 2t6404 is the production code? | CREATE TABLE table_2866456_1 (directed_by VARCHAR,production_code VARCHAR) | SELECT directed_by FROM table_2866456_1 WHERE production_code = "2T6404" |
How many years are listed under joined for the Nor'easters? | CREATE TABLE table_1973729_1 (joined VARCHAR,nickname VARCHAR) | SELECT COUNT(joined) FROM table_1973729_1 WHERE nickname = "Nor'easters" |
For those employees whose salary is in the range of 8000 and 12000 and commission is not null or department number does not equal to 40, show me about the distribution of hire_date and the amount of hire_date bin hire_date by time in a bar chart, show by the y axis in desc. | CREATE TABLE countries (COUNTRY_ID varchar(2),COUNTRY_NAME varchar(40),REGION_ID decimal(10,0))CREATE TABLE job_history (EMPLOYEE_ID decimal(6,0),START_DATE date,END_DATE date,JOB_ID varchar(10),DEPARTMENT_ID decimal(4,0))CREATE TABLE employees (EMPLOYEE_ID decimal(6,0),FIRST_NAME varchar(20),LAST_NAME varchar(25),EMAI... | SELECT HIRE_DATE, COUNT(HIRE_DATE) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 ORDER BY COUNT(HIRE_DATE) DESC |
how many times is the name matt targett and the lane higher than 7? | CREATE TABLE table_63074 ("Rank" real,"Lane" real,"Name" text,"Nationality" text,"Time" real) | SELECT COUNT("Time") FROM table_63074 WHERE "Name" = 'matt targett' AND "Lane" > '7' |
which nation has the most bronze medals ? | CREATE TABLE table_204_261 (id number,"rank" number,"nation" text,"gold" number,"silver" number,"bronze" number,"total" number) | SELECT "nation" FROM table_204_261 ORDER BY "bronze" DESC LIMIT 1 |
Find the maximum and minimum monthly rental for all student addresses. | CREATE TABLE Student_Addresses (monthly_rental INTEGER) | SELECT MAX(monthly_rental), MIN(monthly_rental) FROM Student_Addresses |
what's the wine style with grand cru being roman e-conti | CREATE TABLE table_19046 ("Grand Cru" text,"Region" text,"Village" text,"Wine style" text,"Vineyard surface (2010)" text) | SELECT "Wine style" FROM table_19046 WHERE "Grand Cru" = 'Romanée-Conti' |
A bar chart for giveing me the number of the dates when the max temperature was higher than 85, and sort in descending by the Y. | CREATE TABLE trip (id INTEGER,duration INTEGER,start_date TEXT,start_station_name TEXT,start_station_id INTEGER,end_date TEXT,end_station_name TEXT,end_station_id INTEGER,bike_id INTEGER,subscription_type TEXT,zip_code INTEGER)CREATE TABLE status (station_id INTEGER,bikes_available INTEGER,docks_available INTEGER,time ... | SELECT date, COUNT(date) FROM weather WHERE max_temperature_f > 85 ORDER BY COUNT(date) DESC |
Who was the director for the episode on May 2, 1959? | CREATE TABLE table_25800134_3 (director VARCHAR,airdate VARCHAR) | SELECT director FROM table_25800134_3 WHERE airdate = "May 2, 1959" |
What is the title when u.s. viewers (millions) is 3.97? | CREATE TABLE table_22363 ("No. in series" real,"No. in season" real,"Title" text,"Directed by" text,"Written by" text,"Original air date" text,"U.S. viewers (in millions)" text) | SELECT "Title" FROM table_22363 WHERE "U.S. viewers (in millions)" = '3.97' |
which section is longest ?? | CREATE TABLE table_203_108 (id number,"kilometers" number,"name" text,"location" text,"intersecting routes" text) | SELECT "name" FROM table_203_108 ORDER BY "kilometers" DESC LIMIT 1 |
Which Mountains classification has Points classification of not awarded? | CREATE TABLE table_6003 ("Stage" text,"Winner" text,"General classification" text,"Points classification" text,"Mountains classification" text,"Combination classification" text,"Team classification" text) | SELECT "Mountains classification" FROM table_6003 WHERE "Points classification" = 'not awarded' |
You can give me a bar chart, that groups and counts the country name, list X-axis in descending order. | CREATE TABLE departments (DEPARTMENT_ID decimal(4,0),DEPARTMENT_NAME varchar(30),MANAGER_ID decimal(6,0),LOCATION_ID decimal(4,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 regions (RE... | SELECT COUNTRY_NAME, COUNT(COUNTRY_NAME) FROM countries GROUP BY COUNTRY_NAME ORDER BY COUNTRY_NAME DESC |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.