What is the difference between Stored Procedure and Trigger in SQL

In this article, we will see the difference between Stored Procedure and Trigger in SQL. Following are the main differences between Stored Procedure and Trigger:

Continue reading What is the difference between Stored Procedure and Trigger in SQL

Stored Procedure Trigger
Store Procedures are invoked explicitly Triggers are invoked implicitly
Stored procedure is a user defined piece of code which may return a value (making it a function) that is invoked by calling it explicitly. A trigger is a stored procedure that runs automatically when various events happen (eg update, insert, delete).

What is the difference between synchronous and asynchronous Replication

Following are the difference between synchronous and asynchronous Replication.

1. Asynchronous Replication: There is delay between Master and Slave(Secondary). In this data can be replicated after the transaction has been committed on the master. Which means the slave is never ahead of the master. So, in the case of writing it is usually a little behind the master. This delay also called lag.

2. Synchronous Replication: Continue reading What is the difference between synchronous and asynchronous Replication

What is the difference between union and join

Following are the differences between union and join in relational database engines.
A union returns the results of two different queries as a single recordset and A join allows you to relate similar data in different tables.

UNION JOIN
UNION puts lines from queries after each other, JOIN makes a cartesian product and subsets it
Union Operation is combined result of the Vertical Aggregate of the rows JOIN Operation is combined result of the Horizontal Aggregate of the Columns
Union combines rows JOIN links the rows
Performed only on two similar structures Performed only on two dissimilar structures also
A union returns the results of two different queries as a single recordset. A join allows you to relate similar data in different tables.

Visual depiction of a join. Table A and B’s columns are combined into a single result:

Continue reading What is the difference between union and join