INTERSECT Operator in MariaDB

MariaDB INTERSECT The MariaDB INTERSECT operator is used to get the common or intersecting records from the corresponding columns of the selected tables. Each SELECT statement however must have the same number of expressions, and each corresponding expression should be of the same data type. Syntax: SELECT expr_1, expr_2, … expr_n FROM table1 WHERE conditions … Read more

UNION ALL operator in MariaDB

MariaDB UNION ALL To combine the output sets of two or more MariaDB SELECT statements, without removing the duplicate rows between the SELECT statements’ results, the MariaDB UNION ALL operator is used. Each SELECT statement however must have the same number of expressions, and each corresponding expression should be of the same data type. Syntax: … Read more

UNION operator in MariaDB

MariaDB UNION To combine the output sets of two or more MariaDB SELECT statements, thus removing the duplicate rows between the SELECT statements’ results, the MariaDB UNION operator is used. Each SELECT statement however must have the same number of expressions, and each corresponding expression should be of the same data type. Syntax: SELECT expr_1, … Read more

Right Outer Join in MariaDB

RIGHT JOIN The MariaDB Right Outer Join query returns all the rows from the Right table for the specified fields. For the Left table, it only returns those rows where the join condition is met. Syntax: SELECT expr_1, expr_2, … expr_n FROM table_1 RIGHT JOIN table_2 ON join_predicate; Example: Players Table: ID NAME SPORTS 1 … Read more

Left Outer join in MariaDB

LEFT JOIN The MariaDB Left Outer Join query returns all the rows from the Left table for the specified fields. For the Right table, it only returns those rows where the join condition is met. Syntax: SELECT expr_1, expr_2, … expr_n FROM table_1 LEFT JOIN table_2 ON join_predicate; Example: Players Table: ID NAME SPORTS 1 … Read more

JOINS in MariaDB

MariaDB JOINS To retrieve data from multiple tables, the MariaDB Join Query is used. Types of Joins: There are mainly three types of Joins that the MariaDB database supports. These are: Inner or Simple Join Left Outer Join or Left Join Right Outer Join or Right Join   INNER JOIN The INNER Join is the … Read more

AVG function in MariaDB

MariaDB AVG To get the average value of an expression, the MariaDB AVG function is used. Syntax 1: SELECT expressions, AVG (aggregate_expression) FROM table_name WHERE conditions; Syntax 2: To calculate average and grouping the results by one or more columns. SELECT expression1, expression2, … expression_n, AVG(aggregate_expression) FROM tables WHERE conditions GROUP BY expression1, expression2, … … Read more

MAX function in MariaDB

MariaDB MAX To get the maximum value from a column in the table, the MariaDB MAX function is used. Syntax: SELECT expressions, MAX (aggregate_expression) FROM table_name WHERE conditions; Parameters: Aggregate_expression: It is used to specify the column or expression to be utilised by the aggregate function. Example 1: Using Group By Clause. Players Table: ID … Read more

COUNT function in MariaDB

MariaDB COUNT To get the count of an expression, the MariaDB COUNT function is used. Syntax: SELECT expressions, COUNT (aggregate_expression) FROM table_name WHERE conditions; Parameters: Aggregate_expression: It is used to specify the column or expression to be utilised by the aggregate function. Example 1: Using Group By Clause. Players Table: ID NAME SPORTS 1 Sachin … Read more

MIN function in MariaDB

MariaDB MIN To get the minimum value from a column in the table, the MariaDB MIN function is used. Syntax: SELECT expressions, MIN (aggregate_expression) FROM table_name WHERE conditions; Parameters: Aggregate_expression: It is used to specify the column or expression to be utilised by the aggregate function. Example 1: Using Group By Clause. Players Table: ID … Read more