Utilizing SQL Alongside Python

Options for Speaking Your Data Science Love Language

Merge your love of SQL with your new flame, Python

Getting Started with SQL Databases in Python

This code snippet lets you instantiate into a self-contained SQLite database via sqlite3 — all in Python!

Dealing with MySQL

Installing the MySQL package for Python
  • One for connecting to the database
  • Another for actually creating the database/table
Define a function to connect to your external (already running) MySQL server
Another function for creating the database. An error code will show if there were any issues
Calling your written functions to create and instantiate the MySQL database

Dealing with PostgreSQL

Use the above function to connect to the PostgreSQL database
PostgreSQL will be good to go after this step!

The Deal with SQL IDEs

DBeaver is a super-robust SQL IDE that also boast cross-platform functionality (Windows, Mac, Linux)

Conclusion

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Chaz Frazer

Data Scientist/Esports Analyst/Linguist/Japanese Interpreter: I do a lot in the intersection of gaming and data, helping esports grow.