TensorLearn
Back to Course
Data Intelligence: NumPy & Pandas
Module 11 of 15

11. Databases & SQL

1. ORM (Object Relational Mappers)

Don't write raw SQL strings. Use Python objects.

python
from sqlalchemy import create_engine, Column, Integer, String, Base engine = create_engine('sqlite:///db.sqlite') class User(Base): __tablename__ = 'users' id = Column(Integer, primary_key=True) name = Column(String)

2. Pandas -> SQL

The fastest way to dump data.

python
df.to_sql("users", engine, if_exists="append")

Mark as Completed

TensorLearn - AI Engineering for Professionals