Assignment
1️⃣ Introduction to Relational Databases (4 Assignments)
Assignment 1: Connecting to a SQLite Database
from sqlalchemy import create_engine
engine = create_engine("sqlite:///test.db")
print("Database connected successfully!")Assignment 2: Creating a Database Table with SQLAlchemy
from sqlalchemy import Column, Integer, String, create_engine
from sqlalchemy.ext.declarative import declarative_base
Base = declarative_base()
class User(Base):
__tablename__ = "users"
id = Column(Integer, primary_key=True)
name = Column(String)
email = Column(String)
engine = create_engine("sqlite:///test.db")
Base.metadata.create_all(engine)
print("Table created successfully!")Assignment 3: Inspecting Database Tables
Assignment 4: Checking Database Connection
2️⃣ SQLAlchemy ORM (Object Relational Mapping) (6 Assignments)
Assignment 5: Defining a New Table with More Fields
Assignment 6: Creating a Session to Interact with the Database
Assignment 7: Adding a New User to the Database
Assignment 8: Querying All Users from the Database
Assignment 9: Filtering Data in SQLAlchemy
Assignment 10: Ordering Query Results
3️⃣ CRUD Operations with SQLite/MySQL/PostgreSQL (6 Assignments)
Assignment 11: Updating a User's Email
Assignment 12: Deleting a User from the Database
Assignment 13: Counting the Number of Users
Assignment 14: Using LIKE Operator in Queries
Assignment 15: Querying Users with a Specific Email Domain
Assignment 16: Using distinct() to Get Unique Values
distinct() to Get Unique Values4️⃣ Faker for Generating Fake Test Data (4 Assignments)
Assignment 17: Installing and Using Faker
Assignment 18: Generating Fake Emails and Addresses
Assignment 19: Inserting Fake Users into the Database
Assignment 20: Populating a Products Table with Fake Data
Last updated