MariaDB [(none)]> use reto2; Database changed MariaDB [reto2]> CREATE TABLE VENDEDOR ( -> id_vendedor VARCHAR(3) PRIMARY KEY, -> nombre VARCHAR(50), -> porcentaje_comision DECIMAL(3,2), -> zona VARCHAR(20) -> ); Query OK, 0 rows affected (0.007 sec) MariaDB [reto2]> show tables; +-----------------+ | Tables_in_reto2 | +-----------------+ | vendedor | +-----------------+ 1 row in set (0.001 sec) MariaDB [reto2]> select * from vendedor; Empty set (0.053 sec) MariaDB [reto2]> INSERT INTO VENDEDOR (id_vendedor, nombre, porcentaje_comision, zona) VALUES -> ('001', 'Luis Meza', 0.5, 'Norte'), -> ('002', 'Camilo Lleras', 0.6, 'Centro'), -> ('003', 'Sergio Agudelo', 0.3, 'Centro'), -> ('004', 'Lina Ocampo', 0.5, 'Sur'); Query OK, 4 rows affected (0.003 sec) Records: 4 Duplicates: 0 Warnings: 0 MariaDB [reto2]> select * from vendedor; +-------------+----------------+---------------------+--------+ | id_vendedor | nombre | porcentaje_comision | zona | +-------------+----------------+---------------------+--------+ | 001 | Luis Meza | 0.50 | Norte | | 002 | Camilo Lleras | 0.60 | Centro | | 003 | Sergio Agudelo | 0.30 | Centro | | 004 | Lina Ocampo | 0.50 | Sur | +-------------+----------------+---------------------+--------+ 4 rows in set (0.001 sec) MariaDB [reto2]> CREATE TABLE CLIENTE ( -> id_cliente VARCHAR(5) PRIMARY KEY, -> nombre VARCHAR(50), -> cupo_credito FLOAT -> ); Query OK, 0 rows affected (0.010 sec) MariaDB [reto2]> INSERT INTO CLIENTE (id_cliente, nombre, cupo_credito) VALUES -> ('50964', 'Oscar de Le¢n', 500000), -> ('85963', 'Ana Palencia', 1000000), -> ('25147', 'Teresa Su rez', 1200000), -> ('36259', 'Shamir Beltr n', 700000); Query OK, 4 rows affected (0.004 sec) Records: 4 Duplicates: 0 Warnings: 0 MariaDB [reto2]> select * from cliente; +------------+----------------+--------------+ | id_cliente | nombre | cupo_credito | +------------+----------------+--------------+ | 25147 | Teresa Su rez | 1200000 | | 36259 | Shamir Beltr n | 700000 | | 50964 | Oscar de Le¢n | 500000 | | 85963 | Ana Palencia | 1000000 | +------------+----------------+--------------+ 4 rows in set (0.000 sec) MariaDB [reto2]> show tables; +-----------------+ | Tables_in_reto2 | +-----------------+ | cliente | | vendedor | +-----------------+ 2 rows in set (0.001 sec) MariaDB [reto2]> describe vendedor; +---------------------+--------------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +---------------------+--------------+------+-----+---------+-------+ | id_vendedor | varchar(3) | NO | PRI | NULL | | | nombre | varchar(50) | YES | | NULL | | | porcentaje_comision | decimal(3,2) | YES | | NULL | | | zona | varchar(20) | YES | | NULL | | +---------------------+--------------+------+-----+---------+-------+ 4 rows in set (0.019 sec) MariaDB [reto2]> describe cliente; +--------------+-------------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +--------------+-------------+------+-----+---------+-------+ | id_cliente | varchar(5) | NO | PRI | NULL | | | nombre | varchar(50) | YES | | NULL | | | cupo_credito | float | YES | | NULL | | +--------------+-------------+------+-----+---------+-------+ 3 rows in set (0.020 sec) MariaDB [reto2]> select * from vendedor where zona "norte"; 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 '"norte"' at line 1 MariaDB [reto2]> select * from vendedor where zona 'norte'; 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 ''norte'' at line 1 MariaDB [reto2]> SELECT * FROM VENDEDOR -> WHERE zona = 'Norte'; +-------------+-----------+---------------------+-------+ | id_vendedor | nombre | porcentaje_comision | zona | +-------------+-----------+---------------------+-------+ | 001 | Luis Meza | 0.50 | Norte | +-------------+-----------+---------------------+-------+ 1 row in set (0.002 sec) MariaDB [reto2]> select * from vendedor; +-------------+----------------+---------------------+--------+ | id_vendedor | nombre | porcentaje_comision | zona | +-------------+----------------+---------------------+--------+ | 001 | Luis Meza | 0.50 | Norte | | 002 | Camilo Lleras | 0.60 | Centro | | 003 | Sergio Agudelo | 0.30 | Centro | | 004 | Lina Ocampo | 0.50 | Sur | +-------------+----------------+---------------------+--------+ 4 rows in set (0.000 sec) MariaDB [reto2]> select * from vendedor where zona = 'norte'; +-------------+-----------+---------------------+-------+ | id_vendedor | nombre | porcentaje_comision | zona | +-------------+-----------+---------------------+-------+ | 001 | Luis Meza | 0.50 | Norte | +-------------+-----------+---------------------+-------+ 1 row in set (0.000 sec) MariaDB [reto2]> select * from vendedor where zona = 'centro' and porcentaje_comision = 0.3; +-------------+----------------+---------------------+--------+ | id_vendedor | nombre | porcentaje_comision | zona | +-------------+----------------+---------------------+--------+ | 003 | Sergio Agudelo | 0.30 | Centro | +-------------+----------------+---------------------+--------+ 1 row in set (0.002 sec) MariaDB [reto2]> select * from cliente where cupo_credito between 500000 and 1000000; +------------+----------------+--------------+ | id_cliente | nombre | cupo_credito | +------------+----------------+--------------+ | 36259 | Shamir Beltr n | 700000 | | 50964 | Oscar de Le¢n | 500000 | | 85963 | Ana Palencia | 1000000 | +------------+----------------+--------------+ 3 rows in set (0.001 sec) MariaDB [reto2]> select * from cliente where nombre like 'A%a'; +------------+--------------+--------------+ | id_cliente | nombre | cupo_credito | +------------+--------------+--------------+ | 85963 | Ana Palencia | 1000000 | +------------+--------------+--------------+ 1 row in set (0.000 sec) MariaDB [reto2]> select * from vendedor where nombre like '%A%'; +-------------+----------------+---------------------+--------+ | id_vendedor | nombre | porcentaje_comision | zona | +-------------+----------------+---------------------+--------+ | 001 | Luis Meza | 0.50 | Norte | | 002 | Camilo Lleras | 0.60 | Centro | | 003 | Sergio Agudelo | 0.30 | Centro | | 004 | Lina Ocampo | 0.50 | Sur | +-------------+----------------+---------------------+--------+ 4 rows in set (0.000 sec) MariaDB [reto2]> select * from cliente order by cupo_credito asc; +------------+----------------+--------------+ | id_cliente | nombre | cupo_credito | +------------+----------------+--------------+ | 50964 | Oscar de Le¢n | 500000 | | 36259 | Shamir Beltr n | 700000 | | 85963 | Ana Palencia | 1000000 | | 25147 | Teresa Su rez | 1200000 | +------------+----------------+--------------+ 4 rows in set (0.000 sec) MariaDB [reto2]> select * from vendedor; +-------------+----------------+---------------------+--------+ | id_vendedor | nombre | porcentaje_comision | zona | +-------------+----------------+---------------------+--------+ | 001 | Luis Meza | 0.50 | Norte | | 002 | Camilo Lleras | 0.60 | Centro | | 003 | Sergio Agudelo | 0.30 | Centro | | 004 | Lina Ocampo | 0.50 | Sur | +-------------+----------------+---------------------+--------+ 4 rows in set (0.000 sec) MariaDB [reto2]> select * from vendedor order by nombre desc; +-------------+----------------+---------------------+--------+ | id_vendedor | nombre | porcentaje_comision | zona | +-------------+----------------+---------------------+--------+ | 003 | Sergio Agudelo | 0.30 | Centro | | 001 | Luis Meza | 0.50 | Norte | | 004 | Lina Ocampo | 0.50 | Sur | | 002 | Camilo Lleras | 0.60 | Centro | +-------------+----------------+---------------------+--------+ 4 rows in set (0.000 sec) MariaDB [reto2]> delete * from cliente where cupo_credito <= 500000; 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 '* from cliente where cupo_credito <= 500000' at line 1 MariaDB [reto2]> delete from cliente where cupo_credito <= 500000; Query OK, 1 row affected (0.004 sec) MariaDB [reto2]> select from cliente; 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 'from cliente' at line 1 MariaDB [reto2]> select * from cliente; +------------+----------------+--------------+ | id_cliente | nombre | cupo_credito | +------------+----------------+--------------+ | 25147 | Teresa Su rez | 1200000 | | 36259 | Shamir Beltr n | 700000 | | 85963 | Ana Palencia | 1000000 | +------------+----------------+--------------+ 3 rows in set (0.000 sec) MariaDB [reto2]> select * from vendedor; +-------------+----------------+---------------------+--------+ | id_vendedor | nombre | porcentaje_comision | zona | +-------------+----------------+---------------------+--------+ | 001 | Luis Meza | 0.50 | Norte | | 002 | Camilo Lleras | 0.60 | Centro | | 003 | Sergio Agudelo | 0.30 | Centro | | 004 | Lina Ocampo | 0.50 | Sur | +-------------+----------------+---------------------+--------+ 4 rows in set (0.000 sec) MariaDB [reto2]> update vendedor set nombre = 'Carlos Usuga' where id_vendedor = '001'; Query OK, 1 row affected (0.002 sec) Rows matched: 1 Changed: 1 Warnings: 0 MariaDB [reto2]> select * from vendedor; +-------------+----------------+---------------------+--------+ | id_vendedor | nombre | porcentaje_comision | zona | +-------------+----------------+---------------------+--------+ | 001 | Carlos Usuga | 0.50 | Norte | | 002 | Camilo Lleras | 0.60 | Centro | | 003 | Sergio Agudelo | 0.30 | Centro | | 004 | Lina Ocampo | 0.50 | Sur | +-------------+----------------+---------------------+--------+ 4 rows in set (0.000 sec) MariaDB [reto2]> mysqldump -B -uroot -p reto2>c:/xampp/reto2copia.sql -> ; 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 'mysqldump -B -uroot -p reto2>c:/xampp/reto2copia.sql' at line 1 MariaDB [reto2]> mysqldump -u root -p reto2>c:/xampp/reto2copia.sql; 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 'mysqldump -u root -p reto2>c:/xampp/reto2copia.sql' at line 1 MariaDB [reto2]> show databases; +--------------------+ | Database | +--------------------+ | bd_biblioteca | | information_schema | | libreria | | mysql | | performance_schema | | phpmyadmin | | reto2 | | sistemaventa | | test | +--------------------+ 9 rows in set (0.001 sec) MariaDB [reto2]> mysqldump -B -uroot -p reto2>c:/xampp/reto2copia.sql; 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 'mysqldump -B -uroot -p reto2>c:/xampp/reto2copia.sql' at line 1 MariaDB [reto2]> exit