Содержание
- 2. CONTENTS Relational calculus (tuple, domain) Codd calculus ALPHA language Equivalence and completeness Examples
- 3. Set theory and logic Set theory Predicate calculus Relationships (relations) Set М Р(х); Р – predicate
- 4. Relational calculus Subset of formulas of the predicate calculus Formal description of WHAT it is necessary
- 5. Tuple relational calculus (TRC) Query (in simple case) has the form {t | (F(t)} t -
- 6. TRC – basic components Constants: 7, 'john', 3.14159 and so on. Tuple variables: t1, t2,... –
- 7. TRC – Well formed formulas Atomic formulas: P(t) - P – predicate symbol, - t -
- 8. TRC – Free and bound variables. Queries. The use of quantifiers ∃tF(t) and ∀tF(t) in any
- 9. Example of DB for queries in TRC FAC FACULTY (FNo, Name, Dean, Bld, Fund) DEP DEPARTMENT
- 10. TRC – Examples of projection, selection and join 1) Projection Query. Output faculty names and deans
- 11. TRC – Examples of existential quantifiers {(f.Name,d.Name) | DEP(d) & FAC(f) & f.FNo = d.FNo &
- 12. TRC – Examples of universal quantifiers Query. Output numbers of the teachers that have lectures in
- 13. TRC - Save formulas and queries Exist such syntactically correct queries that do not have correct
- 14. Restricted variables Tuple variable is restricted if it belongs to any predicate that is interpreted by
- 15. Restricted logical connectives If two formulas F and G have restricted variables then: F ∨ G
- 16. Restricted quantifiers Примеры: ∃x(x.Fund ∃x(P(x) & x.Fund ∀x(P(x)) → Q(x, y)) – universal quantifier is restricted
- 17. Domain Relational Calculus (DRC) Query has the form {x1,x2,...,xn | (F(x1,x2,...,xn)} x1,x2,...,xn - attributes domain variables;
- 18. Example of queries in DRC 1) Projection Query. Output faculty names and deans {(y, z)|∃x∃u∃vFAC(x,y,z,u,v)} 2)
- 19. Equivalence of RA, TRC, DRC and relational completeness. Thesis (relational completeness): Any relational language is relationally
- 20. Codd relational calculus (СRС) CRC is subset of the predicate calculus (of the 1-st order) It
- 21. CRC – basic components Constants: 7, 'john', 3.14159 and so on. Tuple variables: t1, t2,... –
- 22. CRC – well formed formulas Terms: P.t – value term: P - predicate, t - tuple
- 23. Formula well defined over quantifiers As a matter of fact, it is a special case of
- 24. Formula with domain of definition Formula W refers to as formula with domain of definition if
- 25. Alpha expression Expression (t1, t2,…, tk) : W is calles simple alpha expression if it has
- 26. ALPHA language Simplified syntax: RANGE [ SOME | ALL] … GET ( ) : range –
- 27. Example of queries in ALPHA and CRC Query. Output names of faculties and their deans CRC:
- 29. Скачать презентацию