Assignment_Db_Python_ 01
Assignment_Db_Python_ 01
Only : 02
Task: Using Python, connect to a MySQL or SQLite database and perform basic operations (CRUD: Create,
Read, Update, Delete) on a table. The table should store employee data (ID, Name, Department, Salary).
Objective: To gain hands-on experience in connecting Python with a database and performing database
operations.
Task: Write and execute an SQL query to fetch data from multiple tables (e.g., orders, customers, and
products) and optimize it for performance by using proper indexing and joins.
Objective: To learn about SQL query optimization techniques and the importance of indexing and joins
for performance.
Task: Implement a Python application that interacts with a database, and ensure that user inputs (such
as login credentials) are sanitized to prevent SQL injection attacks.
Objective: To understand SQL injection risks and how to secure database queries in Python using
parameterized queries.
Task: Design a database schema for an e-commerce platform that includes tables for products, users,
orders, and payments. Normalize the schema to at least the third normal form (3NF).
Objective: To practice database design principles and normalization techniques to reduce redundancy
and improve data integrity.
Task: Write a Python program that connects to a MySQL or PostgreSQL database and retrieves all records
from a table using a database cursor. Implement error handling for database connection failures.
Objective: To understand how to use database cursors for querying data in Python and to handle
exceptions during database operations.