How to Compare Rows in SQL?

How many rows will the following SQL query table return?

  • How many rows will the following SQL query against the REYLIB.EMP table return? SQL> select ename from REYLIB.emp where comm = NULL; (a) No rows (b) 8 rows (c) 10 rows (d) all the rows

  • Answer:

    You have the advantage over the world here because no one knows what the heck REYLIB.EMP table is or what it contains. Only you can read the data or perhaps even answer the question. Have fun.

jackremy at Yahoo! Answers Visit the source

Was this solution helpful to you?

Other answers

I was going to respond like the previous until I realized it was a trick question...the answer is A: It will return no rows - "comm = NULL" can never be true since a NULL value never equates to any other, even another NULL. If it was "WHERE comm IS NULL", then it'd be a case where it would depend on the data.

TheMadProfessor

It will return ALL rows where the value of "comm" is NULL. There is no way to know "How many" it will not return values in COMM where COMM IS NOT NULL.

GKW

Check out this site.

Zahedul

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.