What are Async Methods in JavaScript

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

208 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

467 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

Objectives of a Good Database Design

Alex Onsman
Updated on 15-Jun-2020 12:58:44

4K+ Views

Good Database Design is what everyone wants to achieve to avoid the consequences of dealing with a bad design.The following are the objectives of a good database design −Avoid Redundant DataThe table in the database should be constructed following standards and with utmost dedication. It should have different fields and minimize redundant data. The table should always have a Primary Key that would be a unique id.Faultless InformationThe database should follow the standards and conventions and provide meaningful information useful to the organization.Data IntegrityIntegrity assists in guaranteeing that the values are valid and faultless. Data Integrity is set to tables, ... Read More

One-to-One Relationship in DBMS

Alex Onsman
Updated on 15-Jun-2020 12:57:39

11K+ Views

Relationships in DBMS can be stated as a relation between two entities like Employee-Department, Student-Course, etc.One-to-One relationship in DBMS is a relationship between an instance of an entity with another.The relation can be stated as −An Employee is issued an Employee ID Card. An individual employee is offered a unique ID card in the company. Here, Employee and ID Card (ID_Card) are entities.

Major Concerns with Database Design

Alex Onsman
Updated on 15-Jun-2020 12:57:01

620 Views

Database Design can be a tiresome task and you would need to follow the below approach and tackle the challenges to get a well-designed database.The concerns and challenges with Database design are the following −Following Design StandardsConsidering Design Standards while designing a database is quite essential. It gives you components that are well defined. With this, you can also easily evaluate an existing design.If you are unable to follow the design standards approach, then do not expect the design to be proper and you will not be able to evaluate it.Achieving High Processing SpeedEveryone needs faster access for the relationships ... Read More

Fully Functional Dependency in DBMS

Amit Diwan
Updated on 15-Jun-2020 12:56:07

15K+ Views

An attribute is fully functional dependent on another attribute, if it is Functionally Dependent on that attribute and not on any of its proper subset.For example, an attribute Q is fully functional dependent on another attribute P, if it is Functionally Dependent on P and not on any of the proper subset of P.Let us see an example −ProjectIDProjectCost00110000015000EmpIDProjectIDDaysE099001320E056002190The above relations states that −Days are the number of days spent on the project.EmpID, ProjectID, ProjectCost -> DaysHowever, it is not fully functional dependent.Whereas the subset {EmpID, ProjectID} can easily determine the {Days} spent on the project by the employee.This summarizes ... Read More

Advertisements