Creating a database engine in Python

Introduction to Importing Data in Python

Hugo Bowne-Anderson

Data Scientist at DataCamp

Creating a database engine

  • SQLite database
    • Fast and simple
  • SQLAlchemy
    • Works with many Relational Database Management Systems
from sqlalchemy import create_engine
engine = create_engine('sqlite:///Northwind.sqlite')
Introduction to Importing Data in Python

Getting table names

from sqlalchemy import create_engine
engine = create_engine('sqlite:///Northwind.sqlite')
table_names = engine.table_names()
print(table_names)
['Categories', 'Customers', 'EmployeeTerritories',
'Employees', 'Order Details', 'Orders', 'Products',
'Region', 'Shippers', 'Suppliers', 'Territories']
Introduction to Importing Data in Python

Let's practice!

Introduction to Importing Data in Python

Preparing Video For Download...