Consider the schema below that models a bank’s branches, customers and their accounts and loans. Provide SQL queries to answer the questions that follow.
Branch (bank_name, addr, city, assets) // Primary Key=bank_name
Customer (cust_name, addr, city) // Primary Key=cust_name
Account (acc_num, cust_name, bank_name, type, balance) // Primary Key=acc_num
Loan (loan_num, cust_name, bank_name, type, amount) // Primary Key=loan_num
-- 2. Find the names of all the customers who live in a city with no bank branches.
-- a) Use a nested subquery.
-- b) Use a correlated subquery.
2) a) SELECT cust_name FROM Customer WHERE city NOT IN (SELECT city FROM Branch);
2) b) SELECT cust_name FROM Customer WHERE city NOT EXISTS (SELECT city FROM Branch);
If the answer helped then please upvote, it means a
lot.
And for any queries feel free to comment.
Consider the schema below that models a bank’s branches, customers and their accounts and loans. Provide...
Consider the schema below that models a bank’s branches, customers and their accounts and loans. Provide SQL queries to answer the questions that follow. Branch (bank_name, addr, city, assets) // Primary Key=bank_name Customer (cust_name, addr, city) // Primary Key=cust_name Account (acc_num, cust_name, bank_name, type, balance) // Primary Key=acc_num Loan (loan_num, cust_name, bank_name, type, amount) // Primary Key=loan_num *****Use a nested subquery if possible***** -- 3. Find the bank with the largest total account balance, i.e., the bank -- that has the most funds...
Let us use the conceptual schema diagram below to answer the question parts. It is about a database for banks and their branches. BANK HAS BANK BRANCH Code Name Addr Addr Branch_no Acct_no Loan_no ISSUES ACCTS ISSUES LOANS Balance Type Type Amount 0: n 0: n Name Phone CUSTOMER Addr Ssn
This is how i mapped the relational schema diagram. would this
be correct? i feel like i am missing something.
ud bundle at the start of the class on the due date. ment. 1. (10 pts) Use the ER-to-relational mapping algorithm to map the BANK ER diagram to a relational schema diagram. Prepare the diagram using ERDPlus and make sure to specify all primary keys and foreign keys. (Position the relations so that the arcs from the foreign keys to...
Write SQL statements to answer the following questions using Assignment 3’s schema (tables from part 1). 1- Find how many branches had have loans over $2000.00. 2- For each branch, find the most expensive loan. Your output should include Branch Id, loan amount for the highest loan for that Branch. 3- Find how many accounts there are for each customer. The output should include customer id and number of accounts for that customer. 4- Find the total balance amount of...
Need the SQL query for the questions below
1) Print the name of customers who do not live
in MPLS or Edina, have a loan with an amount of more than 500 in
any branch of the bank but not in the France branch, and have one
or more accounts only in the France branch.
2) Show the name of all Customers who have only
one account with a balance of more than $1000 in any branch of the
bank...
Given the following relational database schema (primary keys are bold and underlined). Answer questions 2.1 to 2.4 Orders(orderld, customerld, dateOrdered, dateRequired, status) Customer(customerld, customerLastName, customerStreet, customerCity, customerState, customer Lip OrderDetails(orderld.productld, quantity, lineNumber, amount) Products(productld, name, description, quantity, unitPrice) Account(accountNumber, customerld, dateOpened, creditCard, mailingStreet, mailingCity, mailingState, mailingZip) 2.1 (2 Points) List all possible foreign keys. For each foreign key list both the referencing and referenced relations. 2.2 (2 Points) Devise a reasonable database instance by filling the tables with data of...
For the below `bank' schema: customer(customerid,username,fname,lname,street1,street2,city,state,zip) account(accountid,customerid,description,) transaction(transactionid,trantimestamp,accountid,amount) A customer may have several accounts, and each account may participate in many transactions. Each transaction will have at least two records, one deducting amount from an account, and one adding amount to an account (for a single transactionid, the sum of amounts will equal zero). Using SQL, answer these questions (write a SQL query that answers these questions): 8) List the top 1% of customers (ordered by total balance). 9) Using...
True Coop Community Bank – A Balanced Scorecard Case True Coop Community Bank (TCCB) is located in the Midwest US and has a total of 10 branches grouped into two divisions, the southern division (SD) and the northern division (ND). Each division consists of five branches; each branch employs a branch president, branch vice-president/chief loan officer, customer service representatives, loan representatives, mortgage loan originators, head tellers, tellers, and administrative assistants. All branches are located within a 60-mile radius. TCCB has...
Hi, Kindly assist with my project management assignment below using the attached case study Question 1 Update the project charter for the remainder of the project in response to Adams’ memo (lines 241 through 246). Question 2 Prepare a plan for the remainder of the project in response to Adams’ memo (lines 241 through 246). Your answers to the above will be assessed in terms of the level of communication displayed, the insights and inferences drawn, and your ability to...
Overview This lab provides you the opportunity to insert and update data with the use of SQL commands. The lab will utilize the FLIX2YOU problem, the current schema. In order to start this lab, you must have successfully completed Lab # 6. In Lab # 6, you executed a script that was provided to you. This script created 7 of the FLIX2YOU tables as documented in the Entity Relationship Diagram in the FLIX2YOU problem document. The second part of lab...