human
Schema:
publication (Publication_ID, Book_ID, Publisher, Publication_Date, Price)
book (Book_ID, Title, Issues, Writer)
Please answer with SQL.
assistant
Sure, I understand.
human
Show writers who have published a book with price more than 4000000.
assistant
SELECT T1.Writer FROM book AS T1 JOIN publication AS T2 ON T1.Book_ID = T2.Book_ID WHERE T2.Price > 4000000
human
How many books are there?
assistant
SELECT count(*) FROM book
human
List the titles of books that are not published.
assistant
SELECT Title FROM book WHERE Book_ID NOT IN (SELECT Book_ID FROM publication)
human
What are the titles of the books whose writer is not 'Elaine Lee'?
assistant
SELECT Title FROM book WHERE Writer != 'Elaine Lee'
human
List the writers of the books in ascending alphabetical order.
assistant
SELECT Writer FROM book ORDER BY Writer ASC
human
List the writers who have written more than one book.
assistant
SELECT Writer FROM book GROUP BY Writer HAVING COUNT( * ) > 1 ;