Page 300 - Information_Practice_Fliipbook_Class11
P. 300

e. An attribute which can uniquely identify tuples of the table but is not defined as primary key of the table.
               f. Software that is used to create, manipulate and maintain a relational database.
         Ans.   a. Database
              b. Data Dictionary
              c. Primary Key
              d. NULL
              e. Super Key
              f. Relational Database Management System (RDBMS)
           2.  Why foreign keys are allowed to have NULL values? Explain with an example.
         Ans.    Foreign keys are referenced values from the table having similar attributes as a primary key from referenced relations. As a result, some
              values in the relation are unknown or do not match the referenced relation in the database.  Thus, this foreign key can have a null value.
              Example:
                Consider two tables, Order  and Customer. The Order table has a foreign key, customerID, which references the primary key
              customerID in the Customer table. If a customer places an order, the customerID in the Order table is set to the customer’s
              ID. However, if a guest or unregistered user places an order, the customerID in the Orders table may be NULL, indicating that no
              particular customer is associated with the order.
           3.  Differentiate between:
               a. Database state and database schema
               b. Primary key and foreign key
               c. Degree and cardinality of a relation
         Ans.   a.  Database State (also known as an extension) refers to the actual data stored in a database at a specific moment. It represents the
                current snapshot of the information contained in the database.
                    Database  Schema  (also  known  as  intension)  defines  the structure of  the database, including  tables, fields,  relationships, and
                constraints. It does not contain the actual data but provides a blueprint for organizing and accessing the data.
              b.  Primary Key: A unique identifier for a record in a database table. It ensures that each record in the table is distinct.
                   Foreign Key: A field in a database table that refers to the primary key in another table. It establishes a link between tables, enforcing
                referential integrity and supporting relationships between them.
                     Refer to 9.2.1: Relational Data Model, Primary Key and 9.2.1: Relational Data Model, Foreign Key for more details.
              c.  Degree of a Relation: Refers to the number of attributes or columns in a relation (table). For example, a relation with attributes A, B,
                and C has a degree of 3.
                 Cardinality of a Relation: Describes the number of tuples or rows in a relation. It indicates the size or cardinality of the set of
                relationships. For instance, a relation with five rows has a cardinality of 5.
           4.  Compared to a file system, how does a database management system avoid redundancy in data through a database?
         Ans.   A Database Management System (DBMS) avoids redundancy in data by centralizing and organizing data in a structured manner. Unlike
              file systems, a DBMS uses a relational model where data is stored in tables with relationships defined between them. This normalization
              process  minimizes  redundancy  by  storing  data  in  a  way  that  avoids  duplication.  Data  integrity  is  maintained  through  foreign  key
              relationships, and changes are made in one place, reducing the risk of inconsistencies that can occur in file systems. This ensures efficient
              data storage, retrieval, and maintenance within a database.
           5.  A school has a rule that each student must participate in a sports activity. So each one should give only one preference for sports activity.
              Suppose there are five students in a class, each having a unique roll number. The class representative has prepared a list of sports
              preferences, as shown below. Answer the following:
               Table: Sports Preferences
               Roll_no        Preference
               9              Cricket
               13             Football
               17             Badminton
               17             Football
               21             Hockey
               24             NULL
               Null           Kabaddi
              a. Roll No. 24 may not be interested in sports. Can a NULL value be assigned to that student’s preference field?
               b.  Roll No. 17 has given two preferences for sports. Which property of relational DBMS is violated here? Can we use any constraint or
                key in the relational DBMS to check against such violations, if any?

          286  Touchpad Informatics Practices-XI
   295   296   297   298   299   300   301   302   303   304   305