tailieunhanh - Lecture Database system concepts (6/e): Chapter 6 - Silberschatz, Korth, Sudarshan

Chapter 6 - Formal relational query languages. In this chapter, we start by presenting the relational algebra, which forms the basis of the widely used SQL query language. We then cover the tuple relational calculus and the domain relational calculus, which are declarative query languages based on mathematical logic. | Chapter 6: Formal Relational Query Languages Database System Concepts, 6th Ed. ©Silberschatz, Korth and Sudarshan See for conditions on re-use Chapter 6: Formal Relational Query Languages Relational Algebra Tuple Relational Calculus Domain Relational Calculus Database System Concepts - 6th Edition ©Silberschatz, Korth and Sudarshan Relational Algebra Procedural language Six basic operators select: σ project: ∏ union: ∪ set difference: – Cartesian product: x rename: ρ The operators take one or two relations as inputs and produce a new relation as a result. Database System Concepts - 6th Edition ©Silberschatz, Korth and Sudarshan Select Operation – Example Relation r σA=B ^ D > 5 (r) Database System Concepts - 6th Edition ©Silberschatz, Korth and Sudarshan Select Operation Notation: σ p(r) p is called the selection predicate Defined as: σp(r) = {t | t ∈ r and p(t)} Where p is a formula in propositional calculus consisting of terms connected by : ∧ (and), ∨ (or), ¬ (not) Each term is one of: op or where op is one of: =, ≠, >, ≥. <. ≤ Example of selection: σ dept_name=“Physics”(instructor) Database System Concepts - 6th Edition ©Silberschatz, Korth and .