Multiple choice

Given the relations employee (name, salary, deptno), and department (deptno, deptname, address). Which of the following queries cannot be expressed using the basic relational algebra operations ($\sigma, \pi, \cup, \cap -$)?

  1. Department address of every employee

  2. Employee whose name is the same as its department name

  3. The sum of all employee salaries

  4. All employees of a given department

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

The six basic operators of relational algebra are the selection(σ ), the projection(π), the Cartesian product (x) (also called the cross product or cross join), the set union (U), the set difference (-), and the rename (p). These six operators are fundamental in the sense that none of them can be omitted without losing expressive power. Many other operators have been defined in terms of these six. Among the most important are set intersection, division, and the natural join, but aggregation is not possible with these basic relational algebra operations. So, we cannot run sum of all employees’ salaries with the six operations.