This article discusses about merging multiple tables by rows and columns using SQL along with a few examples

Image by author
SELECT 
*
FROM table_1
JOIN table_2
USING (id);
SELECT 
*
FROM table_1 t1
JOIN table_2 t2
ON t1.t1_id = t2.t2_id;

Inner Join

SELECT 
*
FROM left_table
INNER JOIN right_table
USING (id);
SELECT 
*
FROM left_table l
INNER JOIN right_table r
ON l.id = r.id;
Inner Join (Image by author)

Left Join

SELECT 
*
FROM left_table
LEFT JOIN right_table
USING (id);
SELECT 
*
FROM left_table l
LEFT JOIN right_table r
ON l.id = r.id;
Left Join (Image by author)

Right Join

Continue reading: https://towardsdatascience.com/merging-tables-using-sql-a2e60ff687e9?source=rss—-7f60cf5620c9—4

Source: towardsdatascience.com