6 ms·
I like the SQL solutions people posted. But what about this one in Prolog? ?- setof(Author, Book^Pages^(book_author(Book, Author), book_pages(Book, Pages), P
by matejn 2y ago
I like the SQL solutions people posted. But what about this one in Prolog?
?- setof(Author, Book^Pages^(book_author(Book, Author), book_pages(Book, Pages), Pages > 1000), Authors).
Depending on the structure of the Prolog database, it could be shorter:
?- setof(Author, Pages^(book(_, Author, Pages), Pages > 1000), Authors).