Consider the bank database in Figure 1, where the primary keys are underlined. Each branch might have many loans or accounts, associated with borrowers or depositors, respectively. Construct the following SQL queries for this relational database. 1. Find the name of each branch that has at least one customer who has an account in the bank and who lives in the "Harrison" city. Make sure each branch name only appears once. < 2. Find the ID of each customer who lives on the same street and in the same city as customer "12345". (1) Please use "tuple variables".< (2) Please use "derived relations" or "with". 3. Find the ID of each customer of the bank who has an account but not a loan. < 4. Find the total sum of all loan amounts for each branch in the bank.

Oracle 12c: SQL
3rd Edition
ISBN:9781305251038
Author:Joan Casteel
Publisher:Joan Casteel
Chapter1: Overview Of Database Concepts
Section: Chapter Questions
Problem 5HOA: Access path A database table is composed of records and fields hold data. Data is stored in records....
icon
Related questions
Question
branch(branchhame, branch+citysassets}
customer (HD, Customer name, customer street, customer city)
loan loan number branch_name, amounty
borrower(ID; loan_number
account (account_number, branch name, balance)e
depositor (HDs account number)-
Figure le
Consider the bank database in Figure 1, where the primary keys are underlined. Each
branch might have many loans or accounts, associated with borrowers or depositors,
respectively. Construct the following SQL queries for this relational database.
1. Find the name of each branch that has at least one customer who has an account in
the bank and who lives in the "Harrison" city. Make sure each branch name only
appears once.
2. Find the ID of each customer who lives on the same street and in the same city as
customer "12345".
(1) Please use "tuple variables". e
(2) Please use "derived relations" or “with".
3. Find the ID of each customer of the bank who has an account but not a loan.
4. Find the total sum of all loan amounts for each branch in the bank. e
Transcribed Image Text:branch(branchhame, branch+citysassets} customer (HD, Customer name, customer street, customer city) loan loan number branch_name, amounty borrower(ID; loan_number account (account_number, branch name, balance)e depositor (HDs account number)- Figure le Consider the bank database in Figure 1, where the primary keys are underlined. Each branch might have many loans or accounts, associated with borrowers or depositors, respectively. Construct the following SQL queries for this relational database. 1. Find the name of each branch that has at least one customer who has an account in the bank and who lives in the "Harrison" city. Make sure each branch name only appears once. 2. Find the ID of each customer who lives on the same street and in the same city as customer "12345". (1) Please use "tuple variables". e (2) Please use "derived relations" or “with". 3. Find the ID of each customer of the bank who has an account but not a loan. 4. Find the total sum of all loan amounts for each branch in the bank. e
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 5 steps

Blurred answer
Knowledge Booster
Dataset
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Oracle 12c: SQL
Oracle 12c: SQL
Computer Science
ISBN:
9781305251038
Author:
Joan Casteel
Publisher:
Cengage Learning