Blog Grid
December 11, 2019 2022-08-20 6:08Blog Grid
SQL Identities are used to get the last identity column value.The three identities in SQL are a. Scope_Identity(), b. @@Identity(), c. Ident_Current(TableName) Above is the Employee table. Above is the Test3 tableNow in the Employee table we will be creating…
The SELF JOIN in SQL, as its name implies, is used to join a table to itself. This means that each row in a table is joined to itself and every other row in that table. However, referencing the same…
Transaction A transaction is a set of SQL command that are treated as a single unit. A successful transaction must pass the ACID test. They are Atomicity, Consistency, Isolation and Durability. ACID Property Explanation Here PRODUCT is an inventory table,…
Let's create an Employee table which has a salary column in it as follows Now we can find the nth highest salary from the above Employee using the following ways 1. Using CTE The code below will find the 3rd…
The FULL OUTER JOIN keyword returns all records when there is a match in left (CAR) or right (COLOR) table records. FULL OUTER JOIN and FULL JOIN are the same. When no matching rows exist for the row in the…
There are two tables, Table-1 as below Table-2 as below What will be the result if we perform INNER JOIN, LEFT JOIN and RIGHT JOIN in the above two tables? Inner Join If we perform the INNER JOIN between the…
In SQL, CROSS JOINs are used to combine each row of one table with each row of another table, and return the Cartesian product of the sets of rows from the tables that are joined. Where to use CROSS JOIN?…
The SQL RIGHTJOIN returns all rows from the right table, even if there are no matches in the left table. This means that if the ON clause matches 0 (zero) records in the left table; the join will still return a…
The SQL LEFT JOIN returns all rows from the left table, even if there are no matches in the right table. This means that if the ON clause matches 0 (zero) records in the right table; the join will still…
JOIN clause is used to combine rows from two or more tables, based on a related column between them.INNER JOIN clause in SQL Server creates a new table (not physical) by combining rows that have matching values in two or…