0 votes
in MariaDB by
What are the different types of clauses used in MariaDB?

1 Answer

0 votes
by
MariaDB supports all clauses used in RDBMS. For example:

MariaDB Where Clause: In MariaDB, WHERE clause is used with SELECT, INSERT, UPDATE and DELETE statement to select or change a specific location where we want to change.

It has appeared after the table name in a statement.

Syntax:

[COMMAND] field,field2,... FROM table_name,table_name2,... WHERE [CONDITION]   

Note: WHERE clause is an optional clause. It can be used with AND, OR, AND & OR, LIKE operators.

MariaDB Like Clause: In MariaDB, LIKE clause is used with SELECT statement to retrieve data when an operation needs an exact match. It can be used with SELECT, INSERT, UPDATE and DELETE statement.

It is used for pattern matching and returns a true or false. The patterns used for comparison accept the following wildcard characters:

"%" wildcard character: It matches numbers of characters (0 or more).

"_" wildcard character: It matches a single character. It matches characters within its set.

Syntax:

SELECT field, field2,.... FROM table_name, table_name2,...   

WHERE field LIKE condition  

MariaDB Order By Clause: In MariaDB database, ORDER BY Clause is used to sort the records in your result set in ascending or descending order.

Syntax:

SELECT expressions    

FROM tables    

[WHERE conditions]    

ORDER BY expression [ ASC | DESC ];  

Note: You can sort the result without using ASC/DESC attributes. By default, the result will be stored in ascending order.

MariaDB DISTINCT Clause: MariaDB DISTINCT Clause is used to remove duplicates from the result when we use it with a SELECT statement.

Syntax:

SELECT DISTINCT expressions    

FROM tables    

[WHERE conditions];.  

Note: When you use the only expression in a DISTINCT clause, the query will return the unique values for that expression. When you use multiple expressions in the DISTINCT clause, the query will return unique combinations for the multiple expressions listed.

The DISTINCT clause doesn't ignore NULL values. So when using the DISTINCT clause in your SQL statement, your result set will include NULL as a distinct value.

MariaDB FROM Clause: MariaDB FROM Clause is used to fetch data from a table. It is also used to join the tables which you will study later.

Syntax:

SELECT columns_names FROM table_name;  

Etc.
...