Udemy
    •  
    •  
    •  
    •  
    •  
    •  
    •  
    •  
Turn what you know into an opportunity and reach millions around the world.
Learn More
Your cart is empty.
Keep shopping
Using MySQL Databases With Python
Rating: 4.5 out of 5(1,626 ratings)
11,703 students

Using MySQL Databases With Python

Learn MySql Database With Python The Fast and Easy Way!
Created byJohn Elder
Last updated 11/2023
English

What you'll learn

  • Understand how to use MySQL Databases With Python
  • Understand the basics of what a Database can do.
  • Install Python, MySQL, Git Bash, and MySQL Connector
  • You'll Learn How To Create a Database and Table
  • How to put data in and take data out using Python
  • How to update and delete data from the database
  • How to explore what's in the database whenever you want
  • How to create basic reports with the data from your database

Course content

1 section25 lectures2h 11m total length
  • Introduction2:34

    Learn how to use MySQL with Python, connect Python to MySQL, and work with an open source, free database popular for websites, big data, and machine learning.

  • First Things First: How To Get Support Fast!0:09
  • What Is A Database5:14

    Compare databases to big spreadsheets to visualize structure and function. Explore how tables hold records, columns enforce data types, and how you add, update, remove, and retrieve data.

  • Install Python4:53

    Download and install Python from python.org, uninstalling older versions and ensuring Python 3.x is added to the path on Windows; also install a text editor like Sublime Text.

  • Install Git Bash Terminal4:20

    Install git bash on Windows to get a lightweight terminal for running commands, and configure default editor, path, ssh and ssl options to use Mac or Linux style commands.

  • Download MySQL4:11

    Install the MySQL community server and the MySQL Workbench to manage databases while using Python in this course. Download the full Windows installer (273 MB) to avoid installation issues.

  • Install MySQL and Workbench7:48

    Install the MySQL server and MySQL Workbench using the installer. Configure a root user with a password, enable the Windows service, and prepare for Python connections.

  • Install MySQL Connector4:16

    Set up the development environment by installing MySQL, Python, and Git Bash. Create a directory and install MySQL Connector with pip to enable Python to connect to MySQL.

  • Connect to Database in Python5:38

    Learn to connect a Python program to a MySQL database using mysql.connector by importing the module, creating a connection with host, user, and password, and verifying the connection.

  • Explore MySQL Workbench7:34

    Explore MySQL Workbench, a graphical tool for visualizing and editing your database, running SQL queries, viewing schemas, and experimenting with the World database and sample data.

  • Create A Database7:13

    Create a new database in Python using a cursor to execute create database test DB, then print the databases to verify with MySQL workbench.

  • Create A Table8:54

    Create a users table in test db with Python by configuring the database, creating a cursor, and executing a create table command with varchar fields and auto increment primary key.

  • Insert One Record Into Table5:39

    Learn how to insert a single record into the users table with an auto-incremented id, using SQL insert into, placeholders like %s, and commit.

  • Insert Many Records Into Table5:39

    Add multiple user records by building a Python list of tuples and executing a parameterized insert statement, then commit and verify auto-incremented IDs in MySQL Workbench.

  • Understanding Data Types4:51

    Discover common data types in MySQL, including varchar, int, float, text, and date types, and learn how to choose the right type for text, numbers, and binary data.

  • Select Data From Table5:18

    Learn to pull data from a MySQL table with Python by creating a cursor, executing a select query, and fetching results. Use specific columns and fetchone for single records.

  • Format Our Results7:29

    Learn to format query results into readable reports by building strings with placeholders, using tabs and headers to display name, email, age, and id in the terminal.

  • The Where Clause4:06

    Learn to use the where clause to filter user data in sql with python, applying conditions like age > 30, age < 30, and name equals 'John', including string quotes.

  • The Like Clause and Wildcards2:50

    Explore how the like clause and percent wildcards let you search patterns, such as names starting with J or containing an i, and how placing wildcards at ends yields results.

  • Using AND and OR3:40

    Learn to use and and or in SQL with a select statement to filter by multiple conditions, such as a name with an i and age 29, or either condition.

  • Updating Records5:23

    Learn to update records with SQL using an update query on users table, set age, apply a where clause, commit via cursor, and rely on user_id as the primary key.

  • Limit and Ordering4:37

    Limit results and offset the first rows in a select from the users table. Order by name or age with ascending or descending order.

  • Delete Records2:44

    Delete records in a MySQL table using a delete statement with a where clause, then commit; delete by a unique field like the user id to avoid removing multiple rows.

  • Delete (Drop) A Table And Backups5:57

    drop a table in MySQL with Python and safely back it up by exporting to CSV or JSON, then re-import using the table data import wizard.

  • Bonus Lecture10:10

    Explore a lifetime membership with access to over 60 courses, including MySQL with Python, Django, and more, with a $200 Udemy discount and a 30-day money-back guarantee.

Requirements

  • A Basic Understanding Of Python Programming Would Be Helpful
  • You don't need any special tools, we'll download everything we need for free. You just need a Windows, Mac, or Linux computer

Description

These days everything uses a database, and MySQL is one of the most popular databases out there.  FREE and Open Source, Mysql is a great database for just about all your needs.

Likewise, Python is one of the most popular and powerful programming languages today.  Pairing the two together is a powerful combination!

In this course you'll learn the basics of using MySQL with Python. 

You'll learn how to create databases and tables, add data, sort data, create reports, pull specific data, and more.

For this courses I'll assume you already have a basic knowledge of Python programming, but you don't need to know anything at all about databases or MySQL to take the course.

You'll learn...

  • What Is A Database

  • How To Install Python

  • How To Install Git Bash Terminal

  • How To Download MySQL

  • How To Install MySQL and Workbench

  • How To Install MySQL Connector

  • How To Connect to Database in Python

  • How To Explore The MySQL Workbench

  • How To Create A Database

  • How To Create A Table

  • How To Insert One Record Into Table

  • How To Insert Many Records Into Table

  • Understanding Data Types

  • How To Select Data From Table

  • How To Format Our Results

  • How To Use The Where Clause

  • How To Use The Like Clause and Wildcards

  • How To Use AND and OR

  • How To Updating Records

  • How To Limit and Order Results

  • How To Delete Records

  • How To Delete (Drop) A Table And Backups

  • And More!

I'll walk you through all of this and more, step by step.  If you have any question along the way, I'm here to answer them.

If you've ever wanted to understand databases or use them in your Python programs, this is the course for you.

We'll download everything you need for this course for free, you don't need any special tools!

I'll see you on the inside!

-John Elder



Who this course is for:

  • Anyone who wants to use the MySQL Database with Python