Multi-Dimensional Array in JavaScript

Sharon Christine
Updated on 15-Jun-2020 14:37:44

747 Views

Basically, multi-dimension arrays are used if you want to put arrays inside an array. Let's take an example. Say you wanted to store every 6 hour's temperature for every weekday. You could do something like:let monday = [35, 28, 29, 31]; let tuesday = [33, 24, 25, 29]; //...This is a good place to use a multidimensional array instead. A multidimensional array is nothing but an array of arrays. If we take forward our example, each row will represent a day while each entry in the row will represent a temp entry. For example, let temps = [    [35, ... Read More

Comb Sort

Jai Janardhan
Updated on 15-Jun-2020 14:29:38

1K+ Views

The basic idea of comb sort and the bubble sort is same. In other words, comb sort is an improvement on the bubble sort. In the bubble sorting technique, the items are compared with the next item in each phase. But for the comb sort, the items are sorted in a specific gap. After completing each phase, the gap is decreased. The decreasing factor or the shrink factor for this sort is 1.3. It means that after completing each phase the gap is divided by 1.3.The complexity of Comb Sort TechniqueTime Complexity: O(n log n) for the best case. O(n^2/2^p) (p ... Read More

RDBMS Terminologies

Amit Diwan
Updated on 15-Jun-2020 14:23:10

12K+ Views

RDMS Terminologies include Database, Table, Columns, etc. Let us see them one by one −DatabaseDatabase is a collection of tables like , , etc.TableA table is a collection of rows and columns , for example, StudentIdStudentNameStudentRank052Tom1035David2077John3ColumnColumn is in a table −RowRow is also called a tuple in RDBMS. A relation in a database has rows and columns.Primary KeyEvery table has one Primary key and cannot have null values.For example, ProjectID is a primary key in Project Table, since it uniquely identifies the project:ProjectIDProjectNameP01Cluster Grouping SystemP02Hospital Management SystemForeign KeyIf you want to link two tables, use Foreign Key.For example, Employee table has DEPT_ID ... Read More

Alternate Key in RDBMS

Amit Diwan
Updated on 15-Jun-2020 14:21:14

5K+ Views

Alternate Key or Secondary Key is the key that has not been selected to be the primary key, but are candidate keys. However, it is considered a candidate key for the primary key.A candidate key not selected as a primary key is called alternate or secondary key. Candidate key is an attribute or set of attributes that you can consider as a Primary key.Let us see an example −Student_IDStudent_EnrollStudent_NameStudent_Email0962717Manishaaa@gmail.com0552655Mananabc@gmail.com0672699Shreyaspqr@gmail.comAbove, Student_ID, Student_Enroll and Student_Email are the candidate keys. They are considered candidate keys since they can uniquely identify the student record. Select any one of the candidate key as the primary. Rest ... Read More

Unique Key in RDBMS

Alex Onsman
Updated on 15-Jun-2020 14:19:07

879 Views

Many users consider Primary Key as Unique Key, since both uniquely identify a table, but Unique Key is different from Primary Key. Unique Key accepts null values and Primary Key cannot have null.Let us compare Primary Key and Unique Key and understand its concept −UsageA Unique Key is used to prevent duplicate values in a column. Primary Key provided uniqueness to a table.NULL ValuesA primary key cannot accept NULL values; this makes Primary Key different from Unique Key, since Unique Key allows one value as NULL value.VolumeA table can only have a single Primary Key, whereas a Unique Key can ... Read More

Sixth Normal Form (6NF)

Amit Diwan
Updated on 15-Jun-2020 14:18:09

6K+ Views

In 6NF, the relation variable is decomposed into irreducible components. A relation is in 6NF, only if, It is in 5NF, and every join dependency on the relation is trivialLet us see an example −Enrollment_NoNameMarksThe possible join dependencies for the above would be −{Enrollment_No, Marks}{Enrollment_No, Name}In Sixth Normal Form (6NF), it would be decomposed to −Enrollment_NoNameEnrollment_No MarksLet us see another example −Student_IDStudent_FirstNameStudent_LastNameMarksS01TomAlter90S02JacobWatson80S03HarrySmith85Let us decompose the table −Student_IDStudent_FirstNameS01TomS02JacobS03HarryStudent_IDStudent_LastNameS01AlterS02WatsonS03SmithStudent_IDMarksS0190S0280                     S03                   85Now the above tables are in 6NF, but as you can guess on your know that ... Read More

Exponential Search

Paul Richard
Updated on 15-Jun-2020 14:10:42

4K+ Views

Exponential search is also known as doubling or galloping search. This mechanism is used to find the range where the search key may present. If L and U are the upper and lower bound of the list, then L and U both are the power of 2. For the last section, the U is the last position of the list. For that reason, it is known as exponential.After finding the specific range, it uses the binary search technique to find the exact location of the search key.The complexity of Exponential Search TechniqueTime Complexity: O(1) for the best case. O(log2 i) ... Read More

Surrogate Key in RDBMS

Ricky Barnes
Updated on 15-Jun-2020 13:48:52

1K+ Views

A Surrogate Key’s only purpose is to be a unique identifier in a database, for example, incremental key, GUID, etc. It hasSurrogate Key has no actual meaning and is used to represent existence. It has an existence only for data analysis.ExampleKeyProductIDPrice505_921987200698_561256170304_571898250458_661666110Above, the surrogate key is Key in the table.Other ExamplesSome other examples of a Surrogate Key −Counter can also be shown as Surrogate Key.System date/time stampRandom alphanumeric string.

Data and Structural Independence

Alex Onsman
Updated on 15-Jun-2020 13:47:58

3K+ Views

Structural IndependenceStructural independence exists when changes in the database structure do not affect DBMS ability to access data.Structural dependence exists when changes in the database structure do not affect DBMS ability to access data.Data IndependenceThe changes done in the lower level will not affect the upper layers. The two types are −Physical Data IndependenceLogical Data IndependenceLet us begin with Physical Data Independence −Physical Data IndependenceModify physical schema without affecting the schema or logical data. It is easier to achieve.It is achieved by the internal level of the database and mapping from the logical level to the internal level. The Conceptual Schema ... Read More

Super Key in RDBMS

Ricky Barnes
Updated on 15-Jun-2020 13:46:26

3K+ Views

Super Key is an attribute (or a set of attributes) that uniquely identify a tuple i.e. an entity in entity set.It is a superset of Candidate Key, since Candidate Keys are selected from super key.ExampleLet us see an example −Student_IDStudent_EnrollStudent_NameStudent_EmailS024545Daveddd@gmail.comS344541Jackjjj@gmail.comS224555Markmmm@gmail.comThe following are the super keys for the above table −{Student_ID}{Student_Enroll}{Student_Email}{Student_ID, Student_Enroll}{Studet_ID, Student_Name}{Student_ID, Student_Email}{Student_Name, Student_Enroll}{Student_ID, Student_Enroll, Student_Name}{Student_ID, Student_Enroll, Student_Email}{Student_ID, Student_Enroll, Student_Name, Student_Email}The following would be the candidate key from the above −{Student_ID}{Student_Enroll}{Student_Email}Read More

Advertisements