Question: Write down the following SQL queries and also write down their outputs a) Find out the loan amount of the customers whose customer street is


Write down the following SQL queries and also write down their outputs
a) Find out the loan amount of the customers whose customer street is Main.
b) Find out the name of the city of the customers whose Bank branch has the second maximum amount of assets.
c) Find the average account balance of those branches where the average account balance is greater than $1000 and the branch balance is 900000 or 1700000.(You dont need to find output table for this one)
d) Find out the name and account number of the customers whose Branch city is in Horseneck and the account balance of the customers are more than 400.
e) Write down the account number of the customer whose name starts with J or H and whose bank branch name is Downtown.
The following sample dataset tables have been given to you. Customer CUSTOME R_NAME Adams CUSTOME R CITY CUSTOMER STREET Spring Senator North Depositor CUSTOMERN AME Johnson ACCOUNT NUMB ER A-101 Pittsfield Brooks Smith A-215 Curry A-102 A-305 Glenn Sand Hill Brooklyn Rye Woodside Stamford Harrison Palo Alto Hayes Turner Johnson A-201 Green Hayes Johnson Jones A-217 Lindsay A-222 Jones Walnut Main Alma Main Main Putnam Nassau Harrison Smith Turner Williams Rye Stamford Princeton Account ACCOUN T NUMB ER A-101 Borrower CUSTOMER_NA ME Jones Smith BALANCE 500 LOAN_NUMBE R L-17 L-23 A-215 700 L-15 A-102 BRANCH NAME Downtown Mianus Perryridge Round Hill Perryridge Redwood Brighton 400 Hayes Jackson L-14 A-305 350 L-93 A-201 900 Curry Smith Williams L-11 A-222 700 L-17 A-217 750 Adams L-16 Loan LOAN NU MBER AMOUN T L-17 ASSETS 900000 1000 Branch BRANCH N AME Downtown Redwood Perryridge Mianus BRANCH CITY Brooklyn Palo Alto Horseneck L-23 BRANCH_NA ME Downtown Redwood Perryridge Downtown Mianus Round Hill Perryridge 2000 2100000 1700000 L-15 1500 L-14 1500 Horseneck 400200 L-93 500 Round Hill 8000000 L-11 900 Pownal 400000 Horseneck Bennington Rye Brooklyn L-16 1300 North Town 3700000 Brighton 7000000
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
