search
Log In
4 votes
792 views

The SQL query

SELECT columns
FROM TableA
RIGHT OUTER JOIN TableB
ON A.columnName = B.columnName
WHERE A.columnName IS NULL

returns the following:

  1. All rows in Table $B$, which meets equality condition above and, none from Table $A$ which meets the condition.
  2. All rows in Table $A$, which meets equality condition above and none from Table $B$, which meets the condition.
  3. All rows in Table $B$, which meets the equality condition
  4. All rows in Table $A$, which meets the equality condition
in Databases
edited by
792 views
0
Not sure maybe option a).
1
None are correct.

4 Answers

5 votes

None of the above options

Explanation:

SELECT Orders.OrderID, Employees.LastName, Employees.FirstName
FROM Orders
RIGHT JOIN Employees
ON Orders.EmployeeID = Employees.EmployeeID;

This gave the result which is same as option A

but when I executed

SELECT Orders.OrderID, Employees.LastName, Employees.FirstName
FROM Orders
RIGHT JOIN Employees
ON Orders.EmployeeID = Employees.EmployeeID
where Orders.EmployeeID is NULL;

Result had only the records where OrderID was NULL

One can try it on w3schools to get a better understanding.

Also one can refer the following link to get a clear understanding

https://www.dofactory.com/sql/right-outer-join

0
You are correct. Please raise objection to this question.
0
yes this in this question none of the option is matching
0

It should return, all rows from table B which doesn't satisfy the equality condition & none from table A.

after joining, the table should be like this - 

A1 A2 B1 B2
meets condition meets condition meets condition meets condition
meets condition meets condition meets condition meets condition
NULL NULL can't meet can't meet

according to given query only last row should be output.

0 votes

Answer (a)

SELECT columns
FROM TableA
RIGHT OUTER JOIN TableB
ON A.columnName = B.columnName
WHERE A.columnName IS NULL

Query returns records of table B which meets equality condition. Thus option (a) matching.


edited by
0 votes
option A. all rows from  table B which meets the condition and none from A which MEETS THE CONDITION.
0 votes

(1) We are first doing A outer join B in this process all the rows of B which are failed to match with Any row of A(on given col.) are also included in result where All A’s columns are set to NULL

(2) Now we are imposing condition on A by  comparing colName to Null  So we are getting all rows where A.colName = null which are noting but all B table’s row which are failed to match with any row of A 

So this will fetch all rows where B is not matching with any row of A (on given Column)

which does not match with any option

Answer:

Related questions

2 votes
4 answers
1
716 views
Properties of $\text{ DELETE'}$ and $\text{ TRUNCATE'}$ commands indicate that After the execution of $\text{ TRUNCATE'}$ operation, $\text{COMMIT}$, and $\text{ROLLBACK}$ statements cannot be performed to retrieve the lost data, while $\text{ DELETE'}$ allow it ... not allow it After the execution of $\text{ DELETE'}$ and $\text{ TRUNCATE'}$ operation no retrieval is possible for the lost data
asked Jan 13, 2020 in Databases Satbir 716 views
1 vote
1 answer
2
301 views
Raymonds tree based algorithm ensures no starvation, but deadlock may occur in rare cases no deadlock, but starvation may occur neither deadlock nor starvation can occur deadlock may occur in cases where the process is already starved
asked Jan 13, 2020 in Databases Satbir 301 views
4 votes
13 answers
3
3.3k views
If every non-key attribute functionally dependent on the primary key, then the relation will be in First normal form Second normal form Third normal form Fourth Normal form
asked Jan 13, 2020 in Databases Satbir 3.3k views
4 votes
2 answers
4
798 views
The following circuit compares two $2$-bit binary numbers, $X$ and $Y$ represented by $X_1X_0$ and $Y_1Y_0$ respectively. ($X_0$ and $Y_0$ represent Least Significant Bits) Under what conditions $Z$ will be $1$? $X>Y$ $X<Y$ $X=Y$ $X!=Y$
asked Jan 13, 2020 in Digital Logic Satbir 798 views
...