A simple project demonstrating CRUD operations (Create, Read, Update, Delete) in Python using SQLite. This project is perfect for beginners looking to understand how to work with a lightweight database.
This repository contains a basic Python script that:
- Creates an SQLite database.
- Sets up a table for user data.
- Implements functions to create, read, update, and delete user records.
It’s designed as a learning tool for anyone interested in mastering the fundamentals of database operations in Python.
- Create: Add new user records to the database.
- Read: Retrieve and display all user records.
- Update: Modify existing user details.
- Delete: Remove user records.
- Lightweight and self-contained, requiring no additional database server.
-
Clone the repository:
git clone https://github.com/yourusername/sqllite-crud-tutorial.git
-
Navigate to the project directory:
cd sqllite-crud-tutorial
-
Run the application:
python main.py
Make sure you have Python 3 installed on your system.
When you run the script, it will:
- Create a database file named
my_database.db
(if it doesn't exist). - Create a table called
users
with columns forid
,name
, andemail
. - Execute sample CRUD operations to demonstrate functionality.
You can modify the script to experiment with different data or extend its functionality for your own projects.
Contributions are welcome! Feel free to fork this repository and submit pull requests with improvements or additional features. If you have major changes in mind, please open an issue first to discuss your ideas.
This project is licensed under the MIT License. See the LICENSE file for details.