The examples were created with the MyWAY SQL manager: Download
How to use the BIN() function in MySQL and MariaDB databases
The BIN() function in MySQL and MariaDB is used to convert a decimal or integer value into its binary representation. The function takes a numeric value as input and returns a string representing the binary form with "0" and "1" characters of that value, for example for use in binary arithmetic or handling binary data.
The result of the function is a string and not a binary value. To perform binary operations or to store binary data, the corresponding binary data types such as BINARY, VARBINARY or BLOB should be used.