recategorized by
4,417 views
24 votes
24 votes

Consider the relation scheme.$$\begin{array}{ll} \text{AUTHOR} & \text{(ANAME, INSTITUTION, ACITY, AGE)} \\\hline  \text{PUBLISHER} & \text{(PNAME, PCITY)} \\\hline   \text{BOOK} & \text{(TITLE, ANAME, PNAME)} \\ \end{array}$$Express the following queries using (one or more of) SELECT, PROJECT, JOIN and DIVIDE operations.

  1. Get the names of all publishers.

  2. Get values of all attributes of all authors who have published a book for the publisher with PNAME=’TECHNICAL PUBLISHERS’.

  3. Get the names of all authors who have published a book for any publisher located in Madras

recategorized by

3 Answers

Best answer
30 votes
30 votes
  1. $\pi _{pname}(publishers)$

  1. $\pi _{authers.*}(\sigma_{ book.pname = "TECHNICAL\; PUBLISHERS" }(book) \;\Join \;authors )$

  1. $\pi _{book.aname}(\sigma_{publishers.pcity = "Madras" }(publishers)\; \Join\;book )$
edited by
11 votes
11 votes

a. select pname

    from publisher;




2. select author*

    from author, book
    where author.aname = book.aname and book.pname = 'TECHNICAL PUBLISHERS';




3. select author.aname 

     from author, book, publisher

   where author.aname = book.aname and book.pname = publisher.pname and publisher.pcity='Madras';

edited by
5 votes
5 votes

Relational algebra is a Procedural language so syntax and meaning of it must be correct.

edited by

Related questions

28 votes
28 votes
6 answers
1
Kathleen asked Oct 8, 2014
11,084 views
Consider the relation scheme $R(A, B, C)$ with the following functional dependencies:$A, B \rightarrow C,$$C \rightarrow A$Show that the scheme $R$ is in $3\text{NF}$ but...
7 votes
7 votes
1 answer
2
go_editor asked Feb 12, 2018
2,513 views
What is the equivalent minimal Boolean expression (in sum of products form) for the Karnaugh map given below?
25 votes
25 votes
3 answers
3
Kathleen asked Oct 8, 2014
3,638 views
What is the number of binary trees with $3$ nodes which when traversed in post-order give the sequence $A, B, C ?$ Draw all these binary trees.
27 votes
27 votes
5 answers
4
Kathleen asked Oct 8, 2014
6,465 views
Let $G_1$ and $G_2$ be subgroups of a group $G$.Show that $G_1 \cap G_2$ is also a subgroup of $G$.Is $G_1 \cup G_2$ always a subgroup of $G$?.