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

In the course of the database theory, we study the key concept regarding the database. The major points in these homework exercises are:Conjunctive Queries, Recall Notation, Relation with Attributes, Algebra Query, Tableau Corresponding to Query, Using Chase, Number of Joins, Set of Constraints, Applied to Relations, Possible for Set

Typology: Exercises

2012/2013

Uploaded on 04/24/2013

bandhula
bandhula 🇮🇳

4.7

(10)

91 documents

1 / 1

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

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
(q2q3), then q1q2or q1q3(recall that the notation prfor 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
AD, 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
{AB, 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 XYwhere YX; 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