2 rows in set (0.05 sec) mysql> select count(*)from ejercicio where sexo='mujer' and nombre like '%a'; +----------+ | count(*) | +----------+ | 2 | +----------+ 1 row in set (0.05 sec) mysql> select count(*)from ejercicio where year(nacimiento) between '1960' and ' 1969; '> \c '> ; '> ñukasfgjdas;; '> zfñjklgbñzsdflnkv;;;; '> (); '> \c '> /c '> select count(*)from ejercicio where year(nacimiento) between '1960' and ' 1969;; ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '1960' and '1969' at line 1 ERROR: No query specified mysql> select count(*)from ejercicio where year(nacimiento) between '1960' and ' 1969'; +----------+ | count(*) | +----------+ | 2 | +----------+ 1 row in set (0.03 sec) mysql> select * from ejercicio where year(current_date()) - year(nacimiento) bet ween '28' and '33'; +------------+-------------------+--------+------------+-------+ | codigo | nombre | sexo | nacimiento | hijos | +------------+-------------------+--------+------------+-------+ | 0028957446 | juan carlos serpa | hombre | 1982-11-25 | 2 | | 0822559966 | mariana gonzales | mujer | 1982-03-24 | 1 | | 9999957446 | carlota sonora | mujer | 1985-11-03 | 4 | +------------+-------------------+--------+------------+-------+ 3 rows in set (0.01 sec) mysql> select sum(hijos) from ejercicio; +------------+ | sum(hijos) | +------------+ | 18 | +------------+ 1 row in set (0.02 sec) mysql> select hijos,count(*) from ejercico group by hijos; ERROR 1146 (42S02): Table 'fechas.ejercico' doesn't exist mysql> select hijos,count (*) from ejercico group by hijos; ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '*) fr om ejercico group by hijos' at line 1 mysql> select hijos,count(*) from ejercicio group by hijos; +-------+----------+ | hijos | count(*) | +-------+----------+ | 0 | 1 | | 1 | 2 | | 2 | 3 | | 4 | 1 | | 6 | 1 | +-------+----------+ 5 rows in set (0.03 sec) mysql> select count(*)from ejercicio where year(current_date) -year(nacimiento) <=28 and sexo='mujer'; +----------+ | count(*) | +----------+ | 0 | +----------+ 1 row in set (0.00 sec) mysql> select count(*)from ejercicio where year(current_date) -year(nacimiento) <=32 and sexo='mujer'; +----------+ | count(*) | +----------+ | 1 | +----------+ 1 row in set (0.00 sec) mysql> create view ejercicio as select * from ejercicio where nombre like '%a'; ERROR 1050 (42S01): Table 'ejercicio' already exists mysql> create view ejercicio as select * from ejercicio where nombre like '%a'; ERROR 1050 (42S01): Table 'ejercicio' already exists mysql> show tables; +------------------+ | Tables_in_fechas | +------------------+ | ejercicio | +------------------+ 1 row in set (0.00 sec) mysql> create view ejercicios as select * from ejercicio where nombre like '%a'; Query OK, 0 rows affected (0.08 sec) mysql> show tables; +------------------+ | Tables_in_fechas | +------------------+ | ejercicio | | ejercicios | +------------------+ 2 rows in set (0.00 sec) mysql> descreibe ejercicios; ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'descr eibe ejercicios' at line 1 mysql> describe ejercicios; +------------+----------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +------------+----------+------+-----+---------+-------+ | codigo | char(10) | NO | | NULL | | | nombre | char(30) | YES | | NULL | | | sexo | char(10) | YES | | NULL | | | nacimiento | date | YES | | NULL | | | hijos | char(2) | YES | | NULL | | +------------+----------+------+-----+---------+-------+ 5 rows in set (0.08 sec) mysql> select * from ejercicios; +------------+-------------------+--------+------------+-------+ | codigo | nombre | sexo | nacimiento | hijos | +------------+-------------------+--------+------------+-------+ | 0028957446 | juan carlos serpa | hombre | 1982-11-25 | 2 | | 1188996633 | yoreida maria | mujer | 0000-00-00 | 2 | | 9999957446 | carlota sonora | mujer | 1985-11-03 | 4 | +------------+-------------------+--------+------------+-------+ 3 rows in set (0.02 sec) mysql> create view ejerciciosexo as select * fom ejercicio where sexo= 'hombre'; ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'fom e jercicio where sexo= 'hombre'' at line 1 mysql> create view ejerciciosexo as select * from ejercicio where sexo= 'hombre' ; Query OK, 0 rows affected (0.09 sec) mysql> select * from ejerciciosexo; +------------+-------------------+--------+------------+-------+ | codigo | nombre | sexo | nacimiento | hijos | +------------+-------------------+--------+------------+-------+ | 0022559966 | eder pulgar | hombre | 1960-02-20 | 6 | | 0028957446 | juan carlos serpa | hombre | 1982-11-25 | 2 | | 22663355 | angel cuadrado | hombre | 1966-05-13 | 0 | | 4488663322 | jorge fuentes | hombre | 1980-06-22 | 2 | +------------+-------------------+--------+------------+-------+ 4 rows in set (0.00 sec) mysql> create view ejerciciosexo as select * from ejercicio where sexo= 'mujer'; ERROR 1050 (42S01): Table 'ejerciciosexo' already exists mysql> create view ejerciciosexos as select * from ejercicio where sexo= 'mujer' ; Query OK, 0 rows affected (0.05 sec) mysql> select * from ejerciciosexos; +------------+-------------------+-------+------------+-------+ | codigo | nombre | sexo | nacimiento | hijos | +------------+-------------------+-------+------------+-------+ | 0822559966 | mariana gonzales | mujer | 1982-03-24 | 1 | | 1188996633 | yoreida maria | mujer | 0000-00-00 | 2 | | 556959966 | angela ruiz | mujer | 1977-11-15 | 1 | | 9999957446 | carlota sonora | mujer | 1985-11-03 | 4 | +------------+-------------------+-------+------------+-------+ 4 rows in set (0.00 sec) mysql> insert into ejercicio(codigo,nombre,sexo,nacimiento,hijos) values('800512 9','Alberto Lechona','hombre','1970-03-22','1'); Query OK, 1 row affected (0.03 sec) mysql> show table ejercicio; ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'ejerc icio' at line 1 mysql> describe table ejercicio; ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'table ejercicio' at line 1 mysql> describe ejercicio; +------------+----------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +------------+----------+------+-----+---------+-------+ | codigo | char(10) | NO | PRI | NULL | | | nombre | char(30) | YES | | NULL | | | sexo | char(10) | YES | | NULL | | | nacimiento | date | YES | | NULL | | | hijos | char(2) | YES | | NULL | | +------------+----------+------+-----+---------+-------+ 5 rows in set (0.00 sec) mysql> describe ejercicios; +------------+----------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +------------+----------+------+-----+---------+-------+ | codigo | char(10) | NO | | NULL | | | nombre | char(30) | YES | | NULL | | | sexo | char(10) | YES | | NULL | | | nacimiento | date | YES | | NULL | | | hijos | char(2) | YES | | NULL | | +------------+----------+------+-----+---------+-------+ 5 rows in set (0.01 sec) mysql> describe ejerciciosexo; +------------+----------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +------------+----------+------+-----+---------+-------+ | codigo | char(10) | NO | | NULL | | | nombre | char(30) | YES | | NULL | | | sexo | char(10) | YES | | NULL | | | nacimiento | date | YES | | NULL | | | hijos | char(2) | YES | | NULL | | +------------+----------+------+-----+---------+-------+ 5 rows in set (0.02 sec) mysql> describe ejerciciosexos; +------------+----------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +------------+----------+------+-----+---------+-------+ | codigo | char(10) | NO | | NULL | | | nombre | char(30) | YES | | NULL | | | sexo | char(10) | YES | | NULL | | | nacimiento | date | YES | | NULL | | | hijos | char(2) | YES | | NULL | | +------------+----------+------+-----+---------+-------+ 5 rows in set (0.00 sec) mysql> select * from ejerciciosexos; +------------+-------------------+-------+------------+-------+ | codigo | nombre | sexo | nacimiento | hijos | +------------+-------------------+-------+------------+-------+ | 0822559966 | mariana gonzales | mujer | 1982-03-24 | 1 | | 1188996633 | yoreida maria | mujer | 0000-00-00 | 2 | | 556959966 | angela ruiz | mujer | 1977-11-15 | 1 | | 9999957446 | carlota sonora | mujer | 1985-11-03 | 4 | +------------+-------------------+-------+------------+-------+ 4 rows in set (0.00 sec) mysql> select * from ejerciciosexo; +------------+-------------------+--------+------------+-------+ | codigo | nombre | sexo | nacimiento | hijos | +------------+-------------------+--------+------------+-------+ | 0022559966 | eder pulgar | hombre | 1960-02-20 | 6 | | 0028957446 | juan carlos serpa | hombre | 1982-11-25 | 2 | | 22663355 | angel cuadrado | hombre | 1966-05-13 | 0 | | 4488663322 | jorge fuentes | hombre | 1980-06-22 | 2 | | 8005129 | Alberto Lechona | hombre | 1970-03-22 | 1 | +------------+-------------------+--------+------------+-------+ 5 rows in set (0.00 sec) mysql> select * from ejercicios; +------------+-------------------+--------+------------+-------+ | codigo | nombre | sexo | nacimiento | hijos | +------------+-------------------+--------+------------+-------+ | 0028957446 | juan carlos serpa | hombre | 1982-11-25 | 2 | | 1188996633 | yoreida maria | mujer | 0000-00-00 | 2 | | 8005129 | Alberto Lechona | hombre | 1970-03-22 | 1 | | 9999957446 | carlota sonora | mujer | 1985-11-03 | 4 | +------------+-------------------+--------+------------+-------+ 4 rows in set (0.00 sec) mysql> select * from ejercicio; +------------+-------------------+--------+------------+-------+ | codigo | nombre | sexo | nacimiento | hijos | +------------+-------------------+--------+------------+-------+ | 0022559966 | eder pulgar | hombre | 1960-02-20 | 6 | | 0028957446 | juan carlos serpa | hombre | 1982-11-25 | 2 | | 0822559966 | mariana gonzales | mujer | 1982-03-24 | 1 | | 1188996633 | yoreida maria | mujer | 0000-00-00 | 2 | | 22663355 | angel cuadrado | hombre | 1966-05-13 | 0 | | 4488663322 | jorge fuentes | hombre | 1980-06-22 | 2 | | 556959966 | angela ruiz | mujer | 1977-11-15 | 1 | | 8005129 | Alberto Lechona | hombre | 1970-03-22 | 1 | | 9999957446 | carlota sonora | mujer | 1985-11-03 | 4 | +------------+-------------------+--------+------------+-------+ 9 rows in set (0.00 sec) mysql> drop view ejerciciosexos; Query OK, 0 rows affected (0.00 sec) mysql> exit Bye C:\xampp\mysql\bin>mysqldump -B -uroot -p fechas>d:/fechas.sql Enter password: C:\xampp\mysql\bin>