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
Show the years, book titles, and publishers for all books, in descending order by year.
assistant
SELECT YEAR , book_title , publisher FROM book_club ORDER BY YEAR DESC
human
Show all publishers which do not have a book in 1989.
assistant
SELECT publisher FROM book_club EXCEPT SELECT publisher FROM book_club WHERE YEAR = 1989
human
show the titles, and authors or editors for all books made after the year 1989.
assistant
SELECT book_title , author_or_editor FROM book_club WHERE YEAR > 1989
human
Show all distinct publishers for books.
assistant
SELECT DISTINCT publisher FROM book_club
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
What are all the company names that have 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" ;