It's a really easy SQL query. I don't know how to squeeze it crying

Asked 2 years ago, Updated 2 years ago, 33 views

Books, book numbers, publishers, and year of publication are included in the relationship. (Basic key is book number)

I would like to print out the name of the publisher that has published more than 10 books in SQL since 2010

I don't think you're simply extracting it from where. I don't know how to squeeze it.

sql

2022-09-22 21:15

1 Answers

Once the name of the publisher is found, the selection attribute is only publisher, and

SELECT Publisher

And the issue year should be after 2010

 WHERE Issue Year >= 2010

For each publisher

GROUP BY Publisher

If you filter the occurrence of more than 10 books (COUNT),

HAVING COUNT >= 10

I think it's going to be SQL.

SELECT Publisher WHERE Publishing Year >= 2010 GROUP BY Publisher HAVING COUNT >= 10

SQL's GROUP BY... HAVING ...I think you can study the contents of

Note


2022-09-22 21:15

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.