Back to articles
Joins and Windows Functions in SQL

Joins and Windows Functions in SQL

via Dev.to TutorialMJ-O

INTRODUCTION Data in relational databases is usually stored in different tables. Joins allows one to combine data from multiple tables whereas window functions allow calculations across related rows without grouping the results into a single row. 1. JOINS Joins are operations that allow one to combine rows from two or more tables based on a related column between them. Types of Joins -INNER JOIN The most common type of join. It returns only the rows that have matching values in both tables based on a related column between them.It can also be written as 'join'. - LEFT JOIN Returns all rows from the table on the left(the first selected table) and matching rows from the right table. Suppose there is no match, NULL values are returned. - RIGHT JOIN Returns all rows from the right table(the second table selected) and matching rows from the left table. Suppose there is no match, NULL values are returned. - FULL OUTER JOIN Returns all rows from both tables. Non-matching rows from both tables

Continue reading on Dev.to Tutorial

Opens in a new tab

Read Full Article
12 views

Related Articles