What are the Constraints and list the available constraints in SQL

Constraint: SQL Constraints are the rules created on tables to control the type of data which goes into a table. Constraints play vital role in filtering invalid data while inserting data into a table. We can create constraints while creating a table

Read More

How to extract alphanumeric characters from a string?

This is possible by using the combination of PATINDEX() and STUFF() functions. Step 1: Declare a Parameter and Store the string in it. Step 2: Search for Alphanumeric characters from the string by using PATINDEX. If exists, just loop the following statements.

Read More

What is Self join and why do we need it?

There is no special type of join called Self join in SQL. The Self join is a normal join which is used to join one table to itself. This kind of join is used when we have Unary relationship (Table refers to

Read More

What is the difference between Table variables and Temporary variables?

Temporary Tables: The scope of Local temporary tables is in the current session and Global temporary tables is till the connection exists. Can Truncate Temporary tables Can be part of a Transaction We pre-fix the table name with #(Local) or ##(Global) Can

Read More

Why/When do we need Cross Join?

Cross Join: It is a kind of join that returns each and every combination of rows from all the tables. We need not write the where condition for this kind of join. Also most importantly we do not need join condition for

Read More