Employees are the staff members assigned to a petrol pump station. Each employee record references the pump they work at viaDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/Adarsh275/PetrolPump-Management-System/llms.txt
Use this file to discover all available pages before exploring further.
Petrolpump_No and can optionally reference a manager within the same organisation via Manager_ID — a self-referential foreign key that points back to another row in the same Employee table. A BEFORE UPDATE trigger named salary_check is intended to reject any UPDATE that sets an employee’s Salary below ₹300,000; however, the trigger as written in querry.sql contains a bug: the condition reads if salary < 300000 (a bare column name) rather than if new.Salary < 300000, and the preceding assignment set WAGE = new.WAGE references a non-existent column. The trigger’s actual behaviour depends on the MySQL version and session context — in some environments the bare salary resolves to the old row value rather than the proposed new value, so the guard may not work as intended. The intent is to prevent salaries below ₹300,000.
Field Reference
Primary key. A unique alphanumeric identifier for the employee, up to 10 characters.Example:
MANG957The employee’s full name, up to 30 characters.Example:
Aman KumarA single character indicating the employee’s gender. Accepted values are
M (male) or F (female).The employee’s job title, up to 10 characters.Examples:
MANAGER, NOZZEL PERSON, CLEANING, COOKING, FOOD MANAGEMENTThe employee’s date of birth. Entered via a Streamlit date picker and stored in
YYYY-MM-DD format.Example: 1992-01-21The employee’s salary in Indian Rupees (INR). Stored as an integer. At update time, the
salary_check trigger is intended to reject values below ₹300,000, but the trigger condition references the bare column name salary (not new.Salary), which is a known bug in the source. Its enforcement is therefore unreliable and depends on the MySQL version in use.The employee’s residential address, up to 255 characters.Example:
Boaring road, PatnaThe employee’s email address, up to 100 characters.Example:
aman@outlook.comForeign key reference to
PetrolPump.Registration_No. Associates the employee with the station they work at.Example: HPC805103Self-referential foreign key. Points to another
Employee.Employee_ID within the same table, establishing a manager–subordinate hierarchy. Can be NULL for top-level managers or employees with no assigned manager.Example: MANG957Add an Employee
Select the Add operation
In the CRUD Operations dropdown, select Add.The main area displays the subheader “Enter Employee Details:”.
Fill in all ten fields
Complete every field shown in the form:
| Field | Input type | Required |
|---|---|---|
| Employee_ID | Text | ✅ |
| Emp_Name | Text | ✅ |
| Emp_Gender | Text (M or F) | ✗ |
| Designation | Text | ✗ |
| DOB | Date picker | ✗ |
| Salary | Number | ✗ |
| Emp_Address | Text | ✅ |
| Email_ID | Text | ✅ |
| Petrolpump_No | Text (FK to PetrolPump) | ✗ |
| Manager_ID | Text (FK to Employee) | ✗ |
create.py:
database.py:
View Employees
Update an Employee
Select Update
In the CRUD Operations dropdown, select Update.A “Current Employee details” expander shows the current data, and an “Employee to Edit” selectbox lists every
Employee_ID.Select the employee
Choose the target
Employee_ID from the dropdown. All nine editable fields are pre-filled with that employee’s current values.Edit the fields
Modify any of the nine editable fields:
Emp_Name, Emp_Gender, Designation, DOB, Salary, Emp_Address, Email_ID, Petrolpump_No, or Manager_ID.Save changes
Click Update Employee.
- On success, a green “Successfully updated” message is displayed.
- If the
salary_checktrigger fires (intended for salaries below ₹300,000 — see the Warning below for the known trigger bug), the update is rejected and the exception is displayed inline viast.exception(err).
update_for_Employee() function in update.py wraps the database call in a try/except to catch and surface trigger errors:
edit_Employee_data() in database.py:
Delete an Employee
Choose the employee to delete
Select the target
Employee_ID from the “Employee to delete” selectbox. An inline warning is displayed:Self-Referential Manager Hierarchy
TheManager_ID column is a self-referential foreign key — it stores the Employee_ID of the employee who manages this record. This allows the system to model a multi-level reporting structure entirely within the single Employee table.
How it works:
- A top-level manager can list themselves as their own
Manager_ID(or the column can be leftNULL). - Subordinates set their
Manager_IDto theEmployee_IDof their direct manager.
HPC805103:
| Employee_ID | Emp_Name | Designation | Manager_ID |
|---|---|---|---|
MANG957 | Aman Kumar | MANAGER | MANG957 (self) |
FOED452 | Sheela Reddy | FOOD MANAGEMENT | MANG957 |
FDEW353 | Saideepak Reddy | NOZZEL PERSON | MANG957 |
DRHD746 | Hima Ullal | COOKING | FOED452 |
FDNG652 | Hradha Nayar | NOZZEL PERSON | FDEW353 |
MANG957 (Aman Kumar) is the station manager. FOED452 (Sheela Reddy) and FDEW353 (Saideepak Reddy) report directly to him. DRHD746 (Hima Ullal) reports to Sheela Reddy, and FDNG652 (Hradha Nayar) reports to Saideepak Reddy — forming a two-level chain below the manager.
Seed Data
The following seven employee records are inserted bycreate_table.sql: