Lab 02 - SELECT
Lab 02 - SELECT
date, salary, and salary after a raise of 10%. Name the last
(Employees table).
SELECT
first_name,
last_name,
hire_date,
salary,
salary * 1.10 AS ANNUAL_SAL
FROM
Employees;
2. Create a query to display the unique manager numbers
SELECT *
FROM Employees
WHERE MONTH(JoinDate) = 6;
5. Write a query in SQL to list the employees of department
SELECT *
FROM Employees
WHERE DepartmentID IN (50, 110)
AND YEAR(JoinDate) = 2000;
6. Write a SQL query to find those employees who were
Return full name (first and last), job id and hire date
SELECT
CONCAT(FirstName, ' ', LastName) AS Full_Name,
JobID,
HireDate
FROM
Employees
WHERE
HireDate BETWEEN '2007-11-02' AND '2009-07-10';
7. Write a query in SQL to list the details of the employees in
the manager_id
SELECT *
FROM Employees
ORDER BY EmployeeID ASC, ManagerID DESC;
8. write a SQL query to find employees whose first names
SELECT *
FROM Employees
WHERE FirstName LIKE '%D%'
OR FirstName LIKE '%S%'
OR FirstName LIKE '%N%'
ORDER BY Salary DESC;
9. Write a query in SQL to list the employees with Hire date
SELECT
EmployeeID,
FirstName,
LastName,
DATE_FORMAT(HireDate, '%b %d, %Y') AS Hire_Date
FROM
Employees;
10. Write a query in SQL to list the employees with a salary
SELECT *
FROM Employees
WHERE Salary BETWEEN 2000 AND 5000
AND (Commission IS NULL OR Commission = 0);
11. Write a query to display FIRST names of employees,
SELECT FirstName
FROM Employees
WHERE SUBSTRING(FirstName, 3, 1) = 'a';
12. Displays the FIRST names of employees with letter “a” and “e” in
their names
SELECT FirstName
FROM Employees
WHERE FirstName LIKE '%a%'
AND FirstName LIKE '%e%';
13. Write a SQL query to find the employees whose first name ends
with the letter ‘m’. Return the first and last name, and salary
between 3000 and 8000 (Begin and end values are included). Sort the
result-set in ascending order by the full name (first and last). Return full