Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Would please help me with these two questions by sql query not relational algebr

ID: 3554274 • Letter: W

Question

Would please help me with these two questions by sql query not relational algebra.

customer (customer_name, customer_street, customer_city )
account (account_number, branch_name(+), balance )
loan (loan_number, branch_name(+), amount )
depositor (customer_name(+), account_number(+) )
borrower (customer_name(+), loan_number(+) )

A. Find the names of all depositors who have an account with a value greater than $4,500.

B. Find the names of all depositors who have an account with a value greater than $7,800 at the "West End" branch.

Explanation / Answer

A. Find the names of all depositors who have an account with a value greater than $4,500.

we can know the account balance from the account table, depositer name from the depositer table, so we have to JOIN the two tables depositor and account on condition that both account numbers should match. one more condition we have to put is, the balance should be greater than $ 4500 which is included in WHERE clause.   

SELECT depositor.customer_name FROM depositer JOIN account ON account.account_number= depositor.account_number WHERE account.balance > $4,500

B. Find the names of all depositors who have an account with a value greater than $7,800 at the "West End" branch.

we need to JOIN account and depositor tables to know the depositor's account balance and branch_name.the conditions of branch name "west end" and balance > $7800 are included in WHERE clause.   

SELECT depositor.cutomer_name FROM depositer JOIN account ON account.account_number= depositer.account_number WHERE account.branch_name="West End" AND account.balance> $7,800

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote