Total Page Preview:   000000000461

What is count function in SQL in English and Hindi

 

Count function in English

The COUNT function in SQL is used to return the number of rows that match a specified condition in a table. The COUNT function is often used in combination with the SELECT statement and can be used with or without the GROUP BY clause.
Here's an example of using the COUNT function in SQL:
Suppose we have a table named students with the following data:
 
Now, we want to count the number of male students in the students table. We can use the COUNT function to accomplish this as follows:
 
In this example, the COUNT function is used to count all rows in the students table where the Gender is equal to 'M'. The result of this query is:
As we can see, the COUNT function returns the value 4, which is the number of rows in the students table where the Gender is equal to 'M'.
 
Note that the COUNT function can also be used in combination with the GROUP BY clause to count the number of rows for each group in the table based on a specified column. For example:
This query would return the number of rows in the students table for each unique Grade value.

 

Count function in Hindi

COUNT function SQL mein ek built-in aggregate function hai jo specified condition ke saath matching rows ki count return karta hai. COUNT function aksar SELECT statement ke saath istemal kiya jata hai aur GROUP BY clause ke saath bhi istemal kiya ja sakta hai.
Yahan ek COUNT function ka example hai:
Maan lijiye ki humare paas Students naam ka ek table hai jismein neeche di gayi data hai:
 
Ab hum Students table mein kitne male students hai unki counting karna chahte hai. Iske liye hum COUNT function ka istemal karenge, jaisa ki neeche diya gaya hai:
 
Is example mein, COUNT function Students table ke sabhi rows ko count kar raha hai jahan Gender 'M' hai. Is query ka result ye hai:
Jaisa ki hum dekh sakte hai, COUNT function 4 value return kar raha hai, jo Students table mein Gender 'M' hai uski rows ki counting hai.
 
Note ki COUNT function GROUP BY clause ke saath istemal karke table ke har group ke rows ki counting karne ke liye bhi istemal kiya jaa sakta hai. For example:
Is query mein COUNT function Students table ke har unique Grade value ke rows ki counting return kar raha hai.

 

 

 

Thank You

About Author

Brijesh Kumar

Database Developer

I have more then 6 years Experience in Microsoft Technologies - SQL Server Database, ETL Azure Cloud - Azure SQL Database, CosmosDB, Azure Data Factory, PowerBI, Web Job, Azure Function, Azure Storage, Web Apps, Powershall and Database Migration On-Premise to Azure Cloud.
LinkedIn : https://www.linkedin.com



Comments


                           
                           

                           

                           

Facebook User: