MariaDB [(none)]> create database seguridad; Query OK, 1 row affected (0.035 sec) MariaDB [(none)]> use seguridad; Database changed MariaDB [seguridad]> creatr table usuario -> (Nombre varchar(20) not null, -> Clave varcha(10) 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 'creatr table usuario (Nombre varchar(20) not null, Clave varcha(10) null)' at line 1 MariaDB [seguridad]> creatr table usuario -> creatr table usuario -> -> ); 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 'creatr table usuario creatr table usuario )' at line 1 MariaDB [seguridad]> create table usuario -> (Nombre varchar(20) not null, -> Clave varchar(10) null); Query OK, 0 rows affected (0.099 sec) MariaDB [seguridad]> describe usuario; +--------+-------------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +--------+-------------+------+-----+---------+-------+ | Nombre | varchar(20) | NO | | NULL | | | Clave | varchar(10) | YES | | NULL | | +--------+-------------+------+-----+---------+-------+ 2 rows in set (0.089 sec) MariaDB [seguridad]> insert into usuario value('Mauricio Sepulveda',encode('mao','78890)); '> insert into usuario value('Mauricio Sepulveda',encode('mao','78890')); '> ' -> ; 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 'Sepulveda',encode('mao','78890')); '' at line 1 MariaDB [seguridad]> insert into usuario value('Mauricio Sepulveda',encode('mao','78890')); Query OK, 1 row affected, 1 warning (0.213 sec) MariaDB [seguridad]> select* from usuario; +--------------------+-------+ | Nombre | Clave | +--------------------+-------+ | Mauricio Sepulveda | ?) | +--------------------+-------+ 1 row in set (0.001 sec) MariaDB [seguridad]> insert into usuario value('Javier Ospina Moreno',encode('jom','456')); Query OK, 1 row affected (0.004 sec) MariaDB [seguridad]> insert into usuario value('Gustavo Lopera',encode('gus','1234')); Query OK, 1 row affected (0.004 sec) MariaDB [seguridad]> insert into usuario value('Christian Camilo Trespalacios',encode('cct','1601')); Query OK, 1 row affected, 1 warning (0.004 sec) MariaDB [seguridad]> select* from usuario; +----------------------+-------+ | Nombre | Clave | +----------------------+-------+ | Mauricio Sepulveda | ?) | | Javier Ospina Moreno | }} | | Gustavo Lopera | *\ | | Christian Camilo Tre | "^ | +----------------------+-------+ 4 rows in set (0.001 sec) MariaDB [seguridad]> insert into usuario value('Christian Camilo Palacios',encode('cct','1601')); Query OK, 1 row affected, 1 warning (0.004 sec) MariaDB [seguridad]> select* from usuario; +----------------------+-------+ | Nombre | Clave | +----------------------+-------+ | Mauricio Sepulveda | ?) | | Javier Ospina Moreno | }} | | Gustavo Lopera | *\ | | Christian Camilo Tre | "^ | | Christian Camilo Pal | "^ | +----------------------+-------+ 5 rows in set (0.001 sec) MariaDB [seguridad]> select decode(clave,'7889') from usuario where nombre='Mauricio Sepulveda'; +----------------------+ | decode(clave,'7889') | +----------------------+ | ?q? | +----------------------+ 1 row in set (0.002 sec) MariaDB [seguridad]> select decode(clave,'7889') from usuario where nombre='Mauricio Sepulveda'; +----------------------+ | decode(clave,'7889') | +----------------------+ | ?q? | +----------------------+ 1 row in set (0.001 sec) MariaDB [seguridad]> select decode(clave,'78890') from usuario where nombre='Mauricio Sepulveda'; +-----------------------+ | decode(clave,'78890') | +-----------------------+ | (- | +-----------------------+ 1 row in set (0.001 sec) MariaDB [seguridad]> insert into usuario value('Camilo Palacios',encode('cctp','0816')); Query OK, 1 row affected, 1 warning (0.009 sec) MariaDB [seguridad]> select decode(clave,'0816') from usuario where nombre='Camilo Palacios'; +----------------------+ | decode(clave,'0816') | +----------------------+ | cct? | +----------------------+ 1 row in set (0.001 sec) MariaDB [seguridad]> select decode(clave,'1234') from usuario where nombre='Gustavo Lopera'; +----------------------+ | decode(clave,'1234') | +----------------------+ | gus | +----------------------+ 1 row in set (0.001 sec) MariaDB [seguridad]> select locate('r','sergio se rie mucho'); +-----------------------------------+ | locate('r','sergio se rie mucho') | +-----------------------------------+ | 3 | +-----------------------------------+ 1 row in set (0.019 sec) MariaDB [seguridad]> select decode(clave,'78890') from usuario where nombre='Mauricio Sepulveda'; +-----------------------+ | decode(clave,'78890') | +-----------------------+ | (- | +-----------------------+ 1 row in set (0.001 sec) MariaDB [seguridad]> select locate('r','sergio se rie mucho'); +-----------------------------------+ | locate('r','sergio se rie mucho') | +-----------------------------------+ | 3 | +-----------------------------------+ 1 row in set (0.001 sec) MariaDB [seguridad]> select locate('s','sergio se rie mucho'); +-----------------------------------+ | locate('s','sergio se rie mucho') | +-----------------------------------+ | 1 | +-----------------------------------+ 1 row in set (0.001 sec) MariaDB [seguridad]> select locate('i','sergio se rie mucho'); +-----------------------------------+ | locate('i','sergio se rie mucho') | +-----------------------------------+ | 5 | +-----------------------------------+ 1 row in set (0.001 sec) MariaDB [seguridad]> select position('i' in 'sergio se rie mucho'); +----------------------------------------+ | position('i' in 'sergio se rie mucho') | +----------------------------------------+ | 5 | +----------------------------------------+ 1 row in set (0.021 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.033 sec) MariaDB [seguridad]> select ltrim(' estudien chicos '); +------------------------------------+ | ltrim(' estudien chicos ') | +------------------------------------+ | estudien chicos | +------------------------------------+ 1 row in set (0.002 sec) MariaDB [seguridad]> select rtrim(' estudien chicos '); +------------------------------------+ | rtrim(' estudien chicos ') | +------------------------------------+ | estudien chicos | +------------------------------------+ 1 row in set (0.001 sec) MariaDB [seguridad]> select trim(' estudien chicos '); +-----------------------------------+ | trim(' estudien chicos ') | +-----------------------------------+ | estudien chicos | +-----------------------------------+ 1 row in set (0.001 sec) MariaDB [seguridad]> [17:16] Javier Ospina Moreno -> select trim(leading '0' from '00estudien chicos00'); 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 '[17:16] Javier Ospina Moreno select trim(leading '0' from '00estudien chicos00')' at line 1 MariaDB [seguridad]> MariaDB [seguridad]> [17:16] Javier Ospina Moreno -> select trim(leading '0' from '00estudien chicos00'); 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 '[17:16] Javier Ospina Moreno select trim(leading '0' from '00estudien chicos00')' at line 1 MariaDB [seguridad]> MariaDB [seguridad]> select trim(leading '0' from '00estudien chicos00'); +----------------------------------------------+ | trim(leading '0' from '00estudien chicos00') | +----------------------------------------------+ | estudien chicos00 | +----------------------------------------------+ 1 row in set (0.002 sec) MariaDB [seguridad]> select trim(trailing '0' from '00estudien chicos00'); +-----------------------------------------------+ | trim(trailing '0' from '00estudien chicos00') | +-----------------------------------------------+ | 00estudien chicos | +-----------------------------------------------+ 1 row in set (0.001 sec) MariaDB [seguridad]> select trim(both '0' from '00estudien chicos00'); +-------------------------------------------+ | trim(both '0' from '00estudien chicos00') | +-------------------------------------------+ | estudien chicos | +-------------------------------------------+ 1 row in set (0.000 sec) MariaDB [seguridad]> exit