Database_Management
Database_Management
Based on the usage and requirement we can choose a software tool that has needed features and the desired output.
https://
www.geeksforgeeks.or
g/cardinality-in-dbms/
The relationship that relates the weak entity type to an owner entity type is known as identifying relationship. The weak entity type
always has total participation(existence dependency) in a relationship because the weak entity type can not be identified without an
owner identity. This doesn’t mean that every existence dependency(total participation) results in a weak entity type.
https://www.g
Dr Edgar F. Codd, after his extensive research on the Relational Model of database systems, came
up with twelve rules of his own, which according to him, a database must obey in order to be
regarded as a true relational database.
These rules can be applied on any database system that manages stored data using only its
relational capabilities. This is a foundation rule, which acts as a base for all the other rules.
A -> B
Above suggests the following:
Example
The following is an example that would make it easier to
understand functional dependency −
We have a <Department> table with two attributes −
DeptId and DeptName.
DeptId = Department ID
DeptName = Department Name
The DeptId is our primary key. Here, DeptId uniquely
identifies the DeptName attribute. This is because if you
want to know the department name, then at first you need to
have the DeptId.
DeptId DeptName
001 Finance
002 Marketing
003 HR
Therefore, the above functional dependency between
DeptId and DeptName can be determined as DeptId is
functionally dependent on DeptName −
A ->B
Example
We are considering the same <Department> table with two
attributes to understand the concept of trivial dependency.
The following is a trivial functional dependency since
DeptId is a subset of DeptId and DeptName
A ->B
Example
A ->B
• Update anomalies − If data items are scattered and are not linked to each other properly, then it could lead to strange situations. For example,
when we try to update one data item having its copies scattered over several places, a few instances get updated properly while a few others
are left with old values. Such instances leave the database in an inconsistent state.
• Deletion anomalies − We tried to delete a record, but parts of it was left undeleted because of unawareness, the data is also saved
somewhere else.
• Insert anomalies − We tried to insert data in a record that does not exist at all.
https://mycareerwise.com/content/membership-test/content/exam/gate/computer-science
Given a Relation with different FD sets for that relation, we have to find out whether one FD set is a subset of another or both are equal.
How do find the relationship between two FD sets? Let FD1 and FD2 be two FD sets for a relation R.
1 If all FDs of FD1 can be derived from FDs present in FD2, we can say that FD2 ⊃ FD1.
2 If all FDs of FD2 can be derived from FDs present in FD1, we can say that FD1 ⊃ FD2.
3 If 1 and 2 both are true, FD1=FD2.
All these three cases can be shown using the Venn diagram:
https://www.javatpoint.com/dbms-normalization
If a relation contain composite or multi-valued attribute, it violates first normal form or a relation is in first normal form if it does not contain
any composite or multi-valued attribute. A relation is in first normal form if every attribute in that relation is singled valued attribute.
• Example 1 – Relation STUDENT in table 1 is not in 1NF because of multi-valued attribute STUD_PHONE. Its decomposition into 1NF
has been shown in table 2.
To be in second normal form, a relation must be in first normal form and relation must not contain any partial dependency. A relation is in
2NF if it has No Partial Dependency, i.e., no non-prime attribute (attributes which are not part of any candidate key) is dependent on
any proper subset of any candidate key of the table.
Partial Dependency – If the proper subset of candidate key determines non-prime attribute, it is called partial dependency.
Whenever some indirect relationship happens to cause
functional dependency (FC), it is known as Transitive
Dependency. Thus, if A -> B and B -> C are true, then A -> C
happens to be a transitive dependency. Thus, to achieve 3NF,
one must eliminate the Transitive Dependency.
3. Third Normal Form –
A relation is in third normal form, if there is no transitive dependency for non-prime attributes as well as it is in second normal form.
A relation is in 3NF if at least one of the following condition holds in every non-trivial function dependency X –> Y
1 X is a super key.
2 Y is a prime attribute (each element of Y is part of some candidate key).