Employees


List all the different job titles and the number of employees with each title.

SELECT Title, COUNT([Title]) 
FROM Employees
GROUP BY Title

List all the different job titles where more than one employee has been assigned.

SELECT Title, COUNT(Title) 
FROM Employees
GROUP BY Title
HAVING COUNT(Title) > 1

List all the employees that were born after 1 Jan 1950

SELECT * 
FROM Employees
WHERE BirthDate > #1/1/1950#

List all the employees that have the letter "c" in their firstname

SELECT * 
FROM Employees
WHERE FirstName Like "*c*"

The following all work in SQL Server

SELECT     Employees.* 
FROM EMPLOYEES
WHERE ReportsTo IS NULL

SELECT     * 
FROM EMPLOYEES
WHERE ReportsTo IS NOT NULL

SELECT     * 
FROM [EMPLOYEES]

SELECT     "Address" 
FROM EMPLOYEES

SELECT     [EMPLOYEES].[Address] 
FROM EMPLOYEES

SELECT     [Address] 
FROM EMPLOYEES


© 2024 Better Solutions Limited. All Rights Reserved. © 2024 Better Solutions Limited TopPrevNext