# Question

Let R = (A, B) and S = (A, C), and let r(R) and s(S) be relations.Write expressions in QBE and Datalog for each of the following queries:

a. {< a > | ∃ b (< a, b >∈ r ∧ b = 17)}

b. {< a, b, c > | < a, b >∈ r ∧ < a,c >∈ s}

c. {< a > | ∃ c (< a,c >∈ s ∧ ∃b1, b2 (< a,b1 > ∈ r ∧ < c, b2 > ∈ r ∧ b1 > b2))}

a. {< a > | ∃ b (< a, b >∈ r ∧ b = 17)}

b. {< a, b, c > | < a, b >∈ r ∧ < a,c >∈ s}

c. {< a > | ∃ c (< a,c >∈ s ∧ ∃b1, b2 (< a,b1 > ∈ r ∧ < c, b2 > ∈ r ∧ b1 > b2))}

## Answer to relevant Questions

Consider the relational database of Figure. Write a Datalog program for each of the following queries:a. Find all employees who work (directly or indirectly) under the manager “Jones”.b. Find all cities of residence of ...Referential-integrity constraints as defined in this chapter involve exactly two relations. Consider a database that includes the following relations:salaried-worker (name, office, phone, salary)hourly-worker (name, ...Using the relations of our sample bank database, write an SQL expression to define the following views:a. A view containing the account numbers and customer names (but not the balances) for all accounts at the Deer Park ...Suppose that we decompose the schema R = (A, B, C, D, E) into (A, B, C) (A, D, E). Show that this decomposition is a loss less-join decomposition if the following set F of functional dependencies holds: A → BC CD ...Explain how functional dependencies can be used to indicate the following:• A one-to-one relationship set exists between entity sets account and customer.• A many-to-one relationship set exists between entity sets ...Post your question

0