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 publishers that have more than one publication.
assistant
SELECT Publisher FROM publication GROUP BY Publisher HAVING COUNT(*) > 1
human
Show the title and publication dates of books.
assistant
SELECT T1.Title , T2.Publication_Date FROM book AS T1 JOIN publication AS T2 ON T1.Book_ID = T2.Book_ID
human
List the publication dates of publications with 3 lowest prices.
assistant
SELECT Publication_Date FROM publication ORDER BY Price ASC LIMIT 3
human
What are the dates of publications in descending order of price?
assistant
SELECT Publication_Date FROM publication ORDER BY Price DESC
human
Please show the most common publication date.
assistant
SELECT Publication_Date FROM publication GROUP BY Publication_Date ORDER BY COUNT(*) DESC LIMIT 1
human
How many distinct publication dates are there in our record?
assistant
SELECT COUNT( DISTINCT Publication_Date ) FROM publication ;