The following are the necessary tables for a Bank Database   customer table: | customer_id | customer_name | customer_street | customer_city | +-------------+---------------+-----------------+---------------+ | C-101       | Jones         | Main            | Harrison      | | C-201       | Smith         | North           | Rye           | | C-211       | Hayes         | Main            | Harrison      | | C-212       | Curry         | North           | Rye           | | C-215       | Lindsay       | Park            | Pittsfield    | | C-220       | Turner        | Putnam          | Stamford      | | C-222       | Williams      | Nassau          | Princeton     | | C-225       | Adams         | Spring          | Pittsfield    | | C-226       | Johnson       | Alma            | Palo Alto     | | C-233       | Glenn         | Sand Hill       | Woodside      | | C-234       | Brooks        | Senator         | Brooklyn      | | C-255       | Green         | Walnut          | Stamford      | +-------------+---------------+-----------------+---------------+ branch table: +-------------+-------------+---------+ | branch_name | branch_city | assets  | +-------------+-------------+---------+ | Brighton    | Brooklyn    | 7100000 | | Downtown    | Brooklyn    | 9000000 | | Mianus      | Horseneck   |  400000 | | North Town  | Rye         | 3700000 | | Perryridge  | Horseneck   | 1700000 | | Pownal      | Bennington  |  300000 | | Redwood     | Palo Alto   | 2100000 | | Round Hill  | Horseneck   | 8000000 | +-------------+-------------+---------+   account table: +-------------+----------------+---------+ | branch_name | account_number | balance | +-------------+----------------+---------+ | Downtown    | A-101          |     500 | | Perryridge  | A-102          |     400 | | Brighton    | A-201          |     900 | | Mianus      | A-215          |     700 | | Brighton    | A-217          |     750 | | Redwood     | A-222          |     700 | | Round Hill  | A-305          |     350 | +-------------+----------------+---------+   loan table: +-------------+-------------+--------+ | loan_number | branch_name | amount | +-------------+-------------+--------+ | L-11        | Round Hill  |    900 | | L-14        | Downtown    |   1500 | | L-15        | Perryridge  |   1500 | | L-16        | Perryridge  |   1300 | | L-17        | Downtown    |   1000 | | L-23        | Redwood     |   2000 | | L-93        | Mianus      |    500 | +-------------+-------------+--------+   depositor table: +-------------+----------------+ | customer_id | account_number | +-------------+----------------+ | C-101       | A-217          | | C-201       | A-215          | | C-211       | A-102          | | C-215       | A-222          | | C-220       | A-305          | | C-226       | A-101          | | C-226       | A-201          | +-------------+----------------+   borrower table: +-------------+-------------+ | customer_id | loan_number | +-------------+-------------+ | C-101       | L-17        | | C-201       | L-11        | | C-201       | L-23        | | C-211       | L-15        | | C-212       | L-93        | | C-222       | L-17        | | C-225       | L-16        | | C-226       | L-14        | +-------------+-------------+     Write MySQL queries for the following tasks:  7. Find the total loan amount of all customers having at least 2 loans from the bank. Show in format customer name, total_loan.

Oracle 12c: SQL
3rd Edition
ISBN:9781305251038
Author:Joan Casteel
Publisher:Joan Casteel
Chapter1: Overview Of Database Concepts
Section: Chapter Questions
Problem 16MC
icon
Related questions
Question

The following are the necessary tables for a Bank Database

 

customer table:

| customer_id | customer_name | customer_street | customer_city |
+-------------+---------------+-----------------+---------------+
| C-101       | Jones         | Main            | Harrison      |
| C-201       | Smith         | North           | Rye           |
| C-211       | Hayes         | Main            | Harrison      |
| C-212       | Curry         | North           | Rye           |
| C-215       | Lindsay       | Park            | Pittsfield    |
| C-220       | Turner        | Putnam          | Stamford      |
| C-222       | Williams      | Nassau          | Princeton     |
| C-225       | Adams         | Spring          | Pittsfield    |
| C-226       | Johnson       | Alma            | Palo Alto     |
| C-233       | Glenn         | Sand Hill       | Woodside      |
| C-234       | Brooks        | Senator         | Brooklyn      |
| C-255       | Green         | Walnut          | Stamford      |
+-------------+---------------+-----------------+---------------+

branch table:

+-------------+-------------+---------+
| branch_name | branch_city | assets  |
+-------------+-------------+---------+
| Brighton    | Brooklyn    | 7100000 |
| Downtown    | Brooklyn    | 9000000 |
| Mianus      | Horseneck   |  400000 |
| North Town  | Rye         | 3700000 |
| Perryridge  | Horseneck   | 1700000 |
| Pownal      | Bennington  |  300000 |
| Redwood     | Palo Alto   | 2100000 |
| Round Hill  | Horseneck   | 8000000 |
+-------------+-------------+---------+

 

account table:

+-------------+----------------+---------+
| branch_name | account_number | balance |
+-------------+----------------+---------+
| Downtown    | A-101          |     500 |
| Perryridge  | A-102          |     400 |
| Brighton    | A-201          |     900 |
| Mianus      | A-215          |     700 |
| Brighton    | A-217          |     750 |
| Redwood     | A-222          |     700 |
| Round Hill  | A-305          |     350 |
+-------------+----------------+---------+

 

loan table:

+-------------+-------------+--------+
| loan_number | branch_name | amount |
+-------------+-------------+--------+
| L-11        | Round Hill  |    900 |
| L-14        | Downtown    |   1500 |
| L-15        | Perryridge  |   1500 |
| L-16        | Perryridge  |   1300 |
| L-17        | Downtown    |   1000 |
| L-23        | Redwood     |   2000 |
| L-93        | Mianus      |    500 |
+-------------+-------------+--------+

 

depositor table:

+-------------+----------------+
| customer_id | account_number |
+-------------+----------------+
| C-101       | A-217          |
| C-201       | A-215          |
| C-211       | A-102          |
| C-215       | A-222          |
| C-220       | A-305          |
| C-226       | A-101          |
| C-226       | A-201          |
+-------------+----------------+

 

borrower table:

+-------------+-------------+
| customer_id | loan_number |
+-------------+-------------+
| C-101       | L-17        |
| C-201       | L-11        |
| C-201       | L-23        |
| C-211       | L-15        |
| C-212       | L-93        |
| C-222       | L-17        |
| C-225       | L-16        |
| C-226       | L-14        |
+-------------+-------------+

 

 

Write MySQL queries for the following tasks: 

7. Find the total loan amount of all customers having at least 2 loans from the bank. Show in format customer name, total_loan.

Expert Solution
steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Knowledge Booster
Table
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
Enhanced Discovering Computers 2017 (Shelly Cashm…
Enhanced Discovering Computers 2017 (Shelly Cashm…
Computer Science
ISBN:
9781305657458
Author:
Misty E. Vermaat, Susan L. Sebok, Steven M. Freund, Mark Frydenberg, Jennifer T. Campbell
Publisher:
Cengage Learning
Np Ms Office 365/Excel 2016 I Ntermed
Np Ms Office 365/Excel 2016 I Ntermed
Computer Science
ISBN:
9781337508841
Author:
Carey
Publisher:
Cengage
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781305627482
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning