21.Complete SQL JOINS | SQL JOIN with Examples

Опубликовано: 28 Октябрь 2024
на канале: learn by doing it
165
8

Complete SQL JOINS | SQL JOIN with Examples

SQL JOINs Explained: Master Table Relationships in SQL!
In this video, learn how to use different SQL JOINs to combine data from multiple tables efficiently. 🔗📊 Understanding JOINs is essential for working with relational databases.

✅ What is a JOIN in SQL?
A JOIN is used to retrieve related data from two or more tables based on a common column. With JOINs, you can efficiently query complex relationships between tables.

Types of SQL JOINs Covered
INNER JOIN:
Retrieves only matching rows from both tables.

LEFT JOIN (LEFT OUTER JOIN):
Retrieves all rows from the left table, and matching rows from the right table (or NULL if no match).

RIGHT JOIN (RIGHT OUTER JOIN):
Retrieves all rows from the right table, and matching rows from the left table (or NULL if no match).

FULL OUTER JOIN:
Returns all rows from both tables (NULL for non-matching rows).

Want more similar videos- hit like, comment, share and subscribe

❤️Do Like, Share and Comment ❤️
❤️ Like Aim 5000 likes! ❤️

➖➖➖➖➖➖➖➖➖➖➖➖➖
Please like & share the video.
➖➖➖➖➖➖➖➖➖➖➖➖➖
script

CREATE TABLE employees (
employee_id INT PRIMARY KEY,
name VARCHAR(50),
department_id INT,
salary DECIMAL(10, 2)
);

-- Create departments table
CREATE TABLE departments (
department_id INT PRIMARY KEY,
department_name VARCHAR(50)
);

-- Insert data into employees table
INSERT INTO employees (employee_id, name, department_id, salary) VALUES
(1, 'Alice', 1, 50000.00),
(2, 'Bob', 2, 45000.00),
(3, 'Charlie', 4, 48000.00),
(4, 'David', 5, 52000.00); -- No department assigned

-- Insert data into departments table
INSERT INTO departments (department_id, department_name) VALUES
(1, 'Human Resources'),
(2, 'Finance'),
(3, 'IT');

➖➖➖➖➖➖➖➖➖➖➖➖➖
AWS DATA ENGINEER :    • AWS DATA ENGINEER  

Azure data factory :
   • Azure Data Factory  

Azure data engineer playlist :    • Azure Data Engineer  

SQL PLAYLIST :    • SQL playlist  

PYSPARK PLAYLIST -
   • Pyspark Tutorial  

➖➖➖➖➖➖➖➖➖➖➖➖➖
📣Want to connect with me? Check out these links:📣

Join telegram to discuss https://t.me/+Cb98j1_fnZs3OTA1

➖➖➖➖➖➖➖➖➖➖➖➖➖
what we have covered in this video:


➖➖➖➖➖➖➖➖➖➖➖➖➖

Hope you liked this video and learned something new :)
See you in next video, until then Bye-Bye!

➖➖➖➖➖➖➖➖➖➖➖➖➖