How To Use Comments In SQL
thecodehubs

In this article, we will learn how to use the Comments in SQL.

Comments can be used to explain sections of SQL statements, and to make it more readable. It can also be used to prevent execution when testing alternative SQL statements.

How To Use WHILE Loop In SQL
thecodehubs

In this article, we will learn how to use the WHILE loop in SQL.

The WHILE loop loops through a block of code as long as a specified condition is not false.

The WHILE loop is handy because they save time, reduces errors, and they make code more readable.

How To Use Case Statement In SQL
thecodehubs

In this article, we will learn how to use the Case statement in SQL.

In SQL, the CASE statement goes through conditions and when the first condition is met it returns a value. So, once a condition is true, it will stop reading and return the result. If no conditions are true, it returns the value in the ELSE clause (like an If Else statement).

It returns NULL if there is no ELSE part and no conditions are true.

How To Use If Else Statement In SQL
thecodehubs

In this article, we will learn how to use the If-Else statement in SQL.

In SQL, the If-Else statement executes a block of code if a specified condition is true. If the condition is false, else block of code can be executed.

The If-Else statement is a part of SQL’s conditional Statements. Conditional Statements are used to perform different actions based on different conditions in SQL.

How To Write Insert Into Select Query In SQL
thecodehubs

In this article, we will learn how to write a SQL insert into select query.

To copy data from one table and insert it into another table in SQL, the INSERT INTO SELECT statement is used.

Data types in source and target table should match.
Existing records in the target table are unaffected.

How To Write Select Into Query In SQL
thecodehubs

In this article, we will learn how to write a SQL select into query.

To copy data from one table into a new table in SQL, the SELECT INTO statement is used.

With the column-names and types as defined in the old table, the new table will be created. You can create new column names using the AS clause (Aliases).

Subscribe

Select Categories