1. Homepage
  2. Homework
  3. CSE233 DATABASE THEORY - Problem Set #2: Relational calculus
This question has been solved

CSE233 DATABASE THEORY - Problem Set #2: Relational calculus

Engage in a Conversation
UCSDCSE233DATABASE THEORYRelational calculusSQL

CSE 233 Spring 2024 CourseNana.COM

Problem Set #2 CourseNana.COM

Due on Tuesday, April 30, 5pm (in class) CourseNana.COM

Please typeset your answer (latex recommended). CourseNana.COM

1. (3 points) Prove that it is undecidable whether a CALC query is mono- tonic (recall that a query Q is monotonic if for all databases D1,D2, if D1 D2 then Q(D1) Q(D2)). CourseNana.COM

2. (3 points) Let Q1, Q2, Q3 be conjunctive queries (no equality). Prove that, if Q1 (Q2 Q3), then Q1 Q2 or Q1 Q3 (recall that the notation P R for queries P,R means that P(I) R(I) for every database I). CourseNana.COM

3. (i) (4 points) The language CALC consists of all CALC sentences of the form CourseNana.COM

y1 ...ynz1 ...zm φ(y1,...,yn,z1 ...zm) CourseNana.COM

where φ is a quantifier-free CALC formula. Prove that satisfiability is decid- able for sentences in CALC. Hint: Come up with a bound on the size of databases one needs to look at in order to check satisfiability. More pre- cisely, show that a sentence Q in this language is satisfiable iff it is satisfied on some database of size bounded by f(Q) for some computable function f. (ii) (3 points) The language CQconsists of queries of the form φ(x ̄) ψ(x ̄) where φ and ψ are CQs. Prove that equivalence of CQqueries is decidable. CourseNana.COM

4. (5 points) A database consists of the following binary relations: PAB QBC RAC CourseNana.COM

(P with attributes AB, Q with attributes BC and R with attributes AC). Consider the relational algebra query P I Q I R (equivalent to the formula φ(a,b,c) = P(a,b)Q(b,c)R(a,c)). Assuming that P,Q and R have size at most n (i.e. they each contain at most n pairs), find the tightest upper boundyoucanonthesizeofP IQIR,asafunctionofn. CourseNana.COM

Hint: There is an obvious upper bound of n2. Try to do better. 1 CourseNana.COM

CourseNana.COM

5. (2 points) Recall the movie database in Problem 1 of the previous home- work, and the query List the theaters showing only movies by Hitchcock. Express this query in nr-Datalog¬. CourseNana.COM

Get in Touch with Our Experts

WeChat (微信) WeChat (微信)
Whatsapp WhatsApp
UCSD代写,CSE233代写,DATABASE THEORY代写,Relational calculus代写,SQL代写,UCSD代编,CSE233代编,DATABASE THEORY代编,Relational calculus代编,SQL代编,UCSD代考,CSE233代考,DATABASE THEORY代考,Relational calculus代考,SQL代考,UCSDhelp,CSE233help,DATABASE THEORYhelp,Relational calculushelp,SQLhelp,UCSD作业代写,CSE233作业代写,DATABASE THEORY作业代写,Relational calculus作业代写,SQL作业代写,UCSD编程代写,CSE233编程代写,DATABASE THEORY编程代写,Relational calculus编程代写,SQL编程代写,UCSDprogramming help,CSE233programming help,DATABASE THEORYprogramming help,Relational calculusprogramming help,SQLprogramming help,UCSDassignment help,CSE233assignment help,DATABASE THEORYassignment help,Relational calculusassignment help,SQLassignment help,UCSDsolution,CSE233solution,DATABASE THEORYsolution,Relational calculussolution,SQLsolution,