Page 40 - DCAP402_DCAO204_DATABASE MANAGEMENT SYSTEM_MANAGING DATABASE
P. 40

Unit 2: Database Relational Model




               SELECT *.D  * .P                                                                 Notes
                         1  1
               FROM Department D , FULLOUTER JOIN Project P
                                1                       1
               WHERE D .PNo = P .PNo
                       1       1
               The following table shows the result

                      Dept_Mid       DNo         PNo       (PNo)     Pname

                         101            2          11         11        A
                         97             5          22         22         B
                         120            4          33        NULL      NULL
                        NULL          NULL       NULL         44        D

          In this relation as you can see all the matched and unmatched columns of both the tables are
          displayed, the values for the unmatched attributes are entered as NULL.

          Division

          To understand the concept of division operator consider a simple example of two relations with
          attributes customer name, product id.
          1.   Customer (Customer name, product id)
          2.   Product (Product id)

          The result of applying the division operator on relations customer and product is shown in the
          “Result” relation.
          A division operator returns a relation (result). That is a collection of rows from first relation
          (customer) such that for every value in second relation (product). There exists a pair (customer
          name, product id) in the first relation (customer).
                                      Customer/product = Result
                                 (Customer, Product)
                                                  = Custmername
                                    (Product id)

                 Customer                         Product      Result = customer/product
             Customer name    Product id      Product id     Customer name
             Ravi             1021321         1021321        Ravi

             Kumar            30991231        30991231       Sharma
             Girish           2310219                        Kumar
             Sharma           1021321                        Rahul
             Rahul            30991231

          The division operation is reverse of cartesian product. We can note that
                 (Customer/product id) = (customer name) * (product id)

                 Customer = Result * Product
          A binary relationship sets is a relationship between only two entities.




                                           LOVELY PROFESSIONAL UNIVERSITY                                   33
   35   36   37   38   39   40   41   42   43   44   45