Download as pdf or txt
Download as pdf or txt
You are on page 1of 12

| mysql |

| performance_schema |
| phpmyadmin |
+--------------------+
4 rows in set (0.02 sec)

MariaDB [(none)]> information_schema


-> <information_schema>
-> use information_schema;
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 'information_schema
<information_schema>
use information_schema' at line 1
MariaDB [(none)]> use information_schema;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
MariaDB [information_schema]> show tables;
+---------------------------------------+
| Tables_in_information_schema |
+---------------------------------------+
| ALL_PLUGINS |
| APPLICABLE_ROLES |
| CHARACTER_SETS |
| COLLATIONS |
| COLLATION_CHARACTER_SET_APPLICABILITY |
| COLUMNS |
| COLUMN_PRIVILEGES |
| ENABLED_ROLES |
| ENGINES |
| EVENTS |
| FILES |
| GLOBAL_STATUS |
| GLOBAL_VARIABLES |
| KEY_CACHES |
| KEY_COLUMN_USAGE |
| PARAMETERS |
| PARTITIONS |
| PLUGINS |
| PROCESSLIST |
| PROFILING |
| REFERENTIAL_CONSTRAINTS |
| ROUTINES |
| SCHEMATA |
| SCHEMA_PRIVILEGES |
| SESSION_STATUS |
| SESSION_VARIABLES |
| STATISTICS |
| SYSTEM_VARIABLES |
| TABLES |
| TABLESPACES |
| TABLE_CONSTRAINTS |
| TABLE_PRIVILEGES |
| TRIGGERS |
| USER_PRIVILEGES |
| VIEWS |
| GEOMETRY_COLUMNS |
| SPATIAL_REF_SYS |
| CLIENT_STATISTICS |
| INDEX_STATISTICS |
| INNODB_SYS_DATAFILES |
| TABLE_STATISTICS |
| INNODB_SYS_TABLESTATS |
| USER_STATISTICS |
| INNODB_SYS_INDEXES |
| XTRADB_RSEG |
| INNODB_CMP_PER_INDEX |
| INNODB_TRX |
| CHANGED_PAGE_BITMAPS |
| INNODB_FT_BEING_DELETED |
| INNODB_LOCK_WAITS |
| INNODB_LOCKS |
| INNODB_TABLESPACES_ENCRYPTION |
| XTRADB_INTERNAL_HASH_TABLES |
| INNODB_SYS_FIELDS |
| INNODB_CMPMEM_RESET |
| INNODB_CMP |
| INNODB_FT_INDEX_TABLE |
| INNODB_SYS_TABLESPACES |
| INNODB_MUTEXES |
| INNODB_BUFFER_PAGE_LRU |
| INNODB_SYS_FOREIGN_COLS |
| INNODB_CMP_RESET |
| INNODB_BUFFER_POOL_STATS |
| INNODB_FT_INDEX_CACHE |
| INNODB_SYS_FOREIGN |
| INNODB_METRICS |
| INNODB_FT_DEFAULT_STOPWORD |
| INNODB_CMPMEM |
| INNODB_SYS_TABLES |
| INNODB_SYS_COLUMNS |
| INNODB_FT_CONFIG |
| INNODB_BUFFER_PAGE |
| INNODB_CMP_PER_INDEX_RESET |
| XTRADB_READ_VIEW |
| INNODB_SYS_SEMAPHORE_WAITS |
| INNODB_CHANGED_PAGES |
| INNODB_FT_DELETED |
| INNODB_TABLESPACES_SCRUBBING |
+---------------------------------------+
78 rows in set (0.00 sec)

MariaDB [information_schema]> select * ft_deleted


-> select * ft_dleted;
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 'ft_deleted
select * ft_dleted' at line 1
MariaDB [information_schema]> select * engines
-> select * engines;
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 'engines
select * engines' at line 1
MariaDB [information_schema]> select * from engines
-> select * from engines;
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 'select * from engines' at line 2
MariaDB [information_schema]> select * from engines;
+--------------------+---------+--------------------------------------
------------------------------------------------------------+---------
-----+------+------------+
| ENGINE | SUPPORT | COMMENT
| TRANSACTIONS | XA | SAVEPOINTS |
+--------------------+---------+--------------------------------------
------------------------------------------------------------+---------
-----+------+------------+
| MRG_MyISAM | YES | Collection of identical MyISAM tables
| NO | NO | NO |
| CSV | YES | Stores tables as CSV files
| NO | NO | NO |
| MEMORY | YES | Hash based, stored in memory, useful
for temporary tables | NO
| NO | NO |
| MyISAM | YES | Non-transactional engine with good
performance and small data footprint | NO
| NO | NO |
| SEQUENCE | YES | Generated tables filled with
sequential values |
YES | NO | YES |
| Aria | YES | Crash-safe tables with MyISAM
heritage |
NO | NO | NO |
| PERFORMANCE_SCHEMA | YES | Performance Schema
| NO | NO | NO |
| InnoDB | DEFAULT | Percona-XtraDB, Supports
transactions, row-level locking, foreign keys and encryption for
tables | YES | YES | YES |
+--------------------+---------+--------------------------------------
------------------------------------------------------------+---------
-----+------+------------+
8 rows in set (0.00 sec)

MariaDB [information_schema]> create database tiendas;


Query OK, 1 row affected (0.02 sec)

MariaDB [information_schema]> use tiendas;


Database changed
MariaDB [tiendas]> create table mascotas (nomMasc,
Especie,sexoMasc,FecNac,FecMue
-> create table MASCOTAS (NomMasc, Especie, SexoMasc, FecNac,
FecMue);
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 ' Especie,sexoMasc,FecNac,FecMue
create table MASCOTAS (NomMasc, Especie, SexoMas' at line 1
MariaDB [tiendas]> crate table MASCOTAS (nommasc char (20), especie
char (20), sexomasc char (1),fecnac (date), fecmue (date));
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 'crate table MASCOTAS (nommasc char (20), especie
char (20), sexomasc char (1),fe' at line 1
MariaDB [tiendas]> create table mascotas (nomMasc,
Especie,sexoMasc,FecNac,FecMue create table MASCOTAS (NomMasc,
Especie, SexoMasc, FecNac, FecMue);
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 ' Especie,sexoMasc,FecNac,FecMue create table
MASCOTAS (NomMasc, Especie, SexoMas' at line 1
MariaDB [tiendas]>
MariaDB [tiendas]>
MariaDB [tiendas]>
MariaDB [tiendas]>
MariaDB [tiendas]>
MariaDB [tiendas]> create table MASCOTA (NomMasc char(20),Especie
char(20),SexoMasc char(1), FecNac (date),FecMue (date));
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 '(date),FecMue (date))' at line 1
MariaDB [tiendas]> create table MASCOTA (NomMasc char(20),Especie
char(20),SexoMasc char(1), FecNac (date),FecMue (date));
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 '(date),FecMue (date))' at line 1
MariaDB [tiendas]> create table MASCOTAS (NomMasc char (20),Espacie
char (20), SexoMasc char (1), FecNac (date), FecMue (date));
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 '(date), FecMue (date))' at line 1
MariaDB [tiendas]> create table mascotas (NomMasc char (20), Especie
char(20),SexoMasc char (1), FecNac date, FecMue date);
Query OK, 0 rows affected (0.16 sec)

MariaDB [tiendas]> create table MASCOTAS (NomMasc char(20),Especie


char(20),SexoMasc char(1),FecNac date,FecMue date);
Query OK, 0 rows affected (0.10 sec)

MariaDB [tiendas]> show tables


-> show tables;
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 'show tables' at line 2
MariaDB [tiendas]> show tables;
+-------------------+
| Tables_in_tiendas |
+-------------------+
| MASCOTAS |
| mascotas |
+-------------------+
2 rows in set (0.00 sec)

MariaDB [tiendas]> describe MASCOTAS;


+----------+----------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+----------+----------+------+-----+---------+-------+
| NomMasc | char(20) | YES | | NULL | |
| Especie | char(20) | YES | | NULL | |
| SexoMasc | char(1) | YES | | NULL | |
| FecNac | date | YES | | NULL | |
| FecMue | date | YES | | NULL | |
+----------+----------+------+-----+---------+-------+
5 rows in set (0.01 sec)

MariaDB [tiendas]> decribe mascotas


-> descibe mascotas;
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 'decribe mascotas
descibe mascotas' at line 1
MariaDB [tiendas]> describe mascotas
-> ;
+----------+----------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+----------+----------+------+-----+---------+-------+
| NomMasc | char(20) | YES | | NULL | |
| Especie | char(20) | YES | | NULL | |
| SexoMasc | char(1) | YES | | NULL | |
| FecNac | date | YES | | NULL | |
| FecMue | date | YES | | NULL | |
+----------+----------+------+-----+---------+-------+
5 rows in set (0.00 sec)

MariaDB [tiendas]> drop database MASCOTAS;


ERROR 1008 (HY000): Can't drop database 'MASCOTAS'; database doesn't
exist
MariaDB [tiendas]> describe mascotas
-> ;
+----------+----------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+----------+----------+------+-----+---------+-------+
| NomMasc | char(20) | YES | | NULL | |
| Especie | char(20) | YES | | NULL | |
| SexoMasc | char(1) | YES | | NULL | |
| FecNac | date | YES | | NULL | |
| FecMue | date | YES | | NULL | |
+----------+----------+------+-----+---------+-------+
5 rows in set (0.01 sec)

MariaDB [tiendas]> describe mascotas


-> ;
+----------+----------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+----------+----------+------+-----+---------+-------+
| NomMasc | char(20) | YES | | NULL | |
| Especie | char(20) | YES | | NULL | |
| SexoMasc | char(1) | YES | | NULL | |
| FecNac | date | YES | | NULL | |
| FecMue | date | YES | | NULL | |
+----------+----------+------+-----+---------+-------+
5 rows in set (0.01 sec)
MariaDB [tiendas]> deswcribe MASCOTAS;
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 'deswcribe MASCOTAS' at line 1
MariaDB [tiendas]> describe MASCOTAS;
+----------+----------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+----------+----------+------+-----+---------+-------+
| NomMasc | char(20) | YES | | NULL | |
| Especie | char(20) | YES | | NULL | |
| SexoMasc | char(1) | YES | | NULL | |
| FecNac | date | YES | | NULL | |
| FecMue | date | YES | | NULL | |
+----------+----------+------+-----+---------+-------+
5 rows in set (0.01 sec)

MariaDB [tiendas]> drop database (MASCOTAS);


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 '(MASCOTAS)' at line 1
MariaDB [tiendas]> drop database MASCOTASBD;
ERROR 1008 (HY000): Can't drop database 'MASCOTASBD'; database doesn't
exist
MariaDB [tiendas]> drop database < MASCOTASB<
-> ;
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 '< MASCOTASB<' at line 1
MariaDB [tiendas]> drop database MASCOTAS;
ERROR 1008 (HY000): Can't drop database 'MASCOTAS'; database doesn't
exist
MariaDB [tiendas]> drop table MASCOTAS;
Query OK, 0 rows affected (0.11 sec)

MariaDB [tiendas]> show tables;


+-------------------+
| Tables_in_tiendas |
+-------------------+
| mascotas |
+-------------------+
1 row in set (0.00 sec)

MariaDB [tiendas]> insert into mascotas values


("Fluffy","gato","f","1993-02-04",NULL);
Query OK, 1 row affected (0.03 sec)

MariaDB [tiendas]> ("Claws","gato","m","1994-03-17",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 '"Claws","gato","m","1994-03-17",NULL)' at line 1
MariaDB [tiendas]> insert into mascotas values
("Claws","gato","m","1994-03-17",NULL);
Query OK, 1 row affected (0.02 sec)

MariaDB [tiendas]> insert into mascotas values


("Buffy","perro","f","1989-05-13",NULL);
Query OK, 1 row affected (0.02 sec)
MariaDB [tiendas]> select * from mascotas;
+---------+---------+----------+------------+--------+
| NomMasc | Especie | SexoMasc | FecNac | FecMue |
+---------+---------+----------+------------+--------+
| Fluffy | gato | f | 1993-02-04 | NULL |
| Claws | gato | m | 1994-03-17 | NULL |
| Buffy | perro | f | 1989-05-13 | NULL |
+---------+---------+----------+------------+--------+
3 rows in set (0.00 sec)

MariaDB [tiendas]> insert into mascotas values


("Bowser","perro","m","1989-08-31,"1995-07-29");
"> ;
"> insert into mascotas values ("Bowser","perro","m","1989-08-
31","1995-07-29");
"> insert into mascotas values ("Bowser","perro","m","1989-08-
31","1995-07-29");
"> "
-> ;
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 '1995-07-29");
;
insert into mascotas values ("Bowser","perro","m","1989-08-31","' at
line 1
MariaDB [tiendas]> select * from mascotas
-> ;
+---------+---------+----------+------------+--------+
| NomMasc | Especie | SexoMasc | FecNac | FecMue |
+---------+---------+----------+------------+--------+
| Fluffy | gato | f | 1993-02-04 | NULL |
| Claws | gato | m | 1994-03-17 | NULL |
| Buffy | perro | f | 1989-05-13 | NULL |
+---------+---------+----------+------------+--------+
3 rows in set (0.00 sec)

MariaDB [tiendas]> insert into mascotas values


("Bowser","perro","m","1989-08-31","1995-07-29");
Query OK, 1 row affected (0.01 sec)

MariaDB [tiendas]> select * from mascotas


-> ;
+---------+---------+----------+------------+------------+
| NomMasc | Especie | SexoMasc | FecNac | FecMue |
+---------+---------+----------+------------+------------+
| Fluffy | gato | f | 1993-02-04 | NULL |
| Claws | gato | m | 1994-03-17 | NULL |
| Buffy | perro | f | 1989-05-13 | NULL |
| Bowser | perro | m | 1989-08-31 | 1995-07-29 |
+---------+---------+----------+------------+------------+
4 rows in set (0.00 sec)

MariaDB [tiendas]> insert into mascotas values


("Slim","ave","f","1996-04-29","NULL);
"> insert into mascotas values ("Slim","ave","f","1996-04-
29",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 'Slim","ave","f","1996-04-29",NULL);

"' at line 1
MariaDB [tiendas]> select * from mascotas
-> ;
+---------+---------+----------+------------+------------+
| NomMasc | Especie | SexoMasc | FecNac | FecMue |
+---------+---------+----------+------------+------------+
| Fluffy | gato | f | 1993-02-04 | NULL |
| Claws | gato | m | 1994-03-17 | NULL |
| Buffy | perro | f | 1989-05-13 | NULL |
| Bowser | perro | m | 1989-08-31 | 1995-07-29 |
+---------+---------+----------+------------+------------+
4 rows in set (0.00 sec)

MariaDB [tiendas]> insert into mascotas values


("Slim","ave","f","1996-04-29",NULL);
Query OK, 1 row affected (0.02 sec)

MariaDB [tiendas]> insert into mascotas values


("Chirpy",2perro","f","2000-05-03","2001-03-28");
"> insert into mascotas values ("Chirpy","perro","f","2000-05-
03","2001-03-28");
"> ;
"> insert into mascotas values ("Chirpy","perro","f","2000-05-
03","2001-03-28");
"> insert into mascotas values ("Chirpy","perro","f","2000-05-
03","2001-03-28");
">
"> select * from mascotas
"> ";
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 '","f","2000-05-03","2001-03-28");
insert into mascotas values ("Chirpy","perro",' at line 1
MariaDB [tiendas]> insert into mascotas values
("Chirpy","perro","f","2000-05-03","2001-03-28");
Query OK, 1 row affected (0.02 sec)

MariaDB [tiendas]> select * from mascotas


-> ;
+---------+---------+----------+------------+------------+
| NomMasc | Especie | SexoMasc | FecNac | FecMue |
+---------+---------+----------+------------+------------+
| Fluffy | gato | f | 1993-02-04 | NULL |
| Claws | gato | m | 1994-03-17 | NULL |
| Buffy | perro | f | 1989-05-13 | NULL |
| Bowser | perro | m | 1989-08-31 | 1995-07-29 |
| Slim | ave | f | 1996-04-29 | NULL |
| Chirpy | perro | f | 2000-05-03 | 2001-03-28 |
+---------+---------+----------+------------+------------+
6 rows in set (0.00 sec)
MariaDB [tiendas]> select * from mascotas where NomMasc="bowser";
+---------+---------+----------+------------+------------+
| NomMasc | Especie | SexoMasc | FecNac | FecMue |
+---------+---------+----------+------------+------------+
| Bowser | perro | m | 1989-08-31 | 1995-07-29 |
+---------+---------+----------+------------+------------+
1 row in set (0.00 sec)

MariaDB [tiendas]> select * from mascotas where FecNac>"1994-01-01";


+---------+---------+----------+------------+------------+
| NomMasc | Especie | SexoMasc | FecNac | FecMue |
+---------+---------+----------+------------+------------+
| Claws | gato | m | 1994-03-17 | NULL |
| Slim | ave | f | 1996-04-29 | NULL |
| Chirpy | perro | f | 2000-05-03 | 2001-03-28 |
+---------+---------+----------+------------+------------+
3 rows in set (0.00 sec)

MariaDB [tiendas]> select * from mascotas where SexoMasc="f" and


especie="perro";
+---------+---------+----------+------------+------------+
| NomMasc | Especie | SexoMasc | FecNac | FecMue |
+---------+---------+----------+------------+------------+
| Buffy | perro | f | 1989-05-13 | NULL |
| Chirpy | perro | f | 2000-05-03 | 2001-03-28 |
+---------+---------+----------+------------+------------+
2 rows in set (0.00 sec)

MariaDB [tiendas]> select


-> ;
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 '' at line 1
MariaDB [tiendas]> select * from mascotas where especie="gato" and
SexoMasc="f";
+---------+---------+----------+------------+--------+
| NomMasc | Especie | SexoMasc | FecNac | FecMue |
+---------+---------+----------+------------+--------+
| Fluffy | gato | f | 1993-02-04 | NULL |
+---------+---------+----------+------------+--------+
1 row in set (0.00 sec)

MariaDB [tiendas]> select distinct NomMasc;


ERROR 1054 (42S22): Unknown column 'NomMasc' in 'field list'
MariaDB [tiendas]> select distinct NomMac from mascotas;
ERROR 1054 (42S22): Unknown column 'NomMac' in 'field list'
MariaDB [tiendas]> select distinct NomMasc from mascotas;
+---------+
| NomMasc |
+---------+
| Fluffy |
| Claws |
| Buffy |
| Bowser |
| Slim |
| Chirpy |
+---------+
6 rows in set (0.00 sec)
MariaDB [tiendas]> select NomMasc,FecNac from mascotas;
+---------+------------+
| NomMasc | FecNac |
+---------+------------+
| Fluffy | 1993-02-04 |
| Claws | 1994-03-17 |
| Buffy | 1989-05-13 |
| Bowser | 1989-08-31 |
| Slim | 1996-04-29 |
| Chirpy | 2000-05-03 |
+---------+------------+
6 rows in set (0.00 sec)

MariaDB [tiendas]> select NomMasc,FecNac from mascotas order by


NomMasc,FecNac ACS;
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 'ACS' at line 1
MariaDB [tiendas]> select NomMasc, FecNac from mascotas order by
NomMasc,FecNac ASC;
+---------+------------+
| NomMasc | FecNac |
+---------+------------+
| Bowser | 1989-08-31 |
| Buffy | 1989-05-13 |
| Chirpy | 2000-05-03 |
| Claws | 1994-03-17 |
| Fluffy | 1993-02-04 |
| Slim | 1996-04-29
MariaDB [tiendas]> select * from mascotas where month (FecNac)=8;
+---------+---------+----------+------------+------------+
| NomMasc | Especie | SexoMasc | FecNac | FecMue |
+---------+---------+----------+------------+------------+
| Bowser | perro | m | 1989-08-31 | 1995-07-29 |
+---------+---------+----------+------------+------------+
MariaDB [tiendas]> select NomMasc from mascotas where NomMasc
like"B%";
+---------+
| NomMasc |
+---------+
| Buffy |
| Bowser |
+---------+
2 rows in set (0.00 sec)

MariaDB [tiendas]> select NomMasc from mascotas where NomMasc


like"%B";
Empty set (0.00 sec)

MariaDB [tiendas]> select NomMasc from mascotas where NomMasc


like"%Y";
+---------+
| NomMasc |
+---------+
| Fluffy |
| Buffy |
| Chirpy |
+---------+
3 rows in set (0.00 sec)

MariaDB [tiendas]> select NomMasc from mascotas where NomMasc


like"%W%";
+---------+
| NomMasc |
+---------+
| Claws |
| Bowser |
+---------+
2 rows in set (0.00 sec)
MariaDB [tiendas]> select count(*) from mascotas;
+----------+
| count(*) |
+----------+
| 6 |
+----------+
1 row in set (0.03 sec)

MariaDB [tiendas]> select count(*) as cantidad from mascotas;


+----------+
| cantidad |
+----------+
| 6 |
+----------+
1 row in set (0.00 sec)
MariaDB [tiendas]> select count(*) from mascotas where
especie="perro";
+----------+
| count(*) |
+----------+
| 3 |
+----------+
1 row in set (0.00 sec)

MariaDB [tiendas]> select count(*) from mascotas group by especie;


+----------+
| count(*) |
+----------+
| 1 |
| 2 |
| 3 |
+----------+
3 rows in set (0.00 sec)

MariaDB [tiendas]> select especie, count(*) from mascotas group by


especie;
+---------+----------+
| especie | count(*) |
+---------+----------+
| ave | 1 |
| gato | 2 |
| perro | 3 |
+---------+----------+
3 rows in set (0.00 sec)
MariaDB [tiendas]> select especie, count(*) cantidad from mascotas
group by especie having cantidad>=2;
+---------+----------+
| especie | cantidad |
+---------+----------+
| gato | 2 |
| perro | 3 |
+---------+----------+
2 rows in set (0.00 sec)

You might also like