
Simple guides to table joins and window functions in SQL.
The postgresql joins clause is used to combine recors from two or more tables in a database.A join is a means for combining fields from two tables by using values common to each. There are five types of joins as shown below; 1.The inner join. 2.The cross join. 3.The left outer join. 4.The right outer join. 5.The full outer join. THE INNER JOIN It creates a new result table by combining column values of two tables(A and B) based upon the join-predicate. The query compares each row of table A with each row of table B to find all pairs of rows, which satisfy the join predicate. When the join-predicate is satisfied, column values for each matched pair of rows of table A and table B are combined into a result row. Its the most common type of join. The syntax used to perform this kind of join is as shown below; SELECT A.column1,B.column2 .... FROM A INNER JOIN B The image below shows how an in inner join works. THE CROSS JOIN It matches every row of the first table with every row of the seco
Continue reading on Dev.to
Opens in a new tab


