GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Python Tutorial
  • Data Types
  • Interview Questions
  • Examples
  • Quizzes
  • DSA Python
  • Data Science
  • NumPy
  • Pandas
  • Practice
  • Django
  • Flask
  • Installation
  • Connect MySQL database

This view

  • Original page
  • New address

GeezerVison is showing www.geeksforgeeks.org — Python Database Tutorial - GeeksforGeeks

geeksforgeeks
search icon
  • Courses
  • Tutorials
  • Interview Prep
  • Python Tutorial
  • Data Types
  • Interview Questions
  • Examples
  • Quizzes
  • DSA Python
  • Data Science
  • NumPy
  • Pandas
  • Practice
  • Django
  • Flask

Python Database Tutorial

Last Updated : 3 Oct, 2026

Python provides support for working with different databases, allowing us to connect to databases, run queries, and manage data using Python.

  • Relational Databases store data in tables with rows and columns, such as MySQL and SQLite.
  • Non-Relational Databases store data in flexible formats such as documents and key-value pairs, such as MongoDB.
  • Connect to databases, run queries, and manage data using Python.
  • Work with JSON data for storing and exchanging structured information.

MySQL

It connects Python applications with MySQL databases. It converts data between Python and MySQL types and does not require third-party libraries.

MySQL Basics

  • Installation
  • Connect MySQL database

MySQL Queries

  • Create Database 
  • Create Table 
  • Insert into Table 
  • Select Query 
  • Where Clause 
  • Order By Clause 
  • Delete Query 
  • Drop Table 
  • Update Query 
  • Limit Clause 
  • Join 
  • Commit & RollBack Operation in Python 

Note: For more information, refer to our detailed Python MySQL Tutorial

SQLite

Provides a simple interface for connecting Python with SQLite databases. It comes built-in with Python, so no separate installation is required.

SQLite Basics

  • Introduction
  • Connecting to Database
  • SQLite Datatypes

SQLite Queries

  • Cursor Object
  • Create Table
  • Insert Data
  • Select Data from Table
  • WHERE Clause
  • ORDER BY Clause
  • LIMIT Clause
  • JOIN Clause
  • Deleting Data in Table
  • DROP Table
  • Update Data
  • Update Specific Column

Note: For more information, refer to our detailed SQLite3 Tutorial

JSON

Format used to store and exchange structured data. Python provides the built-in json module for parsing, serializing, and deserializing JSON data.

JSON Basics

  • Introduction
  • Data types
  • JSON Data in Python

Reading and Writing

  • Reading and Writing
  • Appending

Parsing JSON

  • Parssing Data
  • Python Dictionary To JSON
  • JSON to String
  • String to JSON Object
  • JSON Data into a Custom Python Object

Serializing and Deserializing

  • Serializing JSON
  • json.dump()
  • json.dumps()
  • Deserialize JSON to Object
  • json.load()
  • json.loads()
  • Encoding and Decoding Custom Objects

Note: For more information, refer to Python JSON Tutorials

MongoDB

Popular NoSQL database that stores data in a flexible document-based format instead of tables. It uses BSON, a binary format similar to JSON, for storing and retrieving data.

MongoDB Basics

  • Introduction
  • Installation
  • PyMongo Cursor
  • Create a Database

MongoDB Queries

  • MongoDB Query
  • Insert and Update
  • Insert_one
  • Insert_many
  • Update_one
  • Update_many
  • Delete Data and Drop Collection
  • Delete_one
  • Delete_many
  • Find
  • Find_one
  • Find_one_and_update
  • Find_one_and_delete
  • Find_one_and_replace
  • Sort
  • Distinct
  • Rename
  • Bulk_write
  • Aggregation Operation
  • Limit
  • Nested Queries

MongoDB Indexing

  • Indexing
  • Create_index
  • Index for MongoDB Collection
  • Information Using Collection’s Indexes
  • Drop_index
  • Drop all the Indexes in a Collection
  • Rebuild all the Indexes of a Collection

Note: For more information, refer to Python MongoDB Tutorial

Comment

Explore

    Python Fundamentals
    • Introduction1 min read
    • Input & Output2 min read
    • Variables4 min read
    • Operators4 min read
    • Keywords2 min read
    • Data Types4 min read
    • Conditional Statements3 min read
    • Loops3 min read
    • Functions4 min read
    Python Data Structures
    • String4 min read
    • List3 min read
    • Tuples3 min read
    • Dictionary3 min read
    • Set2 min read
    • Arrays5 min read
    Advanced Python
    • OOP Concepts3 min read
    • Exception Handling5 min read
    • File Handling4 min read
    • Python Database2 min read
    • MongoDB3 min read
    • MySQL7 min read
    • Packages4 min read
    • Modules3 min read
    • DSA Libraries5 min read
    • Python GUI2 min read
    Data Science with Python
    • Numpy3 min read
    • Pandas4 min read
    • Matplotlib3 min read
    • Seaborn3 min read
    • StatsModel2 min read
    • Model Building6 min read
    • TensorFlow2 min read
    • PyTorch5 min read
    Web Development with Python
    • Flask3 min read
    • Django5 min read
    • Django ORM4 min read
    • Jinja2 Templating5 min read
    • Django Templates5 min read
    • REST API3 min read
    • Build API with DRF4 min read
    Python Practice
    • Quiz1 min read
    • Practice Problems2 min read
    • Interview Q & A15+ min read
    Courses
    • Placement 360 Course2 min read
    • Data Science 360 Course2 min read
    • AI Engg Course2 min read
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.