JOIN clause in Oracle SQL



JOIN clause in Oracle SQL


Suppose we have two tables: "employees" and "departments", with the following data:


Table employees:



Table departments


We can use the JOIN clause to combine data from both tables based on the common column "dept_id". For example, to get a list of employees with their department names, we can use the following SQL query:


SELECT emp_name, dept_name

FROM employees e

JOIN departments d

ON e.dept_id = d.dept_id;


NOTE :-    DEPT_ID  ---------> PRIMARY KEY


OUTPUT:





Post a Comment

Previous Post Next Post