by Aman Raiyyani | Mar 8, 2023 | SQL Server
A primary key is a column or set of columns in a table that uniquely identifies each row in the table. A primary key cannot contain null values and must have a unique value for each row. It is used to enforce the integrity of the data and to create a link between...
by Aman Raiyyani | Mar 7, 2023 | SQL Server
This is the most commonly used type of join. It returns only the rows that have matching values in both tables. The syntax for an inner join is: SELECT column1, column2 FROM table1 JOIN table2 ON table1.column = table2.column; Real-life example: A retail store has a...
by Aman Raiyyani | Mar 6, 2023 | SQL Server
LEFT JOIN: This type of join returns all the rows from the left table and the matching rows from the right table. If there is no match, the result will contain NULL values. The syntax for a left join is: <!– wp:paragraph –> <p>SELECT column1,...
by Aman Raiyyani | Mar 6, 2023 | SQL Server
FULL OUTER JOIN: This type of join returns all the rows from both tables, whether there is a match or not. If there is no match, the result will contain NULL values. The syntax for a full outer join is: SELECT column1, column2 FROM table1 FULL OUTER JOIN table2 ON...
by Aman Raiyyani | Mar 6, 2023 | SQL Server
RIGHT JOIN: This type of join returns all the rows from the right table and the matching rows from the left table. If there is no match, the result will contain NULL values. The syntax for a right join is: SELECT column1, column2 FROM table1 RIGHT JOIN table2 ON...