๐ Understanding INNER JOIN in Oracle SQL (Combining Tables)

As part of my continued learning with Oracle Autonomous Database, I explored how to combine data from multiple tables using SQL JOIN operations. This is a fundamental concept in relational databases.
๐ฏ Objective
The goal of this activity was to:
Understand relationships between tables Combine data using INNER JOIN Practice real-world SQL queries
๐ป Step 1: Creating Tables
CREATE TABLE departments ( dept_id NUMBER, dept_name VARCHAR2(50) );
CREATE TABLE employees ( emp_id NUMBER, emp_name VARCHAR2(50), dept_id NUMBER );
๐งช Step 2: Inserting Data
INSERT INTO departments VALUES (1, 'IT'); INSERT INTO departments VALUES (2, 'HR');
INSERT INTO employees VALUES (1, 'Ali', 1);
INSERT INTO employees VALUES (2, 'Sara', 2);
INSERT INTO employees VALUES (3, 'Ahmed', 1);
๐ Step 3: Viewing Tables
SELECT * FROM employees;
SELECT * FROM departments;
๐ Step 4: Performing INNER JOIN
SELECT e.emp_name, d.dept_name
FROM employees e INNER JOIN departments d
ON e.dept_id = d.dept_id;
This query combines employee names with their respective departments.
๐ก What I Learned
How relational databases connect tables Using INNER JOIN to combine data Writing efficient multi-table queries
๐ Conclusion
This activity helped me understand how to work with multiple tables in Oracle SQL. JOIN operations are essential for real-world database applications and data analysis.





