The PetrolPump table is the root entity of the entire system. Every other major record — Employees, Tankers, Sales — holds a foreign key reference back to a pump’sDocumentation 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.
Registration_No. Before adding staff, fuel tankers, or sales data, you must first create the petrol pump station record that anchors them. This page walks you through all four CRUD operations available for pump records in the Streamlit UI.
Field Reference
Primary key. A unique alphanumeric code that identifies the station, up to 10 characters. This value cannot be changed after creation — all dependent records (Employees, Tankers, Sales) reference it by this key.Example:
HPC805103The trading name of the fuel station, up to 50 characters.Example:
Sumaraj PetroleumThe oil-marketing company (OMC) that the station is affiliated with, up to 30 characters. Leave blank if the station is independent.Example:
Hindustan Petroleum CorporationThe calendar year the station opened for business (stored as a 5-digit integer).Example:
2016The Indian state in which the station is located, up to 30 characters.Example:
BiharThe city or town where the station is located, up to 40 characters.Example:
HisuaAdd a Petrol Pump
Select the Add operation
In the CRUD Operations dropdown that appears below Tables, select Add.The main area will display the subheader “Enter Petrolpump Details:”.
Fill in the form fields
Complete the six input fields presented in the form:
| Field | Input type | Required |
|---|---|---|
| Registration_No | Text | ✅ |
| Petrolpump_Name | Text | ✅ |
| Company_Name | Text | ✗ |
| Opening_Year | Number | ✗ |
| State | Text | ✗ |
| City | Text | ✅ |
create_for_Petrolpump() in create.py:
add_Petrolpump_data() in database.py executes the following parameterised INSERT:
View Petrol Pumps
The
read_for_Petrolpump() function in read.py fetches all rows and maps them to labelled columns:
SELECT * FROM Petrolpump.
Update a Petrol Pump
Select Update
In the CRUD Operations dropdown, select Update.The page shows a “Current Petrolpump details” expander with the existing data, and a “Petrolpumps to Edit” selectbox pre-populated with every
Registration_No in the database.Choose the pump to edit
Select the target pump’s
Registration_No from the dropdown. Its current field values are automatically loaded into the form inputs.Edit the fields
Modify any of the five editable fields: Petrolpump_Name, Company_Name, Opening_Year, State, or City.
Registration_No is the primary key and is not editable through the update form. To change a registration number you would need to delete the record and re-create it.edit_Petrolpump_data() in database.py:
Delete a Petrol Pump
Choose the pump to delete
Select the
Registration_No of the pump you wish to remove from the “Petrolpump to delete” selectbox. The UI shows an inline warning:delete_data_Petrolpump() in database.py:
Seed Data
The following five pump records are inserted bycreate_table.sql and serve as the starter dataset for development and testing: