https://github.com/mehtadigisha/crud-operations-on-sales-dataset
CRUD Operations on Sales Dataset
https://github.com/mehtadigisha/crud-operations-on-sales-dataset
crud csv-creation csv-files curd-operation os pandas pandas-dataframe pandas-library python python-pandas sales-data sales-data-crud
Last synced: 3 days ago
JSON representation
CRUD Operations on Sales Dataset
- Host: GitHub
- URL: https://github.com/mehtadigisha/crud-operations-on-sales-dataset
- Owner: mehtadigisha
- Created: 2025-03-09T08:13:07.000Z (7 months ago)
- Default Branch: main
- Last Pushed: 2025-03-09T08:40:06.000Z (7 months ago)
- Last Synced: 2025-08-07T14:48:21.946Z (2 months ago)
- Topics: crud, csv-creation, csv-files, curd-operation, os, pandas, pandas-dataframe, pandas-library, python, python-pandas, sales-data, sales-data-crud
- Language: Jupyter Notebook
- Homepage:
- Size: 4.88 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# CRUD-Operations-on-Sales-Dataset
This project is a simple **Sales Data Management System** built with Python and Pandas. It allows users to **create, read, update, and delete (CRUD)** sales records stored in a CSV file.
---
## π Features
β Create new sales records
β Retrieve and view records by ID
β Update existing records
β Delete records
β Prevent duplicate IDs
β Handles empty datasets gracefully---
## π File Structure
```
π sales_data_project/
βββ sales_data.csv # CSV file to store records
βββ CRUD Operations on Sales Dataset.ipynb # Python script for managing records
βββ README.md # Documentation (this file)
```---
## π οΈ Setup Instructions
### 1οΈβ£ Install Dependencies
Ensure you have **Python 3** installed, then install Pandas:
```sh
pip install pandas
```### 2οΈβ£ Run the Script
Execute the Python script to initialize the dataset and perform operations:
```sh
python CRUD Operations on Sales Dataset.ipynb
```---
## π How to Use
### βΆοΈ Adding New Records
Modify the script to add new records like this:
```python
create_record({"ID": 1, "Product": "Laptop", "Quantity": 2, "Price": 1200, "Customer": "Alice"})
```
### π Reading a Record
```python
read_record(1) # Retrieves record with ID 1
```### βοΈ Updating a Record
```python
update_record(1, {"Price": 1100, "Quantity": 3}) # Updates record with ID 1
```
### β Deleting a Record
```python
delete_record(2) # Removes record with ID 2
```
---
## π Notes
- The script **creates `sales_data.csv` automatically** if it doesnβt exist.
- It **ensures IDs are unique** when adding new records.
- It **converts ID values to integers** for accurate lookups.