Topic describes

Select * from employees;

There is a department table with dept_EMp as follows:

Please find all have assigned staff first_name and last_name and dept_no unallocated staff don’t show, the above example is as follows:

Answer key

SELECT * from JOIN; SELECT * from JOIN;

Elapsed time: 16ms over 59.09% Code submitted with Sqlite Memory: 3400KB Over 36.03% code submitted with Sqlite

SELECT a.last_name, a.first_name, b.dept_no
FROM employees a JOIN dept_emp b
ON a.emp_no = b.emp_no;
Copy the code
SELECT a.last_name, a.first_name, b.dept_no
FROM employees a INNER JOIN dept_emp b
ON a.emp_no = b.emp_no;
Copy the code
SELECT a.last_name, a.first_name, b.dept_no
FROM employees a, dept_emp b
WHERE a.emp_no = b.emp_no;
Copy the code