Himanshu shriv has Published 52 Articles

Difference between Primary key and Foreign key in SQL Database

Himanshu shriv

Himanshu shriv

Updated on 21-Jan-2020 09:38:32

1K+ Views

In the relationaltonal database key is the most important element to maintain the relationship between two tables or to uniquely identify data from the table. Primary key is used to identify data uniquely therefore two rows can’t have the same primary key. It can’t be null.On the other hand, foreign ... Read More

Difference between ETL and ELT in SQL Server

Himanshu shriv

Himanshu shriv

Updated on 21-Jan-2020 09:29:42

648 Views

ETL stands for Extract, Transform and Load. ETL tool is used to extract data from the source RDBMS database and transform extracted data such as applying business logic and  calculation, etc. and  then load data into the target data warehouse. In ETL tool,  transformation of the data performed at the ... Read More

Difference between Star schema and Snowflake schema in SQL Server

Himanshu shriv

Himanshu shriv

Updated on 21-Jan-2020 09:28:49

302 Views

Star schema is relational schema which is follow the concept of facts and dimensions. Fact table is used to store the event like login and dimension tables are used to store the reference data of the partitural event. In star schema , tables are completely denormalized because of this query performance ... Read More

Difference between sequence and identity in Hibernate

Himanshu shriv

Himanshu shriv

Updated on 21-Jan-2020 08:04:06

7K+ Views

Hibernate or JPA support 4 different types of  primary key generator. These generators are used to generate primary key while inserting rows in the database. Below are the primary key generator   −GenerationType.AUTOGenerationType. IDENTITYGenerationType.SEQUENCE GenerationType.TABLEGenerationType. IDENTITY − In identity , database is responsible to auto generate the primary key. Insert a row ... Read More

Difference between Collection.stream().forEach() and Collection.forEach() in Java

Himanshu shriv

Himanshu shriv

Updated on 21-Jan-2020 08:02:10

637 Views

Collection.stream().forEach() and Collection.forEach() both are used to iterate over collection. Collection.forEach()  uses the collection’s iterator. Most of the collections doesn’t allow the structurally modification while iterating over them. If any element add or remove while iteration they will immediately throw concurrent modification exception. If Collection.forEach() is iterating over the synchronized collection ... Read More

Difference between EnumMap and HashMap in Java

Himanshu shriv

Himanshu shriv

Updated on 21-Jan-2020 07:59:49

587 Views

EnumMap is introduced in JDK5. It is designed to use Enum as key in the Map. It is also the implementation of the Map interface. All of the key in the EnumMap should be of the same enum type. In EnumMap , key can’t be null and any it will ... Read More

Difference between readObject and readResolve method in serialization

Himanshu shriv

Himanshu shriv

Updated on 21-Jan-2020 07:43:16

1K+ Views

Serialization is the process of converting object to stream byte and storing byte stream in database or memory. Class which implements java.io.Serializable interface can be serialized. Class which is implementing this interface gives the responsibility to JVM for serialize or persist java object As per the oracle docs −readObject method − Each ... Read More

Differences between stack and queue data structure

Himanshu shriv

Himanshu shriv

Updated on 21-Jan-2020 07:37:57

351 Views

Stack and queue both are data structure to store data in particular order.Stack is linear data structure in which objects are inserted or removed at the same end. Therefore, it is visualized as vertical collection. That is the reason why stack is called Last-in-First-out (LIFO) type of list.Queue is also a ... Read More

Difference between green and native thread

Himanshu shriv

Himanshu shriv

Updated on 21-Jan-2020 07:34:28

1K+ Views

Green threads are created and scheduled by Virtual machine without using OS libraries. “Green” was the project code name of the thread project which was developed by the Java, therefore the name of the thread is “Green”. It can not make use of multiprocessor.On the other hand, Native threads are created ... Read More

Difference between save() and persist() in Hibernate

Himanshu shriv

Himanshu shriv

Updated on 21-Jan-2020 07:33:48

15K+ Views

Save() and persist() both methods are used for saving object in the database. As per docs −Save()  − Persist the given transient instance, first assigning a generated identifier. (Or using the current value of the identifier property if the assigned generator is used.) This operation cascades to associated instances if the association is mapped ... Read More

Advertisements