Difference between COUNT (*) , COUNT(1), COUNT(Col_Name) and COUNT(Distinct(Col_Name) in SQL

Опубликовано: 30 Март 2026
на канале: ItJunction4all
4,859
141

Difference between COUNT (*) , COUNT(1), COUNT(Col_Name) and COUNT(Distinct(Col_Name) in SQL

This is very important SQL Interview Question and it is must asked question in alomost all SQL related interviews.

-------------------------------------------------------------------------
𝗝𝗼𝗶𝗻 𝗺𝗲 𝗼𝗻 𝗦𝗼𝗰𝗶𝗮𝗹 𝗠𝗲𝗱𝗶𝗮:🔥
-------------------------------------------------------------------------
*Instagram :
  / itjunction4all  

*Twitter:
  / sunilkr5672  
-------------------------------------------------------------------------
Table and Insert SQL Script :
-------------------------------------------------------------------------
CREATE TABLE [dbo].[Employees_Tbl](
[EmpID] [int],
[EmpName] [varchar](30),
[Salary] [int],
[DeptID] [int]
)
-----------------------------------------------------------------------------------------------------------------------------
#SQL-Count(*) #SQL-COUNT(1)#SQLInterviewQuestionsandanswers #sqlInterviewQuestions #MAANG #sqlInterviewQuestionsForTesting