Write a relational algebra expression that is equivalent to the following SQL statement: SELECT AVG(SALARY) , COUNT(*) FROM EMPLOYEE WHERE  GENDER = 'M' GROUP BY DEPT_CODE

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

Defined the relational algebra operations as follows:

  • SELECT (p, R) is equivalent to σp(R) referring to a set tuples of relation R that conforms to predicate p
  • PROJECT(L, R)  is equivalent to  πL(R) referring to a relation that contains a vertical subset of R, extracting the values of specified attributes L and eliminating duplicates.
  • JOIN (R, p, S) refers to a relation containing a combination of tuples of relations R and S that satisfy the join condition p.
  • FULL_JOIN (RpS) refers to a relation containing the result of outer join between  relations R and S that satisfy the join condition p
  • LEFT_JOIN (RpS) refers to a relation containing the result of left outer join between  relations R and S that satisfy the join condition p
  • RIGHT_JOIN (RpS) refers to a relation containing the result of right outer join between  relations R and S that satisfy the join condition p
  • CROSS (RS) refers to a relation containing the catesian product of relations  R and S
  • UNION (RS)  refers to a relation containing the union of relations  R and S
  • INTERSECTION (RS) refers to a relation containing the intersection of relations  R and S
  • DIFFERENCE (RS) refers to a relation containing the set difference between relations  R and S
  • AGGREGATE (R, f) refers to a relation derived from relation R with a list of function-attribute pairs, where function is one of the allowed aggregaton functions such as COUNT, SUM, AVERAGE, MAXIMUM and MINIMUM, and attribute is an attribute of R.
  • AGGREGATE (Rf, g) refers to a relation derived from relation R with a grouping of tuples with respect to a list of attributes of R specified in g and a list of function-attribute pairs, where function is one of the allowed aggregaton functions such as COUNT, SUM, AVERAGE, MAXIMUM and MINIMUM, and attribute is an attribute of R.

 

Write a relational algebra expression that is equivalent to the following SQL statement:

SELECT AVG(SALARY) , COUNT(*)

FROM EMPLOYEE

WHERE  GENDER = 'M'

GROUP BY DEPT_CODE

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

Blurred answer
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY