niryuu/sni-each-converted huggingface dataset:
Step 1: For each row in party table, find the corresponding rows in election table.
Step 2: find the number of rows of each value of District in the results of step 1.
Step 3: find Attorney_General of step 1 results with largest value in the results of step 2
Output: SELECT T1.Attorney_General FROM party AS T1 JOIN election AS T2 ON T1.Party_ID = T2.Party GROUP BY T2.District ORDER BY Count ( * ) Desc LIMIT 1
Step 1: For each row in user_profiles table, find the corresponding rows in tweets table.
Step 2: find the number of rows of each value of tweets's uid in the results of step 1.
Step 3: find name, tweets's uid in the results of step 1 whose corresponding value in step 2 is greater than 2
Output: SELECT T2.name , T1.uid FROM tweets AS T1 JOIN user_profiles AS T2 ON T1.uid = T2.uid GROUP BY T1.uid HAVING Count ( * ) > 2
Step 1: For each row in management table, find corresponding rows in department table and in head table.
Step 2: find Name, born_state, Num_Employees of the results of step 1 ordered ascending by age
Output: SELECT T1.Name , T2.born_state , T1.Num_Employees FROM department AS T1 JOIN head AS T2 JOIN management AS T3 ON T1.Department_ID = T3.department_ID AND T3.head_ID = T2.head_ID ORDER BY T2.age Asc
Step 1: For each row in Prescribes table, find corresponding rows in Physician table and in Medication table.
Step 2: find Medication's Name, Physician's Name of the results of step 1
Output: SELECT T2.Name , T1.Name FROM Physician AS T1 JOIN Medication AS T2 JOIN Prescribes AS T3 ON T1.EmployeeID = T3.Physician AND T3.Medication = T2.Code
find the price, distance of flight table with largest value of price
Output: SELECT price , distance FROM flight ORDER BY price Desc LIMIT 1
Step 1: For each row in Physician table, find the corresponding rows in Prescribes table.
Step 2: find the number of rows of each value of Physician in the results of step 1.
Step 3: find SSN of step 1 results with smallest value in the results of step 2
Output: SELECT T1.SSN FROM Physician AS T1 JOIN Prescribes AS T2 ON T1.EmployeeID = T2.Physician GROUP BY T2.Physician ORDER BY Count ( * ) Asc LIMIT 1
find the average Silver and the average Gold in club_rank table
Output: SELECT Avg ( Silver ) , Avg ( Gold ) FROM club_rank
Step 1: find the number of rows of each value of supplier_name in Suppliers table.
Step 2: find supplier_name in Suppliers table whose corresponding value in step 1 is greater than or equals 2
Output: SELECT supplier_name FROM Suppliers GROUP BY supplier_name HAVING Count ( * ) > = 2
Step 1: find the mountain_id of photos table.
Step 2: find the number of rows in mountain table whose mountain's id not one of the results of step 1
Output: SELECT Count ( * ) FROM mountain AS T1 WHERE T1.id NOT IN ( SELECT T2.mountain_id FROM photos AS T2 )
find the number of rows in member table
Output: SELECT Count ( * ) FROM member
Step 1: find the number of rows of each value of Department_ID in department table.
Step 2: find rows of department table with largest value in the results of step 1
Output: SELECT * FROM department GROUP BY Department_ID ORDER BY Count ( * ) Desc LIMIT 1
Step 1: For each row in team table, find the corresponding rows in match_season table.
Step 2: find without repetition Season, Name, Name of the results of step 1
Output: SELECT DISTINCT T2.Season , T1.Name , T1.Name FROM team AS T1 JOIN match_season AS T2 ON T1.Team_id = T2.Team
find the aid, name of aircraft table
Output: SELECT aid , name FROM aircraft
Step 1: For each row in actor table, find the corresponding rows in film_actor table.
Step 2: find the number of rows of each value of film_actor's actor_id in the results of step 1.
Step 3: find first_name, last_name of step 1 results with largest value in the results of step 2
Output: SELECT T1.first_name , T1.last_name FROM actor AS T1 JOIN film_actor AS T2 ON T1.actor_id = T2.actor_id GROUP BY T2.actor_id ORDER BY Count ( * ) Desc LIMIT 1
Step 1: for each value of camera_lens_id in photos table, calculate number of rows.
Step 2: show each value of camera_lens_id in photos table along with the corresponding number of rows ordered ascending by the results of step 1
Output: SELECT name , Count ( * ) FROM photos GROUP BY camera_lens_id ORDER BY Count ( * ) Asc
Step 1: find the party's Party of party table for which Comptroller equals Appropriations.
Step 2: For each row in party table, find the corresponding rows in election table.
Step 3: find party's Party of the results of step 2 whose Committee equals Economic Matters.
Step 4: show the rows that are in both the results of step 1 and the results of step 3
Output: SELECT T1.Party FROM party AS T1 WHERE T1.Comptroller = "Appropriations" INTERSECT SELECT T1.Party FROM party AS T1 JOIN election AS T2 ON T1.Party_ID = T2.Party WHERE T2.Committee = "Economic Matters"
find catalog_entry_name of Catalog_Contents table whose length greater than 3 or length less than 5
Output: SELECT catalog_entry_name FROM Catalog_Contents WHERE length > 5 OR length < 3
Step 1: For each row in Physician table, find the corresponding rows in Patient table.
Step 2: find the number of rows in the results of step 1 whose Patient's Name equals John Dorian and Physician's Name equals John Dorian
Output: SELECT Count ( * ) FROM Physician AS T1 JOIN Patient AS T2 ON T1.EmployeeID = T2.PCP WHERE T2.Name = "John Dorian" AND T1.Name = "John Dorian"
find the maximum followers and the average followers in user_profiles table
Output: SELECT Max ( followers ) , Avg ( followers ) FROM user_profiles
Step 1: For each row in broadcast table, find corresponding rows in program table and in channel table.
Step 2: find channel's Name of the results of step 1 with largest value of Launch
Output: SELECT T2.Name FROM program AS T1 JOIN channel AS T2 JOIN broadcast AS T3 ON T1.Program_ID = T3.Program_ID AND T3.Channel_ID = T2.Channel_ID ORDER BY T1.Launch Desc LIMIT 1
find each value of Country_name in country table along with the number of the corresponding rows to each value
Output: SELECT Country_name , Count ( * ) FROM country GROUP BY Country_name
Step 1: For each row in county table, find the corresponding rows in election table.
Step 2: find Delegate of the results of step 1 whose Population greater than 100000
Output: SELECT T2.Delegate FROM county AS T1 JOIN election AS T2 ON T1.County_Id = T2.District WHERE T1.Population > 100000
find the name of photos table for which name contains Digital
Output: SELECT name FROM photos WHERE name LIKE "Digital"
find the height of Catalog_Contents table with smallest value of price_in_dollars
Output: SELECT height FROM Catalog_Contents ORDER BY price_in_dollars Asc LIMIT 1
Step 1: For each row in Physician table, find the corresponding rows in Appointment table.
Step 2: find the number of rows of each value of Physician in the results of step 1.
Step 3: find Name in the results of step 1 whose corresponding value in step 2 is greater than 1
Output: SELECT T1.Name FROM Physician AS T1 JOIN Appointment AS T2 ON T1.EmployeeID = T2.Physician GROUP BY T2.Physician HAVING Count ( * ) > 1
Step 1: For each row in Appointment table, find corresponding rows in Physician table and in Nurse table.
Step 2: find Physician's Name of the results of step 1 with largest value of Registered
Output: SELECT T1.Name FROM Physician AS T1 JOIN Nurse AS T2 JOIN Appointment AS T3 ON T1.EmployeeID = T3.Physician AND T3.PrepNurse = T2.EmployeeID ORDER BY T2.Registered Desc LIMIT 1
find Lieutenant_Governor of party table whose Party equals Democratic and Comptroller equals Carl McCall
Output: SELECT Lieutenant_Governor FROM party WHERE Party = "Democratic" AND Comptroller = "Carl McCall"
Step 1: For each row in Products table, find the corresponding rows in Product_Suppliers table.
Step 2: find the average product_price of each value of Product_Suppliers's product_id in the results of step 1.
Step 3: find Product_Suppliers's product_id in the results of step 1 whose corresponding value in step 2 is greater than 2
Output: SELECT T2.product_id FROM Products AS T1 JOIN Product_Suppliers AS T2 ON T1.product_id = T2.product_id GROUP BY T2.product_id HAVING Avg ( T1.product_price ) > 2
find the donator_name of endowment table for which amount less than 9
Output: SELECT donator_name FROM endowment WHERE amount < 9
Step 1: For each row in film table, find the corresponding rows in inventory table.
Step 2: for each value of inventory's film_id in the results of step 1, calculate number of rows.
Step 3: show each value of inventory's film_id in the results of step 1 along with the maximum rental_rate with largest value in the results of step 2
Output: SELECT T1.rating , Max ( T1.rental_rate ) FROM film AS T1 JOIN inventory AS T2 ON T1.film_id = T2.film_id GROUP BY T2.film_id ORDER BY Count ( * ) Desc LIMIT 1
Step 1: For each row in ship table, find the corresponding rows in mission table.
Step 2: find Code, Name of the results of step 1
Output: SELECT T1.Code , T2.Name FROM mission AS T1 JOIN ship AS T2 ON T1.Ship_ID = T2.Ship_ID
find the Governor of party table for which Party equals Democratic
Output: SELECT Governor FROM party WHERE Party = "Democratic"
find the average Sheep_and_Goats in farm table whose Total_Horses greater than 5000
Output: SELECT Avg ( Sheep_and_Goats ) FROM farm WHERE Total_Horses > 5000
find the district of address table for which address equals 1
Output: SELECT district FROM address WHERE address = 1
Step 1: for each value of Farm_ID in farm table, calculate summation of Total_Horses.
Step 2: show each value of Farm_ID in farm table along with the corresponding summation of Sheep_and_Goats ordered ascending by the results of step 1
Output: SELECT Pigs , Sum ( Sheep_and_Goats ) FROM farm GROUP BY Farm_ID ORDER BY Sum ( Total_Horses ) Asc
find the name, name of Country table
Output: SELECT name , name FROM Country
find the number of rows in payment table whose amount equals 1
Output: SELECT Count ( * ) FROM payment WHERE amount = 1
Step 1: For each row in team table, find corresponding rows in match_season table and in player table.
Step 2: find player's Player of the results of step 1 ordered ascending by Season
Output: SELECT T3.Player FROM team AS T1 JOIN match_season AS T2 ON T2.Team = T1.Team_id JOIN player AS T3 ON T1.Team_id = T3.Team ORDER BY T2.Season Asc
Step 1: find the number of rows of each value of County_name in county table.
Step 2: find County_name in county table whose corresponding value in step 1 is greater than or equals 2
Output: SELECT County_name FROM county GROUP BY County_name HAVING Count ( * ) > = 2
Step 1: find the number of rows of each value of date_of_publication in Catalogs table.
Step 2: find date_of_publication in Catalogs table whose corresponding value in step 1 is greater than 1
Output: SELECT date_of_publication FROM Catalogs GROUP BY date_of_publication HAVING Count ( * ) > 1
Step 1: For each row in Staff_Department_Assignments table, find corresponding rows in Staff table and in Departments table.
Step 2: find Staff's staff_id, staff_gender of the results of step 1 whose department_name equals Department Manager
Output: SELECT T1.staff_id , T1.staff_gender FROM Staff AS T1 JOIN Departments AS T2 JOIN Staff_Department_Assignments AS T3 ON T1.staff_id = T3.staff_id AND T3.department_id = T2.department_id WHERE T2.department_name = "Department Manager"
find the summation of Share_in_percent in channel table
Output: SELECT Sum ( Share_in_percent ) FROM channel
find without repetition the Committee of election table
Output: SELECT DISTINCT Committee FROM election
Step 1: find the number of rows of each value of name in aircraft table.
Step 2: find name of aircraft table with smallest value in the results of step 1
Output: SELECT name FROM aircraft GROUP BY name ORDER BY Count ( * ) Asc LIMIT 1
find the payment_date of payment table
Output: SELECT payment_date FROM payment
find the Reign of wrestler table for which Days_held greater than 50
Output: SELECT Reign FROM wrestler WHERE Days_held > 50
Step 1: For each row in department table, find the corresponding rows in management table.
Step 2: find without repetition Creation of the results of step 1 whose temporary_acting equals Alabama
Output: SELECT DISTINCT T1.Creation FROM department AS T1 JOIN management AS T2 ON T1.Department_ID = T2.department_ID WHERE T2.temporary_acting = "Alabama"
Step 1: find the number of rows of each value of name in photos table.
Step 2: find name of photos table with largest value in the results of step 1
Output: SELECT name FROM photos GROUP BY name ORDER BY Count ( * ) Desc LIMIT 1
find the name of language table for which name equals AIRPORT POLLOCK
Output: SELECT name FROM language WHERE name = "AIRPORT POLLOCK"
find the Physician of Trained_In table with largest value of CertificationDate
Output: SELECT Physician FROM Trained_In ORDER BY CertificationDate Desc LIMIT 1
find the number of rows in aircraft table whose distance greater than 2000
Output: SELECT Count ( * ) FROM aircraft WHERE distance > 2000
find the average overall_rating in Player_Attributes table
Output: SELECT Avg ( overall_rating ) FROM Player_Attributes
find the Draft_Pick_Number, Season of match_season table for which Position equals Defender
Output: SELECT Draft_Pick_Number , Season FROM match_season WHERE Position = "Defender"
Step 1: For each row in aircraft table, find the corresponding rows in flight table.
Step 2: find flno, origin, name of the results of step 1 ordered ascending by destination
Output: SELECT T1.flno , T1.origin , T2.name FROM flight AS T1 JOIN aircraft AS T2 ON T1.aid = T2.aid ORDER BY T1.destination Asc
Step 1: find the average product_price in Products table.
Step 2: For each row in Products table, find the corresponding rows in Product_Suppliers table.
Step 3: find Product_Suppliers's product_id in the results of step 2 whose product_price greater than the results of step 1
Output: SELECT T2.product_id FROM Products AS T1 JOIN Product_Suppliers AS T2 ON T1.product_id = T2.product_id WHERE T1.product_price > ( SELECT Avg ( T1.product_price ) FROM Products AS T1 )
Step 1: find the Player's id of Player table for which height greater than 180.
Step 2: For each row in Player table, find the corresponding rows in Player_Attributes table.
Step 3: find Player_Attributes's player_api_id of the results of step 2 whose height less than 85.
Step 4: show the rows that are in both the results of step 1 and the results of step 3
Output: SELECT T1.id FROM Player AS T1 WHERE T1.height > 180 INTERSECT SELECT T2.player_api_id FROM Player_Attributes AS T2 JOIN Player AS T1 ON T2.player_fifa_api_id = T1.player_fifa_api_id WHERE T1.height < 85
find the number of rows in Room table whose RoomType equals 112
Output: SELECT Count ( * ) FROM Room WHERE RoomType = 112
Step 1: For each row in Appointment table, find corresponding rows in Physician table and in Nurse table.
Step 2: find Physician's Name of the results of step 1 whose Nurse's Name equals Surgery or Nurse's Name equals Psychiatry
Output: SELECT T1.Name FROM Physician AS T1 JOIN Nurse AS T2 JOIN Appointment AS T3 ON T1.EmployeeID = T3.Physician AND T3.PrepNurse = T2.EmployeeID WHERE T2.Name = "Psychiatry" OR T2.Name = "Surgery"
find the Enrollment of School table for which Mascot equals Glenn
Output: SELECT Enrollment FROM School WHERE Mascot = "Glenn"
Step 1: For each row in management table, find corresponding rows in department table and in head table.
Step 2: find Name of the results of step 1 whose born_state not equals California
Output: SELECT T1.Name FROM department AS T1 JOIN head AS T2 JOIN management AS T3 ON T1.Department_ID = T3.department_ID AND T3.head_ID = T2.head_ID WHERE T2.born_state ! = "California"
Step 1: For each row in School table, find the corresponding rows in budget table.
Step 2: find School_name, total_budget_percent_budgeted, Year of the results of step 1 whose Year greater than 2002
Output: SELECT T1.School_name , T2.total_budget_percent_budgeted , T2.Year FROM School AS T1 JOIN budget AS T2 ON T1.School_id = T2.School_id WHERE T2.Year > 2002
find the average price_in_euros and the maximum price_in_pounds in Catalog_Contents table
Output: SELECT Avg ( price_in_euros ) , Max ( price_in_pounds ) FROM Catalog_Contents
find the Party of party table for which Comptroller equals 1
Output: SELECT Party FROM party WHERE Comptroller = 1
find the average Gold and the maximum Gold in club_rank table
Output: SELECT Avg ( Gold ) , Max ( Gold ) FROM club_rank
Step 1: find the number of rows of each value of customer_id in customer table.
Step 2: find first_name, last_name, customer_id in customer table whose corresponding value in step 1 is greater than or equals 1
Output: SELECT first_name , last_name , customer_id FROM customer GROUP BY customer_id HAVING Count ( * ) > = 1
Step 1: find the rows of Prescribes table for which Prescribes's Physician equals John Wen.
Step 2: For each row in Undergoes table, find corresponding rows in Procedures table and in Nurse table.
Step 3: find Nurse's Name of the results of step 2 whose Cost greater than 1000.
Step 4: show the rows that are in the results of step 1 but not in the results of step 3
Output: SELECT * FROM Prescribes AS T1 WHERE T1.Physician = "John Wen" EXCEPT SELECT T3.Name FROM Procedures AS T2 JOIN Nurse AS T3 JOIN Undergoes AS T4 ON T2.Code = T4.Procedures AND T4.AssistingNurse = T3.EmployeeID WHERE T2.Cost > 1000
find the Name, Event of wrestler table
Output: SELECT Name , Event FROM wrestler
find the maximum customer_phone and the minimum customer_phone in Customers table
Output: SELECT Max ( customer_phone ) , Min ( customer_phone ) FROM Customers
find the Name of channel table
Output: SELECT Name FROM channel
Step 1: find the number of rows of each value of birthday in Player table.
Step 2: find player_name, birthday of Player table ordered descending by the results of step 1.
Step 3: only show the first 5 rows of the results
Output: SELECT player_name , birthday FROM Player GROUP BY birthday ORDER BY Count ( * ) Desc LIMIT 5
find the player_name of Player table with largest value of height
Output: SELECT player_name FROM Player ORDER BY height Desc LIMIT 1
Step 1: For each row in Stay table, find corresponding rows in Patient table and in Room table.
Step 2: find Name of the results of step 1 whose BlockFloor equals 111
Output: SELECT T1.Name FROM Patient AS T1 JOIN Room AS T2 JOIN Stay AS T3 ON T1.SSN = T3.Patient AND T3.Room = T2.RoomNumber WHERE T2.BlockFloor = 111
find the number of rows in department table
Output: SELECT Count ( * ) FROM department
Step 1: find the first_name of customer table.
Step 2: For each row in customer table, find the corresponding rows in rental table.
Step 3: find first_name of the results of step 2 whose return_date greater than 2005-08-23 02:06:01.
Step 4: show the rows that are in the results of step 1 but not in the results of step 3
Output: SELECT T1.first_name FROM customer AS T1 EXCEPT SELECT T1.first_name FROM customer AS T1 JOIN rental AS T2 ON T1.customer_id = T2.customer_id WHERE T2.return_date > "2005-08-23 02:06:01"
Step 1: For each row in aircraft table, find the corresponding rows in flight table.
Step 2: find name of the results of step 1 ordered descending by price.
Step 3: only show the first 3 rows of the results
Output: SELECT T2.name FROM flight AS T1 JOIN aircraft AS T2 ON T1.aid = T2.aid ORDER BY T1.price Desc LIMIT 3
Step 1: For each row in Player table, find the corresponding rows in Player_Attributes table.
Step 2: find player_name of the results of step 1 whose overall_rating greater than 90
Output: SELECT T2.player_name FROM Player_Attributes AS T1 JOIN Player AS T2 ON T1.player_fifa_api_id = T2.player_fifa_api_id WHERE T1.overall_rating > 90
find without repetition the age of head table
Output: SELECT DISTINCT age FROM head
find without repetition the Year of party table for which Comptroller equals Eliot Spitzer
Output: SELECT DISTINCT Year FROM party WHERE Comptroller = "Eliot Spitzer"
find the staff_name, staff_gender of Staff table
Output: SELECT staff_name , staff_gender FROM Staff
find without repetition the product_name of Products table
Output: SELECT DISTINCT product_name FROM Products
find the number of different Program_ID in broadcast table
Output: SELECT Count ( DISTINCT Program_ID ) FROM broadcast
Step 1: find the name of aircraft table ordered descending by distance.
Step 2: only show the first 3 rows of the results
Output: SELECT name FROM aircraft ORDER BY distance Desc LIMIT 3
Step 1: find the journal_committee's Editor_ID of journal_committee table for which Journal_ID equals 13.
Step 2: find the Name of editor table whose editor's Editor_ID not one of the results of step 1
Output: SELECT T1.Name FROM editor AS T1 WHERE T1.Editor_ID NOT IN ( SELECT T2.Editor_ID FROM journal_committee AS T2 WHERE T2.Journal_ID = 13 )
find the customer_name, customer_id of Customers table for which customer_address equals TN
Output: SELECT customer_name , customer_id FROM Customers WHERE customer_address = "TN"
find the first_name, last_name of actor table for which last_update greater than 30
Output: SELECT first_name , last_name FROM actor WHERE last_update > 30
Step 1: For each row in film table, find the corresponding rows in film_actor table.
Step 2: find the number of rows of each value of film_actor's film_id in the results of step 1.
Step 3: find title, actor_id, description of step 1 results with largest value in the results of step 2
Output: SELECT T1.title , T2.actor_id , T1.description FROM film AS T1 JOIN film_actor AS T2 ON T1.film_id = T2.film_id GROUP BY T2.film_id ORDER BY Count ( * ) Desc LIMIT 1
find the Name of channel table for which Owner not equals Beijing
Output: SELECT Name FROM channel WHERE Owner ! = "Beijing"
find the Name of channel table ordered ascending by Name
Output: SELECT Name FROM channel ORDER BY Name Asc
find the number of rows in journal table
Output: SELECT Count ( * ) FROM journal
Step 1: For each row in Physician table, find the corresponding rows in Appointment table.
Step 2: find Name of the results of step 1 with largest value of End
Output: SELECT T1.Name FROM Physician AS T1 JOIN Appointment AS T2 ON T1.EmployeeID = T2.Physician ORDER BY T2.End Desc LIMIT 1
Step 1: For each row in Trained_In table, find corresponding rows in Physician table and in Procedures table.
Step 2: find Procedures's Name of the results of step 1 whose Physician's Name equals John Wen.
Step 3: find the Procedures's Name of Procedures table for which Cost greater than 1000.
Step 4: show the rows that are in the results of step 2 but not in the results of step 3
Output: SELECT T2.Name FROM Physician AS T1 JOIN Procedures AS T2 JOIN Trained_In AS T3 ON T1.EmployeeID = T3.Physician AND T3.Treatment = T2.Code WHERE T1.Name = "John Wen" EXCEPT SELECT T2.Name FROM Procedures AS T2 WHERE T2.Cost > 1000
find the catalog_entry_name, height of Catalog_Contents table for which price_in_pounds greater than 700
Output: SELECT catalog_entry_name , height FROM Catalog_Contents WHERE price_in_pounds > 700
Step 1: find the number of rows of each value of name in user_profiles table.
Step 2: find name in user_profiles table whose corresponding value in step 1 is greater than 1
Output: SELECT name FROM user_profiles GROUP BY name HAVING Count ( * ) > 1
Step 1: For each row in actor table, find the corresponding rows in film_actor table.
Step 2: find the number of rows of each value of film_actor's actor_id in the results of step 1.
Step 3: find first_name, film_actor's actor_id, film_actor's actor_id of step 1 results with largest value in the results of step 2
Output: SELECT T1.first_name , T2.actor_id , T2.actor_id FROM actor AS T1 JOIN film_actor AS T2 ON T1.actor_id = T2.actor_id GROUP BY T2.actor_id ORDER BY Count ( * ) Desc LIMIT 1
find without repetition the Name of Department table
Output: SELECT DISTINCT Name FROM Department
Step 1: For each row in mountain table, find the corresponding rows in photos table.
Step 2: find the number of different color in the results of step 1 whose Country equals Ethiopia
Output: SELECT Count ( DISTINCT T2.color ) FROM mountain AS T1 JOIN photos AS T2 ON T1.id = T2.mountain_id WHERE T1.Country = "Ethiopia"
Step 1: For each row in building table, find the corresponding rows in Institution table.
Step 2: find rows in the results of step 1 whose Founded greater than 1880.
Step 3: find the number of rows of each value of Institution in step 1 rsults.
Step 4: find Name, Height_feet in the results of step 1 whose corresponding value in step 2 is greater than or equals 2
Output: SELECT T1.Name , T1.Height_feet FROM building AS T1 JOIN Institution AS T2 ON T1.building_id = T2.building_id WHERE T2.Founded > 1880 GROUP BY T2.Institution HAVING Count ( * ) > = 2
find the Name of Nurse table
Output: SELECT Name FROM Nurse
find each value of City_ID in city table along with the average Population of the corresponding rows to each value
Output: SELECT City_ID , Avg ( Population ) FROM city GROUP BY City_ID
Step 1: find the Channel_ID of broadcast_share table.
Step 2: find the Name of channel table whose channel's Channel_ID not one of the results of step 1
Output: SELECT T1.Name FROM channel AS T1 WHERE T1.Channel_ID NOT IN ( SELECT T2.Channel_ID FROM broadcast_share AS T2 )
find the staff_id of Staff_Department_Assignments table for which date_assigned_to less than Clerical Staff
Output: SELECT staff_id FROM Staff_Department_Assignments WHERE date_assigned_to < "Clerical Staff"
Step 1: For each row in Catalog_Structure table, find corresponding rows in Catalogs table and in Catalog_Contents table.
Step 2: find catalog_name of the results of step 1 whose parent_entry_id greater than 8
Output: SELECT T1.catalog_name FROM Catalogs AS T1 JOIN Catalog_Structure AS T2 ON T1.catalog_id = T2.catalog_id JOIN Catalog_Contents AS T3 ON T2.catalog_level_number = T3.catalog_level_number WHERE T3.parent_entry_id > 8
Step 1: find the number of rows of each value of destination in flight table.
Step 2: find destination of flight table with largest value in the results of step 1
Output: SELECT destination FROM flight GROUP BY destination ORDER BY Count ( * ) Desc LIMIT 1
find the supplier_name, supplier_phone of Suppliers table ordered ascending by supplier_name
Output: SELECT supplier_name , supplier_phone FROM Suppliers ORDER BY supplier_name Asc
Step 1: For each row in wrestler table, find the corresponding rows in Elimination table.
Step 2: find Time of the results of step 1 whose Name equals Punk or Name equals Orton
Output: SELECT T2.Time FROM wrestler AS T1 JOIN Elimination AS T2 ON T1.Wrestler_ID = T2.Wrestler_ID WHERE T1.Name = "Orton" OR T1.Name = "Punk"
find without repetition the Name of Patient table ordered ascending by Name
Output: SELECT DISTINCT Name FROM Patient ORDER BY Name Asc
Step 1: find the average total_value_purchased of each value of supplier_id in Product_Suppliers table.
Step 2: find supplier_id in Product_Suppliers table whose corresponding value in step 1 is greater than 50000
Output: SELECT supplier_id FROM Product_Suppliers GROUP BY supplier_id HAVING Avg ( total_value_purchased ) > 50000
Step 1: find the number of rows of each value of customer_id in Customers table.
Step 2: find customer_name in Customers table whose corresponding value in step 1 is greater than or equals 3
Output: SELECT customer_name FROM Customers GROUP BY customer_id HAVING Count ( * ) > = 3
find the number of rows in club_rank table whose Gold less than 10
Output: SELECT Count ( * ) FROM club_rank WHERE Gold < 10
Step 1: find the number of rows of each value of email in user_profiles table.
Step 2: find name, email in user_profiles table whose corresponding value in step 1 is greater than 1
Output: SELECT name , email FROM user_profiles GROUP BY email HAVING Count ( * ) > 1
Step 1: For each row in School table, find corresponding rows in budget table and in endowment table.
Step 2: find total_budget_percent_budgeted, donator_name of the results of step 1 with largest value of amount
Output: SELECT T2.total_budget_percent_budgeted , T3.donator_name FROM School AS T1 JOIN budget AS T2 ON T2.School_id = T1.School_id JOIN endowment AS T3 ON T1.School_id = T3.School_id ORDER BY T3.amount Desc LIMIT 1
find the title of film table
Output: SELECT title FROM film
Step 1: find the SSN of Patient table for which Name equals Procrastin-X.
Step 2: find the number of rows in Patient table whose SSN not one of the results of step 1
Output: SELECT Count ( * ) FROM Patient WHERE SSN NOT IN ( SELECT SSN FROM Patient WHERE Name = "Procrastin-X" )
find the first_name of customer table for which create_date greater than 2005-08-23 02:06:01
Output: SELECT first_name FROM customer WHERE create_date > "2005-08-23 02:06:01"
find the catalog_name of Catalogs table for which catalog_name starts with 2
Output: SELECT catalog_name FROM Catalogs WHERE catalog_name LIKE "2%"
Step 1: For each row in match_season table, find corresponding rows in country table and in team table.
Step 2: find Name, Season, Country_name of the results of step 1
Output: SELECT T2.Name , T3.Season , T1.Country_name FROM country AS T1 JOIN team AS T2 JOIN match_season AS T3 ON T1.Country_id = T3.Country AND T3.Team = T2.Team_id AND T1.Country_id = T3.Country
Step 1: For each row in Nurse table, find the corresponding rows in Appointment table.
Step 2: find the number of rows of each value of Physician in the results of step 1.
Step 3: find Name of step 1 results with largest value in the results of step 2
Output: SELECT T1.Name FROM Nurse AS T1 JOIN Appointment AS T2 ON T1.EmployeeID = T2.PrepNurse GROUP BY T2.Physician ORDER BY Count ( * ) Desc LIMIT 1
find the number of rows in mountain table whose Height greater than 15
Output: SELECT Count ( * ) FROM mountain WHERE Height > 15
Step 1: For each row in broadcast table, find corresponding rows in program table and in channel table.
Step 2: find channel's Name of the results of step 1 ordered ascending by Launch
Output: SELECT T2.Name FROM program AS T1 JOIN channel AS T2 JOIN broadcast AS T3 ON T1.Program_ID = T3.Program_ID AND T3.Channel_ID = T2.Channel_ID ORDER BY T1.Launch Asc
Step 1: For each row in channel table, find the corresponding rows in broadcast table.
Step 2: find the number of rows of each value of broadcast's Channel_ID in the results of step 1.
Step 3: find Name of step 1 results with largest value in the results of step 2
Output: SELECT T1.Name FROM channel AS T1 JOIN broadcast AS T2 ON T1.Channel_ID = T2.Channel_ID GROUP BY T2.Channel_ID ORDER BY Count ( * ) Desc LIMIT 1
Step 1: For each row in channel table, find the corresponding rows in broadcast table.
Step 2: find channel's Owner of the results of step 1 whose Time_of_day equals Morning.
Step 3: For each row in program table, find the corresponding rows in broadcast table.
Step 4: find program's Owner of the results of step 3 whose Time_of_day equals Night.
Step 5: show the rows that are in both the results of step 2 and the results of step 4
Output: SELECT T1.Owner FROM channel AS T1 JOIN broadcast AS T2 ON T1.Channel_ID = T2.Channel_ID WHERE T2.Time_of_day = "Morning" INTERSECT SELECT T3.Owner FROM program AS T3 JOIN broadcast AS T2 ON T3.Program_ID = T2.Program_ID WHERE T2.Time_of_day = "Night"
find the height of Catalog_Contents table with smallest value of price_in_pounds
Output: SELECT height FROM Catalog_Contents ORDER BY price_in_pounds Asc LIMIT 1
Step 1: For each row in team table, find corresponding rows in match_season table and in player table.
Step 2: find College of the results of step 1 whose player's Player equals Midfielder.
Step 3: find College of the results of step 1 whose player's Player equals Defender.
Step 4: show the rows that are in both the results of step 2 and the results of step 3
Output: SELECT T2.College FROM team AS T1 JOIN match_season AS T2 ON T2.Team = T1.Team_id JOIN player AS T3 ON T1.Team_id = T3.Team WHERE T3.Player = "Midfielder" INTERSECT SELECT T2.College FROM team AS T1 JOIN match_season AS T2 ON T2.Team = T1.Team_id JOIN player AS T3 ON T1.Team_id = T3.Team WHERE T3.Player = "Defender"
Step 1: find the number of rows of each value of Name in channel table.
Step 2: find Name of channel table with largest value in the results of step 1
Output: SELECT Name FROM channel GROUP BY Name ORDER BY Count ( * ) Desc LIMIT 1
find the product_name of Products table for which product_description equals white
Output: SELECT product_name FROM Products WHERE product_description = "white"
find the customer_name of Customers table with largest value of payment_method
Output: SELECT customer_name FROM Customers ORDER BY payment_method Desc LIMIT 1
Step 1: find the Name of Manufacturers table.
Step 2: find the Name of Manufacturers table.
Step 3: show the rows that are in the results of step 1 but not in the results of step 2
Output: SELECT Name FROM Manufacturers EXCEPT SELECT Name FROM Manufacturers
Step 1: find the number of rows of each value of Station_ID in station table.
Step 2: find Name, Main_Services of station table ordered descending by the results of step 1.
Step 3: only show the first 3 rows of the results
Output: SELECT Name , Main_Services FROM station GROUP BY Station_ID ORDER BY Count ( * ) Desc LIMIT 3
Step 1: find the maximum Price in wine table whose Winery equals John Anthony.
Step 2: find without repetition the Name of wine table whose Price greater than the results of step 1
Output: SELECT DISTINCT Name FROM wine WHERE Price > ( SELECT Max ( Price ) FROM wine WHERE Winery = "John Anthony" )
find the number of rows in Customer_Orders table whose order_status equals Cancelled
Output: SELECT Count ( * ) FROM Customer_Orders WHERE order_status = "Cancelled"
Step 1: find the number of rows of each value of amenity_name in Dorm_amenity table.
Step 2: find amenity_name of Dorm_amenity table with largest value in the results of step 1
Output: SELECT amenity_name FROM Dorm_amenity GROUP BY amenity_name ORDER BY Count ( * ) Desc LIMIT 1
Step 1: For each row in College table, find the corresponding rows in Tryout table.
Step 2: find each value of Tryout's cName in the results of step 1 along with the summation of enr of the corresponding rows to each value
Output: SELECT Sum ( T1.enr ) , T2.cName FROM College AS T1 JOIN Tryout AS T2 ON T1.cName = T2.cName GROUP BY T2.cName
Step 1: find the number of rows of each value of Headquarter in Manufacturers table.
Step 2: find Name, Revenue of Manufacturers table with largest value in the results of step 1
Output: SELECT Name , Revenue FROM Manufacturers GROUP BY Headquarter ORDER BY Count ( * ) Desc LIMIT 1
find rows of roller_coaster table whose Height greater than 3300 or Height greater than 100
Output: SELECT * FROM roller_coaster WHERE Height > 100 OR Height > 3300
Step 1: For each row in Customer_Addresses table, find corresponding rows in Addresses table and in Customers table.
Step 2: find customer_name of the results of step 1 whose city equals Colorado
Output: SELECT T2.customer_name FROM Addresses AS T1 JOIN Customers AS T2 JOIN Customer_Addresses AS T3 ON T1.address_id = T3.address_id AND T3.customer_id = T2.customer_id WHERE T1.city = "Colorado"
Step 1: For each row in Has_amenity table, find corresponding rows in Dorm table and in Dorm_amenity table.
Step 2: find dorm_name of the results of step 1 whose amenity_name not equals TV Lounge
Output: SELECT T1.dorm_name FROM Dorm AS T1 JOIN Dorm_amenity AS T2 JOIN Has_amenity AS T3 ON T1.dormid = T3.dormid AND T3.amenid = T2.amenid WHERE T2.amenity_name ! = "TV Lounge"
find cName, enr of College table whose enr greater than 10000 or state equals LA
Output: SELECT cName , enr FROM College WHERE enr > 10000 OR state = "LA"
Step 1: find the number of rows of each value of Station_ID in station table.
Step 2: find Name in station table whose corresponding value in step 1 is greater than or equals 2
Output: SELECT Name FROM station GROUP BY Station_ID HAVING Count ( * ) > = 2
find the Name of wine table for which Year greater than 2008
Output: SELECT Name FROM wine WHERE Year > 2008
Step 1: For each row in Ref_Characteristic_Types table, find the corresponding rows in Characteristics table.
Step 2: find characteristic_type_description of the results of step 1 whose characteristic_name contains t
Output: SELECT T1.characteristic_type_description FROM Ref_Characteristic_Types AS T1 JOIN Characteristics AS T2 ON T1.characteristic_type_code = T2.characteristic_type_code WHERE T2.characteristic_name LIKE "t"
Step 1: find the average Revenue in Manufacturers table.
Step 2: For each row in Manufacturers table, find the corresponding rows in Products table.
Step 3: find Products's Name in the results of step 2 whose Revenue greater than the results of step 1
Output: SELECT T2.Name FROM Manufacturers AS T1 JOIN Products AS T2 ON T1.Code = T2.Manufacturer WHERE T1.Revenue > ( SELECT Avg ( T1.Revenue ) FROM Manufacturers AS T1 )
find each value of Manufacturer in Products table along with the average Price of the corresponding rows to each value
Output: SELECT Avg ( Price ) , Manufacturer FROM Products GROUP BY Manufacturer
Step 1: For each row in Tryout table, find corresponding rows in College table and in Player table.
Step 2: find pName of the results of step 1 with largest value of enr
Output: SELECT T2.pName FROM College AS T1 JOIN Player AS T2 JOIN Tryout AS T3 ON T1.cName = T3.cName AND T3.pID = T2.pID ORDER BY T1.enr Desc LIMIT 1
find the number of rows in Player table whose pName equals goalie
Output: SELECT Count ( * ) FROM Player WHERE pName = "goalie"
Step 1: For each row in country table, find the corresponding rows in roller_coaster table.
Step 2: find each value of Country_ID in the results of step 1 along with the average Speed of the corresponding rows to each value
Output: SELECT T2.Name , Avg ( T1.Speed ) FROM roller_coaster AS T1 JOIN country AS T2 ON T1.Country_ID = T2.Country_ID GROUP BY T1.Country_ID
Step 1: find the Rank of captain table.
Step 2: find the Rank of captain table.
Step 3: show the rows that are in the results of step 1 but not in the results of step 2
Output: SELECT Rank FROM captain EXCEPT SELECT Rank FROM captain
Step 1: find the Customer_Name of Clients table.
Step 2: find the Customer_Name of Clients table.
Step 3: show the rows that are in the results of step 1 but not in the results of step 2
Output: SELECT Customer_Name FROM Clients EXCEPT SELECT Customer_Name FROM Clients
find the Name of roller_coaster table ordered ascending by Height
Output: SELECT Name FROM roller_coaster ORDER BY Height Asc
find the number of rows in College table whose enr greater than yes
Output: SELECT Count ( * ) FROM College WHERE enr > "yes"
find the Revenue, Revenue of Manufacturers table
Output: SELECT Revenue , Revenue FROM Manufacturers
Step 1: find the number of rows of each value of payment_method in Customers table.
Step 2: find payment_method of Customers table with smallest value in the results of step 1
Output: SELECT payment_method FROM Customers GROUP BY payment_method ORDER BY Count ( * ) Asc LIMIT 1
Step 1: find the Name, City of branch table.
Step 2: find the Name, City of branch table.
Step 3: show the rows that are in the results of step 1 but not in the results of step 2
Output: SELECT Name , City FROM branch EXCEPT SELECT Name , City FROM branch
find the Title, Director of movie table for which Gross_worldwide greater than or equals 2000 with largest value of Gross_worldwide
Output: SELECT Title , Director FROM movie WHERE Gross_worldwide > = 2000 ORDER BY Gross_worldwide Desc LIMIT 1
Step 1: For each row in Player table, find the corresponding rows in Tryout table.
Step 2: find pName, pPos of the results of step 1 whose HS less than 1500
Output: SELECT T1.pName , T2.pPos FROM Player AS T1 JOIN Tryout AS T2 ON T1.pID = T2.pID WHERE T1.HS < 1500
Step 1: For each row in College table, find the corresponding rows in Tryout table.
Step 2: find state of the results of step 1 whose pPos equals goalie.
Step 3: find the Tryout's cName of Tryout table for which pPos equals mid.
Step 4: show the rows that are in both the results of step 2 and the results of step 3
Output: SELECT T1.state FROM College AS T1 JOIN Tryout AS T2 ON T1.cName = T2.cName WHERE T2.pPos = "goalie" INTERSECT SELECT T2.cName FROM Tryout AS T2 WHERE T2.pPos = "mid"
Step 1: find the pID of Tryout table.
Step 2: find the average HS in Player table whose Player's pID not one of the results of step 1
Output: SELECT Avg ( T1.HS ) FROM Player AS T1 WHERE T1.pID NOT IN ( SELECT T2.pID FROM Tryout AS T2 )
Step 1: For each row in Invoices table, find corresponding rows in Customer_Orders table and in Invoice_Items table.
Step 2: find Order_Date of the results of step 1 whose Invoice_Items's Order_Quantity equals 1
Output: SELECT T1.Order_Date FROM Customer_Orders AS T1 JOIN Invoices AS T2 ON T1.Order_ID = T2.Order_ID JOIN Invoice_Items AS T3 ON T2.Invoice_ID = T3.Invoice_ID WHERE T3.Order_Quantity = 1
Step 1: For each row in branch table, find the corresponding rows in membership_register_branch table.
Step 2: find the number of rows of each value of membership_register_branch's Branch_ID in the results of step 1.
Step 3: find Name, Open_year of step 1 results with largest value in the results of step 2
Output: SELECT T1.Name , T1.Open_year FROM branch AS T1 JOIN membership_register_branch AS T2 ON T1.Branch_ID = T2.Branch_ID GROUP BY T2.Branch_ID ORDER BY Count ( * ) Desc LIMIT 1
find the pName, HS of Player table
Output: SELECT pName , HS FROM Player
find each value of Name in Products table along with the average Price of the corresponding rows to each value
Output: SELECT Avg ( Price ) , Name FROM Products GROUP BY Name
find the decision of Tryout table for which pPos equals striker
Output: SELECT decision FROM Tryout WHERE pPos = "striker"
Step 1: For each row in Manufacturers table, find the corresponding rows in Products table.
Step 2: find Headquarter of the results of step 1 whose Products's Name equals James
Output: SELECT T1.Headquarter FROM Manufacturers AS T1 JOIN Products AS T2 ON T1.Code = T2.Manufacturer WHERE T2.Name = "James"
find the Store_Name of Stores table
Output: SELECT Store_Name FROM Stores
find the average HS and the maximum HS in Player table
Output: SELECT Avg ( HS ) , Max ( HS ) FROM Player
Step 1: For each row in Addresses table, find the corresponding rows in Performers table.
Step 2: find Customer_Email_Address of the results of step 1 whose State_County equals Alaska
Output: SELECT T2.Customer_Email_Address FROM Addresses AS T1 JOIN Performers AS T2 ON T1.Address_ID = T2.Address_ID WHERE T1.State_County = "Alaska"
Step 1: find the Rank of captain table for which captain's Class equals Cutter.
Step 2: For each row in Ship table, find the corresponding rows in captain table.
Step 3: find Rank of the results of step 2 whose Type equals Armed schooner.
Step 4: show the rows that are in both the results of step 1 and the results of step 3
Output: SELECT T1.Rank FROM captain AS T1 WHERE T1.Class = "Cutter" INTERSECT SELECT T1.Rank FROM captain AS T1 JOIN Ship AS T2 ON T1.Ship_ID = T2.Ship_ID WHERE T2.Type = "Armed schooner"
Step 1: For each row in appellations table, find the corresponding rows in wine table.
Step 2: find the average Price in the results of step 1 whose appellations's State equals Sonoma
Output: SELECT Avg ( T2.Price ) FROM appellations AS T1 JOIN wine AS T2 ON T1.Appelation = T2.Appelation WHERE T1.State = "Sonoma"
Step 1: For each row in Player table, find the corresponding rows in Tryout table.
Step 2: find each value of pPos in the results of step 1 along with the maximum HS of the corresponding rows to each value
Output: SELECT Max ( T1.HS ) , T2.pPos FROM Player AS T1 JOIN Tryout AS T2 ON T1.pID = T2.pID GROUP BY T2.pPos
Step 1: find the Railway_ID of train table.
Step 2: find the number of rows in railway table whose railway's Railway_ID not one of the results of step 1
Output: SELECT Count ( * ) FROM railway AS T1 WHERE T1.Railway_ID NOT IN ( SELECT T2.Railway_ID FROM train AS T2 )
Step 1: For each row in Customer_Address_History table, find corresponding rows in Addresses table and in Customers table.
Step 2: find customer_name, city, state_province_county of the results of step 1
Output: SELECT T2.customer_name , T1.city , T1.state_province_county FROM Addresses AS T1 JOIN Customers AS T2 JOIN Customer_Address_History AS T3 ON T1.address_id = T3.address_id AND T3.customer_id = T2.customer_id
find the Name, Name of member table ordered ascending by Card_Number
Output: SELECT Name , Name FROM member ORDER BY Card_Number Asc
Step 1: For each row in College table, find the corresponding rows in Tryout table.
Step 2: find College's cName of the results of step 1 whose pPos equals striker.
Step 3: For each row in Player table, find the corresponding rows in Tryout table.
Step 4: find pName of the results of step 3 whose pPos equals yes.
Step 5: show the rows that are in both the results of step 2 and the results of step 4
Output: SELECT T1.cName FROM College AS T1 JOIN Tryout AS T2 ON T1.cName = T2.cName WHERE T2.pPos = "striker" INTERSECT SELECT T3.pName FROM Player AS T3 JOIN Tryout AS T2 ON T3.pID = T2.pID WHERE T2.pPos = "yes"
Step 1: For each row in Customers table, find the corresponding rows in Customer_Contact_Channels table.
Step 2: find the number of rows of each value of Customers's customer_id in the results of step 1.
Step 3: find channel_code, date_became_customer of step 1 results with largest value in the results of step 2
Output: SELECT T2.channel_code , T1.date_became_customer FROM Customers AS T1 JOIN Customer_Contact_Channels AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id ORDER BY Count ( * ) Desc LIMIT 1
Step 1: For each row in culture_company table, find corresponding rows in book_club table and in movie table.
Step 2: find movie's Year, Title, Publisher of the results of step 1 ordered descending by movie's Year
Output: SELECT T2.Year , T2.Title , T1.Publisher FROM book_club AS T1 JOIN movie AS T2 JOIN culture_company AS T3 ON T1.book_club_id = T3.book_club_id AND T3.movie_id = T2.movie_id ORDER BY T2.Year Desc
find the Name, Appelation, Score of wine table for which Score greater than 93 ordered ascending by Name
Output: SELECT Name , Appelation , Score FROM wine WHERE Score > 93 ORDER BY Name Asc
Step 1: For each row in Addresses table, find the corresponding rows in Performers table.
Step 2: find Customer_Name of the results of step 1 whose City_Town equals Feliciaberg
Output: SELECT T2.Customer_Name FROM Addresses AS T1 JOIN Performers AS T2 ON T1.Address_ID = T2.Address_ID WHERE T1.City_Town = "Feliciaberg"
Step 1: find the maximum enr in College table.
Step 2: find the state of College table whose enr greater than the results of step 1
Output: SELECT state FROM College WHERE enr > ( SELECT Max ( enr ) FROM College )
Step 1: For each row in membership_register_branch table, find corresponding rows in member table and in branch table.
Step 2: find member's Name, Hometown of the results of step 1 whose branch's Name equals 2016
Output: SELECT T1.Name , T1.Hometown FROM member AS T1 JOIN branch AS T2 JOIN membership_register_branch AS T3 ON T1.Member_ID = T3.Member_ID AND T3.Branch_ID = T2.Branch_ID WHERE T2.Name = 2016
find the average Price and the average Score in wine table whose Year equals 2009
Output: SELECT Avg ( Price ) , Avg ( Score ) FROM wine WHERE Year = 2009
Step 1: find the Name of member table.
Step 2: find the branch's Name, City of branch table whose Branch_ID not one of the results of step 1
Output: SELECT T1.Name , T1.City FROM branch AS T1 WHERE T1.Branch_ID NOT IN ( SELECT T2.Name FROM member AS T2 )
find each value of product_id in Products table along with the summation of product_price of the corresponding rows to each value
Output: SELECT product_name , Sum ( product_price ) FROM Products GROUP BY product_id
Step 1: For each row in Product_Characteristics table, find corresponding rows in Characteristics table and in Products table.
Step 2: find product_name of the results of step 1 whose characteristic_data_type equals yellow
Output: SELECT T2.product_name FROM Characteristics AS T1 JOIN Products AS T2 JOIN Product_Characteristics AS T3 ON T1.characteristic_id = T3.characteristic_id AND T3.product_id = T2.product_id WHERE T1.characteristic_data_type = "yellow"
find the number of rows in Products table whose color_code equals hot
Output: SELECT Count ( * ) FROM Products WHERE color_code = "hot"
find without repetition the Appelation of wine table
Output: SELECT DISTINCT Appelation FROM wine
find the characteristic_type_description of Ref_Characteristic_Types table
Output: SELECT characteristic_type_description FROM Ref_Characteristic_Types