Please note that the following blog post provides a summary view for what you need to get done (left column) and quick examples that illustrate how to do it in SQL (right column with SQL code in red). For more information please see the resources below:
- SQL Course 2. (2018). SQL Course 2: Interactive Online SQL Training. Retrieved from http://www.sqlcourse2.com/
- Mode Community. (2018). The SQL Tutorial for Data Analysis. Retrieved from https://community.modeanalytics.com/sql/tutorial/introduction-to-sql/
- Programmer Interview. (2018). Practice SQL Interview Questions and Answers. Retrieved from http://www.programmerinterview.com/index.php/database-sql/practice-interview-question-1/
Union |
SELECT ename, job, deptno FROM emp UNION SELECT name, title, deptid FROM emp_history |
Intersect |
SELECT ename, job, emptno FROM emp INTERSECT SELECT name, emptid, title FROM emp_history |
Union all (will include duplicate values) |
SELECT ename, job, emptno FROM emp UNION ALL SELECT name, emptid, title FROM emp_history |