C:\Users\SebastiánHenao>cd c:/xampp/mysql/bin c:\xampp\mysql\bin>mysql -u root -p Enter password: Welcome to the MariaDB monitor. Commands end with ; or \g. Your MariaDB connection id is 8 Server version: 10.4.28-MariaDB mariadb.org binary distribution Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. MariaDB [(none)]> create database Seguridad -> ; Query OK, 1 row affected (0.001 sec) MariaDB [(none)]> use Seguridad; Database changed MariaDB [Seguridad]> create table usuario -> -> (nombre char(20) not null, -> -> clave char(10) 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 '-> (nombre char(20) not null, -> clave char(10) not null)' at line 2 MariaDB [Seguridad]> create table usuario -> (nombre char(20) not null, -> clave char(10) not null); Query OK, 0 rows affected (0.012 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.012 sec) MariaDB [Seguridad]> select encode('triste','dia'); +------------------------+ | encode('triste','dia') | +------------------------+ | ısv¥└╚ | +------------------------+ 1 row in set (0.000 sec) MariaDB [Seguridad]> insert into usuario value('Mauricio Vasquez',encode('mao','123')); Query OK, 1 row affected, 1 warning (0.053 sec) MariaDB [Seguridad]> select * from usuario; +------------------+-------+ | nombre | clave | +------------------+-------+ | Mauricio Vasquez | ?z' | +------------------+-------+ 1 row in set (0.000 sec) MariaDB [Seguridad]> insert into usuario value('Javier Ospina Moreno',encode('jom','456')); Query OK, 1 row affected (0.005 sec) MariaDB [Seguridad]> select * from usuario; +----------------------+-------+ | nombre | clave | +----------------------+-------+ | Mauricio Vasquez | ?z' | | Javier Ospina Moreno | }}♫ | +----------------------+-------+ 2 rows in set (0.000 sec) MariaDB [Seguridad]> select @clave:=encode('sol','145'); +-----------------------------+ | @clave:=encode('sol','145') | +-----------------------------+ | ó♠Î | +-----------------------------+ 1 row in set (0.000 sec) MariaDB [Seguridad]> insert into usuario value('Sol Mireya',@clave); Query OK, 1 row affected, 1 warning (0.004 sec) MariaDB [Seguridad]> select * from usuario; +----------------------+-------+ | nombre | clave | +----------------------+-------+ | Mauricio Vasquez | ?z' | | Javier Ospina Moreno | }}♫ | | Sol Mireya | ?♠? | +----------------------+-------+ 3 rows in set (0.000 sec) MariaDB [Seguridad]> select decode(clave,'123') from usuario where nombre='Mauricio Vasquez'; +---------------------+ | decode(clave,'123') | +---------------------+ | ?^ | +---------------------+ 1 row in set (0.000 sec) MariaDB [Seguridad]> select decode(clave,'456') from usuario where nombre='Javier Ospina Moreno'; +---------------------+ | decode(clave,'456') | +---------------------+ | jom | +---------------------+ 1 row in set (0.000 sec) MariaDB [Seguridad]> select decode(clave,'145') from usuario where nombre='Sol mireya'; +---------------------+ | decode(clave,'145') | +---------------------+ | ?♂? | +---------------------+ 1 row in set (0.000 sec) MariaDB [Seguridad]> select locate('r','sergio se rie mucho'); +-----------------------------------+ | locate('r','sergio se rie mucho') | +-----------------------------------+ | 3 | +-----------------------------------+ 1 row in set (0.000 sec) MariaDB [Seguridad]> select locate('s','sergio se rie mucho'); +-----------------------------------+ | locate('s','sergio se rie mucho') | +-----------------------------------+ | 1 | +-----------------------------------+ 1 row in set (0.000 sec) MariaDB [Seguridad]> select locate('i','sergio se rie mucho'); +-----------------------------------+ | locate('i','sergio se rie mucho') | +-----------------------------------+ | 5 | +-----------------------------------+ 1 row in set (0.000 sec) MariaDB [Seguridad]> select position('i' in 'sergio se rie mucho'); +----------------------------------------+ | position('i' in 'sergio se rie mucho') | +----------------------------------------+ | 5 | +----------------------------------------+ 1 row in set (0.000 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.000 sec) MariaDB [Seguridad]> select ltrim(' estudien chicos '); +------------------------------------+ | ltrim(' estudien chicos ') | +------------------------------------+ | estudien chicos | +------------------------------------+ 1 row in set (0.000 sec) MariaDB [Seguridad]> select rtrim(' estudien chicos '); +------------------------------------+ | rtrim(' estudien chicos ') | +------------------------------------+ | estudien chicos | +------------------------------------+ 1 row in set (0.000 sec) MariaDB [Seguridad]> select trim(' estudien chicos '); +-----------------------------------+ | trim(' estudien chicos ') | +-----------------------------------+ | estudien chicos | +-----------------------------------+ 1 row in set (0.000 sec) MariaDB [Seguridad]> select trim(leading '0' from '00estudien chicos00'); +----------------------------------------------+ | trim(leading '0' from '00estudien chicos00') | +----------------------------------------------+ | estudien chicos00 | +----------------------------------------------+ 1 row in set (0.000 sec) MariaDB [Seguridad]> select trim(trailing '0' from '00estudien chicos00'); +-----------------------------------------------+ | trim(trailing '0' from '00estudien chicos00') | +-----------------------------------------------+ | 00estudien chicos | +-----------------------------------------------+ 1 row in set (0.000 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]> select trim('0' from '00estudien chicos00'); +--------------------------------------+ | trim('0' from '00estudien chicos00') | +--------------------------------------+ | estudien chicos | +--------------------------------------+ 1 row in set (0.000 sec) MariaDB [Seguridad]> exit Bye c:\xampp\mysql\bin>mysqldump -u root -p Seguridad > Seguridadejercicio.sql Enter password: c:\xampp\mysql\bin>