Question: Consider we have a database with 7 relations whose schema is shown as below: Customer = { cid , f name, lname , birthday, income
Consider we have a database with relations whose schema is shown as below:
Customer cid f name, lname birthday, income
Account accnotype, balance, branch no
Owns cid accno
Transactions txn no accno, amount, date, note,txn type
Employee eid f name, lname salary, start date, branch no
PersonalBanker cid eid, assignment date
Branch branch no branch name, street, num employee, manager eid, budget
Write a relational algebra query AND a tuple relational calculus TRC query to answer each of the
following questions. You may use input relation names to differentiate between attributes with the same
name in the results of a join or Cartesian product such as referring to Employee. f name or Customer. f name
in the results of the Cartesian product of Employee and Customer Note that you can use comparison
operators eg etc. over dates.
Note: You should ONLY use relational algebra and calculus notations that we covered in the class.
Find the first name, last name, the branch name, and number of employees for all managers who serve
as both a personal banker and a manager.
Find the first and last names of customers who were born after June nd and whose income is
greater than $
Find the CIDs, first names, last names and birthday of customers who have an account at a branch
with more than employees.
Find the CIDs of customers who do not own a joint account an account that is owned by more than
one customer
Find the CIDs of customers who have personal bankers in both Pittsburgh West and Harrisburg
South branches.
Find the branch names of branches that employ at least one employee whose last name is Jackson
and also at least one employee making less than $
Find the CIDs of customers whose accounts have a transaction of type check where the absolute value
of the transactions amount is greater than $ie they deposited a check greater than $
or paid using a check an amount greater than $
Find the first names, last names and birth dates of the customers whose have the lowest income among
all the customers who were born before August If more than one customer have the lowest
income among this group, return all of them.
Find EIDs and salaries of employees who earn more than the manager of their branch.
Find the first names, last names, and income of customers who own at least an account in all branches.
pts Find all customers who have an account at every branch with a budget between $ and
$
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
