Generic selectors
Exact matches only
Search in title
Search in content
Search in posts
Search in pages
Filter by Categories
nmims post
Objective Type Set
Online MCQ Assignment
Question Solution
Solved Question
Uncategorized

1. Delete the accounts and loans of Downtown branch.

View Answer

Answer: delete from depositor where account_number IN (select account_number from account where branch_name=’Downtown’);

delete from account where branch_name=’Downtown’;

delete from borrower where loan_number IN (select loan_number from loan where branch_name=’Downtown’);

delete from loan where branch_name=’Downtown’;

2. Add a column phoneNo to customer table.

View Answer

Answer: alter table customer add phoneNo numeric(10);

3. Change the size of the branch_city to varchar(20).

View Answer

Answer: ALTER TABLE branch ALTER COLUMN branch_city type varchar(20);

4. Drop the column phoneNo from customer table.

View Answer

Answer: ALTER TABLE customer drop phoneNo;

5. For all customers who have a loan from the bank, find their names, loan numbers, and loan amount.

View Answer

Answer: select customer_name,loan_number,amount from borrower natural join loan;

6. Find the customer names, loan numbers, and loan amounts, for all loans at the Perryridge branch.

View Answer

Answer: select customer_name,loan_number,amount from depositor natural join loan where loan.branch_name=’Perryridge’;

7. For all customers who have a loan from the bank, find their names and loan numbers with the attribute loan_number replaced by loan_id.

View Answer

Answer: select customer_name,loan_number as loan_id,amount from depositor natural join loan;

8. Find the names of all branches that have assets greater than atleast one branch located in Brooklyn.

View Answer

Answer: select branch_name from branch where assets > (select min(assets) from branch where branch_city = ‘Brooklyn’);

9. Find the names of all customers whose street address includes the substring ‘Main’.

View Answer

Answer: select customer_name from customer where customer_street like ‘%Main%’;

10. List loan data, ordered by decreasing amounts, then increasing loan numbers.

View Answer

Answer: select * from loan order by amount desc, loan_number asc;

.woocommerce-message { background-color: #98C391 !important; }