Question: Consider the following bank database schema. The primary key for each relation is underlined. Branches(branchName, branchCity, branchStaqte, assets) Customers(custID, custName, custAddress, custPhone) Accounts(acctNumber, acctType, branchName,
Consider the following bank database schema. The primary key for each relation is underlined. Branches(branchName, branchCity, branchStaqte, assets) Customers(custID, custName, custAddress, custPhone) Accounts(acctNumber, acctType, branchName, balance) Transactions(custID, acctNumber, amount, transDate)
Write the following queries in SQL. Note that you have to write exactly one SQL statement for each question. Also, the query answers must not contain duplicates, but you should use the SQL keyword distinct only when necessary.
Retrieve the name and address of customers who opened at least one saving account. Note that Saving is a valid value for the attribute Account Type (acctType).
Retrieve the name and address of customers who have a Saving account but not any Checking account. Note that both Saving and Checking are valid values for the attribute Account Type (acctType).
Retrieve the name and the account summary of each customer who has opened more than 3 accounts in the bank branch that located in Greensboro, North Carolina. The account summary includes account type (saving, checking, etc.), account number, balance. Both customer names and account type should be listed in a descending order.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
