Question: This was asked by another student. Database Schema: branch ( branch_name , branch_city, assets )... Database Schema: branch ( branch_name , branch_city, assets ) customer

This was asked by another student. Database Schema: branch ( branch_name , branch_city, assets )...

Database Schema:

branch (branch_name, branch_city, assets )

customer (cust_ID, customer_name, customer_street, customer_city )

loan (loan_number, branch_name, amount )

borrower (cust_ID,loan_number )

account (account_number, branch_name, balance )

depositor (cust_ID,account_number )

  • Question 2 (Must include a subquery): Write a query to find the cust_ID and customer name of each customer who lives on the same street and in the same city as customer '12345'. Include customer '12345' in your query results. Tip: Do not hardcode the address for customer 12345. You want to make sure this query continues to return the intended results if customer 12345 moves to a new address or even changes their name.
  • Question 3 (No Joins Allowed): Write a query to find the name of each branch that has at least one customer who has a deposit account in the branch and who lives in "Harrison". No branch name should be repeated in the results.
  • Question 4 (Must include subquery):Write a query to find the name of each customer who has a deposit account atevery branch located in "Brooklyn". Tip: Customers returned in the results may have more than one account at a Brooklyn branch, and they might also have accounts at branches outside Brooklyn. The key is that they must have at least one account at every Brooklyn branch. Do not hardcode the names of the Brooklyn branches - this query should still work if a new branch opens in Brooklyn or if a branch changes its name.
  • Question 5 (Must Include subquery):Write a query that finds the account number of all customers whose deposit account is in the city where they live. Include the customer's id, branch city, and customer city. Tip: The "home city" of a deposit account is defined as the city of the branch the account is assigned to. In order to find the correct customers for this query, you will need to compare the customer's city to the branch city for the customer's account(s).
  • Question 6 (Must include subquery):Write a query that returns every customer that has a loan at Yonkahs Bankahs. Include the customer name and branch name for verification.

Question 7 (Must Include Subquery):Write a query that returns the name and loan number of all customers with loan balances higher than $5,000.00.

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 Mathematics Questions!