Member-only story

Pyodbc SQL CRUD — Create: Examples with MySQL

Josh Otwell
9 min readJan 8, 2020

--

In my day job as a Pipeline Survey Data Analyst, I lean heavily on the Python pyodbc package for interactions with an Access Database. To gain more knowledge and better proficiency with pyodbc, I thought to use it with one of my favorite open-source databases, MySQL. Having recently written a 4-part series on SQL CRUD operations using MySQL, this post is a continuation of sorts. However, Create operations are executed with the pyodbc driver instead of native SQL

Photo by tanialee gonzalez on Unsplash

OS, Software, and DB used:

Self-Promotion:

If you enjoy the content written here, by all means, share this blog and your favorite post(s) with others who may benefit from or like it as well. Since coffee is my favorite drink, you can even buy me one if you would like!

As I have discussed in a previous post, the first letter of the CRUD acronym stands for CREATE. We also know that to introduce new rows of data into a database table, we use the INSERT statement. Feel free to read the first post of my SQL CRUD Basics series, SQL CRUD Basics Part 1 — Create, which is what inspired me to write this post.

Assume for the duration of this post, I am using the below database connection handlers:

import pyodbcconn = pyodbc.connect(“””DRIVER={MySQL ODBC 8.0 Unicode…

--

--

Josh Otwell
Josh Otwell

Written by Josh Otwell

SQL/PHP | Photography | Technical Consultant. Sign-up for my free developer newsletter, OpenLampTech, here: openlamptech.substack.com

No responses yet