In addition to the answer from Sathya, there are a couple of things wrong with your query.
You need to insert some data like this:
Insert into employees (Employee, Name, Email)
Values (1, 'joebloggs','joebloggs@somewhere.com');
I don't think your query will work anyway as you need to concatenate some %
signs in there too, this query does work
Select Employee
From Employees
Where email like '%' || name || '%';
You also need to change your datatypes for the name column from char(25)
to varchar(25)
using char(25)
I think, pads the datatype with spaces so your like comparison won't match.
This type of thing always depends on the data. You are right it is kinda stange having the name as one word. To get around that you need to change your query to split the email address on the period.
So your insert would be :
Insert into employees (Employee, Name, Email)
Values (1, 'joe bloggs','joe.bloggs@somewhere.com');
And your select would be:
Select Employee
From Employees
Where Replace(email, '.' ,' ') like '%' || name || '%';
Obviously this means that names must only be in the format of FirstName{space}LastName
and that email addresses must only be in the format of FirstName{dot}LastName@whatever.com
I would be wary of doing anything like this unless you are 100% sure that the data will always be in the specified format.