Page 286 - Information_Practice_Fliipbook_Class11
P. 286
3. List two advantages and two disadvantages of DBMS.
Ans. The advantages of DBMS are:
• Sharing of Data
• Reduction in Data Redundancy
The disadvantages of DBMS are:
• High initial cost
• Complex software
4. Define an entity and an attribute with respect to RDBMS.
Ans. (i) An entity is a real-world object whose data is stored in the database.
(ii) An attribute defines the characteristics of an entity.
5. Describe Referential Integrity Constraint.
Ans. If a table R1 has a foreign key (i.e., a non-key attribute), say, A, that refers to a UNIQUE attribute, say, B (typically primary
key) of another table R2, then
(i) the value of foreign key A maybe be NULL.
(ii) the value of foreign key A in table R1 maybe be non-NULL (say, val), then there must be a tuple in table R2 having
val as the value of attribute B. For example, suppose attribute Mgr_Id of relation DEPARTMENT refers to the
attribute ID of relation EMPLOYEE. As ID is a primary key of relation EMPLOYEE, Mgr_Id becomes a foreign key
for relation DEPARTMENT. So, in the DEPARTMENT table, if the department having Dept_No value 1 has Mgr_Id
value E0005, then the referential integrity constraint requires that the EMPLOYEE table must have an employee
having Id value E0005. Alternately, Mgr_ID value should be NULL for the DEPARTMENT having Dept_No
value 1.
6. Consider the following database tables:
CLASS (Primary key: ClassId, Section)
+---------+---------+----------+--------------+ STUDENT (Primary key: S_ID)
| ClassId | Section | Stream | ClassTeacher | +------+----------------+-------+---------+-------+
+---------+---------+----------+--------------+ | S_ID | SName | Class | Section | Marks |
| 11 | A | Science | Sona Sahu | +------+----------------+-------+---------+-------+
| 12 | B | Commerce | Anirban Bose | | 17 | Mukesh Agrawal | 11 | C | 88 |
| 11 | C | Arts | Vijaya Ahuja | | 21 | Sanjoy | 11 | A | 76 |
| 12 | B | Commerce | Sushmita Sen | | 34 | Meena | 12 | B | 67 |
| 12 | C | Arts | Amisha Patel | | 41 | Latha | 12 | A | 40 |
| 11 | B | Commerce | S. Jayanthi | | 22 | Niranjan | 11 | C | 91 |
+---------+---------+----------+--------------+ +------+----------------+-------+---------+-------+
A command is executed to insert each of the following tuples in the table CLASS. For each operation, indicate whether it
will be executed successfully. Justify your answer. If not, mention which DBMS constraint does the insert operation violate?
Consider each operation independent of others.
(i) <11, "A", "Science", "Pooja Sahu">
(ii) <11, "D", "Science", "Sara Nayak">
(iii) <11, NULL, "Science", "Ananya Kasaravall">
(iv) <NULL, "D", "Science", "Vinayak Damodar">
(v) <11, "D", "Science", "Sona Sahu">
(vi) <11, "D", NULL, NULL>
(vii) <11, "d", "Commerce","Ananya Kasaravall">
Ans. (i) <11, "A", "Science", "Pooja Sahu">
Error: there is already a tuple in the CLASS table with the primary key <11, "A">.
(ii) b. <11, "D", "Science", "Sara Nayak">
Insertion will be successful as there is no tuple in the CLASS table with the primary key <11, "D">.
(iii) <11, NULL, "Science", "Ananya Kasaravall">
Error: Violation of entity integrity constraint. Section is part of the primary key, so cannot be NULL.
272 Touchpad Informatics Practices-XI

