Слайды и текст доклада
Pic.1
Lecture 6. Relational algebra National Aviation University Computer Science Faculty Department of Software Engineering
Pic.2
CONTENTS Query languages in DB Properties of binary operations Relational algebra operations Examples Equivalent transformation and optimization of relational algebra expressions
Pic.3
Query languages Language categories: procedural (HOW to receive) nonprocedural (WHAT to receive) Formal languages: relational algebra relational calculus (tuple-oriented and domain-oriented)
Pic.4
Relational algebra closure and properties of binary operations Property of binary relations: Operation is commutative if А В = B A Operation is associative if (А В) С = А (В С) …
Pic.5
Relational algebra operations Basic operations: set-theoretic (union, intersection, difference) projection selection cartesian product, join division Additional operations assignment renaming …
Pic.6
Set-theoretic operations
Pic.8
Difference operation
Pic.9
Intersection operation
Pic.10
Projection operation
Pic.11
-comparability of attributes and tuples
Pic.12
Selection (restriction) operation
Pic.15
Join and natural join
Pic.18
Division operation (1)
Pic.19
Division operation(2)
Pic.20
Example of DB for RA queries FAC (FNo, Name, Dean, Bld, Fund) DEP (DNo, FNo, Name, Head, Bld, Fund) TCH (TNo, DNo, Name, Post, Tel, Salary, Comm) GRP (GNo, DNo, Course, Num, Quantity, CurNo) SBJ …
Pic.21
Examples of queries in RA (1)
Pic.22
Examples of queries in RA (2)
Pic.23
Examples of queries in RA (3)
Pic.24
Examples of division operation
Pic.25
Additional operations Additional operations Assignment Renaming Generalized projection Outer join …
Pic.26
Assignment operation
Pic.28
Generalized projection operation
Pic.30
Outer join – example of ordinary join
Pic.34
Equivalent transformations of relational expressions 1) Commutativity of selection: σF(σG(R))=σG(σF(R))=σF&G(R) 2) Commutativity of selection and projection: G(σF(R))=σF(G(R))=σF&G(R), если …
Pic.35
Optimization of RA expressions
Pic.36
General rules of RA expressions optimization General rules of RA expressions optimization: Transform each selection σF1&. . . &Fn(E) to the sequence of selections σF1(. . . σFn(E)) Move each …
Pic.37
Relational Algebra: Summary Relational Algebra: Formal language for handling data in relational model Procedural language, how to retrieve data No practical relevance for querying DB Formal basis for …
Скачать презентацию
Если вам понравился сайт и размещенные на нем материалы, пожалуйста, не забывайте поделиться этой страничкой в социальных сетях и с друзьями! Спасибо!