Suppose, a database consists of the following relations: SUPPLIER (SCODE,…

PYQ GATE 1991

Suppose, a database consists of the following relations:

SUPPLIER (SCODE, SNAME, CITY)

PART (PCODE, PNAME, PDESC, CITY)

PROJECTS (PRCODE, PRNAME, CITY)

SPRR (SCODE, PCODE, PRCODE, QJY)

(a) Write SQL programs corresponding to the following queries:

(i) Print PCODE value for parts supplied to any project in DELHI by a supplier in DELHI.

(ii) Print all triples (CITY, PCODE, CITY), such that a supplier in the first city supplies the specified part to a project in the second city, but do not print triples in which the two CITY values are the same.

(b) Write algebraic solutions to the following:

(i) Get SCODE values for suppliers who supply to both projects PR1 and PR2.

(ii) Get PRCODE values for projects supplied by at least one supplier not in the same city.

Attempted by 1 students.

Sign up free to check your answer

Sign up free

Explore the full course: Zero To Hero

Loading lesson…