





Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Community
Ask the community for help and clear up your study doubts
Discover the best universities in your country according to Docsity users
Free resources
Download our free guides on studying techniques, anxiety management strategies, and thesis advice from Docsity tutors
Question and Answers on Database Management Systems.
Typology: Exercises
1 / 9
This page cannot be seen from the preview
Don't miss anything!
(Questions and answers based on Third MODULE) (1 Mark questions) 1 .A relation schema R is --- if whenever a nontrivial functional dependency x- >A hold in R the X is a super key of R a) BCNF 2 .If every non-prime attribute A of a relation schema R is fully functionally dependent on the primary key of R, then R is said to be in ------- a)2 NF 3 .The set of functional dependencies that is logically implied by F is called the ----- of F a) Closure 4.The database design prevents some data from being stored due to _______. a) Insertion anomalies 5.If one attribute is determinant of second, which in turn is determinant of third, then the relation cannot be: a) 3NF
12 .Define Fourth normal form (4NF) a) It is a level of database normalization where there are no non-trivial multivalued dependencies other than a candidate key. It builds on the first three normal forms (1NF, 2NF and 3NF) and the Boyce-Codd Normal Form (BCNF). ( 5 Mark questions) 13 .What is Functional Dependency and Functional Dependency Set. a) A functional dependency A->B in a relation holds if two tuples having same value of attribute A also have same value for attribute B. Functional Dependency Set: Functional Dependency set or FD set of a relation is the set of all FDs present in the relation. For Example, FD set for relation STUDENT shown in table 1 is: {STUD_NO->STUD_NAME, STUD_NO->STUD_PHONE, STUD_NO->STUD_STATE, STUD_NO-> STUD_COUNTRY, STUD_NO - > STUD_AGE, STUD_STATE->STUD_COUNTRY} 14 .Different types of anomaly in database a) 1. Insert Anomaly 2.Delete Anomaly 3.Update Anomaly
Boyce Codd normal form (BCNF) It is an advance version of 3NF that’s why it is also referred as 3.5NF. BCNF is stricter than 3NF. A table complies with BCNF if it is in 3NF and for every functional dependency X->Y, X should be the super key of the table. 1 6.Define Multivalued dependency a) Multivalued dependency occurs when there are more than one independent multivalued attributes in a table. For example : Consider a bike manufacture company, which produces two colours (Black and white) in each model every year. bike_model manuf_year color M1001 2007 Black M1001 2007 Red M2012 2008 Black M2012 2008 Red M2222 2009 Black M2222 2009 Red Here columns manuf_year and color are independent of each other and dependent on bike_model. In this case these two columns are said to be multivalued dependent on bike_model. These dependencies can be represented like this: bike_model - >> manuf_year ( 10 Mark questions) 1 7.Explain BCNF with an example a) Rules for BCNF For a table to satisfy the Boyce-Codd Normal Form, it should satisfy the following two conditions:
1. It should be in the Third Normal Form. 2. And, for any dependency A → B, A should be a super key. The second point sounds a bit tricky, right? In simple words, it means, that for a dependency A → B, A cannot be a non-prime attribute , if B is a prime attribute. Example Below we have a college enrolment table with columns student_id , subject and professor. student_id subject professor 101 Java P.Java 101 C++ P.Cpp 102 Java P.Java 103 C# P.Chash 104 Java P.Java
In the above table:
What is Multi-valued Dependency? A table is said to have multi-valued dependency, if the following conditions are true,
1. For a dependency A → B, if for a single value of A, multiple value of B exists, then the table may have multi-valued dependency. 2. Also, a table should have at-least 3 columns for it to have a multi-valued dependency. 3. And, for a relation R (A, B, C) , if there is a multi-valued dependency between, A and B, then B and C should be independent of each other. If all these conditions are true for any relation(table), it is said to have multi-valued dependency.
Below we have a college enrolment table with columns s_id , course and hobby. s_id course hobby 1 Science Cricket 1 Maths Hockey 2 C# Cricket 2 Php Hockey As you can see in the table above, student with s_id 1 has opted for two courses, Science and Maths , and has two hobbies, Cricket and Hockey. You must be thinking what problem this can lead to, right? Well the two records for student with s_id 1 , will give rise to two more records, as shown below, because for one student, two hobbies exist, hence along with both the courses, these hobbies should be specified. s_id course hobby 1 Science Cricket 1 Maths Hockey 1 Science Hockey 1 Maths Cricket And, in the table above, there is no relationship between the columns course and hobby. They are independent of each other. So, there is multi-value dependency, which leads to un-necessary repetition of data and other anomalies as well.
To make the above relation satisfy the 4th normal form, we can decompose the table into 2 tables. Course Opted Table s_id course 1 Science 1 Maths 2 C# 2 Php And, Hobbies Table , s_id hobby 1 Cricket 1 Hockey 2 Cricket 2 Hockey Now this relation satisfies the fourth normal form. 20 .Explain Fifth normal form (5NF) and join dependencies with suitable example a) A relation R is in 5NF if and only if every join dependency in R is implied by the candidate keys of R. A relation decomposed into two relations must have loss-less join Property, which ensures that no spurious or extra tuples are generated, when relations are reunited through a natural join. Properties – A relation R is in 5NF if and only if it satisfies following conditions:
1. R should be already in 4NF. 2. It cannot be further non loss decomposed (join dependency) Example – Consider the above schema, with a case as “if a company makes a product and an agent is an agent for that company, then he always sells that product for the company”. Under these circumstances, the ACP table is shown as: Table – ACP Agent Company Product A1 PQR Nut A1 PQR Bolt A1 XYZ Nut A1 XYZ Bolt A2 PQR Nut