Posted inMysql

Examples of the count query in sql

count query in sql : The “COUNT” function in SQL is used to count the number of rows in a table or the number of rows that meet a specific condition.

The basic syntax of the “COUNT” function is as follows:

SELECT COUNT(*) FROM [table “” not found /]

Here, COUNT(*) counts the total number of rows in the specified table.

If you want to count the number of rows based on a specific condition, you can use the “WHERE” clause in the query, like this:

SELECT COUNT(*) FROM [table “” not found /]
WHERE [condition];

For example, to count the number of employees with a salary greater than $50,000 in the “employees” table, you can use the following query:

SELECT COUNT(*) FROM employees WHERE salary > 50000;

I am Jaydeep Gondaliya , a software engineer, the founder and the person running Pakainfo. I'm a full-stack developer, entrepreneur and owner of I live in India and I love to write tutorials and tips that can help to other artisan, a Passionate Blogger, who love to share the informative content on PHP, JavaScript, jQuery, Laravel, CodeIgniter, VueJS, AngularJS and Bootstrap from the early stage.

Leave a Reply

Your email address will not be published. Required fields are marked *

We accept paid guest Posting on our Site : Guest Post Chat with Us On Skype