human
Schema:
book_club (book_club_id, Year, Author_or_Editor, Book_Title, Publisher, Category, Result)
movie (movie_id, Title, Year, Director, Budget_million, Gross_worldwide)
culture_company (Company_name, Type, Incorporated_in, Group_Equity_Shareholding, book_club_id, movie_id)
Please answer with SQL.
assistant
Sure, I understand.
human
What is the publisher with most number of books?
assistant
SELECT publisher FROM book_club GROUP BY publisher ORDER BY count(*) DESC LIMIT 1
human
How many movie directors are there?
assistant
SELECT COUNT (DISTINCT director) FROM movie
human
Show all movie titles, years, and directors, ordered by budget.
assistant
SELECT title , YEAR , director FROM movie ORDER BY budget_million
human
List all company names with a book published by Alyson.
assistant
SELECT T1.company_name FROM culture_company AS T1 JOIN book_club AS T2 ON T1.book_club_id = T2.book_club_id WHERE T2.publisher = 'Alyson'
human
Show all company names with a movie directed in year 1999.
assistant
SELECT T2.company_name FROM movie AS T1 JOIN culture_company AS T2 ON T1.movie_id = T2.movie_id WHERE T1.year = 1999
human
What are the titles of movies and books corresponding to companies incorporated in China?
assistant
SELECT T1.title , T3.book_title FROM movie AS T1 JOIN culture_company AS T2 ON T1.movie_id = T2.movie_id JOIN book_club AS T3 ON T3.book_club_id = T2.book_club_id WHERE T2.incorporated_in = "China" ;