SQL Query to find an employee whose salary is equal to or greater than a specific number
Last Updated :
07 Apr, 2021
In this article, we will discuss the overview of SQL query and our main focus will be on how to Find an Employee whose salary is equal to or greater than a specific number in SQL with the help of examples. Let’s discuss it one by one.
Introduction :
SQL (Structured Query Language ) is used to maintain structured data in relational databases and this is a standard that is used to manipulate data in databases. SQL is further classified into DDL(Data Definition Language), DML(Data Manipulation Language), DCL (Data Control Language) based on purpose in a database we use commands related to these. Queries in SQL allow us to interact with databases. Queries in DBMS helps in the creation, deletion, updating, and retrieval of data from a database.
Step-1: Creating a sample table –
Creating this table employee step_by_step in MySQL.
emp_id |
emp_name |
emp_sex |
emp_age |
emp_salary |
90001
|
ROBERT |
MALE |
35
|
100000
|
90002
|
KISNEY |
MALE |
30
|
80000
|
90003
|
ANDRIA |
FEMALE |
45
|
300000
|
90004
|
JESSICA |
FEMALE |
40
|
250000
|
90005
|
DANNY |
MALE |
38
|
150000
|
Step-2: Creating a database –
Creating a database using the query as follows.
Syntax :
CREATE DATABASE database_name;
Creating a database company as follows.
CREATE DATABASE company;
Output :

Step-3: Using the database –
Using the database company using the following SQL query as follows.
syntax: USE database_name;
Output :

Step-4: Adding a table –
Adding a table employee into a database company using the following SQL query as follows.
Syntax :
CREATE TABLE table_name
( column_name1 data_type1 ,
column_name2 data_type2 ,
column_name3 data_type3 ,
.
.
column_nameN data_typeN , );
SQL Query for Creating a table as follows.
Creating a table employee
with
columns (emp_id,emp_name,emp_sex,emp_age,emp_salary)
into a database company:
Output :

Step-5: Verifying column and data types –
Columns and their data types by DESCRIBE query as follows.
Syntax :
DESCRIBE table_name;
SQL Query for verifying Columns and their data types as follows.
DESCRIBE employee;
Output :

Step-6: Inserting rows into a table employee –
Here, Inserting rows into a table employee as follows.
Syntax :
INSERT INTO table_name
VALUES(column1_data,column2_data,......columnN_data);
Inserted data of 5 employees in the table and created the table employee as follows.
Output :

Step-7: Verifying Inserted data –
Check the inserted data in the database using the select query as follows.
SELECT * FROM employee;
Output :

Examples :
Here, we will see the examples to understand the query as follows.
Example-1 :
Query to find the employee names whose salary is greater than or equal to 1,00,000.
SQL Query –
SELECT emp_name
FROM employee
WHERE emp_salary>=100000;
Output :

Example-2 :
Query to find all details of employees whose salary is greater than or equal to 2,00,000.
SQL Query –
SELECT emp_name
FROM employee
WHERE emp_salary>=200000;
Output :

Example-3 :
Query to find an employee whose salary is 3,00,000.
SQL Query –
SELECT emp_name
FROM employee
WHERE emp_salary=300000;
Output :

Similar Reads
SQL Query to Find Number of Employees According to Gender Whose DOB is Between a Given Range
Query in SQL is like a statement that performs a task. Here, we need to write a query that will find the number of employees according to gender whose DOB is in the given range. We will first create a database named âgeeksâ then we will create a table âdepartmentâ in that database. Creating a Databa
2 min read
SQL Query to Find Names of the Employees Whose Department Have Number of Employees Less than 2
In SQL, we need to find out the department wise information from the given table containing information about employees. One such data is the name of employee who belong to a department having less than 2(i.e. only 1) employees. We shall use the GROUP BY, IN and COUNT clause to achieve this. This is
2 min read
SQL Query to Select all Records From Employee Table Where Name is Not Specified
In SQL, filtering records based on specific criteria is a fundamental task when working with relational databases. One common scenario is selecting all records from a table while excluding certain values, such as specific names or designations. This article demonstrates how to use SQL queries effect
4 min read
SQL Query to find Employees With Higher Salary than Their Department Average ?
Analyzing and understanding salary distributions within departments is a critical aspect of human resource management. In this article, we will explore SQL queries to calculate the average salary for each department and identify employees whose salaries exceed their departmental averages. These quer
4 min read
SQL Query to Find the Name of a Person Whose Name Starts with Specific Letter
Here, we are going to see how to find the name of a person whose name starts with a specified letter in SQL. In this article, we will be making use of the Microsoft SQL Server as our database. For example, finding the name of the person whose name starts with the letter "H". We will use the % symbol
2 min read
C# Program to Print Employees Whose Salary is Greater than Average of all Employees Salaries Using LINQ
LINQ is known as Language Integrated Query and it is introduced in .NET 3.5. It gives the ability to .NET languages to generate queries to retrieve data from the data source. It removes the mismatch between programming languages and databases and the syntax used to create a query is the same no matt
3 min read
SQL Query to Find Monthly Salary of Employee If Annual Salary is Given
SQL stands for Structured Query Language, which used in the database to retrieve data, update and modify data in relational databases like MySql, Oracle, etc. And a query is a question or request for data from the database, that is if we ask someone any question then the question is the query. Simil
3 min read
SQL Query to Find all the Students with Marks Greater than Average Marks
Query in SQL is like a statement that performs a task. Here, we need to write a query to find all the students whose marks are greater than the average marks of students. We will first create a database named âgeeksâ then we will create a table âStudentsâ in that database. Create a Database: We can
2 min read
PostgreSQL Query to Find Employees with Salaries Higher Than Their Departmental Average
In fact, in any organization, pay gaps exist among staff who are placed in different job categories based on their level of experience, skills, and negotiating power. On the other hand, when more employees make more than their departmentâs average, it tempts one to ask about fairness and equity. In
3 min read
SQL Query to get information of employee where employee Is Not Assigned to the Department
In this article, we will discuss the overview of SQL query and our main focus will be on how to get information of employee where employee Is Not Assigned to the Department in SQL. Let's discuss it step by step. Introduction :Queries help us to interact with the database for various operations of da
2 min read