Page 173 - DCAP402_DCAO204_DATABASE MANAGEMENT SYSTEM_MANAGING DATABASE
P. 173

Database Management Systems/Managing Database         Mithilesh Kumar Dubey, Lovely Professional University




                    Notes                           Unit 10: Datalog and Recursion


                                     CONTENTS
                                     Objectives
                                     Introduction

                                     10.1 Datalog and Recursion
                                     10.2 Evaluation of Datalog Program
                                     10.3 Recursive Queries and Negation

                                     10.4 Modeling Complex Data Semantics
                                     10.5 Specialization
                                     10.6 Generalization
                                     10.7 Summary
                                     10.8 Keywords

                                     10.9 Self Assessment
                                     10.10 Review Questions
                                     10.11 Further Readings

                                   Objectives


                                   After studying this unit, you will be able to:
                                      Know datalog and recursion
                                      Describe datalog program evaluation
                                      Explain specialization and generalization

                                   Introduction


                                   While relational algebra can  express many  useful  operations  on relations, there are  some
                                   computations that cannot be written as an expression of relational algebra. A common kind of
                                   operation on data that we cannot express in relational algebra involves an infinite, recursively
                                   defined sequence of similar expressions.

                                   10.1 Datalog and Recursion

                                   We now define a relation  called Components  that identifies  the components of every  part.
                                   Consider the following program, or collection of rules:
                                          Components (Part, Subpart):         Assembly (Part, Subpart, Qty).
                                          Components (Part, Subpart):         Assembly (Part, Part2, Qty),

                                          Components (Part2, Subpart):








          166                               LOVELY PROFESSIONAL UNIVERSITY
   168   169   170   171   172   173   174   175   176   177   178