Transitive Dependency in DBMS

Alex Onsman
Updated on 15-Jun-2020 13:26:27

24K+ Views

What is Transitive DependencyWhen an indirect relationship causes functional dependency it is called Transitive Dependency.If  P -> Q and Q -> R is true, then P-> R is a transitive dependency.To achieve 3NF, eliminate the Transitive Dependency.ExampleMovie_IDListing_IDListing_TypeDVD_Price ($)M08L09Crime180M03L05Drama250M05L09Crime180The above table is not in 3NF because it has a transitive functional dependency −Movie_ID -> Listing_IDListing_ID -> Listing_TypeTherefore, the following has transitive functional dependency.Movie_ID -> Listing_TypeThe above states the relation violates the 3rd Normal Form (3NF).To remove the violation, you need to split the tables and remove the transitive functional dependency.Movie_IDListing_IDDVD_Price ($)M08L09180M03L05250M05L09180Listing_IDListing_TypeL09CrimeL05DramaL09CrimeNow the above relation is in Third Normal Form (3NF) ... Read More

Entity Integrity Rule in RDBMS

Alex Onsman
Updated on 15-Jun-2020 13:22:51

6K+ Views

For Entity Integrity Rule, each table has a Primary Key.Primary Key cannot have NULL value.Student_IDStudent_AwardsStudent_AwardsAbove, you can see our primary key is Student_ID. We cannot consider Student_Awards as the primary key since not every student would have received the award.Let us see another example −Employee_IDEmployee_NameEmployee_AgeEmployee_LocationIn the above table, the Primary Key is Employee_IDLet us now summarize the Entity Integrity Rule −Make sure that each tuple in a table is unique.Every table mush has a primary key, for example, Student_ID for a Student table.Every entity is unique.The relations Primary Key must have unique values for each row.Primary Key cannot have NULL ... Read More

Arguments Object with Rest, Default and Destructured Parameters in JavaScript

Abhinaya
Updated on 15-Jun-2020 13:19:37

204 Views

defaultThis came to handle function parameters with ease. Easily set Default parameters to allow initializing formal parameters with default values. This is possible only if no value or undefined is passed. Let’s see an exampleExampleLive Demo                    // default is set to 1          function inc(val1, inc = 1) {             return val1 + inc;          }          document.write(inc(10, 10));          document.write("");          document.write(inc(10));           restES6 ... Read More

Use of extend Method in jQuery

David Meador
Updated on 15-Jun-2020 13:18:40

1K+ Views

The jQuery.extend() method is used to merge contents of two or more objects together. The object is merged into the first object. You can try to run the following code to learn how to use extend() method −ExampleLive Demo $(document).ready(function() {   $("#button1").click(function() {     var obj1 = {       maths: 60,       history: {pages: 150,price: 400,lessons: 30},       science: 120     };     var obj2 = {       history: { price: 150, lessons: 24 },       economics: 250     };     $.extend(true, obj1, obj2);     $("#demo").append(JSON.stringify(obj1));    }); });    Result    

What are Async Methods in JavaScript

varun
Updated on 15-Jun-2020 13:18:08

226 Views

The async function declaration as the name suggests defines an asynchronous function. This function returns an AsyncFunction object.SyntaxHere’s the syntax −async function functionname([param[, param[, ... param]]]) {    statements to be executed }ExampleLet’ see an example, which prints the result after 5 seconds −                    function displayFunction(num) {             return new Promise(resolve => {                setTimeout(() => {                   resolve(num);                }, 5000);             });          }          async function add2(num) {             const x = displayFunction(7);             const y = displayFunction(5);             return num * await x * await y;          }          add2(15).then(result => {             document.write("Multiplication Result (after 5 seconds): "+result);          });          

Iterate Over Arrays and Objects in jQuery

David Meador
Updated on 15-Jun-2020 13:17:04

1K+ Views

To iterate over arrays and objects in jQuery, use the jQuery forEach() loop. You can try to run the following code to learn how to iterate over arrays and objects −ExampleLive Demo $(document).ready(function(){   $("#button1").click(function(){     var arr = [{subject: "Maths", id:3}, {subject: "History", id:7}];     arr.forEach(function(el, index) {       alert(el.id+" "+el.subject);     });   }); });   Result

Identify Entity from a Given Problem

Amit Diwan
Updated on 15-Jun-2020 13:15:39

4K+ Views

Entity in DBMS can be a real-world object with an existence. To identify entity from a given problem, follow the below given tips −Under the problem description, try to find the entity.Search for nouns, like Teacher, Doctor, etc.Classify nouns to get a wider picture about the entities.Read the problem description repeatedly.Entities are like Persons, Students, Teachers, Courses.Entities has attributes, that properties describing it, for example, for Professor entity, the attributes are  Professor_Name, Professor_Address, Professor_Salary, etcFor example, Problem DescriptionHospital has doctors and patients. Patients visit the hospital to get a consultation from the doctor. Doctor may suggest tests to examine the condition ... Read More

Data Dictionary in DBMS

Alex Onsman
Updated on 15-Jun-2020 13:13:49

8K+ Views

Data Dictionary consists of database metadata. It has records about objects in the database.What Data Dictionary consists ofData Dictionary consists of the following information −Name of the tables in the databaseConstraints of a table i.e. keys, relationships, etc.Columns of the tables that related to each otherOwner of the tableLast accessed information of the objectLast updated information of the objectAn example of Data Dictionary can be personal details of a student −ExampleStudent_IDStudent_NameStudent_AddressStudent_CityThe following is the data dictionary for the above fields −Types of Data DictionaryHere are the two types of data dictionary −Active Data DictionaryThe DBMS software manages the active data ... Read More

Normalize a Database Table

Alex Onsman
Updated on 15-Jun-2020 13:08:38

527 Views

Normalization removes data redundancy and update, insert and delete anomalies and gives you a normalized perfect database design that a database administrator love.To normalize a database table, follow the below given steps that highlights the role of normalization forms and its uses −First Normal Form (1NF)1 INF is useful in removing the data redundancy issue and anomalies of a database. All attributes in 1NF should have atomic domains.Second Normal Form (2NF)The Second Normal Form eliminates partial dependencies on primary keys.Third Normal Form (3NF)The Third Normal Form eliminates Transitive Functional Dependency.Fourth Normal Form (4NF)To be in 4NF, a relation should may ... Read More

Fifth Normal Form (5NF)

Amit Diwan
Updated on 15-Jun-2020 13:06:18

22K+ Views

The 5NF (Fifth Normal Form) is also known as project-join normal form. A relation is in Fifth Normal Form (5NF), if it is in 4NF, and won’t have lossless decomposition into smaller tables.You can also consider that a relation is in 5NF, if the candidate key implies every join dependency in it.ExampleThe below relation violates the Fifth Normal Form (5NF) of Normalization −EmpNameEmpSkillsEmpJob (Assigned Work)DavidJavaE145JohnJavaScriptE146JamiejQueryE146EmmaJavaE147The above relation can be decomposed into the following three tables; therefore, it is not in 5NF −EmpNameEmpSkillsDavidJavaJohnJavaScriptJamiejQueryEmmaJavaThe following is the relation that displays the jobs assigned to each employee −EmpNameEmpJobDavidE145JohnE146JamieE146EmmaE147Here is the skills that are ... Read More

Advertisements