Self join in Mysql:

Self join is a method of centralizing relational data to a single table.A self-join joins the table to itself.

Example:

CREATE TABLE employees (
    NAME VARCHAR(20), 
    email VARCHAR(20),
    mobile VARCHAR(20), 
    sex CHAR(1), 
    birth_date DATE, 
);
     
INSERT INTO  employees VALUES ('xyz','xyz@example.com','11212','F','1985-06-05');
INSERT INTO  employees VALUES ('abc','abc@example.com','11111','M','1985-03-05');
INSERT INTO  employees VALUES ('abc1','abc1@example.com','21111','M','1987-03-05');
         
SELECT e1.name, e2.name,e1.email
FROM employees AS e1, employees AS e2
WHERE e1.email = e2.email AND e1.sex = 'F' AND e2.sex = 'M';