Grouping Data
Query:
SELECT department_id, COUNT(*) AS employee_count FROM employees GROUP BY department_id;
Count the number of employees in each department by grouping the data according to the department ID.
Output:
SELECT Statement in MariaDB
MariaDB uses SQL (Structured Query Language) and it is an open-source relational database management system (RDBMS) for managing and manipulating data. The SELECT statement is the most basic of all the SQL statements. It is essential to get data out of one or more database tables and display it. In this article, we will examine the syntax of the SELECT statement in MariaDB to retrieve records from a table.