Column aliases in MariaDB are used to rename the columns in the output of your queries in an easier-to-understand way. The syntax for it is as follows:
```
SELECT column_name AS alias_name FROM table_name;
```
You can use the AS keyword to assign an alias to the column.
Here is an example:
Let’s say we have a table named Employees with the following data:
ID | First_Name | Last_Name |
—- | ————— | ————- |
1 | John | Doe |
2 | Jane | Doe |
3 | Bob | Smith |
And you want to display the first name and last name of employees as ‘Employee First Name’ and ‘Employee Last Name’, then the SQL query would be:
```
SELECT First_Name AS ‘Employee First Name’, Last_Name AS ‘Employee Last Name’ FROM Employees;
```
This will output:
Employee First Name | Employee Last Name |
—————————- | ————————— |
John | Doe |
Jane | Doe |
Bob | Smith |
Remarks:
- Aliases are useful when column names are long or not very meaningful.
- Aliases only exist for the duration of the query.
- You can also use aliases in the WHERE clause, but it is not supported by all SQL versions.