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                      
tip       Ask Questions on ANYTHING, that arise in your Daily Life at     FORUM9.COM
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
The Difference between 'Count' and 'Count(*)'
 Question Submitted By :: Guest
I also faced this Question!!     Rank Answer Posted By  
 
  Re: The Difference between 'Count' and 'Count(*)'
Answer
# 1
'Count': Counts the number of non-null values.
'Count(*)': Counts the number of rows in the table, 
including null values and duplicates.
 
Is This Answer Correct ?    4 Yes 1 No
Guest
 
  Re: The Difference between 'Count' and 'Count(*)'
Answer
# 2
I agree with the above answer
 
Is This Answer Correct ?    1 Yes 0 No
Nikita
 
 
 
  Re: The Difference between 'Count' and 'Count(*)'
Answer
# 3
Count(exp): Counts the number of rows excluding null values.
Count(*) : Counts the number of rows including null and 
duplicates records.
 
Is This Answer Correct ?    1 Yes 0 No
Vijay Dev Saxena
 
  Re: The Difference between 'Count' and 'Count(*)'
Answer
# 4
In SQL Server 2000,
Query:
------
select count from employees
Answer:
------
invalid column name 'count'


In SQL Server 2000,
Query:
------
select count(*) from employees

Answer:
-------
   No column name
   ----------------
1.  20
 
Is This Answer Correct ?    0 Yes 0 No
Selvaraj.v
 
  Re: The Difference between 'Count' and 'Count(*)'
Answer
# 5
count - It returns the non null values
count(*) - It returns the null values and duplicate values
 
Is This Answer Correct ?    0 Yes 0 No
T.lakshmi
 
  Re: The Difference between 'Count' and 'Count(*)'
Answer
# 6
Count(expr) -> returns the number of records in the table 
where the expr is not null in the particular column.
Count(*) -> returns the number of all records in the table. 
(including duplicates and those with nulls)
 
Is This Answer Correct ?    0 Yes 0 No
Vijay Dev Saxena
 
  Re: The Difference between 'Count' and 'Count(*)'
Answer
# 7
Count(column name or exp) returns the no. of records for a 
specific/particular column of table excluding null values 
whereas Count(*) returns all the rows/records in the table 
including duplicated and null values
 
Is This Answer Correct ?    0 Yes 0 No
Sachin Rathi
 
  Re: The Difference between 'Count' and 'Count(*)'
Answer
# 8
Count(column_name) returns the number of records in the 
table where the column value is not null for the particular 
column.
Count(*) returns the number of all records in the table. 
(including duplicates and those with nulls)
 
Is This Answer Correct ?    0 Yes 1 No
Harish Sharma
 

 
 
 
Other SQL Server Interview Questions
 
  Question Asked @ Answers
 
How to Generate a Series of Random Integers With T-SQL?  1
how to select a field with firstletter as capital and remaining are small letters  7
What are the different types of joins and what does each do?  2
Plz tell about backup&recovery?  2
Assume,there are three tables in a database, Can i have both primary key and foreign key for each table in the same database?  4
What is INTVAL( )and where we use Plz any body help me  1
how to generate XML out of QUERY? McAfee1
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.  2
i want to join two queries....and i want to run them as one after another that is want output of first query then second , then again output of first query then second and so on...  1
Explain the architecture of SQL Server?  2
how many joins we can write if at all we have n no of tables Tanla-Solutions3
what is difference between primary key and Unique  1
Can you create UNIQUE and PRIMARY KEY constraints on computed columns in SQL Server 2000? Infosys1
internal language used in sql server 2000?  1
can you any body tell me suppose database is suspect mode. how can take to normal? Teledata1
how to delete duplicate rows from table CSC2
what is Data Transformation Services (DTS) ?can u explain me in detail? TCS4
What is user stored procedure & it purpose? Wipro3
About DTS usage ? Cognizent2
what is the out put of below queries? a. select * from Emp where null = null; b. select * from Emp where 1=1; Patni6
 
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