Okay, let's start with text data types. So far, we've learnt 3 text types:
VARCHAR, which allows us to enter a value of up to the given amount of characters,
CHAR which is used for data of constant length and
CLOB data type for longer passages.
The choice of the proper type is not always obvious. For instance, if we want to store user passwords and they are supposed to be up to 20 characters long, you may think that
VARCHAR(20) will be the right choice. However, it is good practice to store passwords in your database encrypted.
For instance, we can use a special hash function like SHA-512. The good thing is, it is not easy to decrypt such passwords, so if the data from our database falls into the wrong hands, it won't be easy to get to know the stolen passwords.
The password hash generated with the SHA-512 function is 512 bytes long, which is more or less 88 characters, depending on the encoding.