Docsity

Conjunctive Queries - Database Theory - Homework, Exercises of Introduction to Database Management Systems

Toggle sidebar
bg1
CSE 233 Spring, 2012
Problem Set #2
Due on Tuesday, May 1
This is an individual assignment and the usual criteria for academic
integrity apply. It is recommended to typeset your answer (latex preferred).
1. Let q1, q2, q3be conjunctive queries (no equality). Prove that, if q1โІ
(q2โˆชq3), then q1โІq2or q1โІq3(recall that the notation pโІrfor queries
p, r means that p(I)โІr(I) for every database I).
2. Let Rbe a relation with attributes ABC D. Consider the algebra query
ฯ€AC [ฯ€AB(R)1ฯ€B C (ฯƒC=0(R))] 1ฯ€C D(ฯƒB=5(R)).
(a) Construct the tableau corresponding to the query. Is it minimal (ex-
plain)?
(b) Using the chase, minimize the tableau in (a) knowing that the query
is only applied to databases satisfying the FDs
Aโ†’D, CD โ†’B , C โ†’A.
(c) Construct an algebra query corresponding to the minimized tableau
obtained in (b).
3. Let Rbe a relation over ABCD E. Minimize the number of joins in the
query
ฯ€ACE (R)1ฯ€ADE (R)1ฯ€B CD(R)
knowing that it is only applied to relations Rsatisfying the set of constraints
{Aโ†’B, E โ†’D, D โ†’โ†’ E}.
4. Prove or disprove the following statement: it is possible for a set of
MVDs to imply a non-trivial FD. More precisely, there exists a set โˆ† of
MVDs and a non-trivial FD fsuch that โˆ† |=f. (An FD is trivial if it is of
the form Xโ†’Ywhere YโІX; such an FD is always true.).
1
Docsity.com

Partial preview of the text

Download Conjunctive Queries - Database Theory - Homework and more Exercises Introduction to Database Management Systems in PDF only on Docsity!

CSE 233 Spring, 2012

Problem Set

Due on Tuesday, May 1

This is an individual assignment and the usual criteria for academic integrity apply. It is recommended to typeset your answer (latex preferred).

  1. Let q 1 , q 2 , q 3 be conjunctive queries (no equality). Prove that, if q 1 โІ (q 2 โˆช q 3 ), then q 1 โІ q 2 or q 1 โІ q 3 (recall that the notation p โІ r for queries p, r means that p(I) โІ r(I) for every database I).
  2. Let R be a relation with attributes ABCD. Consider the algebra query

ฯ€AC [ฯ€AB (R) 1 ฯ€BC (ฯƒC=0(R))] 1 ฯ€CD(ฯƒB=5(R)).

(a) Construct the tableau corresponding to the query. Is it minimal (ex- plain)?

(b) Using the chase, minimize the tableau in (a) knowing that the query is only applied to databases satisfying the FDs

A โ†’ D, CD โ†’ B, C โ†’ A.

(c) Construct an algebra query corresponding to the minimized tableau obtained in (b).

  1. Let R be a relation over ABCDE. Minimize the number of joins in the query ฯ€ACE (R) 1 ฯ€ADE (R) 1 ฯ€BCD(R)

knowing that it is only applied to relations R satisfying the set of constraints {A โ†’ B, E โ†’ D, D โ†’โ†’ E}.

  1. Prove or disprove the following statement: it is possible for a set of MVDs to imply a non-trivial FD. More precisely, there exists a set โˆ† of MVDs and a non-trivial FD f such that โˆ† |= f. (An FD is trivial if it is of the form X โ†’ Y where Y โІ X; such an FD is always true.).

Docsity.com