Relational Algebra & Calculus


Answer & solution
Answer: π_ANAME(AUTHOR ⋈ BOOK ⋈ σ_PCITY='Madras'(PUBLISHER)). (no official key was published)
Select publishers by their city: M=σ_PCITY='Madras'(PUBLISHER). Join BOOK to M on the common attribute PNAME. This keeps exactly books whose publisher is among the Madras publishers. Join the result to AUTHOR on ANAME, and finally project ANAME. A full expression is π_ANAME(AUTHOR⋈BOOK⋈σ_PCITY='Madras'(PUBLISHER)). Natural joins are unambiguous here: BOOK and PUBLISHER share PNAME, while AUTHOR and BOOK share ANAME. ACITY and PCITY are different attributes.
The test is on the publisher's city PCITY, not the author's city ACITY. An author outside Madras qualifies if at least one book has a Madras publisher. Conversely an author living in Madras does not qualify solely because of that residence. The word 'any' here is existential: one matching publisher is enough, so use selection and join rather than division.
Under an assumed foreign-key constraint BOOK.ANAME references AUTHOR.ANAME, the AUTHOR join can be omitted and π_ANAME(BOOK⋈M) is equivalent. Since that referential constraint is not explicitly stated, retaining AUTHOR is the safer literal expression for names of stored authors. Projection removes repetitions caused by multiple qualifying books or publishers under set semantics. Exact comparison uses the displayed city value 'Madras', not a silently substituted modern place-name string.