In this article, we will cover how to find all Employee records containing a Specific Word regardless of case-sensitive in SQL and will discuss steps by steps.
We will discuss, how to find all employee records containing a specific word regardless of the case-sensitive. We create the database employee and check for the following query step by step. Considering this table we find all employee records with the developer as the case-insensitive word as follows.
| 60001||WARNER||FRONT-END Developer|
| 60002||CRISTIE||GAME deVeLoper|
| 60003||RANGA||UX deVeLoper|
| 60004||RANGA||UX deVeLoper|
| 60005||PRAD||BACKEND DEVeLoper|
Step-1: Creating a database –
Creating a database using the following SQL query as follows.
CREATE DATABASE database_name;
Step-2: Using the database –
Using the database company as follows.
Step-3: Adding a table –
Adding a table employee into a database company as follows.
CREATE TABLE table_name
( column_name1 data_type1 ,
column_name2 data_type2 ,
column_name3 data_type3 ,
column_nameN data_typeN , );
Step-4: Creating a table –
Creating a table employee with columns (dept_id,emp_name,dept_name,emp_age) into a database company as follows.
Step-5: Verifying columns and data types –
Columns and their data types by DESCRIBE query as follows.
Step-6: Inserting rows into a table –
Inserting rows into a table employee by using the following SQL query as follows.
INSERT INTO table_name VALUES(column1_data,column2_data,......columnN_data);
Step-7: Verifying inserted data –
Check the inserted data in the database using the select query as follows.
SELECT * FROM table_name;
Let’s understand the concept with the help of examples as well for better understanding.
As observed in the table the developer word is case-insensitive but all the employee records with the developer should be retrieved so the query to that is as follows.
WHERE column_name LIKE 'PATTERN';
Selecting data Querying –
WHERE dept_name LIKE '%DEVELOPER';
Here in this table, all the records of an employee with the developer as dept name are obtained without considering the case.
Query to obtain all employee names with the developer as dept_name with case insensitive as follows.
Here in this example, all the names of an employee with a developer are obtained without considering the case.