table
stringlengths
33
7.14k
question
stringlengths
4
1.06k
output
stringlengths
2
4.44k
⌀
CREATE TABLE table_22368 ( "Voting order" real, "Country" text, "Spokespersons" text, "Commentator" text, "Broadcaster" text )
who was the commentator when spokesperson was claude darget
SELECT "Commentator" FROM table_22368 WHERE "Spokespersons" = 'Claude Darget'
CREATE TABLE table_204_32 ( id number, "season" number, "division" text, "w-l" text, "finish" text, "home" text, "road" text, "gf" number, "ga" number, "coach" text, "playoffs" text, "avg attendance" number )
amount of seasons with a winning record
SELECT COUNT("season") FROM table_204_32 WHERE "w-l" > "w-l"
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, ...
How many of the male patients are less than 74 years old?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.gender = "M" AND demographic.age < "74"
CREATE TABLE table_204_696 ( id number, "issue" number, "volume" number, "title" text, "main feature story" text, "first/early appearance story/stories" text, "release date" text )
what other publication was released in the same month as jean gray ?
SELECT "title" FROM table_204_696 WHERE "title" <> 'jean grey' AND "release date" = (SELECT "release date" FROM table_204_696 WHERE "title" = 'jean grey')
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,...
what is maximum days of hospital stay of patients whose primary disease is squamous cell carcinoma oral tongue/sda?
SELECT MAX(demographic.days_stay) FROM demographic WHERE demographic.diagnosis = "SQUAMOUS CELL CARCINOMA ORAL TONGUE/SDA"
CREATE TABLE month ( month_number int, month_name text ) CREATE TABLE city ( city_code varchar, city_name varchar, state_code varchar, country_name varchar, time_zone_code varchar ) CREATE TABLE airline ( airline_code varchar, airline_name text, note text ) CREATE TABLE ground...
i would like information information on flights from SAN FRANCISCO to DENVER on thursday morning
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, date_day, days, flight WHERE ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'DENVER' AND date_day.day_number = 24 AND date_day.month_number = 5 AND d...
CREATE TABLE table_21713 ( "Class" text, "Part 1" text, "Part 2" text, "Part 3" text, "Part 4" text, "Verb meaning" text )
What is the 3rd participle of the verb whose 2nd participle is band?
SELECT "Part 3" FROM table_21713 WHERE "Part 2" = 'band'
CREATE TABLE table_28393 ( "Institution" text, "Location" text, "Founded" real, "Type" text, "Enrollment" real, "Nickname" text, "Joined" text, "Primary Conference" text, "Colors" text )
What is the enrollment for the colors green & black?
SELECT "Enrollment" FROM table_28393 WHERE "Colors" = 'Green & Black'
CREATE TABLE table_806 ( "Rank by average" real, "Competition finish" real, "Couple" text, "Total" real, "Number of dances" real, "Average" text )
The minimum average number of dancers is 34.1 how many times
SELECT MIN("Number of dances") FROM table_806 WHERE "Average" = '34.1'
CREATE TABLE table_48337 ( "Place" text, "Player" text, "Country" text, "Score" real, "To par" text )
Which player(s) is from South Africa?
SELECT "Player" FROM table_48337 WHERE "Country" = 'south africa'
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 t...
give me the number of patients whose age is less than 41 and lab test fluid is urine?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.age < "41" AND lab.fluid = "Urine"
CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_ID decimal(4,0) ) CREATE TABLE job_history ( EMPLOYEE_ID decimal(6,0), START_DATE date, END...
For those employees who do not work in departments with managers that have ids between 100 and 200, find hire_date and the average of employee_id bin hire_date by time, and visualize them by a bar chart, I want to rank in ascending by the y-axis.
SELECT HIRE_DATE, AVG(EMPLOYEE_ID) FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY AVG(EMPLOYEE_ID)
CREATE TABLE table_33806 ( "Year" real, "Name" text, "Nationality" text, "Time" text, "Age category" text )
In which Age Category is Marco Manenti?
SELECT "Age category" FROM table_33806 WHERE "Name" = 'marco manenti'
CREATE TABLE table_name_98 ( result VARCHAR, attendance VARCHAR )
What is the result of the game with 68,436 attending?
SELECT result FROM table_name_98 WHERE attendance = "68,436"
CREATE TABLE VoteTypes ( Id number, Name text ) CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number ) CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, User...
My score and number of non-CW answers per tag.
SELECT t.TagName, SUM(a.Score) AS "total_score", COUNT(a.Id) AS "answer_count" FROM Posts AS a INNER JOIN Posts AS q ON q.Id = a.ParentId INNER JOIN PostTags AS pt ON q.Id = pt.PostId INNER JOIN Tags AS t ON pt.TagId = t.Id WHERE (a.OwnerUserId = '##userid##') AND (a.CommunityOwnedDate IS NULL) GROUP BY t.TagName ORDER...
CREATE TABLE table_64883 ( "Township" text, "County" text, "Pop. (2010)" real, "Land ( sqmi )" real, "Water (sqmi)" real, "Latitude" real, "Longitude" real, "GEO ID" real, "ANSI code" real )
What GEO ID has a longitude of -102.693028?
SELECT "GEO ID" FROM table_64883 WHERE "Longitude" = '-102.693028'
CREATE TABLE table_name_64 ( attendance INTEGER, result VARCHAR )
What was the highest attendance of games that resulted in L 23-20?
SELECT MAX(attendance) FROM table_name_64 WHERE result = "l 23-20"
CREATE TABLE table_name_99 ( nominated_by_the_taoiseach INTEGER, total VARCHAR, cultural_and_educational_panel VARCHAR, industrial_and_commercial_panel VARCHAR, administrative_panel VARCHAR )
What is the average nominated of the composition nominated by Taioseach with an Industrial and Commercial panel less than 9, an administrative panel greater than 0, a cultural and educational panel greater than 2, and a total less than 29?
SELECT AVG(nominated_by_the_taoiseach) FROM table_name_99 WHERE industrial_and_commercial_panel < 9 AND administrative_panel > 0 AND cultural_and_educational_panel > 2 AND total < 29
CREATE TABLE table_name_61 ( total_matches INTEGER, year VARCHAR, points_won VARCHAR )
How many Total matches have a Year of career, and a Points won larger than 25?
SELECT SUM(total_matches) FROM table_name_61 WHERE year = "career" AND points_won > 25
CREATE TABLE table_25363 ( "R" real, "Player" text, "Scottish Premier League" real, "Scottish Cup" real, "Scottish League Cup" real, "Champions League (qualifying)" real, "Europa League" real, "Total" real )
Name the scottish premier league georgios samaras
SELECT "Scottish Premier League" FROM table_25363 WHERE "Player" = 'Georgios Samaras'
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_id int ) CREATE TABLE instructor ( ...
Just how big do you think 579 is ?
SELECT DISTINCT num_enrolled FROM course WHERE department = 'EECS' AND number = 579
CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE d_labitems ( row_id number...
what was patient 22245's daily average value of body weight this year?
SELECT AVG(chartevents.valuenum) FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 22245)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'admi...
CREATE TABLE table_23195_5 ( present_share VARCHAR, producing_nation VARCHAR )
Name the present share for australia
SELECT present_share FROM table_23195_5 WHERE producing_nation = "Australia"
CREATE TABLE table_name_79 ( year VARCHAR, make_ VARCHAR, _model VARCHAR )
What year has a make & model of mci d4000n?
SELECT year FROM table_name_79 WHERE make_ & _model = "mci d4000n"
CREATE TABLE table_train_7 ( "id" int, "bleeding" int, "hypotension" bool, "burn_injury" int, "hypoperfusion" bool, "hypertension" bool, "age" float, "lactate" int, "NOUSE" float )
intracranial bleed or intracranial hypertension during this hospital admission
SELECT * FROM table_train_7 WHERE bleeding = 1 OR hypertension = 1
CREATE TABLE table_8484 ( "School" text, "Locality" text, "Ages" text, "Capacity" real, "Ofsted" real )
Which Capacity has a School of windlehurst school, and an Ofsted smaller than 131889?
SELECT SUM("Capacity") FROM table_8484 WHERE "School" = 'windlehurst school' AND "Ofsted" < '131889'
CREATE TABLE table_name_63 ( moving_from VARCHAR, country VARCHAR )
What moving has fra as the country?
SELECT moving_from FROM table_name_63 WHERE country = "fra"
CREATE TABLE table_1470 ( "C/W 15+" real, "Oblast\\Age" text, "15 to 17" real, "18 to 19" real, "20 to 24" real, "25 to 29" real, "30 to 34" real, "35 to 39" real, "40 to 44" real, "45 to 49" real, "50 to 54" real, "55 to 59" real, "60 to 64" real, "65 to 69" real...
What is the minimum if 40 to 44?
SELECT MIN("40 to 44") FROM table_1470
CREATE TABLE Course_Authors_and_Tutors ( author_id INTEGER, author_tutor_ATB VARCHAR(3), login_name VARCHAR(40), password VARCHAR(40), personal_name VARCHAR(80), middle_name VARCHAR(80), family_name VARCHAR(80), gender_mf VARCHAR(1), address_line_1 VARCHAR(80) ) CREATE TABLE Courses...
A bar chart shows the distribution of password and gender_mf .
SELECT password, gender_mf FROM Course_Authors_and_Tutors ORDER BY personal_name
CREATE TABLE table_name_6 ( time VARCHAR, opponent VARCHAR )
What is shintaro ishiwatari's time?
SELECT time FROM table_name_6 WHERE opponent = "shintaro ishiwatari"
CREATE TABLE table_name_83 ( week INTEGER, result VARCHAR )
What was the latest week with a result of l 14-3?
SELECT MAX(week) FROM table_name_83 WHERE result = "l 14-3"
CREATE TABLE table_name_86 ( population_estimate_2005 VARCHAR, capital VARCHAR )
how many population estimate 2005 are for majene?
SELECT COUNT(population_estimate_2005) FROM table_name_86 WHERE capital = "majene"
CREATE TABLE table_22822559_4 ( date VARCHAR, team VARCHAR )
On what date did the Pistons play @ toronto?
SELECT date FROM table_22822559_4 WHERE team = "@ Toronto"
CREATE TABLE table_69970 ( "Match" real, "Date" text, "Competition or tour" text, "Ground" text, "Opponent" text, "Score1" text )
Where was match 8 played?
SELECT "Ground" FROM table_69970 WHERE "Match" = '8'
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,...
give me the number of patients whose primary disease is hyperglycemia;hyponatremia and age is less than 62?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "HYPERGLYCEMIA;HYPONATREMIA" AND demographic.age < "62"
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 t...
provide the number of patients whose admission type is emergency and diagnoses long title is chronic pulmonary heart disease, unspecified?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admission_type = "EMERGENCY" AND diagnoses.long_title = "Chronic pulmonary heart disease, unspecified"
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 )
For those records from the products and each product's manufacturer, find headquarter and the sum of code , and group by attribute headquarter, and visualize them by a bar chart, and I want to sort y axis from low to high order.
SELECT T2.Headquarter, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Headquarter ORDER BY T1.Code
CREATE TABLE table_name_71 ( champion VARCHAR, year VARCHAR, finalist VARCHAR )
What is Champion, when Year is greater than 2007, and when Finalist is 'Asvel'?
SELECT champion FROM table_name_71 WHERE year > 2007 AND finalist = "asvel"
CREATE TABLE table_9054 ( "Outcome" text, "Date" real, "Championship" text, "Surface" text, "Opponent" text, "Score" text )
What was the surface tye during the match with the opponent of richard fromberg?
SELECT "Surface" FROM table_9054 WHERE "Opponent" = 'richard fromberg'
CREATE TABLE table_73953 ( "Name" text, "Turbines" text, "Capacity (MW)" text, "Power (MW\u00b7hr/yr)" text, "Location (county)" text, "Year Operational" real, "Status" text )
What all capacities have turbines between 50-60?
SELECT "Capacity (MW)" FROM table_73953 WHERE "Turbines" = '50-60'
CREATE TABLE table_name_62 ( date VARCHAR, margin_of_victory VARCHAR )
What is the date of the tournament with 5 strokes as the margin of victory?
SELECT date FROM table_name_62 WHERE margin_of_victory = "5 strokes"
CREATE TABLE table_name_64 ( to_par VARCHAR, score VARCHAR )
Name the to par for score of 74-74-74-71=293
SELECT to_par FROM table_name_64 WHERE score = 74 - 74 - 74 - 71 = 293
CREATE TABLE table_71189 ( "Event" text, "Time" text, "Venue" text, "Date" text, "Notes" text )
What were the notes for the time 45.74?
SELECT "Notes" FROM table_71189 WHERE "Time" = '45.74'
CREATE TABLE table_26407 ( "Season" text, "Name" text, "Teams" real, "Relegated to league" text, "Promoted to league" text, "Promoted from league" text, "Relegated from league" text )
How many seasons did Barking Birmingham & Solihull Stourbridge were relegated from league?
SELECT COUNT("Season") FROM table_26407 WHERE "Relegated from league" = 'Barking Birmingham & Solihull Stourbridge'
CREATE TABLE table_5896 ( "Game" real, "February" real, "Opponent" text, "Score" text, "Record" text )
Which Opponent has a February larger than 7 and Record of 37-16-4?
SELECT "Opponent" FROM table_5896 WHERE "February" > '7' AND "Record" = '37-16-4'
CREATE TABLE table_78543 ( "Tujunga" text, "La Crescenta- Montrose" text, "Glendale" text, "La Ca\u00f1ada Flintridge" text, "Pasadena" text )
What is the percentage of La Canada Flintridge when Tujunga is 7%?
SELECT "La Ca\u00f1ada Flintridge" FROM table_78543 WHERE "Tujunga" = '7%'
CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_typ...
have patient 61527's been prescribed docusate sodium, potassium chloride, or spironolactone in the last year?
SELECT COUNT(*) > 0 FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 61527) AND prescriptions.drug IN ('docusate sodium', 'potassium chloride', 'spironolactone') AND DATETIME(prescriptions.startdate, 'start of year') = DATETIME(CURRENT_TIME(), 's...
CREATE TABLE Customer_Event_Notes ( Customer_Event_Note_ID INTEGER, Customer_Event_ID INTEGER, service_type_code CHAR(15), resident_id INTEGER, property_id INTEGER, date_moved_in DATETIME ) CREATE TABLE Properties ( property_id INTEGER, property_type_code CHAR(15), property_address ...
Just list the resident id and details in a bar chart.
SELECT other_details, resident_id FROM Residents
CREATE TABLE rooms ( roomid text, roomname text, beds number, bedtype text, maxoccupancy number, baseprice number, decor text ) CREATE TABLE reservations ( code number, room text, checkin text, checkout text, rate number, lastname text, firstname text, adults...
What are the name of rooms that cost more than the average.
SELECT roomname FROM rooms WHERE baseprice > (SELECT AVG(baseprice) FROM rooms)
CREATE TABLE table_name_53 ( owner VARCHAR, horse_name VARCHAR )
Who is the owner of Icabad Crane?
SELECT owner FROM table_name_53 WHERE horse_name = "icabad crane"
CREATE TABLE table_204_795 ( id number, "date" text, "opponent" text, "score" text, "result" text, "location" text, "attendance" number )
how many total wins did the team have in 1949 ?
SELECT COUNT(*) FROM table_204_795 WHERE "result" = 'win' AND "date" = 1949
CREATE TABLE table_name_93 ( player VARCHAR, total VARCHAR, country VARCHAR )
Who is that player from South Africa who had a total score under 293?
SELECT player FROM table_name_93 WHERE total < 293 AND country = "south africa"
CREATE TABLE table_26493520_1 ( title VARCHAR, written_by VARCHAR, directed_by VARCHAR )
How many episodes were written by Alexander Woo and directed by Scott Winant?
SELECT COUNT(title) FROM table_26493520_1 WHERE written_by = "Alexander Woo" AND directed_by = "Scott Winant"
CREATE TABLE table_50540 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text )
What is High Rebounds, when Date is 'March 12'?
SELECT "High rebounds" FROM table_50540 WHERE "Date" = 'march 12'
CREATE TABLE table_name_86 ( record VARCHAR, date VARCHAR )
What was the record after the January 18 game?
SELECT record FROM table_name_86 WHERE date = "january 18"
CREATE TABLE table_35305 ( "Date" text, "Tournament" text, "Winning score" text, "Margin of victory" text, "Runner(s)-up" text )
Which Runner(s)-up has a Margin of victory of 1 stroke, and a Tournament of world seniors invitational?
SELECT "Runner(s)-up" FROM table_35305 WHERE "Margin of victory" = '1 stroke' AND "Tournament" = 'world seniors invitational'
CREATE TABLE table_name_79 ( laps VARCHAR, grid VARCHAR, time VARCHAR )
How many laps had a grid over 16 and a Time of +1:35.890?
SELECT laps FROM table_name_79 WHERE grid > 16 AND time = "+1:35.890"
CREATE TABLE table_30128 ( "Year(s)" real, "Television commentator" text, "Dual Television commentator" text, "Radio commentator" text, "Spokesperson" text )
Who made the comments for radio broadcast when Jan Gabrielsson made them for television broadcast?
SELECT "Radio commentator" FROM table_30128 WHERE "Television commentator" = 'Jan Gabrielsson'
CREATE TABLE table_3557 ( "Pick #" real, "Brand (to)" text, "Employee (Real name)" text, "Role(s)" text, "Brand (from)" text )
Name the brand for pick number 15
SELECT "Brand (to)" FROM table_3557 WHERE "Pick #" = '15'
CREATE TABLE climber ( Id VARCHAR )
How many climbers are there?
SELECT COUNT(*) FROM climber
CREATE TABLE table_name_39 ( director VARCHAR, film_title_used_in_nomination VARCHAR )
What is the Director of Children of Sarajevo?
SELECT director FROM table_name_39 WHERE film_title_used_in_nomination = "children of sarajevo"
CREATE TABLE table_name_26 ( distance VARCHAR, type VARCHAR )
What is the distance for the team time trial?
SELECT distance FROM table_name_26 WHERE type = "team time trial"
CREATE TABLE table_75031 ( "Call sign" text, "Analog channel" text, "Digital channel" text, "Virtual channel" text, "Network" text, "Station Ownership" text )
Virtual channel of 16.5 has what call sign?
SELECT "Call sign" FROM table_75031 WHERE "Virtual channel" = '16.5'
CREATE TABLE table_26847237_1 ( score VARCHAR, opposition VARCHAR, location VARCHAR )
What was the score when the opposition was West Coast in Wanganui?
SELECT score FROM table_26847237_1 WHERE opposition = "West Coast" AND location = "Wanganui"
CREATE TABLE table_29083 ( "Round #" text, "Home Team" text, "Win/Loss" text, "Score" text, "Opposition" text, "Location" text )
what is the home team when the round # is round 1?
SELECT "Home Team" FROM table_29083 WHERE "Round #" = 'Round 1'
CREATE TABLE table_19296 ( "Celebrity" text, "Famous for" text, "Entered" text, "Exited" text, "Finished" text )
What is the finished place where exited is day 11?
SELECT "Finished" FROM table_19296 WHERE "Exited" = 'Day 11'
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 class_of_service ( booking_class varchar, rank int, class_description text ) CREATE ...
i need information for a flight from DENVER to ATLANTA
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 = 'DENVER' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'ATLANTA...
CREATE TABLE table_37965 ( "Callsign" text, "Area served" text, "Frequency" text, "Band" text, "On-air ID" text, "Purpose" text )
Name the purpose for on-air ID of 2xx
SELECT "Purpose" FROM table_37965 WHERE "On-air ID" = '2xx'
CREATE TABLE gymnast ( Gymnast_ID int, Floor_Exercise_Points real, Pommel_Horse_Points real, Rings_Points real, Vault_Points real, Parallel_Bars_Points real, Horizontal_Bar_Points real, Total_Points real ) CREATE TABLE people ( People_ID int, Name text, Age real, Height ...
What are the hometowns of gymnasts and the corresponding number of gymnasts. Show a pie chart.
SELECT Hometown, COUNT(*) FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID = T2.People_ID GROUP BY T2.Hometown
CREATE TABLE table_38780 ( "Team" text, "Stadium" text, "Capacity" real, "Highest" real, "Lowest" real, "Average" real )
Highest smaller than 3,378, and a Stadium of cappielow has what average capacity?
SELECT AVG("Capacity") FROM table_38780 WHERE "Highest" < '3,378' AND "Stadium" = 'cappielow'
CREATE TABLE airport_service ( city_code varchar, airport_code varchar, miles_distant int, direction varchar, minutes_distant int ) CREATE TABLE flight ( aircraft_code_sequence text, airline_code varchar, airline_flight text, arrival_time int, connections int, departure_time...
please list the morning flights from PHILADELPHIA to TORONTO
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 = 'PHILADELPHIA' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = '...
CREATE TABLE table_27734769_9 ( high_rebounds VARCHAR, team VARCHAR )
Who did the high rebounds for the team Minnesota?
SELECT high_rebounds FROM table_27734769_9 WHERE team = "Minnesota"
CREATE TABLE table_10026563_1 ( ended_time_as_senior_g8_leader VARCHAR, person VARCHAR )
When did Jacques Chirac stop being a G8 leader?
SELECT ended_time_as_senior_g8_leader FROM table_10026563_1 WHERE person = "Jacques Chirac"
CREATE TABLE table_21772 ( "District" real, "Incumbent" text, "2008 Status" text, "Democratic" text, "Republican" text, "Independent Green" text, "Libertarian" text, "Other Party" text )
Who was the republican candidate in the race with incumbent thelma drake?
SELECT "Republican" FROM table_21772 WHERE "Incumbent" = 'Thelma Drake'
CREATE TABLE table_name_43 ( score VARCHAR, championship VARCHAR, surface VARCHAR, outcome VARCHAR )
what is the score when the surface is carpet (i) outcome is winner and the championship is rotterdam, netherlands?
SELECT score FROM table_name_43 WHERE surface = "carpet (i)" AND outcome = "winner" AND championship = "rotterdam, netherlands"
CREATE TABLE SuggestedEdits ( Id number, PostId number, CreationDate time, ApprovalDate time, RejectionDate time, OwnerUserId number, Comment text, Text text, Title text, Tags text, RevisionGUID other ) CREATE TABLE PendingFlags ( Id number, FlagTypeId number, Po...
Top 30 Users from Milan, Italy.
SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation FROM Users WHERE LOWER(Location) LIKE '%toulouse%' ORDER BY Reputation DESC LIMIT 30
CREATE TABLE table_204_184 ( id number, "#" number, "title" text, "producer(s)" text, "featured guest(s)" text, "length" text )
how many tracks are in the album ?
SELECT COUNT("title") FROM table_204_184
CREATE TABLE table_6001 ( "Stage" text, "Winner" text, "General classification" text, "Points classification" text, "Mountains classification" text, "Combination classification" text, "Team classification" text )
Which Combination classification has a Stage of 14?
SELECT "Combination classification" FROM table_6001 WHERE "Stage" = '14'
CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime ti...
until 2104, patient 7073 underwent any procedure?
SELECT COUNT(*) > 0 FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 7073) AND STRFTIME('%y', procedures_icd.charttime) <= '2104'
CREATE TABLE ENROLL ( CLASS_CODE varchar(5), STU_NUM int, ENROLL_GRADE varchar(50) ) CREATE TABLE CLASS ( CLASS_CODE varchar(5), CRS_CODE varchar(10), CLASS_SECTION varchar(2), CLASS_TIME varchar(20), CLASS_ROOM varchar(8), PROF_NUM int ) CREATE TABLE STUDENT ( STU_NUM int, ...
What is the number of professors for different school.
SELECT SCHOOL_CODE, COUNT(*) FROM DEPARTMENT AS T1 JOIN PROFESSOR AS T2 ON T1.DEPT_CODE = T2.DEPT_CODE GROUP BY T1.SCHOOL_CODE
CREATE TABLE table_38498 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Record" text )
Name the visitor for detroit on february 24
SELECT "Visitor" FROM table_38498 WHERE "Home" = 'detroit' AND "Date" = 'february 24'
CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeri...
what is patient 016-34108's last ward id until 2104?
SELECT patient.wardid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '016-34108') AND STRFTIME('%y', patient.unitadmittime) <= '2104' ORDER BY patient.unitadmittime DESC LIMIT 1
CREATE TABLE table_35331 ( "Episode" text, "Title" text, "Writer(s)" text, "Preservation" text, "Original airdate" text )
What is the original airdate for episode 7-17 (195) from writer Sidney Slon?
SELECT "Original airdate" FROM table_35331 WHERE "Writer(s)" = 'sidney slon' AND "Episode" = '7-17 (195)'
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, sc...
In the afternoon of Fall 2006 , is 692 available ?
SELECT COUNT(*) > 0 FROM course, course_offering, semester WHERE course_offering.start_time >= '12:00:00' AND course.course_id = course_offering.course_id AND course.department = 'EECS' AND course.number = 692 AND semester.semester = 'Fall' AND semester.semester_id = course_offering.semester AND semester.year = 2006
CREATE TABLE table_name_18 ( days VARCHAR, year VARCHAR, constituency VARCHAR )
What are the number of days in 1945 where the constituent was heywood and radcliffe?
SELECT days FROM table_name_18 WHERE year = "1945" AND constituency = "heywood and radcliffe"
CREATE TABLE song ( artist_name VARCHAR, languages VARCHAR, rating INTEGER )
Find the names of the artists who have produced English songs but have never received rating higher than 8.
SELECT DISTINCT artist_name FROM song WHERE languages = "english" EXCEPT SELECT DISTINCT artist_name FROM song WHERE rating > 8
CREATE TABLE table_11677691_12 ( player VARCHAR, school VARCHAR )
who are all the players for armwood high school
SELECT player FROM table_11677691_12 WHERE school = "Armwood High school"
CREATE TABLE table_68523 ( "Date" text, "Course" text, "Distance" text, "Type" text, "Winner" text )
What type had a course of Grosseto To Rieti?
SELECT "Type" FROM table_68523 WHERE "Course" = 'grosseto to rieti'
CREATE TABLE table_name_25 ( season VARCHAR, league VARCHAR, european_competitions VARCHAR )
What is the Season when league shows bundesliga, and a European competition of played korac cup?
SELECT season FROM table_name_25 WHERE league = "bundesliga" AND european_competitions = "played korac cup"
CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemicsystolic number, systemicdiastolic number, systemicmean number, observationtime time ) CREATE TABLE allergy ( allergy...
when's the first time patient 022-44805 had the maximum chloride in 12/this year?
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 = '022-44805')) AND lab.labname = 'chloride' AND DATETIME(lab.labresulttime, 'start of...
CREATE TABLE table_name_30 ( points VARCHAR, home VARCHAR, date VARCHAR )
What points have pittsburgh as the home, and November 29 as the date?
SELECT points FROM table_name_30 WHERE home = "pittsburgh" AND date = "november 29"
CREATE TABLE table_204_449 ( id number, "no" number, "episode" text, "title" text, "original airdate" text, "viewers" number, "nightly\nrank" number )
which episode had at least 1.0 viewers ?
SELECT "title" FROM table_204_449 WHERE "viewers" >= 1.0
CREATE TABLE table_51405 ( "Name" text, "Current version" text, "System" text, "Platform" text, "License" text )
what is the current version of the name mupen64plus with gpl v2 license?
SELECT "Current version" FROM table_51405 WHERE "License" = 'gpl v2' AND "Name" = 'mupen64plus'
CREATE TABLE Order_Items ( item_id INTEGER, order_item_status_code VARCHAR(15), order_id INTEGER, product_id INTEGER, item_status_code VARCHAR(15), item_delivered_datetime DATETIME, item_order_quantity VARCHAR(80) ) CREATE TABLE Premises ( premise_id INTEGER, premises_type VARCHAR(1...
Show each premise type and the number of premises in that type Visualize by bar chart, and show by the Y in ascending please.
SELECT premises_type, COUNT(*) FROM Premises GROUP BY premises_type ORDER BY COUNT(*)
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_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) ...
this month when was patient 11826 prescribed the first propofol?
SELECT prescriptions.startdate FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 11826) AND prescriptions.drug = 'propofol' AND DATETIME(prescriptions.startdate, 'start of month') = DATETIME(CURRENT_TIME(), 'start of month', '-0 month') ORDER BY p...
CREATE TABLE aircraft ( aid number(9,0), name varchar2(30), distance number(6,0) ) CREATE TABLE flight ( flno number(4,0), origin varchar2(20), destination varchar2(20), distance number(6,0), departure_date date, arrival_date date, price number(7,2), aid number(9,0) ) CREAT...
Draw a bar chart of destination versus the total number, sort Y in asc order.
SELECT destination, COUNT(*) FROM flight GROUP BY destination ORDER BY COUNT(*)
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 ) C...
count the number of patients whose diagnosis short title is follicular cyst of ovary and drug route is buccal.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.short_title = "Follicular cyst of ovary" AND prescriptions.route = "BUCCAL"
CREATE TABLE checking ( custid number, balance number ) CREATE TABLE savings ( custid number, balance number ) CREATE TABLE accounts ( custid number, name text )
Find the checking balance of the accounts whose savings balance is higher than the average savings balance.
SELECT T2.balance FROM accounts AS T1 JOIN checking AS T2 ON T1.custid = T2.custid WHERE T1.name IN (SELECT T1.name FROM accounts AS T1 JOIN savings AS T2 ON T1.custid = T2.custid WHERE T2.balance > (SELECT AVG(balance) FROM savings))
CREATE TABLE table_name_85 ( tyre VARCHAR, chassis VARCHAR )
What tyre has a chassis of p57 p61?
SELECT tyre FROM table_name_85 WHERE chassis = "p57 p61"
CREATE TABLE table_72336 ( "Colt model no." text, "Name" text, "Stock" text, "Fire control" text, "Rear sight" text, "Forward assist" text, "Case deflector" text, "Barrel length" text, "Barrel profile" text, "Barrel twist" text, "Hand guards" text, "Bayonet Lug" text, ...
What are the Colt model numbers of the models named GAU-5A/A, with no bayonet lug, no case deflector and stock of 2nd generation?
SELECT "Colt model no." FROM table_72336 WHERE "Bayonet Lug" = 'No' AND "Stock" = '2nd Generation' AND "Case deflector" = 'No' AND "Name" = 'GAU-5A/A'