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 difference between the following two sql 
statements 
select count(*) from <tablename>
select count(col_name) from <tablename>
 Question Submitted By :: Srikanth
I also faced this Question!!     Rank Answer Posted By  
 
  Re: What is the difference between the following two sql statements select count(*) from <tablename> select count(col_name) from <tablename>
Answer
# 1
select count(*) from <tablename> returns the number of rows 
in the table.

select count(col_name) from <tablename> return number 
values in the column (Ignores null value in the colum). For 
example if we execute the following 2 queries then

select count(*) form emp
select count(comm) form emp 

The result will be
14
4
 
Is This Answer Correct ?    18 Yes 1 No
Debasis
 
  Re: What is the difference between the following two sql statements select count(*) from <tablename> select count(col_name) from <tablename>
Answer
# 2
for the First Qry,result is "No.of records"
for the second Qry,result is "No.of records for particular 
columnname"
 
Is This Answer Correct ?    6 Yes 0 No
Kushi
 
 
 

 
 
 
Other SQL Server Interview Questions
 
  Question Asked @ Answers
 
What is the use of CASCADE CONSTRAINTS?  2
WHAT IS TRIGGERS IN SQL? AND WHAT IS THE BENIFIT?  5
WHICH INDEX IS FAST CLUSTER AND NON CLUSTER INDEX L&T2
What is referential integrity? What are the advantages of it? Digital-Domain3
What types of integrity are enforced by a foreign-key constraint  1
How do you know which index a table is using?  4
How to Debug a Stored Procedure? Allianz4
How do you load large data to the SQL server database?  2
When do we use the UPDATE_STATISTICS command?  3
can you any body tell me which service pack is installed in the sql server?  3
what are the joins,primary key,foriegn key, candidate key, super key and expain them? Polaris2
What is the Query of getting last 10 transaction Reports (like insert, update, Delete Data from Tabele) ? Wipro4
Can I remove the default constraint columns in SQL SERVER? Value-Labs3
When do you use SQL Profiler?  2
what is the Surrogate key?and wt is the diff between Primary key and Surrogate Key?  2
wt is mean by acid property? i know it is atomocity,consistency,isolation and durabulaty but wt is these mean and wt actions it's perform Idea1
What is a trigger?  3
Would it be a good idea to create an index on a table that always contains 10 records? Why or why not?  3
How can you get @@error and @@rowcount at the same time?  5
What are the different types of joins and what does each do?  2
 
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