Microsoft Windows [Versión 10.0.22621.2215] (c) Microsoft Corporation. Todos los derechos reservados. C:\Users\Harold Martinez>cd/xampp/mysql/bin C:\xampp\mysql\bin>mysql -uroot -p Enter password: Welcome to the MariaDB monitor. Commands end with ; or \g. Your MariaDB connection id is 8 Server version: 10.4.24-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)]> use facturacion; Database changed MariaDB [facturacion]> show tables; +-----------------------+ | Tables_in_facturacion | +-----------------------+ | cliente | | clientetotal | | detallado | | detallefactura | | factura | | producto | +-----------------------+ 6 rows in set (0.006 sec) MariaDB [facturacion]> describe cliente; +-------------+----------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +-------------+----------+------+-----+---------+-------+ | cedula | int(10) | NO | PRI | NULL | | | nombre | char(40) | NO | | NULL | | | direccion | char(30) | NO | | NULL | | | fechainicio | date | NO | | NULL | | +-------------+----------+------+-----+---------+-------+ 4 rows in set (0.007 sec) MariaDB [facturacion]> select * from cliente; +--------+------------------+-----------+-------------+ | cedula | nombre | direccion | fechainicio | +--------+------------------+-----------+-------------+ | 100 | alexandralopez | aranjuez | 2003-12-03 | | 200 | sebastianperez | sabaneta | 2005-07-17 | | 300 | saraherrera | floresta | 2007-09-20 | | 400 | luisaroldan | floresta | 2009-10-15 | | 500 | mariohenao | bello | 2004-02-28 | | 600 | luisacifuentes | florencia | 2003-09-01 | | 700 | edithgarcia | envigado | 2006-03-03 | | 800 | claudialainez | itag | 2005-04-13 | | 900 | vivianpiedrahita | centro | 2006-01-19 | +--------+------------------+-----------+-------------+ 9 rows in set (0.006 sec) MariaDB [facturacion]> select * from clientetotal; +--------+------------------+-----------+-------------+-------------+---------------+-------------+ | cedula | nombre | direccion | fechainicio | nrofacturas | sumaarticulos | totalpagado | +--------+------------------+-----------+-------------+-------------+---------------+-------------+ | 100 | alexandralopez | aranjuez | 2003-12-03 | 0 | 0 | 0 | | 200 | sebastianperez | sabaneta | 2005-07-17 | 0 | 0 | 0 | | 300 | saraherrera | floresta | 2007-09-20 | 0 | 0 | 0 | | 400 | luisaroldan | floresta | 2009-10-15 | 0 | 0 | 0 | | 500 | mariohenao | bello | 2004-02-28 | 0 | 0 | 0 | | 600 | luisacifuentes | florencia | 2003-09-01 | 0 | 0 | 0 | | 700 | edithgarcia | envigado | 2006-03-03 | 0 | 0 | 0 | | 800 | claudialainez | itag | 2005-04-13 | 0 | 0 | 0 | | 900 | vivianpiedrahita | centro | 2006-01-19 | 0 | 0 | 0 | +--------+------------------+-----------+-------------+-------------+---------------+-------------+ 9 rows in set (0.003 sec) MariaDB [facturacion]> select * from factura; +------------+--------+----------+-----+-----------+-------+ | nrofactura | cedula | subtotal | iva | retencion | total | +------------+--------+----------+-----+-----------+-------+ | 1001 | 100 | 1813500 | 0 | 0 | 0 | | 1101 | 600 | 588510 | 0 | 0 | 0 | | 2002 | 300 | 475020 | 0 | 0 | 0 | | 2202 | 700 | 351000 | 0 | 0 | 0 | | 3003 | 200 | 444600 | 0 | 0 | 0 | | 3303 | 600 | 475020 | 0 | 0 | 0 | | 4004 | 400 | 3905460 | 0 | 0 | 0 | | 4404 | 100 | 470340 | 0 | 0 | 0 | | 5005 | 200 | 4387500 | 0 | 0 | 0 | | 5505 | 700 | 374400 | 0 | 0 | 0 | | 6006 | 500 | 1150110 | 0 | 0 | 0 | | 6606 | 800 | 1345500 | 0 | 0 | 0 | | 7007 | 100 | 1776060 | 0 | 0 | 0 | | 7707 | 900 | 1491750 | 0 | 0 | 0 | | 8008 | 400 | 685620 | 0 | 0 | 0 | | 8808 | 800 | 58500 | 0 | 0 | 0 | | 9009 | 400 | 397800 | 0 | 0 | 0 | | 9909 | 900 | 965250 | 0 | 0 | 0 | +------------+--------+----------+-----+-----------+-------+ 18 rows in set (0.002 sec) MariaDB [facturacion]> select * from producto; +--------+-------------+---------------+----------+------------+------------+ | codigo | articulo | valorunitario | cantidad | valorventa | existencia | +--------+-------------+---------------+----------+------------+------------+ | 10 | tv | 1250000 | 22 | 1462500 | 0 | | 11 | computador | 900000 | 15 | 0 | 0 | | 12 | Ipad Air | 3000000 | 23 | 0 | 0 | | 20 | auricules | 75000 | 27 | 87750 | 0 | | 30 | mp3 | 150000 | 24 | 175500 | 0 | | 40 | mouse | 25000 | 33 | 29250 | 0 | | 50 | taclado | 130000 | 45 | 152100 | 0 | | 60 | discoduro | 203000 | 17 | 237510 | 0 | | 70 | unidaddvd | 250000 | 19 | 292500 | 0 | | 80 | usb | 80000 | 28 | 93600 | 0 | | 90 | lapizoptico | 134000 | 17 | 156780 | 0 | +--------+-------------+---------------+----------+------------+------------+ 11 rows in set (0.007 sec) MariaDB [facturacion]> Select articulo,if(cantidad>20, ‘Bastantes’,’Pocos’) Cantidad_de_articulos from producto; +-------------+-----------------------+ | articulo | Cantidad_de_articulos | +-------------+-----------------------+ | tv | Bastantes | | computador | Pocos | | Ipad Air | Bastantes | | auricules | Bastantes | | mp3 | Bastantes | | mouse | Bastantes | | taclado | Bastantes | | discoduro | Pocos | | unidaddvd | Pocos | | usb | Bastantes | | lapizoptico | Pocos | +-------------+-----------------------+ 11 rows in set (0.000 sec) MariaDB [facturacion]> Select nombre,if(fechainicio<’2005-01-01’, ‘Cliente Antiguo’,’Cliente nuevo’) Tiempo_de_clientes from cliente; +------------------+--------------------+ | nombre | Tiempo_de_clientes | +------------------+--------------------+ | alexandralopez | Cliente Antiguo | | sebastianperez | Cliente nuevo | | saraherrera | Cliente nuevo | | luisaroldan | Cliente nuevo | | mariohenao | Cliente Antiguo | | luisacifuentes | Cliente Antiguo | | edithgarcia | Cliente nuevo | | claudialainez | Cliente nuevo | | vivianpiedrahita | Cliente nuevo | +------------------+--------------------+ 9 rows in set (0.001 sec) MariaDB [facturacion]> select nombre, fechainicio, case when(monthname(fechainicio) in ('January','February','March','April')) then '1º cuatrimestre' when (monthname(fechainicio) in ('May','June','July','August'))then '2º cuatrimestre' else '3º cuatrimestre' end as 'mes' from cliente; +------------------+-------------+-----------------+ | nombre | fechainicio | mes | +------------------+-------------+-----------------+ | alexandralopez | 2003-12-03 | 3º cuatrimestre | | sebastianperez | 2005-07-17 | 2º cuatrimestre | | saraherrera | 2007-09-20 | 3º cuatrimestre | | luisaroldan | 2009-10-15 | 3º cuatrimestre | | mariohenao | 2004-02-28 | 1º cuatrimestre | | luisacifuentes | 2003-09-01 | 3º cuatrimestre | | edithgarcia | 2006-03-03 | 1º cuatrimestre | | claudialainez | 2005-04-13 | 1º cuatrimestre | | vivianpiedrahita | 2006-01-19 | 1º cuatrimestre | +------------------+-------------+-----------------+ 9 rows in set (0.001 sec) MariaDB [facturacion]> exit Bye C:\xampp\mysql\bin>mysqldump -B -uroot --routines facturacion>c:/xampp/facturacion.sql C:\xampp\mysql\bin>