answer
stringlengths
6
3.91k
question
stringlengths
7
766
context
stringlengths
27
7.14k
SELECT Lname FROM FACULTY WHERE Building = "Barton" ORDER BY Lname
Find the last names of faculties in building Barton in alphabetic order.
CREATE TABLE FACULTY (Lname VARCHAR, Building VARCHAR)
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 = 13897)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'admi...
what was patient 13897's daily average value of body weight until 07/2104?
CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, value...
SELECT location_attendance FROM table_17001658_8 WHERE game = 55
Name the location attendance for game 55
CREATE TABLE table_17001658_8 (location_attendance VARCHAR, game VARCHAR)
SELECT Fname FROM FACULTY WHERE Rank = "Professor" ORDER BY Fname
Find the first names of faculties of rank Professor in alphabetic order.
CREATE TABLE FACULTY (Fname VARCHAR, Rank VARCHAR)
SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE NOT patient.hospitaldischargetime IS NULL AND STRFTIME('%y', patient.hospitaldischargetime) = '2101'
what's the number of patients who left the hospital in 2101?
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE medication ( medicatio...
SELECT high_rebounds FROM table_17001658_7 WHERE game = 46
Who got the game high rebounds in game 46?
CREATE TABLE table_17001658_7 (high_rebounds VARCHAR, game VARCHAR)
SELECT T1.DName FROM DEPARTMENT AS T1 JOIN MINOR_IN AS T2 ON T1.DNO = T2.DNO GROUP BY T2.DNO ORDER BY COUNT(*) DESC LIMIT 1
Find the name of the department that has the biggest number of students minored in?
CREATE TABLE DEPARTMENT (DName VARCHAR, DNO VARCHAR); CREATE TABLE MINOR_IN (DNO VARCHAR)
SELECT P.Id AS "post_link", P.Tags, P.CreationDate FROM Posts AS P WHERE P.AnswerCount > 0 AND P.Tags LIKE '%##Tag1##%' AND P.Tags LIKE '%##Tag2##%' ORDER BY P.CreationDate DESC LIMIT 50000
Search: Posts by specific two Tags.
CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, Dupli...
SELECT COUNT(score) FROM table_17001658_7 WHERE game = 37
How many scores are listed for game 37?
CREATE TABLE table_17001658_7 (score VARCHAR, game VARCHAR)
SELECT DName FROM DEPARTMENT EXCEPT SELECT T1.DName FROM DEPARTMENT AS T1 JOIN MINOR_IN AS T2 ON T1.DNO = T2.DNO
Find the name of the department that has no students minored in?
CREATE TABLE DEPARTMENT (DName VARCHAR, DNO VARCHAR); CREATE TABLE MINOR_IN (DNO VARCHAR); CREATE TABLE DEPARTMENT (DName VARCHAR)
SELECT Nationality, COUNT(*) FROM journalist GROUP BY Nationality ORDER BY COUNT(*)
Plot the total number by grouped by nationality as a bar graph, I want to list by the Y in ascending.
CREATE TABLE journalist ( journalist_ID int, Name text, Nationality text, Age text, Years_working int ) CREATE TABLE news_report ( journalist_ID int, Event_ID int, Work_Type text ) CREATE TABLE event ( Event_ID int, Date text, Venue text, Name text, Event_Attendance...
SELECT date FROM table_17001658_7 WHERE team = "Milwaukee"
What date was the opposing team Milwaukee?
CREATE TABLE table_17001658_7 (date VARCHAR, team VARCHAR)
SELECT T1.DName FROM DEPARTMENT AS T1 JOIN MEMBER_OF AS T2 ON T1.DNO = T2.DNO GROUP BY T2.DNO ORDER BY COUNT(*) LIMIT 1
Find the name of the department that has the fewest members.
CREATE TABLE MEMBER_OF (DNO VARCHAR); CREATE TABLE DEPARTMENT (DName VARCHAR, DNO VARCHAR)
SELECT "Avg. Finish" FROM table_24649 WHERE "Winnings" = '$71,200'
What is the average finish when winnings equals $71,200?
CREATE TABLE table_24649 ( "Year" real, "Starts" real, "Wins" real, "Top 5" real, "Top 10" real, "Poles" real, "Avg. Start" text, "Avg. Finish" text, "Winnings" text, "Position" text, "Team(s)" text )
SELECT pressure_in_hpa__mbar_ FROM table_170097_1 WHERE vacuum_range = "Ultra high vacuum"
What is the pressure in ultra high vacuum?
CREATE TABLE table_170097_1 (pressure_in_hpa__mbar_ VARCHAR, vacuum_range VARCHAR)
SELECT Rank FROM FACULTY GROUP BY Rank ORDER BY COUNT(*) LIMIT 1
Find the rank of the faculty that the fewest faculties belong to.
CREATE TABLE FACULTY (Rank VARCHAR)
SELECT wsu_year_s_ FROM table_name_88 WHERE pro_year_s_ = "1974-77"
What is WSU Year(s), when Pro Year(s) is 1974-77?
CREATE TABLE table_name_88 ( wsu_year_s_ VARCHAR, pro_year_s_ VARCHAR )
SELECT COUNT(nightly_rank) FROM table_17004367_3 WHERE episode_number_production_number = "06 1-06"
what is the nightly rank where the episode number production number is 06 1-06?
CREATE TABLE table_17004367_3 (nightly_rank VARCHAR, episode_number_production_number VARCHAR)
SELECT T2.Fname, T2.Lname FROM COURSE AS T1 JOIN FACULTY AS T2 ON T1.Instructor = T2.FacID GROUP BY T1.Instructor ORDER BY COUNT(*) DESC LIMIT 3
What are the first and last names of the instructors who teach the top 3 number of courses?
CREATE TABLE COURSE (Instructor VARCHAR); CREATE TABLE FACULTY (Fname VARCHAR, Lname VARCHAR, FacID VARCHAR)
SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS Position, DisplayName, Reputation, WebsiteUrl, Location, WebsiteUrl, AboutMe, 'http://stackoverflow.com/users/' + CAST(Id AS TEXT(10)) AS ProfileUrl FROM Users WHERE UPPER(Location) LIKE '%NETHERLANDS%' OR UPPER(Location) LIKE '%NEDERLAND%' OR UPPER(Location) LIKE ...
Top 2000 Stack Overflow Users From Netherlands By Reputation. Top 2000 SO users from Netherlands or Netherlands based cities.
CREATE TABLE TagSynonyms ( Id number, SourceTagName text, TargetTagName text, CreationDate time, OwnerUserId number, AutoRenameCount number, LastAutoRename time, Score number, ApprovedByUserId number, ApprovalDate time ) CREATE TABLE ReviewTaskResults ( Id number, Review...
SELECT COUNT(weekly_rank) FROM table_17004367_3 WHERE total = 1980000
what is the number of weekly rank where the total is 1980000?
CREATE TABLE table_17004367_3 (weekly_rank VARCHAR, total VARCHAR)
SELECT T2.Building FROM COURSE AS T1 JOIN FACULTY AS T2 ON T1.Instructor = T2.FacID GROUP BY T1.Instructor ORDER BY COUNT(*) DESC LIMIT 1
Which building does the instructor who teaches the most number of courses live in?
CREATE TABLE COURSE (Instructor VARCHAR); CREATE TABLE FACULTY (Building VARCHAR, FacID VARCHAR)
SELECT transaction_type, COUNT(*) FROM Financial_Transactions GROUP BY transaction_type ORDER BY transaction_type DESC
Show the transaction type and the number of transactions by a bar chart, and show in descending by the transaction_type.
CREATE TABLE Customers_Cards ( card_id INTEGER, customer_id INTEGER, card_type_code VARCHAR(15), card_number VARCHAR(80), date_valid_from DATETIME, date_valid_to DATETIME, other_card_details VARCHAR(255) ) CREATE TABLE Customers ( customer_id INTEGER, customer_first_name VARCHAR(20)...
SELECT high_assists FROM table_17001658_9 WHERE game = 70
Name the high assists for 70 game
CREATE TABLE table_17001658_9 (high_assists VARCHAR, game VARCHAR)
SELECT T1.CName FROM COURSE AS T1 JOIN ENROLLED_IN AS T2 ON T1.CID = T2.CID GROUP BY T2.CID HAVING COUNT(*) >= 5
What are the name of courses that have at least five enrollments?
CREATE TABLE ENROLLED_IN (CID VARCHAR); CREATE TABLE COURSE (CName VARCHAR, CID VARCHAR)
SELECT "loser" FROM table_204_373 WHERE id = 1
who is the first loser listed on this chart ?
CREATE TABLE table_204_373 ( id number, "wager" text, "winner" text, "loser" text, "location" text, "date" text )
SELECT pe̍h_ōe_jī FROM table_17015_2 WHERE chinese = "前金區"
Name the pe̍h-ōe-jī for 前金區
CREATE TABLE table_17015_2 (pe̍h_ōe_jī VARCHAR, chinese VARCHAR)
SELECT T2.Fname, T2.Lname FROM COURSE AS T1 JOIN FACULTY AS T2 ON T1.Instructor = T2.FacID WHERE T1.CName = "COMPUTER LITERACY"
Find the first name and last name of the instructor of course that has course name
CREATE TABLE FACULTY (Fname VARCHAR, Lname VARCHAR, FacID VARCHAR); CREATE TABLE COURSE (Instructor VARCHAR, CName VARCHAR)
SELECT ratt FROM table_name_97 WHERE long = "78"
What is the Ratt of the year with a 78 long?
CREATE TABLE table_name_97 ( ratt VARCHAR, long VARCHAR )
SELECT no FROM table_17015_2 WHERE population__2010_ = 171906
Name the number where population 2010 is 171906
CREATE TABLE table_17015_2 (no VARCHAR, population__2010_ VARCHAR)
SELECT T2.Dname, T2.Room FROM COURSE AS T1 JOIN DEPARTMENT AS T2 ON T1.DNO = T2.DNO WHERE T1.CName = "INTRODUCTION TO COMPUTER SCIENCE"
Find the department name and room of the course INTRODUCTION TO COMPUTER SCIENCE.
CREATE TABLE COURSE (DNO VARCHAR, CName VARCHAR); CREATE TABLE DEPARTMENT (Dname VARCHAR, Room VARCHAR, DNO VARCHAR)
SELECT Rank, COUNT(*) FROM Faculty AS T1 JOIN Student AS T2 ON T1.FacID = T2.Advisor GROUP BY T1.Rank ORDER BY Rank
How many students are advised by each rank of faculty? List the rank and the number of students Plot them as bar chart, I want to display from low to high by the Rank please.
CREATE TABLE Student ( StuID INTEGER, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3) ) CREATE TABLE Activity ( actid INTEGER, activity_name varchar(25) ) CREATE TABLE Faculty_Participates_in ( FacID IN...
SELECT tongyong FROM table_17015_2 WHERE chinese = "湖內區"
Name the tongyong for chinese of 湖內區
CREATE TABLE table_17015_2 (tongyong VARCHAR, chinese VARCHAR)
SELECT T3.Fname, T3.LName, T2.gradepoint FROM ENROLLED_IN AS T1 JOIN GRADECONVERSION AS T2 JOIN STUDENT AS T3 ON T1.Grade = T2.lettergrade AND T1.StuID = T3.StuID
Find the student first and last names and grade points of all enrollments.
CREATE TABLE ENROLLED_IN (Grade VARCHAR, StuID VARCHAR); CREATE TABLE STUDENT (Fname VARCHAR, LName VARCHAR, StuID VARCHAR); CREATE TABLE GRADECONVERSION (gradepoint VARCHAR, lettergrade VARCHAR)
SELECT architect FROM table_name_43 WHERE built < 1915 AND building = "electric railway chambers"
Who was the architect that built the Electric Railway Chambers before 1915?
CREATE TABLE table_name_43 ( architect VARCHAR, built VARCHAR, building VARCHAR )
SELECT COUNT(tongyong) FROM table_17015_2 WHERE hanyu = "Qiaotou"
Name the tongyong for qiaotou
CREATE TABLE table_17015_2 (tongyong VARCHAR, hanyu VARCHAR)
SELECT DISTINCT T3.Fname FROM ENROLLED_IN AS T1 JOIN GRADECONVERSION AS T2 JOIN STUDENT AS T3 ON T1.Grade = T2.lettergrade AND T1.StuID = T3.StuID WHERE T2.gradepoint >= 3.8
Find the distinct student first names of all students that have grade point at least 3.8 in one course.
CREATE TABLE ENROLLED_IN (Grade VARCHAR, StuID VARCHAR); CREATE TABLE STUDENT (Fname VARCHAR, StuID VARCHAR); CREATE TABLE GRADECONVERSION (gradepoint VARCHAR, lettergrade VARCHAR)
SELECT player FROM table_name_2 WHERE position = "f"
What players have a position of F?
CREATE TABLE table_name_2 ( player VARCHAR, position VARCHAR )
SELECT pixels FROM table_1701371_2 WHERE hardware_colours = 8
How many pixels would be found in a hardware colour of 8?
CREATE TABLE table_1701371_2 (pixels VARCHAR, hardware_colours VARCHAR)
SELECT T1.Fname, T1.Lname FROM FACULTY AS T1 JOIN MEMBER_OF AS T2 ON T1.FacID = T2.FacID WHERE T2.DNO = 520
Find the full names of faculties who are members of department with department number 520.
CREATE TABLE FACULTY (Fname VARCHAR, Lname VARCHAR, FacID VARCHAR); CREATE TABLE MEMBER_OF (FacID VARCHAR, DNO VARCHAR)
SELECT P.Id AS "post_link", P.Tags FROM Posts AS P, PostTags AS Pt, Tags AS T WHERE P.Id = Pt.PostId AND T.Id = Pt.TagId AND T.TagName = '##tag1##' AND P.PostTypeId = 1 AND P.AnswerCount > 0 AND NOT P.AcceptedAnswerId IS NULL AND NOT (SELECT P2.Id FROM Posts AS P2 WHERE P2.Id = P.AcceptedAnswerId AND P2.Body LIKE '%##t...
Find Questions with one tag and specific answer text.
CREATE TABLE TagSynonyms ( Id number, SourceTagName text, TargetTagName text, CreationDate time, OwnerUserId number, AutoRenameCount number, LastAutoRename time, Score number, ApprovedByUserId number, ApprovalDate time ) CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, ...
SELECT char_cells FROM table_1701371_2 WHERE hardware_colours = 8
If hardware colours is 8 what would the char cells be?
CREATE TABLE table_1701371_2 (char_cells VARCHAR, hardware_colours VARCHAR)
SELECT T2.Fname, T2.Lname FROM MINOR_IN AS T1 JOIN STUDENT AS T2 ON T1.StuID = T2.StuID WHERE T1.DNO = 140
What are the first names and last names of the students that minor in the department with DNO 140.
CREATE TABLE STUDENT (Fname VARCHAR, Lname VARCHAR, StuID VARCHAR); CREATE TABLE MINOR_IN (StuID VARCHAR, DNO VARCHAR)
SELECT "Away team" FROM table_59909 WHERE "Home team" = 'newton heath'
Who was the away team against Newton Heath?
CREATE TABLE table_59909 ( "Tie no" text, "Home team" text, "Score" text, "Away team" text, "Date" text )
SELECT year__ceremony_ FROM table_17025328_1 WHERE original_title = "Le Confessional"
Name the year for le confessional
CREATE TABLE table_17025328_1 (year__ceremony_ VARCHAR, original_title VARCHAR)
SELECT T2.Lname FROM DEPARTMENT AS T1 JOIN FACULTY AS T2 ON T1.DNO = T3.DNO JOIN MEMBER_OF AS T3 ON T2.FacID = T3.FacID WHERE T1.DName = "Computer Science"
Find the last names of faculties who are members of computer science department.
CREATE TABLE DEPARTMENT (DNO VARCHAR, DName VARCHAR); CREATE TABLE MEMBER_OF (DNO VARCHAR, FacID VARCHAR); CREATE TABLE FACULTY (Lname VARCHAR, FacID VARCHAR)
SELECT SUM("Date") FROM table_56197 WHERE "Score" = '3–6, 6–4, 3–6, 6–1, 6–2'
On what Date was the Score of 3 6, 6 4, 3 6, 6 1, 6 2
CREATE TABLE table_56197 ( "Outcome" text, "Date" real, "Championship" text, "Surface" text, "Opponent" text, "Score" text )
SELECT year__ceremony_ FROM table_17025328_1 WHERE original_title = "Les portes tournantes"
Name the year for les portes tournantes
CREATE TABLE table_17025328_1 (year__ceremony_ VARCHAR, original_title VARCHAR)
SELECT AVG(T2.gradepoint) FROM ENROLLED_IN AS T1 JOIN GRADECONVERSION AS T2 JOIN STUDENT AS T3 ON T1.Grade = T2.lettergrade AND T1.StuID = T3.StuID WHERE T3.LName = "Smith"
Find the average grade point of student whose last name is Smith.
CREATE TABLE ENROLLED_IN (Grade VARCHAR, StuID VARCHAR); CREATE TABLE STUDENT (LName VARCHAR, StuID VARCHAR); CREATE TABLE GRADECONVERSION (gradepoint INTEGER, lettergrade VARCHAR)
SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', patient.unitadmittime)) FROM patient WHERE patient.uniquepid = '013-38992' AND patient.wardid = 561 AND patient.hospitaldischargetime IS NULL ORDER BY patient.unitadmittime LIMIT 1
what's the number of hours that have passed since patient 013-38992 first stayed in ward 561 during this hospital visit?
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime t...
SELECT MAX(w) FROM table_17012578_37 WHERE l = 5
Of the teams that lost 5 games, what is the highest number of wins?
CREATE TABLE table_17012578_37 (w INTEGER, l VARCHAR)
SELECT MAX(T2.gradepoint), MIN(T2.gradepoint) FROM ENROLLED_IN AS T1 JOIN GRADECONVERSION AS T2 JOIN STUDENT AS T3 ON T1.Grade = T2.lettergrade AND T1.StuID = T3.StuID WHERE T3.city_code = "NYC"
What is the maximum and minimum grade point of students who live in NYC?
CREATE TABLE ENROLLED_IN (Grade VARCHAR, StuID VARCHAR); CREATE TABLE STUDENT (city_code VARCHAR, StuID VARCHAR); CREATE TABLE GRADECONVERSION (gradepoint INTEGER, lettergrade VARCHAR)
SELECT "Athlete" FROM table_79341 WHERE "Result" = '18.55'
Which athlete, has an 18.55 result
CREATE TABLE table_79341 ( "Rank" real, "Group" text, "Athlete" text, "Nationality" text, "Result" real )
SELECT MAX(Ends) AS lost FROM table_17012578_37
What is the highest number of ends lost?
CREATE TABLE table_17012578_37 (Ends INTEGER)
SELECT CName FROM COURSE WHERE Credits = 3 UNION SELECT CName FROM COURSE WHERE Credits = 1 AND Hours = 4
Find the names of courses that have either 3 credits or 1 credit but 4 hours.
CREATE TABLE COURSE (CName VARCHAR, Credits VARCHAR, Hours VARCHAR)
SELECT "Position" FROM table_71693 WHERE "Vehicle" = 'bmw' AND "Year" = '2006'
What position did the BMW vehicle made in 2006 hold?
CREATE TABLE table_71693 ( "Year" real, "Class" text, "Vehicle" text, "Position" text, "Stages won" text )
SELECT COUNT(Ends) AS won FROM table_17012578_37 WHERE pa = 39
How many values are in the ends won cell corresponding to a PA of 39?
CREATE TABLE table_17012578_37 (Ends VARCHAR, pa VARCHAR)
SELECT DName FROM DEPARTMENT WHERE Division = "AS" UNION SELECT DName FROM DEPARTMENT WHERE Division = "EN" AND Building = "NEB"
Find the names of departments that are either in division AS or in division EN and in Building NEB.
CREATE TABLE DEPARTMENT (DName VARCHAR, Division VARCHAR, Building VARCHAR)
SELECT personal_name, author_id FROM Course_Authors_and_Tutors ORDER BY personal_name
Return a bar chart about the distribution of personal_name and author_id .
CREATE TABLE Students ( student_id INTEGER, date_of_registration DATETIME, date_of_latest_logon DATETIME, login_name VARCHAR(40), password VARCHAR(10), personal_name VARCHAR(40), middle_name VARCHAR(40), family_name VARCHAR(40) ) CREATE TABLE Courses ( course_id INTEGER, author_...
SELECT skip FROM table_17012578_6 WHERE shot_pct = 88 AND province = "Alberta"
Who was Alberta's skip when the shot pct was 88?
CREATE TABLE table_17012578_6 (skip VARCHAR, shot_pct VARCHAR, province VARCHAR)
SELECT Fname FROM STUDENT WHERE NOT StuID IN (SELECT StuID FROM ENROLLED_IN)
Find the first name of students not enrolled in any course.
CREATE TABLE STUDENT (Fname VARCHAR, StuID VARCHAR); CREATE TABLE ENROLLED_IN (Fname VARCHAR, StuID VARCHAR)
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 ((((flight.departure_time BETWEEN 1800 AND 2200) OR (NOT flight.departure_time BETWEEN 601 AND 1759)) AND date_day.day_number = 20 AND date_day.m...
what are the flights from DALLAS to BOSTON for tomorrow night or evening
CREATE TABLE month ( month_number int, month_name text ) CREATE TABLE flight_leg ( flight_id int, leg_number int, leg_flight int ) CREATE TABLE fare ( fare_id int, from_airport varchar, to_airport varchar, fare_basis_code text, fare_airline text, restriction_code text, ...
SELECT MAX(pa) FROM table_17012578_6
What is the top Points Allowed?
CREATE TABLE table_17012578_6 (pa INTEGER)
SELECT product_id FROM product_suppliers ORDER BY total_amount_purchased DESC LIMIT 3
What are the ids of the top three products that were purchased in the largest amount?
CREATE TABLE product_suppliers (product_id VARCHAR, total_amount_purchased VARCHAR)
SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE DATETIME(patient.hospitaladmittime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year')
find the number of patients who were admitted to the hospital in the last year.
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) ...
SELECT COUNT(pa) FROM table_17012578_6 WHERE blank_ends = 1
When the blank ends at 1, what is the PA?
CREATE TABLE table_17012578_6 (pa VARCHAR, blank_ends VARCHAR)
SELECT product_id, product_type_code FROM products ORDER BY product_price LIMIT 1
What are the product id and product type of the cheapest product?
CREATE TABLE products (product_id VARCHAR, product_type_code VARCHAR, product_price VARCHAR)
SELECT T2.Name, T1.Price FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name ORDER BY T1.Price
For those records from the products and each product's manufacturer, a bar chart shows the distribution of name and the sum of price , and group by attribute name, and rank by the y axis from low to high.
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 COUNT(record) FROM table_17058116_6 WHERE team = "Charlotte"
How many times did the team play charlotte?
CREATE TABLE table_17058116_6 (record VARCHAR, team VARCHAR)
SELECT COUNT(DISTINCT product_type_code) FROM products
Find the number of different product types.
CREATE TABLE products (product_type_code VARCHAR)
SELECT COUNT(new_council) FROM table_name_82 WHERE previous_council = 54 AND staying_councillors > 36
What is the full number of New Council when the previous council was 54 and the staying councilor number is bigger than 36?
CREATE TABLE table_name_82 ( new_council VARCHAR, previous_council VARCHAR, staying_councillors VARCHAR )
SELECT date FROM table_17058116_6 WHERE team = "Charlotte"
What day did the team play charlotte?
CREATE TABLE table_17058116_6 (date VARCHAR, team VARCHAR)
SELECT T1.address_details FROM addresses AS T1 JOIN customer_addresses AS T2 ON T1.address_id = T2.address_id WHERE T2.customer_id = 10
Return the address of customer 10.
CREATE TABLE customer_addresses (address_id VARCHAR, customer_id VARCHAR); CREATE TABLE addresses (address_details VARCHAR, address_id VARCHAR)
SELECT date FROM table_name_35 WHERE attendance = "71,789"
On what date was the crowd size of 71,789?
CREATE TABLE table_name_35 ( date VARCHAR, attendance VARCHAR )
SELECT date FROM table_17058116_7 WHERE score = "L 99–107 (OT)"
When was the game with score l 99–107 (ot)
CREATE TABLE table_17058116_7 (date VARCHAR, score VARCHAR)
SELECT T1.staff_id, T1.staff_gender FROM staff AS T1 JOIN staff_department_assignments AS T2 ON T1.staff_id = T2.staff_id WHERE T2.job_title_code = "Department Manager"
What are the staff ids and genders of all staffs whose job title is Department Manager?
CREATE TABLE staff_department_assignments (staff_id VARCHAR, job_title_code VARCHAR); CREATE TABLE staff (staff_id VARCHAR, staff_gender VARCHAR)
SELECT date FROM table_16388439_3 WHERE home_team = "Adelaide" AND ground = "Westpac Stadium"
Name the date for adelaide for westpac stadium
CREATE TABLE table_16388439_3 ( date VARCHAR, home_team VARCHAR, ground VARCHAR )
SELECT location_attendance FROM table_17058116_7 WHERE record = "20–23"
Where was the game with record 20–23 and how many people attended it
CREATE TABLE table_17058116_7 (location_attendance VARCHAR, record VARCHAR)
SELECT payment_method_code, COUNT(*) FROM customers GROUP BY payment_method_code
For each payment method, return how many customers use it.
CREATE TABLE customers (payment_method_code VARCHAR)
SELECT COUNT("Total") FROM table_974 WHERE "Quarter" = '2012 Q1'
How many total smartphones were shipped during the quarter 2012 Q1?
CREATE TABLE table_974 ( "Quarter" text, "Android" text, "iOS" text, "Symbian" text, "BlackBerry OS" text, "Linux" text, "Windows Phone" text, "Other" text, "Total" text )
SELECT high_rebounds FROM table_17058116_7 WHERE high_points = "Charlie Villanueva (32)"
Who scored highest rebounds high points is charlie villanueva (32)
CREATE TABLE table_17058116_7 (high_rebounds VARCHAR, high_points VARCHAR)
SELECT product_id FROM order_items GROUP BY product_id ORDER BY COUNT(*) DESC LIMIT 1
What is the id of the product that was ordered the most often?
CREATE TABLE order_items (product_id VARCHAR)
SELECT release_date FROM table_20174050_1 WHERE target__number = "069 69"
When was the audio book with target number 069 69 released?
CREATE TABLE table_20174050_1 ( release_date VARCHAR, target__number VARCHAR )
SELECT score FROM table_17058116_7 WHERE game = 46
What is the score of game 46
CREATE TABLE table_17058116_7 (score VARCHAR, game VARCHAR)
SELECT T1.customer_name, T1.customer_phone, T1.customer_email FROM customers AS T1 JOIN customer_orders AS T2 ON T1.customer_id = T2.customer_id GROUP BY T2.customer_id ORDER BY COUNT(*) DESC LIMIT 1
What are the name, phone number and email address of the customer who made the largest number of orders?
CREATE TABLE customers (customer_name VARCHAR, customer_phone VARCHAR, customer_email VARCHAR, customer_id VARCHAR); CREATE TABLE customer_orders (customer_id VARCHAR)
SELECT "title" FROM table_204_643 WHERE "release" > (SELECT "release" FROM table_204_643 WHERE "title" = 'utabito (歌人 singer?)') ORDER BY "release" LIMIT 1
what song was this artist on after utabito ?
CREATE TABLE table_204_643 ( id number, "release" number, "artist" text, "title" text, "notes" text, "album" text )
SELECT high_points FROM table_17058116_5 WHERE date = "November 2"
Who scored the high points on the date November 2?
CREATE TABLE table_17058116_5 (high_points VARCHAR, date VARCHAR)
SELECT product_type_code, AVG(product_price) FROM products GROUP BY product_type_code
What is the average price for each type of product?
CREATE TABLE products (product_type_code VARCHAR, product_price INTEGER)
SELECT "nation" FROM table_204_771 WHERE "gold" >= 2
name the nations that won at least 2 gold medals .
CREATE TABLE table_204_771 ( id number, "rank" number, "nation" text, "gold" number, "silver" number, "bronze" number, "total" number )
SELECT COUNT(location_attendance) FROM table_17058116_5 WHERE game = 13
In how many locations did Game 13 take place?
CREATE TABLE table_17058116_5 (location_attendance VARCHAR, game VARCHAR)
SELECT COUNT(*) FROM department_stores AS T1 JOIN department_store_chain AS T2 ON T1.dept_store_chain_id = T2.dept_store_chain_id WHERE T2.dept_store_chain_name = "South"
How many department stores does the store chain South have?
CREATE TABLE department_stores (dept_store_chain_id VARCHAR); CREATE TABLE department_store_chain (dept_store_chain_id VARCHAR, dept_store_chain_name VARCHAR)
SELECT "Score" FROM table_7871 WHERE "Visitor" = 'montreal canadiens' AND "Date" = 'february 18'
What's the score on february 18 when the visitors are the montreal canadiens?
CREATE TABLE table_7871 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Record" text )
SELECT location_attendance FROM table_17058116_5 WHERE date = "November 21"
Where was the game that took place in November 21 located and how many attended?
CREATE TABLE table_17058116_5 (location_attendance VARCHAR, date VARCHAR)
SELECT T1.staff_name, T2.job_title_code FROM staff AS T1 JOIN staff_department_assignments AS T2 ON T1.staff_id = T2.staff_id ORDER BY T2.date_assigned_to DESC LIMIT 1
What is the name and job title of the staff who was assigned the latest?
CREATE TABLE staff (staff_name VARCHAR, staff_id VARCHAR); CREATE TABLE staff_department_assignments (job_title_code VARCHAR, staff_id VARCHAR, date_assigned_to VARCHAR)
SELECT Country_name, COUNT(*) FROM country AS T1 JOIN match_season AS T2 ON T1.Country_id = T2.Country GROUP BY T1.Country_name
How many players are from each country. Show a pie chart.
CREATE TABLE team ( Team_id int, Name text ) CREATE TABLE country ( Country_id int, Country_name text, Capital text, Official_native_language text ) CREATE TABLE player ( Player_ID int, Player text, Years_Played text, Total_WL text, Singles_WL text, Doubles_WL text, ...
SELECT high_rebounds FROM table_17058178_11 WHERE date = "April 7"
Name the high reobounds for april 7
CREATE TABLE table_17058178_11 (high_rebounds VARCHAR, date VARCHAR)
SELECT T2.product_type_code, T2.product_name, T2.product_price FROM product_suppliers AS T1 JOIN products AS T2 ON T1.product_id = T2.product_id WHERE T1.supplier_id = 3
Give me the product type, name and price for all the products supplied by supplier id 3.
CREATE TABLE products (product_type_code VARCHAR, product_name VARCHAR, product_price VARCHAR, product_id VARCHAR); CREATE TABLE product_suppliers (product_id VARCHAR, supplier_id VARCHAR)
SELECT "Score" FROM table_75469 WHERE "Loss" = 'chad fox (3–3)'
What was the score of the game that had a loss of Chad Fox (3 3)?
CREATE TABLE table_75469 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Save" text, "Attendance" real, "Record" text )
SELECT COUNT(record) FROM table_17058151_7 WHERE game = 43
How many games was game 43?
CREATE TABLE table_17058151_7 (record VARCHAR, game VARCHAR)
SELECT DISTINCT T1.customer_name FROM customers AS T1 JOIN customer_orders AS T2 ON T1.customer_id = T2.customer_id WHERE T2.order_status_code = "Pending" ORDER BY T2.customer_id
Return the distinct name of customers whose order status is Pending, in the order of customer id.
CREATE TABLE customers (customer_name VARCHAR, customer_id VARCHAR); CREATE TABLE customer_orders (customer_id VARCHAR, order_status_code VARCHAR)