Category: Misc
-
How to use distinct in SQL?
SQL DISTINCT clause is used to remove the duplicates columns from the result set. The distinct keyword is used with select keyword in conjunction. It is helpful when we avoid duplicate values present in the specific columns/tables. The unique values are fetched when we use the distinct keyword. Syntax: Parameters: Expressions: The columns or calculations that we want to retrieve are…
-
CTE (Common Table Expression)SQL
The Common Table Expressions (CTE) are imported into the SQL to simplify many classes of the Structured Query Language (SQL) for a derived table, which is unsuitable. It was introduced in 2005 SQL SERVER version. The common table expressions (CTE) are a result set, which we reference with the SELECT, INSERT, UPDATE, or DELETE statement. In SQL 2008, we add a CTE for the unique MERGE statement. How to…
-
SQL CONCAT Function
The CONCAT function in SQL is a String function, which is used to merge two or more strings. The Concat service converts the Null values to an Empty string when we display the result. This function is used to concatenate two strings to make a single string. The operator is used to link character strings and column string. We can…
-
SQL Comments
SQL Comments are used to explain the sections of the SQL statements, and used to prevent the statements of SQL. In many programming languages, comments matter a lot. A Microsoft Access database does not support the comments. So, Mozilla Firefox and Microsoft Edge use the Microsoft Access database in the examples. There are three types of comments, which are…
-
SQL add/drop/update column operation
The statement ALTER TABLE is mainly used to delete, add, or modify the columns into an existing table. It is also used to add many constraints on the current table. ADD COLUMN is used to add the particular table to the existing one. We can add additional information without creating the whole database again. SQL add column is used to add column…
-
SQL group by
In SQL, The Group By statement is used for organizing similar data into groups. The data is further organized with the help of equivalent function. It means, if different rows in a precise column have the same values, it will arrange those rows in a group. Syntax: Sample Table: Employee S.no Name AGE Salary 1 John 24…
-
SQL Formatter
The lengthy code becomes difficult to interpret. There is a large amount of unformatted SQL code while reading SQL scripts, which are difficult to reduce and understand. The Formatting options in SQL makes the work easier for us. SQL Formatter SQL Formatting is a slow process. Many formatting tools are used to speed up the…