instruction stringlengths 0 1.06k | input stringlengths 11 5.3k | response stringlengths 2 4.44k |
|---|---|---|
Where did Audette Racing win? | CREATE TABLE table_28098 ("Round" real,"Circuit" text,"Location" text,"Date" text,"Pole position" text,"Fastest lap" text,"Winning driver" text,"Winning team" text) | SELECT "Location" FROM table_28098 WHERE "Winning team" = 'Audette Racing' |
How many times was iran barkley an opponent? | CREATE TABLE table_17530 ("Number" real,"Name" text,"Titles" text,"Date" text,"Opponent" text,"Result" text,"Defenses" real) | SELECT "Number" FROM table_17530 WHERE "Opponent" = 'Iran Barkley' |
Who was the visitor on march 21? | CREATE TABLE table_69819 ("Date" text,"Visitor" text,"Score" text,"Home" text,"Decision" text,"Attendance" real,"Record" text) | SELECT "Visitor" FROM table_69819 WHERE "Date" = 'march 21' |
Draw a bar chart about the distribution of Nationality and the amount of Nationality , and group by attribute Nationality, could you order by the total number from low to high? | 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 stadium (ID int,name text,Capacity int,City text,Country text,Opening_year... | SELECT Nationality, COUNT(Nationality) FROM swimmer GROUP BY Nationality ORDER BY COUNT(Nationality) |
How many regions had a life expectancy at birth in 2001-2002 of 75.9? | CREATE TABLE table_25042332_33 (hdi VARCHAR,life_expectancy_at_birth__2001_2002_ VARCHAR) | SELECT COUNT(hdi) FROM table_25042332_33 WHERE life_expectancy_at_birth__2001_2002_ = "75.9" |
Name the attendance on april 17 | CREATE TABLE table_14514 ("Date" text,"Opponent" text,"Score" text,"Loss" text,"Attendance" text,"Record" text) | SELECT "Attendance" FROM table_14514 WHERE "Date" = 'april 17' |
Who's the Republican ticket with a Democratic ticket of flora d. johnson? | CREATE TABLE table_name_62 (republican_ticket VARCHAR,democratic_ticket VARCHAR) | SELECT republican_ticket FROM table_name_62 WHERE democratic_ticket = "flora d. johnson" |
authors with at least 5 papers | CREATE TABLE writes (paperid int,authorid int)CREATE TABLE paper (paperid int,title varchar,venueid int,year int,numciting int,numcitedby int,journalid int)CREATE TABLE field (fieldid int)CREATE TABLE venue (venueid int,venuename varchar)CREATE TABLE cite (citingpaperid int,citedpaperid int)CREATE TABLE author (authori... | SELECT DISTINCT COUNT(paper.paperid), writes.authorid FROM paper, writes WHERE writes.paperid = paper.paperid GROUP BY writes.authorid HAVING COUNT(paper.paperid) >= 5 |
What is the verb meaning for class 4? | CREATE TABLE table_44587 ("Class" text,"Part 1" text,"Part 2" text,"Part 3" text,"Part 4" text,"Verb meaning" text) | SELECT "Verb meaning" FROM table_44587 WHERE "Class" = '4' |
How many totals have a Player of ahmad fouzee masuri, and an FA Cup larger than 0? | CREATE TABLE table_name_37 (total VARCHAR,player VARCHAR,fa_cup VARCHAR) | SELECT COUNT(total) FROM table_name_37 WHERE player = "ahmad fouzee masuri" AND fa_cup > 0 |
what is the number of patients whose age is less than 89 and diagnoses long title is transient neonatal thrombocytopenia? | 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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.age < "89" AND diagnoses.long_title = "Transient neonatal thrombocytopenia" |
Who was the opponent on April 21, 2008? | CREATE TABLE table_name_44 (opponent VARCHAR,date VARCHAR) | SELECT opponent FROM table_name_44 WHERE date = "april 21, 2008" |
Which Debut year has a Player of bob hayton, and Games smaller than 2? | CREATE TABLE table_66506 ("Debut year" real,"Player" text,"Games" real,"Goals" real,"Years at club" text) | SELECT AVG("Debut year") FROM table_66506 WHERE "Player" = 'bob hayton' AND "Games" < '2' |
What are the section offerings for SPANISH 562 after 08:30 P.M. ? | CREATE TABLE jobs (job_id int,job_title varchar,description varchar,requirement varchar,city varchar,state varchar,country varchar,zip int)CREATE TABLE ta (campus_job_id int,student_id int,location varchar)CREATE TABLE course_prerequisite (pre_course_id int,course_id int)CREATE TABLE program_course (program_id int,cour... | SELECT DISTINCT course_offering.end_time, course_offering.section_number, course_offering.start_time FROM course, course_offering, semester WHERE course_offering.start_time > '08:30' AND course.course_id = course_offering.course_id AND course.department = 'SPANISH' AND course.number = 562 AND semester.semester = 'WN' A... |
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, give me the comparison about the sum of manager_id over the job_id , and group by attribute job_id by a bar chart, display by the y axis in desc please. | CREATE TABLE employees (EMPLOYEE_ID decimal(6,0),FIRST_NAME varchar(20),LAST_NAME varchar(25),EMAIL varchar(25),PHONE_NUMBER varchar(20),HIRE_DATE date,JOB_ID varchar(10),SALARY decimal(8,2),COMMISSION_PCT decimal(2,2),MANAGER_ID decimal(6,0),DEPARTMENT_ID decimal(4,0))CREATE TABLE regions (REGION_ID decimal(5,0),REGIO... | SELECT JOB_ID, SUM(MANAGER_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 GROUP BY JOB_ID ORDER BY SUM(MANAGER_ID) DESC |
What was the score in Round 3? | CREATE TABLE table_name_32 (record VARCHAR,round VARCHAR) | SELECT record FROM table_name_32 WHERE round = "3" |
how the percentile is the pt value of 13.8 among patients of the same age as patient 32163 during the last hospital visit? | CREATE TABLE d_icd_procedures (row_id number,icd9_code text,short_title text,long_title text)CREATE TABLE inputevents_cv (row_id number,subject_id number,hadm_id number,icustay_id number,charttime time,itemid number,amount number)CREATE TABLE cost (row_id number,subject_id number,hadm_id number,event_type text,event_id... | SELECT DISTINCT t1.c1 FROM (SELECT labevents.valuenum, PERCENT_RANK() OVER (ORDER BY labevents.valuenum) AS c1 FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'pt') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.age = (SEL... |
Please return me a bar chart show what are the total smallest rating of different movie title?, and I want to sort total number from low to high order. | CREATE TABLE Reviewer (rID int,name text)CREATE TABLE Movie (mID int,title text,year int,director text)CREATE TABLE Rating (rID int,mID int,stars int,ratingDate date) | SELECT T2.title, SUM(MIN(T1.stars)) FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID GROUP BY T2.title ORDER BY SUM(MIN(T1.stars)) |
Who had the pole position in Jerez? | CREATE TABLE table_name_82 (pole_position VARCHAR,location VARCHAR) | SELECT pole_position FROM table_name_82 WHERE location = "jerez" |
how many gold medals did the top 3 nations earn altogether ? | CREATE TABLE table_203_739 (id number,"rank" number,"nation" text,"gold" number,"silver" number,"bronze" number,"total" number) | SELECT SUM("gold") FROM table_203_739 WHERE "rank" <= 3 |
A bar chart for what are the number of the names of the technicians that are assigned to repair machines with more point values than 70?, and could you sort how many name from low to high order? | CREATE TABLE technician (technician_id real,Name text,Team text,Starting_Year real,Age int)CREATE TABLE repair (repair_ID int,name text,Launch_Date text,Notes text)CREATE TABLE machine (Machine_ID int,Making_Year int,Class text,Team text,Machine_series text,value_points real,quality_rank int)CREATE TABLE repair_assignm... | SELECT Name, COUNT(Name) FROM repair_assignment AS T1 JOIN machine AS T2 ON T1.Machine_ID = T2.Machine_ID JOIN technician AS T3 ON T1.technician_id = T3.technician_id WHERE T2.value_points > 70 GROUP BY Name ORDER BY COUNT(Name) |
how many medicines were prescribed during the current hospital visit to patient 006-47576? | CREATE TABLE lab (labid number,patientunitstayid number,labname text,labresult number,labresulttime time)CREATE TABLE vitalperiodic (vitalperiodicid number,patientunitstayid number,temperature number,sao2 number,heartrate number,respiration number,systemicsystolic number,systemicdiastolic number,systemicmean number,obs... | SELECT COUNT(*) FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-47576' AND patient.hospitaldischargetime IS NULL)) |
Which tournament had a 2008 result of 1R? | CREATE TABLE table_name_85 (tournament VARCHAR) | SELECT tournament FROM table_name_85 WHERE 2006 = "a" AND 2008 = "1r" |
Display a bar chart for what is the average salary for each job title? | CREATE TABLE employees (EMPLOYEE_ID decimal(6,0),FIRST_NAME varchar(20),LAST_NAME varchar(25),EMAIL varchar(25),PHONE_NUMBER varchar(20),HIRE_DATE date,JOB_ID varchar(10),SALARY decimal(8,2),COMMISSION_PCT decimal(2,2),MANAGER_ID decimal(6,0),DEPARTMENT_ID decimal(4,0))CREATE TABLE job_history (EMPLOYEE_ID decimal(6,0)... | SELECT JOB_TITLE, AVG(SALARY) FROM employees AS T1 JOIN jobs AS T2 ON T1.JOB_ID = T2.JOB_ID GROUP BY T2.JOB_TITLE |
What was victoria's away date? | CREATE TABLE table_9467 ("Date" text,"Home" text,"Score" text,"Away" text,"Attendance" real) | SELECT "Date" FROM table_9467 WHERE "Away" = 'victoria' |
Show the average of population from each status, list by the the average of population in asc. | CREATE TABLE competition_record (Competition_ID int,Farm_ID int,Rank int)CREATE TABLE farm_competition (Competition_ID int,Year int,Theme text,Host_city_ID int,Hosts text)CREATE TABLE farm (Farm_ID int,Year int,Total_Horses real,Working_Horses real,Total_Cattle real,Oxen real,Bulls real,Cows real,Pigs real,Sheep_and_Go... | SELECT Status, AVG(Population) FROM city GROUP BY Status ORDER BY AVG(Population) |
Which college with a position of rb had a pick larger than 6 in round 28? | CREATE TABLE table_name_19 (college VARCHAR,round VARCHAR,pick VARCHAR,position VARCHAR) | SELECT college FROM table_name_19 WHERE pick > 6 AND position = "rb" AND round = 28 |
Which Bore has a Name of 9 adr? | CREATE TABLE table_name_94 (bore VARCHAR,name VARCHAR) | SELECT bore FROM table_name_94 WHERE name = "9 adr" |
Which Source model has a Release date of 1992-04-06? | CREATE TABLE table_32761 ("Name" text,"Release date" text,"Latest version" text,"Status support" text,"Source model" text,"Architecture" text,"Target market" text) | SELECT "Source model" FROM table_32761 WHERE "Release date" = '1992-04-06' |
Which Draws % has Wins larger than 1, and Loses % of 0%, and a Team of al-zawraa? | CREATE TABLE table_65711 ("Team" text,"Matches" real,"Wins" real,"Wins %" text,"Draws" real,"Draws %" text,"Loses" real,"Loses %" text,"Against" real) | SELECT "Draws %" FROM table_65711 WHERE "Wins" > '1' AND "Loses %" = '0%' AND "Team" = 'al-zawraa' |
What are all the CFL teams where the pick number is 36? | CREATE TABLE table_20321 ("Pick #" real,"CFL Team" text,"Player" text,"Position" text,"College" text) | SELECT "CFL Team" FROM table_20321 WHERE "Pick #" = '36' |
What is the longitude with a latitude of 47.985154? | CREATE TABLE table_22457 ("Township" text,"County" text,"Pop. (2010)" real,"Land (sqmi)" text,"Water (sqmi)" text,"Latitude" text,"Longitude" text,"GEO ID" real,"ANSI code" real) | SELECT "Longitude" FROM table_22457 WHERE "Latitude" = '47.985154' |
What is the Torque of the model with the engine code of M54B25? | CREATE TABLE table_56299 ("Model" text,"Years" text,"Engine code" text,"Power" text,"Torque" text) | SELECT "Torque" FROM table_56299 WHERE "Engine code" = 'm54b25' |
What is the Call sign for the ERP W 19? | CREATE TABLE table_name_75 (call_sign VARCHAR,erp_w VARCHAR) | SELECT call_sign FROM table_name_75 WHERE erp_w = 19 |
list possible round trip DAILY flights between BOSTON and OAKLAND | CREATE TABLE flight_stop (flight_id int,stop_number int,stop_days text,stop_airport text,arrival_time int,arrival_airline text,arrival_flight_number int,departure_time int,departure_airline text,departure_flight_number int,stop_time int)CREATE TABLE month (month_number int,month_name text)CREATE TABLE flight (aircraft_... | 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, fare, flight, flight_fare WHERE ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'OAKLAND' AND NOT fare.round_trip_cost IS NULL AND flight_fare.fare_id... |
were any towers established before the year 1800 ? | CREATE TABLE table_203_665 (id number,"name" text,"municipality" text,"established" number,"tower height\nin meters (ft)" text,"focal plane\nin meters (ft)" text,"current status" text,"current condition" text) | SELECT (SELECT COUNT(*) FROM table_203_665 WHERE "established" < 1800) > 0 |
provide the number of patients whose admission location is transfer from hosp/extram and primary disease is bladder cancer/sda? | 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 WHERE demographic.admission_location = "TRANSFER FROM HOSP/EXTRAM" AND demographic.diagnosis = "BLADDER CANCER/SDA" |
What's the lowest Code that's got a Most Spoke Language of Xhosa, a Place of Addo Elephant National Park, and an Area (KM 2) that's smaller than 1.08? | CREATE TABLE table_38879 ("Place" text,"Code" real,"Area (km 2)" real,"Population" real,"Most spoken language" text) | SELECT MIN("Code") FROM table_38879 WHERE "Most spoken language" = 'xhosa' AND "Place" = 'addo elephant national park' AND "Area (km 2 )" < '1.08' |
The software courses are taught by whom ? | CREATE TABLE program_requirement (program_id int,category varchar,min_credit int,additional_req varchar)CREATE TABLE gsi (course_offering_id int,student_id int)CREATE TABLE course_tags_count (course_id int,clear_grading int,pop_quiz int,group_projects int,inspirational int,long_lectures int,extra_credit int,few_tests i... | SELECT DISTINCT instructor.name FROM instructor INNER JOIN offering_instructor ON offering_instructor.instructor_id = instructor.instructor_id INNER JOIN course_offering ON offering_instructor.offering_id = course_offering.offering_id INNER JOIN area ON course_offering.course_id = area.course_id WHERE area.area LIKE '%... |
Which country is Lee Trevino from? | CREATE TABLE table_name_97 (country VARCHAR,player VARCHAR) | SELECT country FROM table_name_97 WHERE player = "lee trevino" |
what's the report with location sterreichring | CREATE TABLE table_16731 ("Rnd" real,"Race" text,"Date" text,"Location" text,"Pole Position" text,"Fastest Lap" text,"Race Winner" text,"Constructor" text,"Report" text) | SELECT "Report" FROM table_16731 WHERE "Location" = 'Österreichring' |
Who was the opponent on December 2, 1962? | CREATE TABLE table_45221 ("Week" real,"Date" text,"Opponent" text,"Result" text,"Attendance" real) | SELECT "Opponent" FROM table_45221 WHERE "Date" = 'december 2, 1962' |
What was the time for Aprilia and their driver Casey Stoner, before gird 9, and less than 26 laps? | CREATE TABLE table_name_35 (time_retired VARCHAR,rider VARCHAR,laps VARCHAR,manufacturer VARCHAR,grid VARCHAR) | SELECT time_retired FROM table_name_35 WHERE manufacturer = "aprilia" AND grid < 9 AND laps < 26 AND rider = "casey stoner" |
When indianapolis, indiana is the location what is the institution? | CREATE TABLE table_28211213_2 (institution VARCHAR,location VARCHAR) | SELECT institution FROM table_28211213_2 WHERE location = "Indianapolis, Indiana" |
What fuel system was used in 1960-62? | CREATE TABLE table_44105 ("Model" text,"Years" text,"Engine" text,"Displacement" text,"Power" text,"Fuel system" text) | SELECT "Fuel system" FROM table_44105 WHERE "Years" = '1960-62' |
Which authority has a rocket launch called shahpar-2? | CREATE TABLE table_362 ("Rocket launch" text,"Launch Date" text,"Mission" text,"Institutional authority" text,"Launch Site" text,"Outcomes" text,"Derivatives" text) | SELECT "Institutional authority" FROM table_362 WHERE "Rocket launch" = 'Shahpar-2' |
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, give me the comparison about the amount of job_id over the job_id , and group by attribute job_id, and sort by the y axis in desc. | 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 job_history (EMPLOYEE_ID decimal(6,0),START_DATE date,END_DATE date,JOB_ID varchar(10),DEPARTMENT_ID decimal(4,0))CREATE TABLE regions (REGIO... | SELECT JOB_ID, COUNT(JOB_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 GROUP BY JOB_ID ORDER BY COUNT(JOB_ID) DESC |
how many world records does ethiopia hold ? | CREATE TABLE table_203_102 (id number,"event" text,"performance" text,"athlete" text,"nation" text,"place" text,"date" text) | SELECT COUNT(*) FROM table_203_102 WHERE "nation" = 'ethiopia' |
how many times did internacional de madrid cf end the season at the top of their division ? | CREATE TABLE table_203_783 (id number,"season" text,"tier" number,"division" text,"place" text) | SELECT COUNT(*) FROM table_203_783 WHERE "place" = 1 |
in 12/this year when was the last lab test of patient 006-124193? | CREATE TABLE microlab (microlabid number,patientunitstayid number,culturesite text,organism text,culturetakentime time)CREATE TABLE treatment (treatmentid number,patientunitstayid number,treatmentname text,treatmenttime time)CREATE TABLE diagnosis (diagnosisid number,patientunitstayid number,diagnosisname text,diagnosi... | SELECT lab.labresulttime FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-124193')) AND DATETIME(lab.labresulttime, 'start of year') = DATETIME(CURRENT_T... |
For those records from the products and each product's manufacturer, show me about the distribution of name and price , and group by attribute headquarter in a bar chart. | 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.Price FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter, T1.Name |
In language where Thursday is bres'var, what is Sunday? | CREATE TABLE table_1277350_3 (sunday_surya__the_sun_ VARCHAR,thursday_guru__jupiter_ VARCHAR) | SELECT sunday_surya__the_sun_ FROM table_1277350_3 WHERE thursday_guru__jupiter_ = "برس وار Bres'var" |
Who had the most rebounds and how many did he have during the game on June 11? | CREATE TABLE table_name_41 (high_rebounds VARCHAR,date VARCHAR) | SELECT high_rebounds FROM table_name_41 WHERE date = "june 11" |
Which Division has a Position of 6th? | CREATE TABLE table_5751 ("Season" real,"Level" text,"Division" text,"Administration" text,"Position" text) | SELECT "Division" FROM table_5751 WHERE "Position" = '6th' |
Which date had a venue of the State Sports Centre? | CREATE TABLE table_9708 ("Date" text,"Home team" text,"Score" text,"Away team" text,"Venue" text,"Box Score" text,"Report" text) | SELECT "Date" FROM table_9708 WHERE "Venue" = 'state sports centre' |
what is discharge time and diagnoses short title of subject name cynthia robinson? | 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.dischtime, diagnoses.short_title FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.name = "Cynthia Robinson" |
Give me a bar chart for the total number of each country, could you order from low to high by the the total number ? | CREATE TABLE wedding (Church_ID int,Male_ID int,Female_ID int,Year int)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) | SELECT Country, COUNT(*) FROM people GROUP BY Country ORDER BY COUNT(*) |
which school has 14 large championships | CREATE TABLE table_19136 ("School" text,"Mascot" text,"Conference" text,"National Titles" real,"Founded" real) | SELECT "School" FROM table_19136 WHERE "National Titles" = '14' |
What is the score for the home team for the venue glenferrie oval? | CREATE TABLE table_name_57 (home_team VARCHAR,venue VARCHAR) | SELECT home_team AS score FROM table_name_57 WHERE venue = "glenferrie oval" |
What category is the nominated work of cecilie, winner of the robert award? | CREATE TABLE table_4826 ("Award" text,"Year" real,"Category" text,"Nominated Work" text,"Result" text) | SELECT "Category" FROM table_4826 WHERE "Nominated Work" = 'cecilie' AND "Award" = 'robert award' |
How many draw is in a place that is less than 1? | CREATE TABLE table_65807 ("Draw" real,"Artist" text,"Song" text,"Percentage" text,"Place" real) | SELECT COUNT("Draw") FROM table_65807 WHERE "Place" < '1' |
Show all book categories and the number of books in each category, list in asc by the bar. | CREATE TABLE culture_company (Company_name text,Type text,Incorporated_in text,Group_Equity_Shareholding real,book_club_id text,movie_id text)CREATE TABLE book_club (book_club_id int,Year int,Author_or_Editor text,Book_Title text,Publisher text,Category text,Result text)CREATE TABLE movie (movie_id int,Title text,Year ... | SELECT Category, COUNT(*) FROM book_club GROUP BY Category ORDER BY Category |
What is the ngc number when the object type is lenticular galaxy and the constellation is hydra? | CREATE TABLE table_name_12 (ngc_number INTEGER,object_type VARCHAR,constellation VARCHAR) | SELECT MAX(ngc_number) FROM table_name_12 WHERE object_type = "lenticular galaxy" AND constellation = "hydra" |
what is the distance for ridge? | CREATE TABLE table_62741 ("Name" text,"Feature" text,"Latitude" text,"Longitude" text,"Distance" text,"Bearing" text) | SELECT "Distance" FROM table_62741 WHERE "Feature" = 'ridge' |
What is the party of the maryland 6 district? | CREATE TABLE table_79088 ("District" text,"Incumbent" text,"Party" text,"First elected" real,"Results" text) | SELECT "Party" FROM table_79088 WHERE "District" = 'maryland 6' |
List the dates of enrollment and completion of the student with family name 'Zieme' and personal name 'Bernie'. | CREATE TABLE student_tests_taken (registration_id number,date_test_taken time,test_result text)CREATE TABLE course_authors_and_tutors (author_id number,author_tutor_atb text,login_name text,password text,personal_name text,middle_name text,family_name text,gender_mf text,address_line_1 text)CREATE TABLE students (stude... | SELECT T1.date_of_enrolment, T1.date_of_completion FROM student_course_enrolment AS T1 JOIN students AS T2 ON T1.student_id = T2.student_id WHERE T2.family_name = "Zieme" AND T2.personal_name = "Bernie" |
What is the lowest overall number for total(min. 2 medals)? | CREATE TABLE table_22355_65 (total_min_2_medals_ INTEGER) | SELECT MIN(total_min_2_medals_) FROM table_22355_65 |
How much was the budget of ' Finding Nemo | CREATE TABLE producer (pid int,gender text,name text,nationality text,birth_city text,birth_year int)CREATE TABLE classification (id int,msid int,gid int)CREATE TABLE movie (mid int,title text,release_year int,title_aka text,budget text)CREATE TABLE actor (aid int,gender text,name text,nationality text,birth_city text,... | SELECT budget FROM movie WHERE title = 'Finding Nemo' |
What all capacities have turbines between 50-60? | CREATE TABLE table_26387382_1 (capacity__mw_ VARCHAR,turbines VARCHAR) | SELECT capacity__mw_ FROM table_26387382_1 WHERE turbines = "50-60" |
Which Constellation has an Apparent magnitude larger that 7.7, and an NGC number of 7777 | CREATE TABLE table_51226 ("NGC number" real,"Object type" text,"Constellation" text,"Right ascension (J2000)" text,"Declination (J2000)" text,"Apparent magnitude" real) | SELECT "Constellation" FROM table_51226 WHERE "Apparent magnitude" > '7.7' AND "NGC number" = '7777' |
What was Week 14 when Week 13 was Nebraska (8-2)? | CREATE TABLE table_name_37 (week_14_nov_27 VARCHAR,week_13_nov_20 VARCHAR) | SELECT week_14_nov_27 FROM table_name_37 WHERE week_13_nov_20 = "nebraska (8-2)" |
What is the per capita income with more than 2,466 households and a median family income of $53,940? | CREATE TABLE table_12115 ("County" text,"Per capita income" text,"Median household income" text,"Median family income" text,"Population" real,"Number of households" real) | SELECT "Per capita income" FROM table_12115 WHERE "Number of households" > '2,466' AND "Median family income" = '$53,940' |
What is the Result of Goal number 3? | CREATE TABLE table_42164 ("Goal" real,"Date" text,"Venue" text,"Score" text,"Result" text,"Competition" text) | SELECT "Result" FROM table_42164 WHERE "Goal" = '3' |
Which award ceremony took place on May 15, 1965? | CREATE TABLE table_45325 ("Ceremony" text,"Date" text,"Host(s)" text,"Venue" text,"Film of the Year" text) | SELECT "Ceremony" FROM table_45325 WHERE "Date" = 'may 15, 1965' |
what is the average lost when played is more than 14? | CREATE TABLE table_48996 ("Position" real,"Name" text,"Played" real,"Drawn" real,"Lost" real,"Points" real) | SELECT AVG("Lost") FROM table_48996 WHERE "Played" > '14' |
What is the average number of attendance at home games for each year? | CREATE TABLE player (player_id text,birth_year number,birth_month number,birth_day number,birth_country text,birth_state text,birth_city text,death_year number,death_month number,death_day number,death_country text,death_state text,death_city text,name_first text,name_last text,name_given text,weight number,height numb... | SELECT year, AVG(attendance) FROM home_game GROUP BY year |
For those records from the products and each product's manufacturer, what is the relationship between code and revenue , and group by attribute headquarter? | CREATE TABLE Products (Code INTEGER,Name VARCHAR(255),Price DECIMAL,Manufacturer INTEGER)CREATE TABLE Manufacturers (Code INTEGER,Name VARCHAR(255),Headquarter VARCHAR(255),Founder VARCHAR(255),Revenue REAL) | SELECT T1.Code, T2.Revenue FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter |
What country team had Thurles Sarsfields? | CREATE TABLE table_name_8 (county_team VARCHAR,club_team_s_ VARCHAR) | SELECT county_team FROM table_name_8 WHERE club_team_s_ = "thurles sarsfields" |
Return a pie chart on how old is the youngest person for each job? | CREATE TABLE PersonFriend (name varchar(20),friend varchar(20),year INTEGER)CREATE TABLE Person (name varchar(20),age INTEGER,city TEXT,gender TEXT,job TEXT) | SELECT job, MIN(age) FROM Person GROUP BY job |
Who were the commanders when 8 off 0 men were wounded? | CREATE TABLE table_11793221_2 (commander VARCHAR,wounded VARCHAR) | SELECT commander FROM table_11793221_2 WHERE wounded = "8 off 0 men" |
Name the originl title for no stars in the jungle | CREATE TABLE table_2378 ("Year (Ceremony)" text,"Film title used in nomination" text,"Original title" text,"Director" text,"Result" text) | SELECT "Original title" FROM table_2378 WHERE "Film title used in nomination" = 'No Stars in the Jungle' |
what was the first chr syst/diastl hrt fail diagnosis time of patient 87232 in the current hospital visit? | CREATE TABLE admissions (row_id number,subject_id number,hadm_id number,admittime time,dischtime time,admission_type text,admission_location text,discharge_location text,insurance text,language text,marital_status text,ethnicity text,age number)CREATE TABLE d_labitems (row_id number,itemid number,label text)CREATE TABL... | SELECT diagnoses_icd.charttime FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'chr syst/diastl hrt fail') AND diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 87232 AND admissi... |
What day did the VFL pay MCG? | CREATE TABLE table_name_90 (date VARCHAR,venue VARCHAR) | SELECT date FROM table_name_90 WHERE venue = "mcg" |
Which leagues have Raiders as their mascot? | CREATE TABLE table_11044765_1 (league VARCHAR,mascot VARCHAR) | SELECT league FROM table_11044765_1 WHERE mascot = "Raiders" |
how many friendly matches were in the table ? | CREATE TABLE table_203_179 (id number,"goal" number,"date" text,"venue" text,"opponent" text,"score" text,"result" text,"competition" text) | SELECT COUNT(*) FROM table_203_179 WHERE "competition" = 'friendly match' |
In the match where newcastle jets was the away team, what was the crown attendance? | CREATE TABLE table_name_79 (crowd VARCHAR,away_team VARCHAR) | SELECT crowd FROM table_name_79 WHERE away_team = "newcastle jets" |
how many drugs were prescribed in this year for patient 018-99743? | CREATE TABLE intakeoutput (intakeoutputid number,patientunitstayid number,cellpath text,celllabel text,cellvaluenumeric number,intakeoutputtime time)CREATE TABLE microlab (microlabid number,patientunitstayid number,culturesite text,organism text,culturetakentime time)CREATE TABLE treatment (treatmentid number,patientun... | SELECT COUNT(*) FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '018-99743')) AND DATETIME(medication.drugstarttime, 'start of year') = DATETIM... |
Which Season was the Division Three Hampton Park Rangers champions? | CREATE TABLE table_name_63 (season VARCHAR,division_three VARCHAR) | SELECT season FROM table_name_63 WHERE division_three = "hampton park rangers" |
Name the D 47 O with D 48 O of r 9 | CREATE TABLE table_name_80 (d_47_o VARCHAR,d_48_o VARCHAR) | SELECT d_47_o FROM table_name_80 WHERE d_48_o = "r 9" |
List the names of buildings that have no company office. | CREATE TABLE Office_locations (name VARCHAR,id VARCHAR,building_id VARCHAR)CREATE TABLE buildings (name VARCHAR,id VARCHAR,building_id VARCHAR) | SELECT name FROM buildings WHERE NOT id IN (SELECT building_id FROM Office_locations) |
hans r. esmer and christophe larrouilh were both replaced in what month in 2009 ? | CREATE TABLE table_204_805 (id number,"name" text,"club" text,"date of departure" text,"replacement" text,"date of appointment" text) | SELECT "date of departure" FROM table_204_805 WHERE "name" = 'hans r. emser' |
What is the Name when the position is g, and weight is 190 pounds? | CREATE TABLE table_name_54 (name VARCHAR,position VARCHAR,weight__lbs_ VARCHAR) | SELECT name FROM table_name_54 WHERE position = "g" AND weight__lbs_ = 190 |
What are all the players who played in match season, sorted by college in ascending alphabetical order? | CREATE TABLE player (player_id number,player text,years_played text,total_wl text,singles_wl text,doubles_wl text,team number)CREATE TABLE country (country_id number,country_name text,capital text,official_native_language text)CREATE TABLE match_season (season number,player text,position text,country number,team number... | SELECT player FROM match_season ORDER BY college |
How many losses did leon patton have with the longest gain higher than 45? | CREATE TABLE table_76396 ("Name" text,"Gain" real,"Loss" real,"Long" real,"Avg/G" real) | SELECT COUNT("Loss") FROM table_76396 WHERE "Name" = 'leon patton' AND "Long" > '45' |
How many open cups were hosted in 1993? | CREATE TABLE table_17371 ("Year" real,"Division" text,"League" text,"Reg. Season" text,"Playoffs" text,"Open Cup" text) | SELECT COUNT("Open Cup") FROM table_17371 WHERE "Year" = '1993' |
How many Total has a Player of dave stockton? | CREATE TABLE table_name_53 (total VARCHAR,player VARCHAR) | SELECT COUNT(total) FROM table_name_53 WHERE player = "dave stockton" |
How many entries are there for founded when the location was springfield, ohio? | CREATE TABLE table_24195232_1 (founded VARCHAR,location VARCHAR) | SELECT COUNT(founded) FROM table_24195232_1 WHERE location = "Springfield, Ohio" |
For those employees who do not work in departments with managers that have ids between 100 and 200, visualize a bar chart about the distribution of job_id and manager_id , and could you list in asc by the MANAGER_ID? | CREATE TABLE job_history (EMPLOYEE_ID decimal(6,0),START_DATE date,END_DATE date,JOB_ID varchar(10),DEPARTMENT_ID decimal(4,0))CREATE TABLE departments (DEPARTMENT_ID decimal(4,0),DEPARTMENT_NAME varchar(30),MANAGER_ID decimal(6,0),LOCATION_ID decimal(4,0))CREATE TABLE regions (REGION_ID decimal(5,0),REGION_NAME varcha... | SELECT JOB_ID, MANAGER_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY MANAGER_ID |
what are the four most commonly given microbiology tests for patients who have received vasopressors - norepinephrine > 0.1 micrograms/kg/min before, within 2 months in 2105? | CREATE TABLE diagnosis (diagnosisid number,patientunitstayid number,diagnosisname text,diagnosistime time,icd9code text)CREATE TABLE microlab (microlabid number,patientunitstayid number,culturesite text,organism text,culturetakentime time)CREATE TABLE treatment (treatmentid number,patientunitstayid number,treatmentname... | SELECT t3.culturesite FROM (SELECT t2.culturesite, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, treatment.treatmenttime FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'vasopressors - norepinephrine > 0.1 microgra... |
Who was the home team in the game with a record of 2-4? | CREATE TABLE table_47606 ("Date" text,"Visitor" text,"Score" text,"Home" text,"Record" text) | SELECT "Home" FROM table_47606 WHERE "Record" = '2-4' |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.