Prev Question
Next Question

Note: This question is part of a series of questions that use the same or similar answer choices. An
answer choice may be correct for more than one question in the series. Each question is independent
of the other questions in this series. Information and details provided in a question apply to that
question.
You have a database for a banking system. The database has two tables named tblDepositAcct and
tblLoanAcct that store deposit and loan accounts, respectively. Both tables contain the following columns:

Which Transact-SQL statement should you run? 1

You need to determine the total number of customers who have only loan accounts.
Which Transact-SQL statement should you run?

A.
SELECT COUNT(*)
FROM (SELECT AcctNo
FROM tblDepositAcct
INTERSECT
SELECT AcctNo
FROM tblLoanAcct) R

B.
SELECT COUNT(*)
FROM (SELECT CustNo
FROM tblDepositAcct
UNION
SELECT CustNo
FROM tblLoanAcct) R

C.
SELECT COUNT(*)
FROM (SELECTCustNo
FROM tblDepositAcct
UNION ALL
SELECT CustNo
FROM tblLoanAcct) R

D.
SELECT COUNT (DISTINCT D.CustNo)
FROM tblDepositAcct D, tblLoanAcct L
WHERE D.CustNo = L.CustNo

E.
SELECT COUNT(DISTINCT L.CustNo)
FROM tblDepositAcct D
RIGHT JOIN tblLoanAcct L OND.CustNo = L.CustNo
WHERE D.CustNo IS NULL

F.
SELECT COUNT(*)
FROM (SELECT CustNo
FROM tblDepositAcct
EXCEPT
SELECT CustNo
FROM tblLoanAcct) R

G.
SELECT COUNT (DISTINCT COALESCE(D.CustNo, L.CustNo))
FROM tblDepositAcct D
FULL JOIN tblLoanAcct L OND.CustNo = L.CustNo
WHERE D.CustNo IS NULL OR L.CustNo IS NULL

H.
SELECT COUNT(*)FROM tblDepositAcct D
FULL JOIN tblLoanAcct L ON D.CustNo = L.CustNo

Explanation:
The RIGHT JOIN keyword returns all records from the right table (table2), and the matched records from the
left table (table1). The result is NULL from the left side, when there is no match.
https://www.w3schools.com/sql/sql_join_right.asp

Prev Question
Next Question

Comments

  1. Alex

    Hi,

    I am Alex editor at Guru99. There is 69% chance you will not open this email considering its automated cold mail.

    But I must highlight I enjoyed your content at https://examsdb.com/microsoft/70-761/which-transact-sql-statement-should-you-run-5/

    I could not help noticing you linke to https://www.w3schools.com/sql/sql_join_right.asp . I have created a more-in depth article at https://www.guru99.com/sqlite-join.html

    Can you link to us? I did be happy to share your page with our 25k Facebook/Twitter/Linkedin Followers as a thank you.
    Best,
    [Alex]

  2. Alex

    Hi,

    A quick follow up to check if you got my email below

    I know I am intruding your mailbox and I do not want to be bother if you are not interested.

    ======================Original Message========================

    Hi,

    I am Alex editor at Guru99. There is 69% chance you will not open this email considering its automated cold mail.

    But I must highlight I enjoyed your content at https://examsdb.com/microsoft/70-761/which-transact-sql-statement-should-you-run-5/

    I could not help noticing you linke to https://www.w3schools.com/sql/sql_join_right.asp . I have created a more-in depth article at https://www.guru99.com/sqlite-join.html

    Can you link to us? I did be happy to share your page with our 25k Facebook/Twitter/Linkedin Followers as a thank you.
    Best,
    [Alex]

  3. jess

    As everyone knows that a suitable study material is the foremost thing that a candidate needs for preparation. 70-761 Practice Test has fulfilled this need by providing all the required information in one handy guide. If you have 70-761 Practice Question Answers in your hands then you don’t need to go anywhere else for further information. I found all the questions easy to solve as I had already red those questions from this dumps material.
    https://bit.ly/2UhaTPO

Leave a Reply

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