Page 143 - Informatics_Practices_Fliipbook_Class12
P. 143

4. The  order  in  which  names  of  the  attributes  appear  in  a  relation  schema  is  not  relevant  to  the  DBMS  for  its
               operations. Similarly, DBMS ignores the ordering of tuples in a relation.



                    Can a table have two identical tuples?



            Consider the table MOVIE given below:


                 MOVIEID               TITLE               LANGUAGE            RATING            PLATFORM
                   M001           Pushpa: The Rise            Telugu             7.9         Amazon Prime Video
                   M004           The Mauritanian            Spanish             7.5              Showtime
                   M010              Jai Bheem                Tamil              9.1               Disnep+
                   M011       Spider-Man: No Way Home         Hindi              8.8                 NA
                   M015               Thalaivi               French              6.1                Netflix
                   M018      Zack Snyder's Justice League    English             8.1              HBO Max

            What is the degree of the table MOVIE? What is the cardinality of the table MOVIE?

            4.2.2 NULL Value
            If the value for an attribute is unknown for a tuple, DBMS uses the NULL value. An attribute value may be NULL in the
            following situations:

            The value exists but is currently unknown (for example, DOB).
            We do not know whether the value exists (for example, landline number).
            No value is applicable (for example, spouse name for an unmarried employee).
            Note that in DEPARTMENT relation, Mgr_Id corresponding to the department having Dept_No 3 is NULL as a
            manager has not been assigned to the department having Dept_No 3.
            As mentioned above, a key identifies a tuple in a table uniquely. Attributes that are part of the key are known as key

            attributes. When a key has more than one attribute, it is called a composite key. For example, in the relation WORKS_
            ON, neither Proj_No nor Emp_Id  can act as the key of the table WORKS_ON (why?). However, attributes Proj_No
            and Emp_Id together form a composite key of the relation  WORKS_ON. The notion of keys is described below:



                  NULL: Denotes an unknown attribute value.



            Candidate Key

            A set of attributes that uniquely identify each tuple in a relation is called its candidate key. The set of attributes that
            form a candidate key is minimal in the sense that no subset of a candidate key qualifies to be a candidate key. For
            example, let us consider a scenario where no two projects have the same project number Proj_No. Further, the
            project names are unique within a department. However, different departments may have projects with the same
            name. Let us consider candidate keys for the relation PROJECT in this scenario. As no two projects have the same
            Proj_No, the attribute Proj_No  will serve as a candidate key. As Proj_No  identifies the tuples in the table
            PROJECT uniquely, it is evident that the following combinations of the attributes will also pinpoint the tuples in the
            table PROJECT uniquely:
                 Proj_No
                 Proj_No, Proj_Name

                                                                                        Database Query using SQL  129
   138   139   140   141   142   143   144   145   146   147   148