1sf/bird-sql-train-with-schema huggingface dataset:
Database: movie_platform
Tables: lists, movies, ratings_users, lists_users, ratings
Columns (table index, column name): -1, *, 0, user_id, 0, list_id, 0, list_title, 0, list_movie_number, 0, list_update_timestamp_utc, 0, list_creation_timestamp_utc, 0, list_followers, 0, list_url, 0, list_comments, 0, list_description, 0, list_cover_image_url, 0, list_first_image_url, 0, list_second_image_url, 0, list_third_image_url, 1, movie_id, 1, movie_title, 1, movie_release_year, 1, movie_url, 1, movie_title_language, 1, movie_popularity, 1, movie_image_url, 1, director_id, 1, director_name, 1, director_url, 2, user_id, 2, rating_date_utc, 2, user_trialist, 2, user_subscriber, 2, user_avatar_image_url, 2, user_cover_image_url, 2, user_eligible_for_trial, 2, user_has_payment_method, 3, user_id, 3, list_id, 3, list_update_date_utc, 3, list_creation_date_utc, 3, user_trialist, 3, user_subscriber, 3, user_avatar_image_url, 3, user_cover_image_url, 3, user_eligible_for_trial, 3, user_has_payment_method, 4, movie_id, 4, rating_id, 4, rating_url, 4, rating_score, 4, rating_timestamp_utc, 4, critic, 4, critic_likes, 4, critic_comments, 4, user_id, 4, user_trialist, 4, user_subscriber, 4, user_eligible_for_trial, 4, user_has_payment_method
Question: What is the name of the movie whose critic received the highest amount of likes? Indicate the URL to the rating on Mubi.
Evidence: critic received the highest amount of likes refers to MAX(critic_likes);
SQL: SELECT T2.movie_title, T1.rating_url FROM ratings AS T1 INNER JOIN movies AS T2 ON T1.movie_id = T2.movie_id ORDER BY T1.critic_likes DESC LIMIT 1
Database: movie_platform
Tables: lists, movies, ratings_users, lists_users, ratings
Columns (table index, column name): -1, *, 0, user_id, 0, list_id, 0, list_title, 0, list_movie_number, 0, list_update_timestamp_utc, 0, list_creation_timestamp_utc, 0, list_followers, 0, list_url, 0, list_comments, 0, list_description, 0, list_cover_image_url, 0, list_first_image_url, 0, list_second_image_url, 0, list_third_image_url, 1, movie_id, 1, movie_title, 1, movie_release_year, 1, movie_url, 1, movie_title_language, 1, movie_popularity, 1, movie_image_url, 1, director_id, 1, director_name, 1, director_url, 2, user_id, 2, rating_date_utc, 2, user_trialist, 2, user_subscriber, 2, user_avatar_image_url, 2, user_cover_image_url, 2, user_eligible_for_trial, 2, user_has_payment_method, 3, user_id, 3, list_id, 3, list_update_date_utc, 3, list_creation_date_utc, 3, user_trialist, 3, user_subscriber, 3, user_avatar_image_url, 3, user_cover_image_url, 3, user_eligible_for_trial, 3, user_has_payment_method, 4, movie_id, 4, rating_id, 4, rating_url, 4, rating_score, 4, rating_timestamp_utc, 4, critic, 4, critic_likes, 4, critic_comments, 4, user_id, 4, user_trialist, 4, user_subscriber, 4, user_eligible_for_trial, 4, user_has_payment_method
Question: What are the top 5 most popular movies of the 21st century? Indicate how many users gave it a rating score of 5.
Evidence: most popular movies refers to MAX(movie_popularity); rating score of 5 refers to rating_score = 5; movies of the 21st century refers to movie_release_year> = 2000
SQL: SELECT DISTINCT T2.movie_id, SUM(T1.rating_score = 5) FROM ratings AS T1 INNER JOIN movies AS T2 ON T1.movie_id = T2.movie_id ORDER BY T2.movie_popularity DESC LIMIT 5
Database: movie_platform
Tables: lists, movies, ratings_users, lists_users, ratings
Columns (table index, column name): -1, *, 0, user_id, 0, list_id, 0, list_title, 0, list_movie_number, 0, list_update_timestamp_utc, 0, list_creation_timestamp_utc, 0, list_followers, 0, list_url, 0, list_comments, 0, list_description, 0, list_cover_image_url, 0, list_first_image_url, 0, list_second_image_url, 0, list_third_image_url, 1, movie_id, 1, movie_title, 1, movie_release_year, 1, movie_url, 1, movie_title_language, 1, movie_popularity, 1, movie_image_url, 1, director_id, 1, director_name, 1, director_url, 2, user_id, 2, rating_date_utc, 2, user_trialist, 2, user_subscriber, 2, user_avatar_image_url, 2, user_cover_image_url, 2, user_eligible_for_trial, 2, user_has_payment_method, 3, user_id, 3, list_id, 3, list_update_date_utc, 3, list_creation_date_utc, 3, user_trialist, 3, user_subscriber, 3, user_avatar_image_url, 3, user_cover_image_url, 3, user_eligible_for_trial, 3, user_has_payment_method, 4, movie_id, 4, rating_id, 4, rating_url, 4, rating_score, 4, rating_timestamp_utc, 4, critic, 4, critic_likes, 4, critic_comments, 4, user_id, 4, user_trialist, 4, user_subscriber, 4, user_eligible_for_trial, 4, user_has_payment_method
Question: What is the average number of followers of the lists created by the user who rated the movie "Pavee Lackeen: The Traveller Girl" on 3/27/2011 at 2:06:34 AM?
Evidence: average number of followers refers to AVG(list_followers); movie "Pavee Lackeen: The Traveller Girl" refers to movie_title = 'Pavee Lackeen: The Traveller Girl'; on 3/27/2011 at 2:06:34 AM refers to rating_timestamp_utc = '2011-03-27 02:06:34'
SQL: SELECT CAST(SUM(T4.list_followers) AS REAL) / COUNT(T2.list_id) FROM ratings AS T1 INNER JOIN lists_users AS T2 ON T1.user_id = T2.user_id INNER JOIN movies AS T3 ON T1.movie_id = T3.movie_id INNER JOIN lists AS T4 ON T2.list_id = T4.list_id WHERE T3.movie_title LIKE 'Pavee Lackeen: The Traveller Girl' AND T1.rating_timestamp_utc LIKE '2011-03-27 02:06:34'
Database: movie_platform
Tables: lists, movies, ratings_users, lists_users, ratings
Columns (table index, column name): -1, *, 0, user_id, 0, list_id, 0, list_title, 0, list_movie_number, 0, list_update_timestamp_utc, 0, list_creation_timestamp_utc, 0, list_followers, 0, list_url, 0, list_comments, 0, list_description, 0, list_cover_image_url, 0, list_first_image_url, 0, list_second_image_url, 0, list_third_image_url, 1, movie_id, 1, movie_title, 1, movie_release_year, 1, movie_url, 1, movie_title_language, 1, movie_popularity, 1, movie_image_url, 1, director_id, 1, director_name, 1, director_url, 2, user_id, 2, rating_date_utc, 2, user_trialist, 2, user_subscriber, 2, user_avatar_image_url, 2, user_cover_image_url, 2, user_eligible_for_trial, 2, user_has_payment_method, 3, user_id, 3, list_id, 3, list_update_date_utc, 3, list_creation_date_utc, 3, user_trialist, 3, user_subscriber, 3, user_avatar_image_url, 3, user_cover_image_url, 3, user_eligible_for_trial, 3, user_has_payment_method, 4, movie_id, 4, rating_id, 4, rating_url, 4, rating_score, 4, rating_timestamp_utc, 4, critic, 4, critic_likes, 4, critic_comments, 4, user_id, 4, user_trialist, 4, user_subscriber, 4, user_eligible_for_trial, 4, user_has_payment_method
Question: Between 1/1/2017 to 12/31/2017, how many users who were eligible for trial when they rated the movie "Patti Smith: Dream of Life"and what is the image URL to the movie on Mubi?
Evidence: Between 1/1/2017 to 12/31/2017 refers to rating_timestamp_utc between '2017-01-01 00:00:00' and '2017-12-31 00:00:00'; eligible for trial refers to user_eligible_for_trial = 1; movie "Patti Smith: Dream of Life" refers to movie_title = 'Patti Smith: Dream of Life'
SQL: SELECT COUNT(T1.user_id), T2.movie_image_url FROM ratings AS T1 INNER JOIN movies AS T2 ON T1.movie_id = T2.movie_id WHERE datetime(T1.rating_timestamp_utc) BETWEEN '2017-01-01 00:00:00' AND '2017-12-31 00:00:00'
Database: movie_platform
Tables: lists, movies, ratings_users, lists_users, ratings
Columns (table index, column name): -1, *, 0, user_id, 0, list_id, 0, list_title, 0, list_movie_number, 0, list_update_timestamp_utc, 0, list_creation_timestamp_utc, 0, list_followers, 0, list_url, 0, list_comments, 0, list_description, 0, list_cover_image_url, 0, list_first_image_url, 0, list_second_image_url, 0, list_third_image_url, 1, movie_id, 1, movie_title, 1, movie_release_year, 1, movie_url, 1, movie_title_language, 1, movie_popularity, 1, movie_image_url, 1, director_id, 1, director_name, 1, director_url, 2, user_id, 2, rating_date_utc, 2, user_trialist, 2, user_subscriber, 2, user_avatar_image_url, 2, user_cover_image_url, 2, user_eligible_for_trial, 2, user_has_payment_method, 3, user_id, 3, list_id, 3, list_update_date_utc, 3, list_creation_date_utc, 3, user_trialist, 3, user_subscriber, 3, user_avatar_image_url, 3, user_cover_image_url, 3, user_eligible_for_trial, 3, user_has_payment_method, 4, movie_id, 4, rating_id, 4, rating_url, 4, rating_score, 4, rating_timestamp_utc, 4, critic, 4, critic_likes, 4, critic_comments, 4, user_id, 4, user_trialist, 4, user_subscriber, 4, user_eligible_for_trial, 4, user_has_payment_method
Question: What is the average number of number of movies added to the lists of user 8516503? Indicate how many movies did he/she give a rating score of 5.
Evidence: average number of number of movies refers to AVG(list_movie_number); user 8516503 refers to user_id = 8516503; rating score of 5 refers to rating_score = 5
SQL: SELECT AVG(T3.list_movie_number) , SUM(CASE WHEN T1.rating_score = 5 THEN 1 ELSE 0 END) FROM ratings AS T1 INNER JOIN lists_users AS T2 ON T1.user_id = T2.user_id INNER JOIN lists AS T3 ON T2.user_id = T3.user_id WHERE T1.user_id = 8516503
Database: movie_platform
Tables: lists, movies, ratings_users, lists_users, ratings
Columns (table index, column name): -1, *, 0, user_id, 0, list_id, 0, list_title, 0, list_movie_number, 0, list_update_timestamp_utc, 0, list_creation_timestamp_utc, 0, list_followers, 0, list_url, 0, list_comments, 0, list_description, 0, list_cover_image_url, 0, list_first_image_url, 0, list_second_image_url, 0, list_third_image_url, 1, movie_id, 1, movie_title, 1, movie_release_year, 1, movie_url, 1, movie_title_language, 1, movie_popularity, 1, movie_image_url, 1, director_id, 1, director_name, 1, director_url, 2, user_id, 2, rating_date_utc, 2, user_trialist, 2, user_subscriber, 2, user_avatar_image_url, 2, user_cover_image_url, 2, user_eligible_for_trial, 2, user_has_payment_method, 3, user_id, 3, list_id, 3, list_update_date_utc, 3, list_creation_date_utc, 3, user_trialist, 3, user_subscriber, 3, user_avatar_image_url, 3, user_cover_image_url, 3, user_eligible_for_trial, 3, user_has_payment_method, 4, movie_id, 4, rating_id, 4, rating_url, 4, rating_score, 4, rating_timestamp_utc, 4, critic, 4, critic_likes, 4, critic_comments, 4, user_id, 4, user_trialist, 4, user_subscriber, 4, user_eligible_for_trial, 4, user_has_payment_method
Question: Who is the director of the most popular movie of all time and when was it released? Indicate the average rating score of the users who were on a trialist when they rated the movie.
Evidence: most popular movie of all time refers to MAX(movie_popularity); a trialist refers to user_trialist = 1; average rating score = AVG(rating_score)
SQL: SELECT T1.director_name, T1.movie_release_year , SUM(T2.rating_score) / COUNT(T2.user_id) FROM movies AS T1 INNER JOIN ratings AS T2 ON T1.movie_id = T2.movie_id WHERE T2.user_trialist = 1 ORDER BY T1.movie_popularity DESC LIMIT 1
Database: movie_platform
Tables: lists, movies, ratings_users, lists_users, ratings
Columns (table index, column name): -1, *, 0, user_id, 0, list_id, 0, list_title, 0, list_movie_number, 0, list_update_timestamp_utc, 0, list_creation_timestamp_utc, 0, list_followers, 0, list_url, 0, list_comments, 0, list_description, 0, list_cover_image_url, 0, list_first_image_url, 0, list_second_image_url, 0, list_third_image_url, 1, movie_id, 1, movie_title, 1, movie_release_year, 1, movie_url, 1, movie_title_language, 1, movie_popularity, 1, movie_image_url, 1, director_id, 1, director_name, 1, director_url, 2, user_id, 2, rating_date_utc, 2, user_trialist, 2, user_subscriber, 2, user_avatar_image_url, 2, user_cover_image_url, 2, user_eligible_for_trial, 2, user_has_payment_method, 3, user_id, 3, list_id, 3, list_update_date_utc, 3, list_creation_date_utc, 3, user_trialist, 3, user_subscriber, 3, user_avatar_image_url, 3, user_cover_image_url, 3, user_eligible_for_trial, 3, user_has_payment_method, 4, movie_id, 4, rating_id, 4, rating_url, 4, rating_score, 4, rating_timestamp_utc, 4, critic, 4, critic_likes, 4, critic_comments, 4, user_id, 4, user_trialist, 4, user_subscriber, 4, user_eligible_for_trial, 4, user_has_payment_method
Question: What is the name of the movie that was rated recently by user 57756708?
Evidence: user 57756708 refers to user_id = 57756708; rated recently refers to MAX(rating_timestamp_utc)
SQL: SELECT T2.movie_title FROM ratings AS T1 INNER JOIN movies AS T2 ON T1.movie_id = T2.movie_id WHERE T1.user_id = 57756708 ORDER BY T1.rating_timestamp_utc DESC LIMIT 1
Database: movie_platform
Tables: lists, movies, ratings_users, lists_users, ratings
Columns (table index, column name): -1, *, 0, user_id, 0, list_id, 0, list_title, 0, list_movie_number, 0, list_update_timestamp_utc, 0, list_creation_timestamp_utc, 0, list_followers, 0, list_url, 0, list_comments, 0, list_description, 0, list_cover_image_url, 0, list_first_image_url, 0, list_second_image_url, 0, list_third_image_url, 1, movie_id, 1, movie_title, 1, movie_release_year, 1, movie_url, 1, movie_title_language, 1, movie_popularity, 1, movie_image_url, 1, director_id, 1, director_name, 1, director_url, 2, user_id, 2, rating_date_utc, 2, user_trialist, 2, user_subscriber, 2, user_avatar_image_url, 2, user_cover_image_url, 2, user_eligible_for_trial, 2, user_has_payment_method, 3, user_id, 3, list_id, 3, list_update_date_utc, 3, list_creation_date_utc, 3, user_trialist, 3, user_subscriber, 3, user_avatar_image_url, 3, user_cover_image_url, 3, user_eligible_for_trial, 3, user_has_payment_method, 4, movie_id, 4, rating_id, 4, rating_url, 4, rating_score, 4, rating_timestamp_utc, 4, critic, 4, critic_likes, 4, critic_comments, 4, user_id, 4, user_trialist, 4, user_subscriber, 4, user_eligible_for_trial, 4, user_has_payment_method
Question: What are the top 10 oldest movies and what are the average rating score for each movie? Indicate the name of the director and when the movies were released.
Evidence: the average rating score refers to AVG(T2.rating_score); oldest movies refers to MIN(rating_timestamp_utc)
SQL: SELECT T2.movie_id, AVG(T1.rating_score), T2.director_name, T2.movie_release_year FROM ratings AS T1 INNER JOIN movies AS T2 ON T1.movie_id = T2.movie_id ORDER BY T1.rating_timestamp_utc ASC LIMIT 10
Database: book_publishing_company
Tables: authors, jobs, publishers, employee, pub_info, stores, discounts, titles, roysched, sales, titleauthor
Columns (table index, column name): -1, *, 0, au_id, 0, au_lname, 0, au_fname, 0, phone, 0, address, 0, city, 0, state, 0, zip, 0, contract, 1, job_id, 1, job_desc, 1, min_lvl, 1, max_lvl, 2, pub_id, 2, pub_name, 2, city, 2, state, 2, country, 3, emp_id, 3, fname, 3, minit, 3, lname, 3, job_id, 3, job_lvl, 3, pub_id, 3, hire_date, 4, pub_id, 4, logo, 4, pr_info, 5, stor_id, 5, stor_name, 5, stor_address, 5, city, 5, state, 5, zip, 6, discounttype, 6, stor_id, 6, lowqty, 6, highqty, 6, discount, 7, title_id, 7, title, 7, type, 7, pub_id, 7, price, 7, advance, 7, royalty, 7, ytd_sales, 7, notes, 7, pubdate, 8, title_id, 8, lorange, 8, hirange, 8, royalty, 9, stor_id, 9, ord_num, 9, ord_date, 9, qty, 9, payterms, 9, title_id, 10, au_id, 10, title_id, 10, au_ord, 10, royaltyper
Question: Which date has the most ordered quantity? What is the total order quantity on that day?
Evidence: total quantity refers to qty; most ordered quantity refers to order with the highest quantity where MAX(sum(qty))
SQL: SELECT ord_date, SUM(qty) FROM sales GROUP BY ord_date ORDER BY SUM(qty) DESC LIMIT 1
Database: book_publishing_company
Tables: authors, jobs, publishers, employee, pub_info, stores, discounts, titles, roysched, sales, titleauthor
Columns (table index, column name): -1, *, 0, au_id, 0, au_lname, 0, au_fname, 0, phone, 0, address, 0, city, 0, state, 0, zip, 0, contract, 1, job_id, 1, job_desc, 1, min_lvl, 1, max_lvl, 2, pub_id, 2, pub_name, 2, city, 2, state, 2, country, 3, emp_id, 3, fname, 3, minit, 3, lname, 3, job_id, 3, job_lvl, 3, pub_id, 3, hire_date, 4, pub_id, 4, logo, 4, pr_info, 5, stor_id, 5, stor_name, 5, stor_address, 5, city, 5, state, 5, zip, 6, discounttype, 6, stor_id, 6, lowqty, 6, highqty, 6, discount, 7, title_id, 7, title, 7, type, 7, pub_id, 7, price, 7, advance, 7, royalty, 7, ytd_sales, 7, notes, 7, pubdate, 8, title_id, 8, lorange, 8, hirange, 8, royalty, 9, stor_id, 9, ord_num, 9, ord_date, 9, qty, 9, payterms, 9, title_id, 10, au_id, 10, title_id, 10, au_ord, 10, royaltyper
Question: What is the title with the most ordered quantity in year 1992?
Evidence: total quantity refers to qty; most ordered quantity refers to order with the highest quantity where MAX(count(qty)); date refers to ord_date; year 1992 refers to YEAR(ord_date) = 1992
SQL: SELECT T2.title FROM sales AS T1 INNER JOIN titles AS T2 ON T1.title_id = T2.title_id WHERE STRFTIME('%Y', T1.ord_date) = '1992' ORDER BY T1.qty DESC LIMIT 1
Database: book_publishing_company
Tables: authors, jobs, publishers, employee, pub_info, stores, discounts, titles, roysched, sales, titleauthor
Columns (table index, column name): -1, *, 0, au_id, 0, au_lname, 0, au_fname, 0, phone, 0, address, 0, city, 0, state, 0, zip, 0, contract, 1, job_id, 1, job_desc, 1, min_lvl, 1, max_lvl, 2, pub_id, 2, pub_name, 2, city, 2, state, 2, country, 3, emp_id, 3, fname, 3, minit, 3, lname, 3, job_id, 3, job_lvl, 3, pub_id, 3, hire_date, 4, pub_id, 4, logo, 4, pr_info, 5, stor_id, 5, stor_name, 5, stor_address, 5, city, 5, state, 5, zip, 6, discounttype, 6, stor_id, 6, lowqty, 6, highqty, 6, discount, 7, title_id, 7, title, 7, type, 7, pub_id, 7, price, 7, advance, 7, royalty, 7, ytd_sales, 7, notes, 7, pubdate, 8, title_id, 8, lorange, 8, hirange, 8, royalty, 9, stor_id, 9, ord_num, 9, ord_date, 9, qty, 9, payterms, 9, title_id, 10, au_id, 10, title_id, 10, au_ord, 10, royaltyper
Question: List the title, price and publication date for all sales with 'ON invoice' payment terms.
Evidence: publication date refers to pubdate; payment terms refers to payterms; payterms = 'ON invoice'
SQL: SELECT T2.title, T2.price, T2.pubdate FROM sales AS T1 INNER JOIN titles AS T2 ON T1.title_id = T2.title_id WHERE T1.payterms = 'ON invoice'
Database: book_publishing_company
Tables: authors, jobs, publishers, employee, pub_info, stores, discounts, titles, roysched, sales, titleauthor
Columns (table index, column name): -1, *, 0, au_id, 0, au_lname, 0, au_fname, 0, phone, 0, address, 0, city, 0, state, 0, zip, 0, contract, 1, job_id, 1, job_desc, 1, min_lvl, 1, max_lvl, 2, pub_id, 2, pub_name, 2, city, 2, state, 2, country, 3, emp_id, 3, fname, 3, minit, 3, lname, 3, job_id, 3, job_lvl, 3, pub_id, 3, hire_date, 4, pub_id, 4, logo, 4, pr_info, 5, stor_id, 5, stor_name, 5, stor_address, 5, city, 5, state, 5, zip, 6, discounttype, 6, stor_id, 6, lowqty, 6, highqty, 6, discount, 7, title_id, 7, title, 7, type, 7, pub_id, 7, price, 7, advance, 7, royalty, 7, ytd_sales, 7, notes, 7, pubdate, 8, title_id, 8, lorange, 8, hirange, 8, royalty, 9, stor_id, 9, ord_num, 9, ord_date, 9, qty, 9, payterms, 9, title_id, 10, au_id, 10, title_id, 10, au_ord, 10, royaltyper
Question: What is the title that have at least 10% royalty without minimum range amount.
Evidence: at least 10% royalty refers to royalty > = 10; minimum range is synonym for low range which refers to lorange; without minimum range amount refers to lorange <> 0
SQL: SELECT T1.title FROM titles AS T1 INNER JOIN roysched AS T2 ON T1.title_id = T2.title_id WHERE T2.lorange = 0 AND T2.royalty >= 10
Database: book_publishing_company
Tables: authors, jobs, publishers, employee, pub_info, stores, discounts, titles, roysched, sales, titleauthor
Columns (table index, column name): -1, *, 0, au_id, 0, au_lname, 0, au_fname, 0, phone, 0, address, 0, city, 0, state, 0, zip, 0, contract, 1, job_id, 1, job_desc, 1, min_lvl, 1, max_lvl, 2, pub_id, 2, pub_name, 2, city, 2, state, 2, country, 3, emp_id, 3, fname, 3, minit, 3, lname, 3, job_id, 3, job_lvl, 3, pub_id, 3, hire_date, 4, pub_id, 4, logo, 4, pr_info, 5, stor_id, 5, stor_name, 5, stor_address, 5, city, 5, state, 5, zip, 6, discounttype, 6, stor_id, 6, lowqty, 6, highqty, 6, discount, 7, title_id, 7, title, 7, type, 7, pub_id, 7, price, 7, advance, 7, royalty, 7, ytd_sales, 7, notes, 7, pubdate, 8, title_id, 8, lorange, 8, hirange, 8, royalty, 9, stor_id, 9, ord_num, 9, ord_date, 9, qty, 9, payterms, 9, title_id, 10, au_id, 10, title_id, 10, au_ord, 10, royaltyper
Question: State the title and royalty percentage for title ID BU2075 between 10000 to 50000 range.
Evidence: lorange mean low range; hirange mean high range; range refers to between the low and high range; lorange>10000; hirange<12000
SQL: SELECT T1.title, T2.royalty FROM titles AS T1 INNER JOIN roysched AS T2 ON T1.title_id = T2.title_id WHERE T2.lorange > 10000 AND T2.hirange < 50000 AND T1.title_ID = 'BU2075'
Database: book_publishing_company
Tables: authors, jobs, publishers, employee, pub_info, stores, discounts, titles, roysched, sales, titleauthor
Columns (table index, column name): -1, *, 0, au_id, 0, au_lname, 0, au_fname, 0, phone, 0, address, 0, city, 0, state, 0, zip, 0, contract, 1, job_id, 1, job_desc, 1, min_lvl, 1, max_lvl, 2, pub_id, 2, pub_name, 2, city, 2, state, 2, country, 3, emp_id, 3, fname, 3, minit, 3, lname, 3, job_id, 3, job_lvl, 3, pub_id, 3, hire_date, 4, pub_id, 4, logo, 4, pr_info, 5, stor_id, 5, stor_name, 5, stor_address, 5, city, 5, state, 5, zip, 6, discounttype, 6, stor_id, 6, lowqty, 6, highqty, 6, discount, 7, title_id, 7, title, 7, type, 7, pub_id, 7, price, 7, advance, 7, royalty, 7, ytd_sales, 7, notes, 7, pubdate, 8, title_id, 8, lorange, 8, hirange, 8, royalty, 9, stor_id, 9, ord_num, 9, ord_date, 9, qty, 9, payterms, 9, title_id, 10, au_id, 10, title_id, 10, au_ord, 10, royaltyper
Question: Among the titles with royalty percentage, which title has the greatest royalty percentage. State it's minimum range to enjoy this royalty percentage.
Evidence: minimum range is synonym for low range which refers to lorange
SQL: SELECT T1.title, T2.lorange FROM titles AS T1 INNER JOIN roysched AS T2 ON T1.title_id = T2.title_id ORDER BY T2.royalty DESC LIMIT 1
Database: book_publishing_company
Tables: authors, jobs, publishers, employee, pub_info, stores, discounts, titles, roysched, sales, titleauthor
Columns (table index, column name): -1, *, 0, au_id, 0, au_lname, 0, au_fname, 0, phone, 0, address, 0, city, 0, state, 0, zip, 0, contract, 1, job_id, 1, job_desc, 1, min_lvl, 1, max_lvl, 2, pub_id, 2, pub_name, 2, city, 2, state, 2, country, 3, emp_id, 3, fname, 3, minit, 3, lname, 3, job_id, 3, job_lvl, 3, pub_id, 3, hire_date, 4, pub_id, 4, logo, 4, pr_info, 5, stor_id, 5, stor_name, 5, stor_address, 5, city, 5, state, 5, zip, 6, discounttype, 6, stor_id, 6, lowqty, 6, highqty, 6, discount, 7, title_id, 7, title, 7, type, 7, pub_id, 7, price, 7, advance, 7, royalty, 7, ytd_sales, 7, notes, 7, pubdate, 8, title_id, 8, lorange, 8, hirange, 8, royalty, 9, stor_id, 9, ord_num, 9, ord_date, 9, qty, 9, payterms, 9, title_id, 10, au_id, 10, title_id, 10, au_ord, 10, royaltyper
Question: Provide a list of titles together with its publisher name for all publishers located in the USA.
Evidence: publisher name refers to pub_name;
SQL: SELECT T1.title, T2.pub_name FROM titles AS T1 INNER JOIN publishers AS T2 ON T1.pub_id = T2.pub_id WHERE T2.country = 'USA'