DBAS27198 Lecture Notes - Lecture 5: Mysql, Switch Statement

76 views3 pages

Document Summary

A union b, where a union says take all the elements in both sets and remove the duplicates. A u b is 1 2 3 4 6 7. Select expression1, expression2 from table1 [where conditions] union. Union removes duplicate rows, but union all does not remove duplicate rows same number of columns, compatible types means we are casting the union. Get the employee records from the employees and job history tables: -employees table select employee_id, hire_date as start date, job_id from employees where employee_id=101; Job history table select employee_id, start_date, end_date, job_history from job_history where employee_id=101; Notice how the conditions above match in both columns!! This is called union compatible in technical terms. The intersect operator returns the results of 2 or more select statements. For example, two select statements and it returns what is in between them. Union is more common than intersection but intersect has its rules.

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers