Sql Query To Use a Inner Joins


Inner Join is used to retrieve the only record, that having matched column value (e.g id) on both tables.

We can perform inner joins in multiple tables.

Here we are performing inner joins between employees and the job_history table, that having matched column employee_id value.

In second query we only use AS or Alias

Enter - Select * from table_name;
SQL Query
SELECT 'Using Inner Joins'; SELECT first_name,email,salary,start_date,end_date FROM employees inner join job_history WHERE employees.employee_id = job_history.employee_id; SELECT 'Using Inner Joins as Alias'; SELECT e.first_name,e.email,e.salary,jh.start_date,jh.end_date FROM employees as e inner join job_history as jh WHERE e.employee_id = jh.employee_id;
Output