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 7 relations whose schema is shown as below:
Customer ={cid, f name, lname, birthday, income}
Account ={accno,type, 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 (e.g.<,>,<=, etc.) over dates.
Note: You should ONLY use relational algebra and calculus notations that we covered in the class.
(1) 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.
(2) Find the first and last names of customers who were born after June 2nd,2001 and whose income is
greater than $100,000.
(3) Find the CIDs, first names, last names and birthday of customers who have an account at a branch
with more than 25 employees.
(4) Find the CIDs of customers who do not own a joint account (an account that is owned by more than
one customer).
5) Find the CIDs of customers who have personal bankers in both Pittsburgh West and Harrisburg
South branches.
(6) 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 $20,000.
(7) Find the CIDs of customers whose accounts have a transaction of type check where the absolute value
of the transactions amount is greater than $10,000(i.e. they deposited a check greater than $10,000
or paid using a check an amount greater than $10,000).
(8) 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 211950.(If more than one customer have the lowest
income among this group, return all of them.)
(9) Find EIDs and salaries of employees who earn more than the manager of their branch.
(10) Find the first names, last names, and income of customers who own at least an account in all branches.
(11)[5 pts] Find all customers who have an account at every branch with a budget between $20,000 and
$200,000.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!