You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
atomb0mb edited this page Jul 22, 2021
·
1 revision
Union
Find a list of employee and branch names
SELECT employee.first_name AS Employee_Branch_Names
FROM employee
UNION
SELECT branch.branch_name
FROM branch;
Find a list of all clients & branch suppliers' names
SELECT client.client_name AS Non-Employee_Entities, client.branch_id AS Branch_ID
FROM client
UNION
SELECT branch_supplier.supplier_name, branch_supplier.branch_id
FROM branch_supplier;
Join
Add the extra branch
INSERT INTO branch VALUES(4, "Buffalo", NULL, NULL);
SELECT employee.emp_id, employee.first_name, branch.branch_name
FROM employee
JOIN branch -- LEFT JOIN, RIGHT JOIN
ON employee.emp_id = branch.mgr_id;