Salary Range for Teachers by Department.

Beginner

In this project, you will learn how to retrieve the maximum and minimum salary for each department in a MySQL database using built-in functions and SQL queries.

SQLMySQL

Introduction

In this project, you will learn how to retrieve the maximum and minimum salary for each department in a MySQL database using built-in functions and SQL queries.

👀 Preview

MySQL [edusys]> SOURCE ~/project/functionQuery.sql;
+------------+------------+------------+
| dept_name  | max_salary | min_salary |
+------------+------------+------------+
| Biology    |   72000.00 |   72000.00 |
| Comp. Sci. |   92000.00 |   65000.00 |
| Elec. Eng. |   80000.00 |   80000.00 |
| Finance    |   90000.00 |   80000.00 |
| History    |   62000.00 |   60000.00 |
| Music      |   40000.00 |   40000.00 |
| Physics    |   95000.00 |   87000.00 |
+------------+------------+------------+
7 rows in set (0.001 sec)

ðŸŽŊ Tasks

In this project, you will learn:

  • How to start the MySQL server and import data into the database
  • How to write a SQL query to retrieve the maximum and minimum salary for each department
  • How to execute the SQL query script in the MySQL command line client

🏆 Achievements

After completing this project, you will be able to:

  • Understand how to use MySQL built-in functions like MAX() and MIN() to retrieve data
  • Write SQL queries to group and aggregate data based on specific criteria
  • Execute SQL scripts in the MySQL command line client
  • Apply your knowledge to solve real-world data analysis problems

Teacher

labby

Labby

Labby is the LabEx teacher.