Lecture4 - results(V inner join PROJ1 union(V inner join PROJ2 select ENAME from V inner join PROJ1 on V.PNO=PROJ1.PNO where PNAME=”CAD” union

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
Exercise 6.3: Assume that relation PROJ is horizontally fragmented as: o o Modify the query obtained in Exercise 6.2 (this means that you should first solve Exercise 6.2 but do not post it in WebTycho!) to a query expressed on fragments. View V is defined in exercise 6.1, and it has the following attributes: (ENO, ENAME, PNO, RESP). To obtain the project name, we inner join the view with PROJ relation (PNO, PNAME, BUDGET, LOC). In general, since the PROJ relation is broken into 2 fragments, we need to inner join the view with both fragments, and take a union the
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: results. (V inner join PROJ1) union (V inner join PROJ2) select ENAME from V inner join PROJ1 on V.PNO=PROJ1.PNO where PNAME=”CAD” union select ENAME from V inner join PROJ2 on V.PNO=PROJ2.PNO where PNAME=”CAD” Since PROJ 2 doesn’t have any records where PNAME=“CAD” , the second join doesn’t return any records. Hence, the query becomes: select ENAME from V inner join PROJ1 on V.PNO=PROJ1.PNO where PNAME=”CAD”...
View Full Document

This note was uploaded on 12/23/2009 for the course DBST 663 taught by Professor Tba during the Spring '09 term at MD University College.

Ask a homework question - tutors are online