Answer :
Final answer:
Relational algebra is a procedural query language used to manipulate and retrieve data from relational databases. It provides a set of operators and operations that can be used to build queries for specific tasks. In the given question, we are asked to build queries using different relational algebra operators and operations to perform various tasks such as displaying employees with a specific salary range, finding employees working in a specific department, finding managers of a department, and finding employees working in one department but not another. By using the appropriate operators and operations, we can easily retrieve the required information from the given relational schemas.
Explanation:
In order to build the required queries, we can use the following relational algebra operators and operations:
Rho (ρ) Operator:
The rho operator is used for renaming attributes or relations. It allows us to assign new names to attributes or relations in order to make the query more readable.
Selection (σ) Operator:
The selection operator is used to retrieve tuples from a relation that satisfy a specific condition. It allows us to filter the data based on a given condition.
Projection (π) Operator:
The projection operator is used to retrieve specific attributes from a relation. It allows us to select only the required attributes from a relation.
Intersection (⋂) Operator:
The intersection operator is used to retrieve common tuples from two relations. It allows us to find the tuples that exist in both relations.
Union (⋃) Operator:
The union operator is used to retrieve all tuples from two relations. It allows us to combine the tuples from both relations without any duplicates.
Difference (-) Operator:
The difference operator is used to retrieve tuples from one relation that do not exist in another relation. It allows us to find the tuples that are unique to one relation.
Join (⨝) Operator:
The join operator is used to combine tuples from two relations based on a common attribute. It allows us to retrieve information from multiple relations by matching the values of a common attribute.
Now, let's build the required queries using these operators:
Query 1:
Display employees (by name and ID) with an annual salary between 60000 (included) and 90000 (excluded)
σ(60000 ≤ Annual_Salary < 90000)(Works_IN) ⨝ Employee_ID = EID (Employee)
Query 2:
For each employee, who works in the ""Design"" department since January 2009, display the employee’s name and the employee’s annual salary
σ(Department_name = ""Design"" ∧ start_date ≥ January 2009)(Works_IN) ⨝ Employee_ID = EID (Employee)
Query 3:
Find the name and rank of the manager who manages the ""Research"" department, also display the budget of that department
σ(Department_name = ""Research"")(Department) ⨝ ManagerID = EID (Manages) ⨝ DepartmentID = Did (Department)
Query 4:
Find the name of employees who earn more than $100,000 per year, along with the names of the departments they work in
σ(Annual_Salary > 100000)(Works_IN) ⨝ Employee_ID = EID (Employee) ⨝ Department_ID = Did (Department)
Query 5:
Assume employees can work in more than one department, find employees (by name and salary) who work in the ""Design"" department but not the ""Research"" department
(σ(Department_name = ""Design"")(Works_IN) ⨝ Employee_ID = EID (Employee)) - (σ(Department_name = ""Research"")(Works_IN) ⨝ Employee_ID = EID (Employee))
Learn more about relational algebra queries here:
https://brainly.com/question/30906883
#SPJ14