Back to articles
SQL Joins & Window Functions: The Skills That Separate Analysts from Beginners
How-ToSystems

SQL Joins & Window Functions: The Skills That Separate Analysts from Beginners

via Dev.toMburu

You have learned the basics of SQL - 'SELECT', 'WHERE', 'GROUP BY' and now you are ready to level up: to move from I know SQL to I can analyze data. I will help you understand Joins and Window Functions and with these you`ll be able to answer much more complex questions from your data. PART 1: SQL JOINS Imagine you have two tables: One table has Customers Another table has Orders If you want to know which customer made which order, you will need a JOIN. What Is a JOIN? A Join lets you combine these two tables so you can see the customer alongside their order all in one result. In simple terms: A Join connects rows from two or more tables based on a related column between them. Example Tables Customers Table customer_id name 1 Shujaa 2 Achieng 3 Brian Orders Table order_id customer_id amount 101 1 5000 102 1 3000 103 2 7000 INNER JOIN This is the Most Common join and returns only the rows where there is a match in both tables. sql SELECT c.name, o.order_id, o.amount FROM Customers c INN

Continue reading on Dev.to

Opens in a new tab

Read Full Article
2 views

Related Articles