ALLInterview.com :: Home Page KalAajKal.com
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
   Refer this Site  Refer This Site to Your Friends  Site Map  Bookmark this Site  Set it as your HomePage  Contact Us     Login  |  Sign Up                      
info       Did you received any Funny E-Mails from your Friends and like to share with rest of our friends? Yeah!! you can post that stuff   HERE
Google
 
Categories  >>  Software  >>  Databases  >>  SQL Server
 
 


 

 
 Oracle interview questions  Oracle Interview Questions
 SQL Server interview questions  SQL Server Interview Questions
 MS Access interview questions  MS Access Interview Questions
 MySQL interview questions  MySQL Interview Questions
 Postgre interview questions  Postgre Interview Questions
 Sybase interview questions  Sybase Interview Questions
 DB Architecture interview questions  DB Architecture Interview Questions
 DB Administration interview questions  DB Administration Interview Questions
 DB Development interview questions  DB Development Interview Questions
 SQL PLSQL interview questions  SQL PLSQL Interview Questions
 Databases AllOther interview questions  Databases AllOther Interview Questions
Question
what is the out put of below queries?
    a. select * from Emp where null = null;
    b. select * from Emp where 1=1;
 Question Submitted By :: Jawahar
I also faced this Question!!     Rank Answer Posted By  
 
  Re: what is the out put of below queries? a. select * from Emp where null = null; b. select * from Emp where 1=1;
Answer
# 1
in first case it would response and it will show error and 
in second case it will show object belonging to first row 
and column
 
Is This Answer Correct ?    0 Yes 15 No
Rohit
 
  Re: what is the out put of below queries? a. select * from Emp where null = null; b. select * from Emp where 1=1;
Answer
# 2
In First case it will not return any rows. only the colum 
names will be displayed.

In the second case all the records that are available in 
the table will be displayed.
 
Is This Answer Correct ?    25 Yes 1 No
Phani
 
 
 
  Re: what is the out put of below queries? a. select * from Emp where null = null; b. select * from Emp where 1=1;
Answer
# 3
1st Query Output is:

SQL> select * from Emp where null = null;

no rows selected

2nd Query Output is:

All the rows and columns of emp table
 
Is This Answer Correct ?    6 Yes 1 No
Subbu
 
  Re: what is the out put of below queries? a. select * from Emp where null = null; b. select * from Emp where 1=1;
Answer
# 4
select * from Emp where null = null;

null can not be equal to null.So,Condition is not satisfied.
So,it will give only column name.

select * from Emp where 1=1;

1 is always equal to 1.So,Condition is satisfied ,So It 
will give all data which is present in table.
 
Is This Answer Correct ?    13 Yes 1 No
Jay Vardhan Singh
 
  Re: what is the out put of below queries? a. select * from Emp where null = null; b. select * from Emp where 1=1;
Answer
# 5
a. select * from Emp where null = null;

null = null will be always false.. so no rows returned..
change the query to "select * from Emp where null is null;"
to select all rows

b. select * from Emp where 1=1;

1 = 1 will be always true.. so all the rows are returned..
 
Is This Answer Correct ?    11 Yes 1 No
Jerry Joseph
 
  Re: what is the out put of below queries? a. select * from Emp where null = null; b. select * from Emp where 1=1;
Answer
# 6
a. select * from Emp where null = null;

null= null is always false os no rows returns.

b. select * from Emp where 1=1;

it returns all rows
 
Is This Answer Correct ?    7 Yes 0 No
Anil Patel
 
  Re: what is the out put of below queries? a. select * from Emp where null = null; b. select * from Emp where 1=1;
Answer
# 7
a)in the first case there is no output only the column 
names alone is displyed

b)in this case all rows will be displayed even for 
1=1,2=2,3=3,..........
 
Is This Answer Correct ?    3 Yes 0 No
Gowthami Radhakrishnan
 
  Re: what is the out put of below queries? a. select * from Emp where null = null; b. select * from Emp where 1=1;
Answer
# 8
Hi,

select * from EMP where null=null;
->null=null is always false so it gives 0 records.
if it is null is null then it fetches all the records in a 
table..

select * from EMP where 1=1;
->it fetches  all the records in a table 
if it is select * from EMP where 1=2;
-->it fetches 0 records..
 
Is This Answer Correct ?    1 Yes 1 No
Sailaja
 
  Re: what is the out put of below queries? a. select * from Emp where null = null; b. select * from Emp where 1=1;
Answer
# 9
u can not compare two nulls

null means nothing.so
ANS 1:no row
ANS 2:All row (because of 1=1  is always true for all rows)
 
Is This Answer Correct ?    1 Yes 1 No
Nitin Yadav(nitin.yadav.india@
 

 
 
 
Other SQL Server Interview Questions
 
  Question Asked @ Answers
 
Can a stored procedure call another stored procedure. If yes what level and can it be controlled?  2
write the query for taking database restore in sql?  2
what is the diffrence between Snap Shot and Transaction Replication CSC1
What is ACID Property of Transaction?  4
Can I know,how to Execute Funcion and Trigger through command(Manualy Execution) in MS SQL/SERVER 2005,give me answer with Example.  1
SQL stops working in every 15 days displaying message that database log file is full. Log file size is 3.95 GB. It is happening after shrinking the database also. What is solution to overcome this problem. Please help me as it's urgent.  5
explain different types of jions with examples briefly? Zensar1
How to list all tables having unique constraints in any of the columns in a database.  1
How to Execute an Operating System Command From Within SQL Server ?  2
How to find the date and time of last updated table? Teledata4
1.what is the purpose of using alias name in sql server? with certain example? 2.what is cursor?will u plz explain me in detail with certain example?  3
What is the use of MOVE keyword in restore command IBM2
we have emp table like Ename,EDOJ,EDOB with Column structure.but we want to know the employee Age.How? Any Body Plz  6
how to dispaly a particular row details from a given table  1
Explain the new features of SQL server 2000?  1
What is bit datatype and what's the information that can be stored inside a bit column?  1
any one can explain Self mapping Delegation Remote Credentials  1
About DTS usage ? Cognizent2
How To Make password Protected SQL Server 2005 Database i.e when i open SQL Server database then ask for password.  1
How will u get 5 years back record?  4
 
For more SQL Server Interview Questions Click Here 
 
 
 
 
 
   
Copyright Policy  |  Terms of Service  |  Help  |  Site Map 1  |  Articles  |  Site Map  |   Site Map  |  Contact Us interview questions urls   External Links 
   
Copyright © 2007  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  Forum9.com   ::  KalAajKal.com