Page 31 - DCAP402_DCAO204_DATABASE MANAGEMENT SYSTEM_MANAGING DATABASE
P. 31

Database Management Systems/Managing Database




                    Notes
                                                                    Projection  1
                                             Eid              Dep-Name         Sex           Relationship
                                     12354261           Nivedita                F     Mother
                                     12354263           Lizzi                   F     Sister
                                     12354267           Raven                   F     Doughtier

                                   2.    (DNo = 7 AND Address = ‘New Jersey’) OR (DNo = 8 AND Address = ‘Detroit’) EMPLOYEE

                                       This condition selects the rows from employee which satisfy the conditions.
                                       DNo = 7 and address = ‘New Jersey’ OR the condition
                                       DNo = 8 and address ‘Detroit’.
                                       If either of the conditions are satisfied then that row is selected.
                                       The boolean operators used here convey the following meaning.

                                       A  AND B  = TRUE if A, & B, are true i.e., the row must satisfy both conditions (A  & B ) in
                                         1      1                                                       1   1
                                       order to get selected.
                                       (A    B )    A  OR B  = TRUE if either A  OR B  is true.
                                         1    1     1    1               1    1
                                       (A   B )    A  AND B  = False if either of A  & B  are false.
                                         1   1     1      1                1   1
                                       (A   B )   A  OR B  = False if both of A, and B, are false.
                                         1   1     1    1
                                       The resulting relation is,
                                                                    Projection  2

                                      Age   Ename   Eid      Bdata   Address   Sex   ($) Salary   Dno  Phone No.
                                        41   John   12345261   10-8-1965   New Jersey   M   25000   7   773213218
                                        51   Bill   12345265   12-5-1955   Detroit   F   35000   8   773271142

                                       Some examples of the select operator:
                                                  DEPARTMENT
                                         manager-id = 4341
                                                                           EMPLOYEE
                                         (Salary > 40000 AND age < 40) OR (Salary   20000 AND age   20)
                                                                  DEPENDENT. Different comparison operators can be
                                         (Dep-Name = ‘Raven’) OR (relationship = ‘Brother’)
                                       used with select operator.
                                       (a)  <   Less than

                                       (b)  >   Greater than
                                       (c)  =   Equal to
                                       (d)       Not equal to
                                       (e)       Less than or equal to
                                       (f)       Greater than or equal to.

                                       We can even use boolean operator “not” to negate a condition.
                                   3.  Display all the information of projects except those which are located in Chicago.
                                                 =     PROJECT
                                         Not Plocation  ‘Chicago’




          24                                LOVELY PROFESSIONAL UNIVERSITY
   26   27   28   29   30   31   32   33   34   35   36