instruction stringlengths 0 1.06k | input stringlengths 11 5.3k | response stringlengths 2 4.44k |
|---|---|---|
Give me a bar chart showing the number of films for each director, rank in ascending by the Y-axis. | CREATE TABLE schedule (Cinema_ID int,Film_ID int,Date text,Show_times_per_day int,Price float)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_cod... | SELECT Directed_by, COUNT(Directed_by) FROM film GROUP BY Directed_by ORDER BY COUNT(Directed_by) |
How many lessons have been cancelled? | CREATE TABLE addresses (address_id number,line_1_number_building text,city text,zip_postcode text,state_province_county text,country text)CREATE TABLE lessons (lesson_id number,customer_id number,lesson_status_code text,staff_id number,vehicle_id number,lesson_date time,lesson_time text,price number)CREATE TABLE vehicl... | SELECT COUNT(*) FROM lessons WHERE lesson_status_code = "Cancelled" |
A bar chart shows the distribution of ACC_Road and Team_ID , and group by attribute ACC_Home, and list from high to low by the Team_ID. | CREATE TABLE basketball_match (Team_ID int,School_ID int,Team_Name text,ACC_Regular_Season text,ACC_Percent text,ACC_Home text,ACC_Road text,All_Games text,All_Games_Percent int,All_Home text,All_Road text,All_Neutral text)CREATE TABLE university (School_ID int,School text,Location text,Founded real,Affiliation text,En... | SELECT ACC_Road, Team_ID FROM basketball_match GROUP BY ACC_Home, ACC_Road ORDER BY Team_ID DESC |
What year or years did arnold palmer win? | CREATE TABLE table_9757 ("Player" text,"Country" text,"Year(s) won" text,"Total" real,"To par" text,"Finish" text) | SELECT "Year(s) won" FROM table_9757 WHERE "Player" = 'arnold palmer' |
In what round was a player from Michigan selected? | CREATE TABLE table_51001 ("Round" real,"Pick" real,"Player" text,"Position" text,"School/Club Team" text) | SELECT MAX("Round") FROM table_51001 WHERE "School/Club Team" = 'michigan' |
What is the description of the measure that got 78.27% yes votes? | CREATE TABLE table_27941 ("meas. num." real,"passed" text,"YES votes" real,"NO votes" real,"% YES" text,"Const. Amd.?" text,"type" text,"description" text) | SELECT "description" FROM table_27941 WHERE "% YES" = '78.27%' |
what is the listing for 2012 when 2004 is more than 0, 2008 is more than 1 1994 is 8 and 2005 is less than 11? | CREATE TABLE table_67537 ("Country" text,"2012" real,"2011" real,"2010" real,"2009" real,"2008" real,"2007" real,"2006" real,"2005" real,"2004" real,"2003" real,"2002" real,"2001" real,"2000" real,"1999" real,"1998" real,"1997" real,"1996" real,"1995" real,"1994" real,"1993" real,"1992" real,"1991" real,"1990" real,"19... | SELECT MIN("2012") FROM table_67537 WHERE "2004" > '0' AND "2008" > '1' AND "1994" = '8' AND "2005" < '11' |
What was the method when the time was 1:01? | CREATE TABLE table_78398 ("Res." text,"Record" text,"Opponent" text,"Method" text,"Event" text,"Round" real,"Time" text,"Location" text) | SELECT "Method" FROM table_78398 WHERE "Time" = '1:01' |
count the number of patients whose death status is 0 and procedure long title is endoscopic removal of stone(s) from biliary tract? | 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 procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.expire_flag = "0" AND procedures.long_title = "Endoscopic removal of stone(s) from biliary tract" |
What is the Song with an Issue Date(s) that is 19 june? | CREATE TABLE table_42482 ("Volume:Issue" text,"Issue Date(s)" text,"Weeks on Top" real,"Song" text,"Artist" text) | SELECT "Song" FROM table_42482 WHERE "Issue Date(s)" = '19 june' |
How many episodes are 122 in the series? | CREATE TABLE table_29152820_1 (no_in_season VARCHAR,no_in_series VARCHAR) | SELECT COUNT(no_in_season) FROM table_29152820_1 WHERE no_in_series = 122 |
What is the Result from the Date that is December 8, 1963? | CREATE TABLE table_name_24 (result VARCHAR,date VARCHAR) | SELECT result FROM table_name_24 WHERE date = "december 8, 1963" |
Which role did joemon play before 1991? | CREATE TABLE table_12070 ("Year" real,"Movie title" text,"Role" text,"Direction" text,"Screenplay" text) | SELECT "Role" FROM table_12070 WHERE "Year" < '1991' AND "Direction" = 'joemon' |
How many laps did Jo Bonnier driver when the grid number was smaller than 11? | CREATE TABLE table_name_6 (laps INTEGER,driver VARCHAR,grid VARCHAR) | SELECT SUM(laps) FROM table_name_6 WHERE driver = "jo bonnier" AND grid < 11 |
What is the Point of Chassis of Lancia d50 in 1954 | CREATE TABLE table_name_91 (points VARCHAR,chassis VARCHAR,year VARCHAR) | SELECT points FROM table_name_91 WHERE chassis = "lancia d50" AND year = 1954 |
For each customer status code, how many customers are classified that way Visualize by bar chart, and display in ascending by the bar. | CREATE TABLE Lessons (lesson_id INTEGER,customer_id INTEGER,lesson_status_code VARCHAR(15),staff_id INTEGER,vehicle_id INTEGER,lesson_date DATETIME,lesson_time VARCHAR(10),price DOUBLE)CREATE TABLE Addresses (address_id INTEGER,line_1_number_building VARCHAR(80),city VARCHAR(50),zip_postcode VARCHAR(20),state_province_... | SELECT customer_status_code, COUNT(*) FROM Customers GROUP BY customer_status_code ORDER BY customer_status_code |
Which Team 1, has Team 2, Slovan Liberec? | CREATE TABLE table_62305 ("Team 1" text,"Agg." text,"Team 2" text,"1st leg" text,"2nd leg" text) | SELECT "Team 1" FROM table_62305 WHERE "Team 2" = 'slovan liberec' |
What is the name of the church that is located in flor ? | CREATE TABLE table_62464 ("Parish (Prestegjeld)" text,"Sub-Parish (Sokn)" text,"Church Name" text,"Year Built" text,"Location of the Church" text) | SELECT "Church Name" FROM table_62464 WHERE "Location of the Church" = 'florø' |
What is the highest amount of money a play from Scotland United States has? | CREATE TABLE table_name_99 (money___ INTEGER,country VARCHAR) | SELECT MAX(money___) AS $__ FROM table_name_99 WHERE country = "scotland united states" |
Who was the husband date that was married in 1858? | CREATE TABLE table_50102 ("Order" real,"Name dates" text,"Princess Royal from (date) to (date)" text,"Parent" text,"Date married" text,"Husband dates" text) | SELECT "Husband dates" FROM table_50102 WHERE "Date married" = '1858' |
What is the team #2 with Deport as team #1? | CREATE TABLE table_76066 ("Team #1" text,"Points" text,"Team #2" text,"1st leg" text,"2nd leg" text) | SELECT "Team #2" FROM table_76066 WHERE "Team #1" = 'deport' |
calculate the number of patients treated with benz100 and aged below 67. | 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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.age < "67" AND prescriptions.formulary_drug_cd = "BENZ100" |
Find the dates of assessment notes for students with first name 'Fanny', and count them by a bar chart, and order from low to high by the how many date of notes. | CREATE TABLE Ref_Incident_Type (incident_type_code VARCHAR(10),incident_type_description VARCHAR(80))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),ot... | SELECT date_of_notes, COUNT(date_of_notes) FROM Assessment_Notes AS T1 JOIN Students AS T2 ON T1.student_id = T2.student_id WHERE T2.first_name = "Fanny" ORDER BY COUNT(date_of_notes) |
troy ruttman was entered by the same person as which other driver ? | CREATE TABLE table_204_511 (id number,"number" number,"driver" text,"entrant" text,"chassis" text,"engine" text,"tyre" text) | SELECT "driver" FROM table_204_511 WHERE "driver" <> 'troy ruttman' AND "entrant" = (SELECT "entrant" FROM table_204_511 WHERE "driver" = 'troy ruttman') |
what is the surface when the winner and score is gustavo kuerten 6-4, 7-5, 7-6(6)? | CREATE TABLE table_9216 ("Tournament" text,"Surface" text,"Week" text,"Winner and score" text,"Finalist" text,"Semifinalists" text) | SELECT "Surface" FROM table_9216 WHERE "Winner and score" = 'gustavo kuerten 6-4, 7-5, 7-6(6)' |
who is the first detroit lions pick not from the pac-10 ? | CREATE TABLE table_203_417 (id number,"rnd." number,"pick #" number,"nfl team" text,"player" text,"pos." text,"college" text,"conf." text,"notes" text) | SELECT "player" FROM table_203_417 WHERE "nfl team" = 'detroit lions' AND "conf." <> 'pac-10' ORDER BY "pick #" LIMIT 1 |
What is the highest number of FCWC in the Years of 1958 1965, and an ICFC smaller than 11? | CREATE TABLE table_74957 ("Ranking" real,"Nationality" text,"Name" text,"Years" text,"ICFC" real,"FCWC" real,"Total" real) | SELECT MAX("FCWC") FROM table_74957 WHERE "Years" = '1958–1965' AND "ICFC" < '11' |
What is the name of the highest mountain? | CREATE TABLE climber (climber_id number,name text,country text,time text,points number,mountain_id number)CREATE TABLE mountain (mountain_id number,name text,height number,prominence number,range text,country text) | SELECT name FROM mountain ORDER BY height DESC LIMIT 1 |
A bar chart about how many wines are there for each grape? | CREATE TABLE grapes (ID INTEGER,Grape TEXT,Color TEXT)CREATE TABLE wine (No INTEGER,Grape TEXT,Winery TEXT,Appelation TEXT,State TEXT,Name TEXT,Year INTEGER,Price INTEGER,Score INTEGER,Cases INTEGER,Drink TEXT)CREATE TABLE appellations (No INTEGER,Appelation TEXT,County TEXT,State TEXT,Area TEXT,isAVA TEXT) | SELECT Grape, COUNT(*) FROM wine GROUP BY Grape |
Where did the wrestler, super parka, with the title with a reign of 2? | CREATE TABLE table_75665 ("Wrestler" text,"Reign" text,"Days held" text,"Location" text,"Event" text) | SELECT "Location" FROM table_75665 WHERE "Wrestler" = 'super parka' AND "Reign" = '2' |
When was Mario Elie picked in a round before 7? | CREATE TABLE table_58876 ("Round" real,"Pick" real,"Player" text,"Nationality" text,"School/Club Team" text) | SELECT MAX("Pick") FROM table_58876 WHERE "Player" = 'mario elie' AND "Round" < '7' |
what was the number of times usl a league did not qualify for the playoffs ? | CREATE TABLE table_204_590 (id number,"year" number,"division" number,"league" text,"regular season" text,"playoffs" text,"open cup" text,"avg. attendance" number) | SELECT COUNT(*) FROM table_204_590 WHERE "league" = 'usl a-league' AND "playoffs" = 'did not qualify' |
When did sony music direct a label? | CREATE TABLE table_14911 ("Region" text,"Date" text,"Label" text,"Format" text,"Catalog" text) | SELECT "Date" FROM table_14911 WHERE "Label" = 'sony music direct' |
I want to know the method for opponent of jerry bohlander | CREATE TABLE table_name_71 (method VARCHAR,opponent VARCHAR) | SELECT method FROM table_name_71 WHERE opponent = "jerry bohlander" |
Most viewed posts of me. | 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 PostLinks (Id number,CreationDate time,PostId number,RelatedPos... | SELECT Id AS "post_link", ViewCount, Score, Tags FROM Posts WHERE Posts.OwnerUserId = @UserId AND ViewCount > 0 ORDER BY ViewCount DESC, Score DESC LIMIT 20 |
How many car numbers were listed for Rusty Wallace? | CREATE TABLE table_1769428_2 (car__number VARCHAR,winning_driver VARCHAR) | SELECT COUNT(car__number) FROM table_1769428_2 WHERE winning_driver = "Rusty Wallace" |
give me the top four most common output events in this year. | CREATE TABLE medication (medicationid number,patientunitstayid number,drugname text,dosage text,routeadmin text,drugstarttime time,drugstoptime time)CREATE TABLE diagnosis (diagnosisid number,patientunitstayid number,diagnosisname text,diagnosistime time,icd9code text)CREATE TABLE cost (costid number,uniquepid text,pat... | SELECT t1.celllabel FROM (SELECT intakeoutput.celllabel, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM intakeoutput WHERE intakeoutput.cellpath LIKE '%output%' AND DATETIME(intakeoutput.intakeoutputtime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') GROUP BY intakeoutput.celllabel) AS ... |
What is Spain's skip? | CREATE TABLE table_36921 ("Nation" text,"Skip" text,"Third" text,"Second" text,"Lead" text) | SELECT "Skip" FROM table_36921 WHERE "Nation" = 'spain' |
What was the attendance on October 6? | CREATE TABLE table_name_78 (attendance VARCHAR,date VARCHAR) | SELECT attendance FROM table_name_78 WHERE date = "october 6" |
how many took at least 35:00 to finish ? | CREATE TABLE table_204_664 (id number,"rank" number,"bib" number,"name" text,"nationality" text,"start" text,"penalties (p+p+s+s)" text,"time" text,"deficit" text) | SELECT COUNT(*) FROM table_204_664 WHERE "time" >= 35 |
What is the name of the Winner in north carolina at the greater greensboro open? | CREATE TABLE table_34397 ("Date" text,"Tournament" text,"Location" text,"Winner" text,"Score" text,"1st prize ($)" text) | SELECT "Winner" FROM table_34397 WHERE "Location" = 'north carolina' AND "Tournament" = 'greater greensboro open' |
how many voted in the texas 6 section | CREATE TABLE table_1341884_45 (first_elected VARCHAR,district VARCHAR) | SELECT first_elected FROM table_1341884_45 WHERE district = "Texas 6" |
What is maximum age of hispanic, latino, or puerto rican patients whose duration of hospital stay was 14 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 MAX(demographic.age) FROM demographic WHERE demographic.ethnicity = "HISPANIC/LATINO - PUERTO RICAN" AND demographic.days_stay = "14" |
SOpt - Number of active posts last month per mod. | 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 Posts (Id number,PostTypeId number,AcceptedAnswerId number,ParentId number,CreationDate time,DeletionDate time,Score ... | SELECT COUNT(*) AS PostsLastMonth, 6 AS Moderators, (COUNT(*) / 6) AS PostsLastMonthPerMod FROM Posts WHERE LastActivityDate >= DATEADD(month, -1, (SELECT MAX(LastActivityDate) FROM Posts)) |
which flight between PITTSBURGH and BALTIMORE on 7 19 has the smallest seating capacity | CREATE TABLE flight_leg (flight_id int,leg_number int,leg_flight int)CREATE TABLE date_day (month_number int,day_number int,year int,day_name varchar)CREATE TABLE food_service (meal_code text,meal_number int,compartment text,meal_description varchar)CREATE TABLE time_interval (period text,begin_time int,end_time int)CR... | SELECT DISTINCT FLIGHT_0.flight_id FROM aircraft, airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, airport_service AS AIRPORT_SERVICE_2, airport_service AS AIRPORT_SERVICE_3, city AS CITY_0, city AS CITY_1, city AS CITY_2, city AS CITY_3, date_day AS DATE_DAY_0, date_day AS DATE_DAY_1, days A... |
Which Rally Name has a Surface of asphalt and gravel? | CREATE TABLE table_13650 ("Round" real,"Dates" text,"Rally Name" text,"Rally HQ" text,"Support Category" text,"Surface" text) | SELECT "Rally Name" FROM table_13650 WHERE "Surface" = 'asphalt and gravel' |
what is the maximum daily number of people diagnosed with streptococcal septicemia the last year? | CREATE TABLE d_icd_diagnoses (row_id number,icd9_code text,short_title text,long_title text)CREATE TABLE microbiologyevents (row_id number,subject_id number,hadm_id number,charttime time,spec_type_desc text,org_name text)CREATE TABLE icustays (row_id number,subject_id number,hadm_id number,icustay_id number,first_careu... | SELECT MAX(t1.c1) FROM (SELECT COUNT(DISTINCT diagnoses_icd.hadm_id) AS c1 FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'streptococcal septicemia') AND DATETIME(diagnoses_icd.charttime, 'start of year') = DATETIME(CURRENT_T... |
What was the location attendance on January 19? | CREATE TABLE table_name_47 (location_attendance VARCHAR,date VARCHAR) | SELECT location_attendance FROM table_name_47 WHERE date = "january 19" |
Give me a histogram for how many musicals has each nominee been nominated for? | CREATE TABLE musical (Musical_ID int,Name text,Year int,Award text,Category text,Nominee text,Result text)CREATE TABLE actor (Actor_ID int,Name text,Musical_ID int,Character text,Duration text,age int) | SELECT Nominee, COUNT(*) FROM musical GROUP BY Nominee |
give me the list of patients with lab test item id 50824 who died in or before 2115. | CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital_status text,age text,dob text,gender text,language text,religion text,admission_type text,days_stay text,insurance text,ethnicity text,expire_fla... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dod_year <= "2115.0" AND lab.itemid = "50824" |
tipuani municipality when tacacoma municipality is 6? | CREATE TABLE table_2509202_2 (tipuani_municipality VARCHAR,tacacoma_municipality VARCHAR) | SELECT tipuani_municipality FROM table_2509202_2 WHERE tacacoma_municipality = "6" |
What is the average (Jericho) with a Population (Total) less than 4,059 in 1986 and a (Barcaldine) higher than 1,779? | CREATE TABLE table_15188 ("Year" real,"Population (Total)" real,"(Barcaldine)" real,"(Aramac)" real,"(Jericho)" real) | SELECT AVG("(Jericho)") FROM table_15188 WHERE "Population (Total)" < '4,059' AND "Year" = '1986' AND "(Barcaldine)" > '1,779' |
What Score has a Place of t8, and a Country of scotland? | CREATE TABLE table_name_86 (score VARCHAR,place VARCHAR,country VARCHAR) | SELECT score FROM table_name_86 WHERE place = "t8" AND country = "scotland" |
List the pictorals from issues when lindsey roeper was the cover model. | CREATE TABLE table_72699 ("Date" text,"Cover model" text,"Centerfold model" text,"Interview subject" text,"20 Questions" text,"Pictorials" text) | SELECT "Pictorials" FROM table_72699 WHERE "Cover model" = 'Lindsey Roeper' |
What is the least round for the game played at Members Equity Stadium in from of 12,581 people? | CREATE TABLE table_79640 ("Round" real,"Date" text,"Home Team" text,"Away Team" text,"Attendance" real,"Stadium" text) | SELECT MIN("Round") FROM table_79640 WHERE "Stadium" = 'members equity stadium' AND "Attendance" < '12,581' |
what were the four most frequently prescribed drugs at the same time, since 4 years ago, among the patients who were prescribed with heparin flush port (10units/ml)? | 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 labevents (row_id number,subject_id number,hadm_id number,itemid number,char... | SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, prescriptions.startdate FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE prescriptions.drug = 'heparin flush port (10units/ml)' AND DATETIME(prescriptions.start... |
How many of the patients with icd9 code 598 died in or before the 2115? | 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 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... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.dod_year <= "2155.0" AND procedures.icd9_code = "598" |
what was the last single from this music group ? | CREATE TABLE table_204_672 (id number,"year" number,"title" text,"label" text,"uk singles chart" number,"u.s. billboard hot 100 chart" number) | SELECT "title" FROM table_204_672 ORDER BY id DESC LIMIT 1 |
What is the sum of the heights for the Cornell Big Red? | CREATE TABLE table_65330 ("Position" text,"Height (cm)" real,"Weight (kg)" real,"Birthplace" text,"2009\u201310 team" text) | SELECT SUM("Height (cm)") FROM table_65330 WHERE "2009\u201310 team" = 'cornell big red' |
What were the ratings for 'episode 6'? | CREATE TABLE table_29368 ("Episode #" real,"Title" text,"Directed by" text,"Written by" text,"Originalairdate" text,"Ratings" text) | SELECT "Ratings" FROM table_29368 WHERE "Title" = 'Episode 6' |
subject has a history of primary psychotic disorder ( e.g. schizophrenia, schizoaffective disorder, delusional disorder ) or bipolar disorder. | CREATE TABLE table_train_137 ("id" int,"hbv" bool,"systolic_blood_pressure_sbp" int,"hemoglobin_a1c_hba1c" float,"substance_dependence" bool,"hcv" bool,"schizophrenia" bool,"neutrophil_count" int,"renal_disease" bool,"creatinine_clearance_cl" float,"platelet_count" float,"diastolic_greater_than" int,"pulse_rate" int,"b... | SELECT * FROM table_train_137 WHERE primary_psychotic_disorder = 1 OR schizophrenia = 1 OR schizoaffective_disorder = 1 OR delusional_disorder = 1 OR bipolar_disorder = 1 |
Show me team_id by acc regular season in a histogram, list by the Y-axis in desc. | CREATE TABLE university (School_ID int,School text,Location text,Founded real,Affiliation text,Enrollment real,Nickname text,Primary_conference text)CREATE TABLE basketball_match (Team_ID int,School_ID int,Team_Name text,ACC_Regular_Season text,ACC_Percent text,ACC_Home text,ACC_Road text,All_Games text,All_Games_Perce... | SELECT ACC_Regular_Season, Team_ID FROM basketball_match ORDER BY Team_ID DESC |
WHAT SCHOOL DID THE PLAYER FROM SOUTH CAROLINA ATTEND? | CREATE TABLE table_17069 ("Player" text,"Position" text,"School" text,"Hometown" text,"College" text) | SELECT "School" FROM table_17069 WHERE "College" = 'South Carolina' |
Name the average zone for waddon marsh tram stop | CREATE TABLE table_name_64 (zone INTEGER,stations VARCHAR) | SELECT AVG(zone) FROM table_name_64 WHERE stations = "waddon marsh tram stop" |
What is the area of Colonsay Island? | CREATE TABLE table_143579_1 (area___ha__ INTEGER,island VARCHAR) | SELECT MIN(area___ha__) FROM table_143579_1 WHERE island = "Colonsay" |
In what district is the city listed in Serial number 9? | CREATE TABLE table_22328 ("Serial No." real,"District" text,"Headquartered City" text,"City Population (2009)" real,"City Area(km 2)" real) | SELECT COUNT("District") FROM table_22328 WHERE "Serial No." = '9' |
On what Date is Carlton the Away Team? | CREATE TABLE table_name_98 (date VARCHAR,away_team VARCHAR) | SELECT date FROM table_name_98 WHERE away_team = "carlton" |
Find the number of orders in each day and bin the number of orders by customers in a line chart. | CREATE TABLE Customer_Contact_Channels (customer_id INTEGER,channel_code VARCHAR(15),active_from_date DATETIME,active_to_date DATETIME,contact_number VARCHAR(50))CREATE TABLE Order_Items (order_id INTEGER,product_id INTEGER,order_quantity VARCHAR(15))CREATE TABLE Customer_Addresses (customer_id INTEGER,address_id INTEG... | SELECT order_date, COUNT(order_date) FROM Customers AS t1 JOIN Customer_Orders AS t2 ON t1.customer_id = t2.customer_id WHERE order_status = "Delivered" GROUP BY customer_name |
What's the series number of the episode that's written by Elizabeth Devine? | CREATE TABLE table_651 ("No. in series" real,"No. in season" real,"Title" text,"Directed by" text,"Written by" text,"Original air date" text,"U.S. viewers (millions)" text) | SELECT MIN("No. in series") FROM table_651 WHERE "Written by" = 'Elizabeth Devine' |
Tell me the number of weeks for december 5, 2005 | CREATE TABLE table_31751 ("Week" real,"Date" text,"Opponent" text,"Result" text,"Venue" text,"Start Time" text,"Attendance" text) | SELECT COUNT("Week") FROM table_31751 WHERE "Date" = 'december 5, 2005' |
Find the total student enrollment for different affiliation type schools Plot them as bar chart, could you rank by the names from high to low? | CREATE TABLE university (School_ID int,School text,Location text,Founded real,Affiliation text,Enrollment real,Nickname text,Primary_conference text)CREATE TABLE basketball_match (Team_ID int,School_ID int,Team_Name text,ACC_Regular_Season text,ACC_Percent text,ACC_Home text,ACC_Road text,All_Games text,All_Games_Perce... | SELECT Affiliation, SUM(Enrollment) FROM university GROUP BY Affiliation ORDER BY Affiliation DESC |
What is the Segment A for when Segment C is s Sailboard? | CREATE TABLE table_15187735_6 (segment_a VARCHAR,segment_c VARCHAR) | SELECT segment_a FROM table_15187735_6 WHERE segment_c = "s Sailboard" |
Competition of fa cup rd 1 had what venue? | CREATE TABLE table_name_69 (venue VARCHAR,competition VARCHAR) | SELECT venue FROM table_name_69 WHERE competition = "fa cup rd 1" |
Tell me the actor's name for escho raz o voyne | CREATE TABLE table_31813 ("Nomination" text,"Actor's Name" text,"Film Name" text,"Director" text,"Country" text) | SELECT "Actor's Name" FROM table_31813 WHERE "Film Name" = 'escho raz o voyne' |
Name the average year for much ado about nothing and recipient of ray virta | CREATE TABLE table_name_50 (year INTEGER,play VARCHAR,recipient VARCHAR) | SELECT AVG(year) FROM table_name_50 WHERE play = "much ado about nothing" AND recipient = "ray virta" |
What Podiums listing has a World Rally Championship series entry? | CREATE TABLE table_64399 ("Season" real,"Series" text,"Team" text,"Races" text,"Wins" text,"Poles" text,"F/Laps" text,"Podiums" text,"Points" text,"Position" text) | SELECT "Podiums" FROM table_64399 WHERE "Series" = 'world rally championship' |
Where did they play against Clemson? | CREATE TABLE table_7541 ("Date" text,"Opponent" text,"Location" text,"Result" text,"Attendance" real) | SELECT "Location" FROM table_7541 WHERE "Opponent" = 'clemson' |
How many release dates have a Country of west germany, and a Release format of vinyl? | CREATE TABLE table_name_89 (release_date VARCHAR,country VARCHAR,release_format VARCHAR) | SELECT COUNT(release_date) FROM table_name_89 WHERE country = "west germany" AND release_format = "vinyl" |
how many votes did the independent party have ? | CREATE TABLE table_203_798 (id number,"party" text,"votes" text,"%" number,"swing" number,"seats" number,"change" number) | SELECT "votes" FROM table_203_798 WHERE "party" = 'independent' |
What was the result when there were less than 3 rounds against Gil Rael? | CREATE TABLE table_name_16 (res VARCHAR,round VARCHAR,opponent VARCHAR) | SELECT res FROM table_name_16 WHERE round < 3 AND opponent = "gil rael" |
What is the name of the award in a year more than 2005, and the Result of nominated? | CREATE TABLE table_name_17 (award VARCHAR,year VARCHAR,result VARCHAR) | SELECT award FROM table_name_17 WHERE year > 2005 AND result = "nominated" |
Get Title, ViewCount for all posts. | CREATE TABLE PostLinks (Id number,CreationDate time,PostId number,RelatedPostId number,LinkTypeId number)CREATE TABLE PostNotices (Id number,PostId number,PostNoticeTypeId number,CreationDate time,DeletionDate time,ExpiryDate time,Body text,OwnerUserId number,DeletionUserId number)CREATE TABLE PostsWithDeleted (Id numb... | SELECT Title, ViewCount FROM Posts |
a1c 7.1 _ 11 | CREATE TABLE table_train_243 ("id" int,"c_peptide_level" float,"finger_stick_measurements" bool,"diabetic" string,"fasting_blood_glucose_fbg" float,"hypoglycemia" bool,"insulin_requirement" float,"triglyceride_tg" float,"a1c" float,"age" float,"NOUSE" float) | SELECT * FROM table_train_243 WHERE a1c >= 7.1 AND a1c <= 11 |
Which team was played against on the game where Earl Watson (6) had the highest assists on January 19? | CREATE TABLE table_name_19 (team VARCHAR,high_assists VARCHAR,date VARCHAR) | SELECT team FROM table_name_19 WHERE high_assists = "earl watson (6)" AND date = "january 19" |
How many laps have a Time/Retired of +12.5 secs? | CREATE TABLE table_10930 ("Driver" text,"Constructor" text,"Laps" real,"Time/Retired" text,"Grid" real) | SELECT COUNT("Laps") FROM table_10930 WHERE "Time/Retired" = '+12.5 secs' |
Tell me the highest total when the horse is spender s | CREATE TABLE table_12014 ("Rider" text,"Horse" text,"Faults" text,"Round 1 + 2A Points" text,"Total" real) | SELECT MAX("Total") FROM table_12014 WHERE "Horse" = 'spender s' |
Visualize a bar chart about the distribution of other_details and the average of monthly_rental , and group by attribute other_details. | CREATE TABLE Students_in_Detention (student_id INTEGER,detention_id INTEGER,incident_id INTEGER)CREATE TABLE Ref_Address_Types (address_type_code VARCHAR(15),address_type_description VARCHAR(80))CREATE TABLE Students (student_id INTEGER,address_id INTEGER,first_name VARCHAR(80),middle_name VARCHAR(40),last_name VARCHAR... | SELECT other_details, AVG(monthly_rental) FROM Student_Addresses GROUP BY other_details ORDER BY monthly_rental DESC |
Draw a bar chart for what are the ids and details of events that have more than one participants?, and show in asc by the Y. | CREATE TABLE Participants_in_Events (Event_ID INTEGER,Participant_ID INTEGER)CREATE TABLE Participants (Participant_ID INTEGER,Participant_Type_Code CHAR(15),Participant_Details VARCHAR(255))CREATE TABLE Services (Service_ID INTEGER,Service_Type_Code CHAR(15))CREATE TABLE Events (Event_ID INTEGER,Service_ID INTEGER,Eve... | SELECT T1.Event_Details, T1.Event_ID FROM Events AS T1 JOIN Participants_in_Events AS T2 ON T1.Event_ID = T2.Event_ID GROUP BY T1.Event_Details ORDER BY T1.Event_ID |
give me the top four of the most common output events? | CREATE TABLE icustays (row_id number,subject_id number,hadm_id number,icustay_id number,first_careunit text,last_careunit text,first_wardid number,last_wardid number,intime time,outtime time)CREATE TABLE d_icd_diagnoses (row_id number,icd9_code text,short_title text,long_title text)CREATE TABLE transfers (row_id number... | SELECT d_items.label FROM d_items WHERE d_items.itemid IN (SELECT t1.itemid FROM (SELECT outputevents.itemid, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM outputevents GROUP BY outputevents.itemid) AS t1 WHERE t1.c1 <= 4) |
When the strike rate is 70.10, what is the balls? | CREATE TABLE table_name_36 (balls VARCHAR,strike_rate VARCHAR) | SELECT balls FROM table_name_36 WHERE strike_rate = "70.10" |
how many single patients are diagnosed with migrne unsp wo ntrc mgrn? | 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.marital_status = "SINGLE" AND diagnoses.short_title = "Migrne unsp wo ntrc mgrn" |
what is lab test abnormal status of subject id 6983? | 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 text)CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title ... | SELECT lab.flag FROM lab WHERE lab.subject_id = "6983" |
What was the round 5 score if the team's total points where 212? | CREATE TABLE table_16815824_1 (round5 VARCHAR,total_points VARCHAR) | SELECT round5 FROM table_16815824_1 WHERE total_points = 212 |
what is date of death and discharge time of subject id 94762? | 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 demographic.dod, demographic.dischtime FROM demographic WHERE demographic.subject_id = "94762" |
show me the flights arriving at DAL from all other airports | 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 aircraft (aircraft_code varchar,aircraft_description varchar,manufacturer va... | SELECT DISTINCT flight.flight_id FROM airport, airport_service, city, flight WHERE airport.airport_code = 'DAL' AND city.city_code = airport_service.city_code AND flight.from_airport = airport_service.airport_code AND flight.to_airport = airport.airport_code |
What was the score of game 30? | CREATE TABLE table_name_52 (score VARCHAR,game VARCHAR) | SELECT score FROM table_name_52 WHERE game = 30 |
who was the first coach to reach the ncaa tournament ? | CREATE TABLE table_203_593 (id number,"tenure" text,"coach" text,"years" number,"record" text,"pct." number,"ncaa tournament" number) | SELECT "coach" FROM table_203_593 WHERE NOT "ncaa tournament" IS NULL ORDER BY "tenure" LIMIT 1 |
when standard speed (6th gear) is 88, what is the rpm? | CREATE TABLE table_19704392_1 (rpm VARCHAR,standard_speed__6th_gear_ VARCHAR) | SELECT rpm FROM table_19704392_1 WHERE standard_speed__6th_gear_ = "88" |
What home is dated march 19? | CREATE TABLE table_47742 ("Date" text,"Visitor" text,"Score" text,"Home" text,"Attendance" real,"Record" text,"Points" real) | SELECT "Home" FROM table_47742 WHERE "Date" = 'march 19' |
metion the age and primary disease of gonzalo wasson. | CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital_status text,age text,dob text,gender text,language text,religion text,admission_type text,days_stay text,insurance text,ethnicity text,expire_flag... | SELECT demographic.age, demographic.diagnosis FROM demographic WHERE demographic.name = "Gonzalo Wasson" |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.