edited by
2,367 views
8 votes
8 votes

Suppose a database consist of the following relations:

SUPPLIER (SCODE,SNAME,CITY).

PART (PCODE,PNAME,PDESC,CITY).

PROJECTS (PRCODE,PRNAME,PRCITY).

SPPR (SCODE,PCODE,PRCODE,QTY).

Write algebraic solution to the following :

  1. Get SCODE values for suppliers who supply to both projects PR1 and PR2.
  2. Get PRCODE values for projects supplied by at least one supplier not in the same city.
edited by

2 Answers

12 votes
12 votes
SCODE values for suppliers who supply to both projects PR1 and PR2 -

$\Pi_{scode, prcode}(SPPR)÷\Pi_{prcode}(\sigma_{prname=pr1\vee prname=pr2}(PROJECTS))$

PRCODE values for projects supplied by at least one supplier not in the same city -

$\Pi_{prcode}(\sigma _{city<>prcity}((SUPPLIER*SPPR)*PROJECTS))$

* is natural join.
2 votes
2 votes

Ans of these two questions are below

edited by

Related questions

20 votes
20 votes
3 answers
2
Akash Kanase asked Apr 18, 2016
3,451 views
Consider the binary tree in the figure below:Give different steps for deleting the node with key $5$ so that the structure is preserved.
40 votes
40 votes
9 answers
4