You are on page 1of 1

HOME Interview Questions MCQs *LAB VIVA CLASS NOTES SEMINAR TOPICS ONLINE TEST GATE CAT Internship

ABOUT US Privacy Policy

Home » RDBMS Objective Questions » 250+ TOP MCQs on SQL Queries and Answers
Any Skill Search Here...

250+ TOP MCQs on SQL Queries and Answers


RDBMS Questions and Answers for Aptitude test on “Sql Queries”.

1. Find all the bank customers having a loan, an account, or both at the bank.

Answer: select customer_name from depositor


union all
select customer_name from borrower;

2. Find all the bank customers having both a loan and an account at the bank

Answer: select customer_name from depositor


intersect all
select customer_name from borrower;

3. Find all customers who have an account but no loan at the bank.

Answer: select customer_name from depositor


except
select customer_name from borrower;

Aggregate Functions (avg,min,max,sum,count) / Group By


4. Find the average account balance at the Perryridge branch.

Answer: select avg(balance) from account where branch_name=’Perryridge’;

5. Find the average account balance at each branch.

Answer: select avg(balance),branch_name


from account natural join depositor
group by branch_name;

6. Find the number of depositors for each branch (Use distinct).

Answer: select count(Distinct customer_name),branch_name


from account natural join depositor
group by branch_name;

7. Find those branches where the average accounts balance is more than Rs. 1200.

Answer: select branch_name from account


group by branch_name
having avg(balance)>1200

8. Find the number of branches of the bank.

Answer: select count(distinct branch_name) from branch;

9. Find the average balance for each customer who lives in Harrison and has at least three accounts.

Answer: /*select avg(balance) from account where account_number in


(
select account_number from depositor
where customer_name =
(select customer_name from depositor group by customer_name
having count(account_number) >= 2
intersect
select customer_name from customer where
customer_city = ‘Harrison’));*/

select avg(balance), customer_name from


depositor natural join account natural join customer
where customer_city = ‘Harrison’ group by customer_name
having count(customer_name)>=2;

Null values
10. Find all loan numbers that appear in the loan relation with null values for amount.

Answer: select loan_number from loan where amount is null.

---- >> Related Posts Of Above Questions :::

------>>[MOST IMPORTANT]<<------

1. 250+ TOP MCQs on SQL Queries and Answers


2. 250+ TOP MCQs on SQL Queries and Answers
3. 250+ TOP MCQs on SQL Queries and Answers
4. 250+ TOP MCQs on Aggregate Functions and Answers
5. 250+ TOP MCQs on The Relational Algebra and Answers
6. 300+ [LATEST] Complex Sql Queries Interview Questions and Answers
7. 250+ TOP MCQs on SQL Queries and Answers
8. 250+ TOP MCQs on Distributed Queries and Answers
9. 250+ TOP MCQs on Basic Operations and Answers
10. 250+ TOP MCQs on Choosing Data Types for Efficient Queries and Answers
11. 250+ TOP MCQs on Recursive Queries and Aggregation Features
12. 300+ [LATEST] Common Sql Queries Interview Questions and Answers
13. 300+ TOP ANCILLARY SERVICES Interview Questions and Answers
14. 250+ TOP MCQs on LINQ and Answers
15. 300+ TOP Balance of Payments MCQs and Answers
16. 300+ TOP World Bank MCQs and Answers
17. 300+ TOP BANKING Interview Questions and Answers
18. 300+ TOP Bank Reconciliation Interview Questions and Answers
19. 250+ TOP MCQs on Join Expressions and Answers
20. 300+ TOP Dissolution of a Partnership Firm Class 12 MCQs Pdf

LEAVE A REPLY

Your email address will not be published. Required fields are marked *

Comment

Name *

Email *

Website

Post Comment

Engineering 2021 , Engineering Interview Questions.com , Theme by Engineering|| Privacy Policy|| Terms and Conditions|| ABOUT US|| Contact US||
Engineering interview questions,Mcqs,Objective Questions,Class Lecture Notes,Seminor topics,Lab Viva Pdf PPT Doc Book free download. Most Asked Technical Basic CIVIL |
Mechanical | CSE | EEE | ECE | IT | Chemical | Medical MBBS Jobs Online Quiz Tests for Freshers Experienced .

You might also like