Category: SQL

Use of CONCAT Function in SQL

Use of CONCAT Function in SQL: (1) “CONCAT” function is used to add two or more strings together. (2) Let’s take an example to Add Vendor No. and Vendor Name field in one string in Vendor table as shown. (3) Select the database in the SQL server and click on the “New Query” button as shown. …

Use of CHARINDEX Function in SQL

Use of CHARINDEX Function in SQL: (1) “CHARINDEX” function is used to get the position of Character from a string. (2) Let’s take an example to get the position of ‘e’ from the Vendor Address field in the Vendor table as shown. Note: (i) This function performs a case-insensitive search and (ii) Gives first find position …

Use of CHAR function in SQL

Use of CHAR function in SQL: (1) “CHAR” function is used to get the first CHARACTER from ASCII Value. (2) Let’s take an example to get CHAR from the ASCII Value field from the Vendor table as shown. (3) Select the database in the SQL server and click on the “New Query” button as shown. (4) …

Use of ASCII function in SQL

Use of ASCII function in SQL: (1) “ASCII” function is used to get the first ASCII value of a string. (2) Let’s take an example to get the ASCII value of Vendor Name from Vendor table as shown. (3) Select the database in the SQL server and click on the “New Query” button as shown. (4) …

Take Database Backup via SQL Query in SQL Server

Take Database Backup via SQL Query in SQL Server: (1) “BACKUP DATABASE” statement is used to take a full backup of an existing database. (2) Syntax of “BACKUP DATABASE”& DIFFERENTIAL statement is: BACKUP DATABASE database_nameTO DISK = ‘PathOfFile’; BACKUP DATABASE database_nameTO DISK = ‘PathOfFile’;With DIFFERENTIAL (3) Select the database in the SQL server and click on the …

Create Database via query in SQL Server

Create Database via query in SQL Server: (1) “CREATE DATABASE” command is used to create a new database in SQL Server. (2) Syntax: Create Database NameOfDataBase; (3) Let’s create a database via query. Select the database in the SQL server and click on the “New Query” button as shown. (4) After that new query editor open …

Use of INNER JOIN in SQL Server

Use of INNER JOIN in SQL Server: (1) “INNER JOINS” is used to combine data from two or more tables, according to the related column similarity. It returns records having the same value in both tables. (2) Syntax of “INNER JOIN” statements are: SELECT Col1, Col2, …ColNFROM table_name1INNER JOIN table_name2ON table_name1.col1 = table_name2.col1; (3) Let’s take an …

Types of JOINS Statement in SQL Server

Types of JOINS Statement in SQL Server: (1) “JOINS” is used to combine data from two or more tables, according to the related column similarity. (2) Different types of JOINS are- INNER JOIN LEFT JOIN RIGHT JOIN FULL JOIN SELF JOIN (3) INNER JOIN: Return records having the same value in both tables. (4) LEFT JOIN: …