MariaDB [(none)]> create database seguridad; Query OK, 1 row affected (0.00 sec) MariaDB [(none)]> use seguridad; Database changed MariaDB [seguridad]> create table usuario -> (nombre char(20) not null, -> clave char(10)0 not null); ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '0 not null)' at line 3 MariaDB [seguridad]> create table usuario -> (nombre char(20) not null, -> clave char(10) not null); Query OK, 0 rows affected (0.14 sec) MariaDB [seguridad]> describe usuario; +--------+----------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +--------+----------+------+-----+---------+-------+ | nombre | char(20) | NO | | NULL | | | clave | char(10) | NO | | NULL | | +--------+----------+------+-----+---------+-------+ 2 rows in set (0.00 sec) MariaDB [seguridad]> select encode('triste','dia'); +------------------------+ | encode('triste','dia') | +------------------------+ | Õsv¾ÀÈ | +------------------------+ 1 row in set (0.00 sec) MariaDB [seguridad]> insert into usuario value('Mauricio Vasquez',encode('mao','123')); Query OK, 1 row affected (0.06 sec) MariaDB [seguridad]> select * from usuario; +------------------+-------+ | nombre | clave | +------------------+-------+ | Mauricio Vasquez | ?z' | +------------------+-------+ 1 row in set (0.00 sec) MariaDB [seguridad]> insert into usuario value('Javier Ospina',encode('jom','456')); Query OK, 1 row affected (0.03 sec) MariaDB [seguridad]> select * from usuario; +------------------+-------+ | nombre | clave | +------------------+-------+ | Mauricio Vasquez | ?z' | | Javier Ospina | }} | +------------------+-------+ 2 rows in set (0.00 sec) MariaDB [seguridad]> select @clave:=encode('sol','145'); +-----------------------------+ | @clave:=encode('sol','145') | +-----------------------------+ | ¢× | +-----------------------------+ 1 row in set (0.00 sec) MariaDB [seguridad]> insert into usuario value('Sol Mireya',@clave); Query OK, 1 row affected (0.04 sec) MariaDB [seguridad]> select * from usuario; +------------------+-------+ | nombre | clave | +------------------+-------+ | Mauricio Vasquez | ?z' | | Javier Ospina | }} | | Sol Mireya | ½ž | +------------------+-------+ 3 rows in set (0.00 sec) MariaDB [seguridad]> select decode(clave,'123') from usuario where nombre='Mauricio Vasquez'; +---------------------+ | decode(clave,'123') | +---------------------+ | mao | +---------------------+ 1 row in set (0.00 sec) MariaDB [seguridad]> select decode(clave,'jom') from usuario where nombre='Javier Ospina'; +---------------------+ | decode(clave,'jom') | +---------------------+ | >b | +---------------------+ 1 row in set (0.00 sec) MariaDB [seguridad]> select decode(clave,'456') from usuario where nombre='Javier Ospina'; +---------------------+ | decode(clave,'456') | +---------------------+ | jom | +---------------------+ 1 row in set (0.00 sec) MariaDB [seguridad]> select decode(clave,'145') from usuario where nombre='Sol Mireya; '> ' -> ; Empty set (0.00 sec) MariaDB [seguridad]> select decode(clave,'145') from usuario where nombre='Sol Mireya'; +---------------------+ | decode(clave,'145') | +---------------------+ | sol | +---------------------+ 1 row in set (0.00 sec) MariaDB [seguridad]> select locate('r','sergio se rie mucho'); +-----------------------------------+ | locate('r','sergio se rie mucho') | +-----------------------------------+ | 3 | +-----------------------------------+ 1 row in set (0.00 sec) MariaDB [seguridad]> select locate('s',sergio se rie mucho'); '> ' -> ; ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'rie mucho'); '' at line 1 MariaDB [seguridad]> select locate('s','sergio se rie mucho'); +-----------------------------------+ | locate('s','sergio se rie mucho') | +-----------------------------------+ | 1 | +-----------------------------------+ 1 row in set (0.00 sec) MariaDB [seguridad]> select position('i' in 'sergio se rie mucho'), -> ' '> ; '> ; '> ' -> -> -> -> -> -> -> -> -> -> -> -> -> -> -> -> -> ,; ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '' at line 19 MariaDB [seguridad]> select position('i' in 'sergio se rie mucho'); +----------------------------------------+ | position('i' in 'sergio se rie mucho') | +----------------------------------------+ | 5 | +----------------------------------------+ 1 row in set (0.00 sec) MariaDB [seguridad]> select position('h' in 'sergio se rie mucho'); +----------------------------------------+ | position('h' in 'sergio se rie mucho') | +----------------------------------------+ | 18 | +----------------------------------------+ 1 row in set (0.00 sec) MariaDB [seguridad]> select mid('hola como estas' from 4 for 6); +-------------------------------------+ | mid('hola como estas' from 4 for 6) | +-------------------------------------+ | a como | +-------------------------------------+ 1 row in set (0.00 sec) MariaDB [seguridad]> select ltrim(' estudien chicos '); +------------------------------------+ | ltrim(' estudien chicos ') | +------------------------------------+ | estudien chicos | +------------------------------------+ 1 row in set (0.00 sec) MariaDB [seguridad]> select rtrim(' estudien chicos '); +------------------------------------+ | rtrim(' estudien chicos ') | +------------------------------------+ | estudien chicos | +------------------------------------+ 1 row in set (0.00 sec) MariaDB [seguridad]> select trim(' estudien chicos '); +-----------------------------------+ | trim(' estudien chicos ') | +-----------------------------------+ | estudien chicos | +-----------------------------------+ 1 row in set (0.00 sec) MariaDB [seguridad]> exit