-- Show the total number of employees in the Employees Table
SELECT COUNT(*)
FROM Employees;
--Find the average salary(Average Salary)
-- Of Employees in the employees table
SELECT AVG(Salary) AS AverageSalary
FROM Employees;
-- Show the number of different departments (NumberOfDepartments) in the employees table
SELECT COUNT(DISTINCT DepartmentName) AS NumberOfDepartments
FROM Employees;
-- Show the highest(HighestSalary), lowest(LowestSalary) , and average(AverageSalary) salary of
-- Employees in the employees table
SELECT MAX(Salary) AS HighestSalary,
MIN(Salary) AS LowestSalary,
AVG(Salary) AS AverageSalary
FROM Employees;
-- Find the departments that have more than 10 employees
SELECT DepartmentName, COUNT(*) AS NumberOfEmployees
FROM Employees
GROUP BY DepartmentName
HAVING COUNT(*) > 10;
-- Find the total sales amount(TotalSales) from the sales table
SELECT SUM(SaleAmount) AS TotalSales
FROM Sales;
-- Find the total sales amount for sales made in the year 2023(TotalSales2023) from the sales table
SELECT SUM(SaleAmount) AS TotalSales2023
FROM Sales
WHERE Year(SaleDate) = 2023;
-- Find the highest price of products(HighestPrice) in the products table
SELECT MAX(Price) AS HighestPrice
FROM Products;
-- Find the lowest price of products(LowestPrice) in the products table
SELECT MIN(Price) AS LowestPrice
FROM Products;
-- Find the total sales amount for each salesperson in the sales table. Order the results from the highest sales amount
-- To the lowest
SELECT Salesman, SUM(SaleAmount) AS TotalSales
FROM Sales
GROUP BY Salesman
ORDER BY TotalSales DESC;
To embed this project on your website, copy the following code and paste it into your website's HTML: