255 views
1 votes
1 votes

consider the following table T

A B
1 5
2 10
3 15

SELECT * FROM T WHERE EXISTS (SELECT COUNT(*) FROM T WHERE B=2);

NO. of rows returned  by above query__________

1 Answer

0 votes
0 votes
The EXISTS operator returns true if the sub-query returns one or more records. Since sub-query gives count =0;

it will return all three rows.

Related questions

0 votes
0 votes
1 answer
3
rayhanrjt asked Jan 6, 2023
717 views
Write SQL command to find DepartmentID, EmployeeName from Employee table whose average salary is above 20000.
2 votes
2 votes
1 answer
4
Subhrangsu asked Jun 18, 2022
431 views
Write SQL query to show all employees hired on June 4,1984 (non-default format)emp(empno,ename,job,mgr,hiredate,sal,comm,deptno)