SQL Practice Logo

SQLPractice Online

Home/Tutorials/

HR Database

Practice with HR Database
Beginner Level6 Tables

HR Database SQL Tutorial

Human Resources management system with employees, departments, and job roles

🎯 What you'll practice: Employee management, Salary analysis, Department reporting, Location tracking using real-world database scenarios.

📊 Database Tables

employees

Core hr data table

departments

Core hr data table

jobs

Core hr data table

locations

Core hr data table

countries

Core hr data table

regions

Core hr data table

🔍 Common Query Patterns

Employee Salary Analysis

Find employees with salary above average

SELECT first_name, last_name, salary
FROM employees
WHERE salary > (
SELECT AVG(salary) FROM employees
);
Try Now →

Department Employee Count

Count employees by department

SELECT d.department_name,
COUNT(e.employee_id) as emp_count
FROM departments d
LEFT JOIN employees e ON d.department_id = e.department_id
GROUP BY d.department_name;
Try Now →

🚀 Ready to Practice?

Start practicing SQL queries with the hr database database. All tables are loaded and ready to use!