A database model determines the logical structure of a database and determines in which manner data can be stored, organized and manipulated on a fundamental basis. before the databases are designed, the only way to store data was are in file storage, which increases the complexity as programmers had to go to great lengths to extract the data, and their programs had to perform complex parsing and relating.There are various languages like Perl process the text in an easier manner due to its powerful regular expressions. However, accessing the data from files is still a complex task. There is no ... Read More
In Ternary relationship three different Entities takes part in a Relationship.Relationship Degree = 3For Example: Consider a Mobile manufacture company.Three different entities involved:Mobile - Manufactured by company. Part - Mobile Part which company get from Supplier. Supplier - Supplier supplies Mobile parts to Company.Mobile, Part and Supplier will participate simultaneously in a relationship. because of this fact when we consider cardinality we need to consider it in the context of two entities simultaneously relative to third entity.Cardinality in Ternary RelationshipSay for a given instance of Supplier and an Instance of Part, can that supplier supply that particular part for multiple Mobile models.Example ... Read More
In java, a non-static final variable can be assigned a value at two places.At the time of declaration.In constructor.ExampleLive Demopublic class Tester { final int A; //Scenario 1: assignment at time of declaration final int B = 2; public Tester() { //Scenario 2: assignment in constructor A = 1; } public void display() { System.out.println(A + ", " + B); } public static void main(String[] args) { Tester tester = new Tester(); ... Read More
Unlike C, C++, Java does not allow static local variables. The compiler will throw the compilation error.ExampleCreate a java class named Tester.Tester.javaLive Demopublic class Tester { public static void main(String args[]) { static int a = 10; } }OutputCompile and Run the file to verify the result.Tester.java:3: error: illegal start of expression static int a = 10;
Data is collected and stored on personal computers which are small and easily manageable. The data is generally used by the same department of an organization and is accessed by a small group of people.
The end user is usually not concerned about the transaction or operations done at various levels and is only aware of the product which may be a software or an application. Therefore, this is a shared database which is specifically designed for the end user, just like different levels’ managers. Summary of whole information is collected in this database.
A One-to-One Unary Relationship is the association with the same entity between the same instances represented by same role group.Above figure represents a set of married persons with the relationship MARRIED_TO. Each person is married to only one and only one person in the group.In One-to-One Unary we have three cases available −Mandatory-MandatoryOptional-OptionalOptional-Mandatory or Mandatory-OptionalMandatory-MandatoryEach instance of the role group must fully participate in the relationship. In the above example a Person is married to one and only one Person.Optional-OptionalIn this case the participation of a instance within a role group is optional i.e. the participation is not mandatory.In the ... Read More
Being a type of Collection, we can convert a set to Stream using its stream() method.ExampleLive Demoimport java.util.HashSet; import java.util.Set; import java.util.stream.Stream; public class Tester { public static void main(String args[]) { Set set = new HashSet(); set.add("a"); set.add("b"); set.add("c"); set.add("d"); set.add("e"); set.add("f"); Stream stream = set.stream(); stream.forEach(data->System.out.print(data+" ")); } }Outputa b c d e f
We can convert a stream to set using the following ways.Using stream.collect() with Collectors.toSet() method - Stream collect() method iterates its elements and stores them in a collection.collect(Collector.toSet()) method.Using set.add() method - Iterate stream using forEach and then add each element to the set.ExampleLive Demoimport java.util.*; import java.util.stream.Stream; import java.util.stream.Collectors; public class Tester { public static void main(String[] args) { Stream stream = Stream.of("a", "b", "c", "d"); // Method 1 Set set = stream.collect(Collectors.toSet()); set.forEach(data -> System.out.print(data + " ")); ... Read More
A One-to-Many Unary Relationship is the association with the same entity between the same instances represented by different role groups.Consider the relationship between Managers and Employees.The two different Roles in this relationship are- Managers and Employees. Only few Employees take the role of Managers within an organization while everyone working for an organization is an Employee.One Manager manages multiple Employees and each Manager is also an Employee. One-to-Many Optional-MandatoryEach instance of one role group must participate in the relationship while instance of other role group can optionally participate in the relationship. The Role of Manager satisfies the optional participation as there are ... Read More
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP