In this post we will discuss about OUTPUT option. T-SQL supports an OUTPUT clause for modification statements, which we can use to return information from modified rows.
We can use output option for purposes like auditing, archiving and others. We can use OUTPUT clause with insert, update, delete statements.
SQL: IN OPERATOR
In this post we will discuss IN operator in SQL server 2016 with example.
The arithmetic operator (=) compare a single value to another single value. In case a value needs to be compared to a list of values then the IN predicate is used.
The IN predicate
In this post we discuss about set operators with example for better understanding. In SQL there three set operators union, intersect, except.
Before discussing about set operators we have to know some rules for set operators:
Column alias must be expression in the first query.
Each select statement must
Like Operator in SQL
In this post we will discuss Like Operator in SQL with example and it's used in Query.
The LIKE allows comparison of one string value with another string value. This is achieved by using wildcard character.
Using LIKE operator we can filter character string data based on
Self joins are used to compare values in a column with other values in the same column in the same table.
In some situations, it is necessary to join a table to itself, as through joining two separate tables. This is referred to self join.
There is no
Inner join is same as join, so we can use either inner join or join keyword.
Using this join we can joins two or more tables and we can also specify more then one predicate in the ON clause.
This type of join can be used in situations
In this post we will discuss about the delete and truncate statement in sql server 2016.In SQL we can delete rows from the table using DELETE and TRUNCATE TABLE.
With the use of Delete statement we can delete rows from the table. we can also specify the predicate to
In this post we will discuss about update statement in SQL server 2016.
SQL support the update statement to allow us to modify or change the existing data in a tables.
The update statement in SQL either update all the rows from a table or a selected set of
LEARN SQL: PART-3
In this post we will discuss DEFAULT, CHECK,UNIQUE constraints with example.
Default constraint inserts the default value into a column when you do not provide value for column.
At the time of table creation default value is assigned to column. the datatype of the value should match the
LEARN SQL: PART-2
In this post we will discuss constraints in SQL server.
SQL constraints are used to specify rules for storing data in to table. Constraints defined rules that must be applied to data before storing them into database/table to ensure integrity.
Only data, which satisfies the conditions will be