Python SQLite Tutorial: Complete Overview – Creating a Database, Table, and Running Queries

///Python SQLite Tutorial: Complete Overview – Creating a Database, Table, and Running Queries

Python SQLite Tutorial: Complete Overview – Creating a Database, Table, and Running Queries

FavoriteLoadingAdd to favorites

In this Python SQLite tutorial, we will be going over a complete introduction to the sqlite3 built-in module within Python. SQLite allows us to quickly get up and running with databases, without spinning up larger databases like MySQL or Postgres. We will be creating a database, creating a table, insert, select, update, and delete data. Let’s get started…

The code from this video can be found at:

If you enjoy these videos and would like to support my channel, I would greatly appreciate any assistance through my Patreon account:

Or a one-time contribution through PayPal:

If you would like to see additional ways in which you can support the channel, you can check out my support page:

You can find me on:
My website –
Facebook –
Twitter –
Google Plus –
Tumblr –

By |2017-07-01T04:09:43+00:00July 1st, 2017|Python Video Tutorials|28 Comments


  1. Victor Mongi July 1, 2017 at 4:13 am - Reply

    This tutorial is a Gem, seriously…. God Bless You Corey… keep making great stuff mannnn….

  2. Kha Nguyen July 1, 2017 at 4:18 am - Reply

    It could be better if you combine decorator with your sqlite functions like this slide.

  3. Byomkesh Das July 1, 2017 at 4:20 am - Reply

    How you are accumulating all such good information Maaaaaaan? A BIG thumbs up. Thank you very much.

  4. BayerischerSchweizer July 1, 2017 at 4:20 am - Reply

    Great video, I am using Python with SQLite at work and educated myself with Coreys Videos,.. thanks man 🙂

  5. Daniel Morettin July 1, 2017 at 4:24 am - Reply

    Hey Corey this is great! One question:

    What is the pythonic way to deal with the connection and cursor when using modular programming?

    Should I create a class that acts as a database manager and has connection and cursor in __init__?

    Otherwise I’m passing the connection and cursor into functions all the time. It seems like there is a better way.

  6. shadman sakib khan July 1, 2017 at 4:30 am - Reply

    how could you be so good at explaining codes ? hats off to you,would appreciate if you pull up a whole project based learning on (django/flask)+ (sql/postgres)+python .

  7. no name July 1, 2017 at 4:30 am - Reply

    I always skip over your videos because the thumbnails are washed out, similar to how the thumbnails for videos that I’ve already watched are.

  8. hjop010 July 1, 2017 at 4:32 am - Reply

    Great content. Just became a patron. Hope you can continue with this because these are some of the best tutorials I have seen in the web, payed or not. Are you planning on building some applications?

  9. Kerron July 1, 2017 at 4:32 am - Reply

    hey Corey, do you mind doing a python vid on map, reduce, filter, etc? Much appreciated!

  10. Parul Gupta July 1, 2017 at 4:35 am - Reply

    please explain @property and __repr__

  11. Alice July 1, 2017 at 4:35 am - Reply

    please, have a series about django and SQLite, I am so looking forward 🙂

  12. debvdo July 1, 2017 at 4:38 am - Reply

    Is a context manager required for a CREATE TABLE statement? Your code does not use it.

  13. aslam admani July 1, 2017 at 4:43 am - Reply

    Hello there, how would you go about user input?
    for instance, on the terminal or application, where a user wishes to input data (to be stored in a db),
    when string formatting is bad practice, how would one go about this problem?
    thanks !

  14. Mancuss July 1, 2017 at 4:44 am - Reply

    In your first 20 seconds, you make people’s apps super insecure… SQLite is ok for dev, but NEVER, NEVER use it in production environment… other than that… awesome video! 🙂

  15. Elijah Lucian July 1, 2017 at 4:45 am - Reply


  16. MARCVS LICINIVS CRASSVS July 1, 2017 at 4:55 am - Reply

    You are incredible. You need to be at Treehouse, Udemy, or Lynda.

  17. davor m July 1, 2017 at 4:55 am - Reply

    A Nobel prize for Python education!

  18. Suman Banerjee July 1, 2017 at 4:56 am - Reply

    Please do one tutorial on pyqtgraph. Please…

  19. RulerL0rd July 1, 2017 at 4:59 am - Reply

    Thank you so much.

  20. Amitesh Sahay July 1, 2017 at 5:01 am - Reply

    Hey Corry, please post videos on Python Functional programming…..

  21. Hanni bal July 1, 2017 at 5:01 am - Reply

    first of all thanks for this amazing tutorials and really you are a person hard to find
    just i want to ask you what are the steps to start learning python from A to Z and how long you need to become a python programmer

  22. zao sun July 1, 2017 at 5:01 am - Reply

    you read my mind. very clear video.

  23. Sanjay Shr July 1, 2017 at 5:01 am - Reply

    Awesome looking for more videos on DB stuff

  24. Shankar GS July 1, 2017 at 5:02 am - Reply

    Hi Corey, Thanks for the Video, really great, good explanation. I’m having problem in the output format.Can you please help?
    [(u’Corey’, u’Schafer’, 90000.0)]. Values are prefixed with ‘u’. How to get rid off them?

  25. Koodauskanava July 1, 2017 at 5:06 am - Reply

    Thanks a lot for this very clear tutorial. Really nice demonstration.

  26. Ken July 1, 2017 at 5:07 am - Reply

    Best tutor in the world,no holding back giving it all for the good of all,i wish you were tutoring me in a class…or a your disciple,i would call you my master!!!

  27. Zwork101 July 1, 2017 at 5:08 am - Reply

    Pythonic means code that doesn’t just get the syntax right but that follows the conventions of the Python community and uses the language in the way it is intended to be used. This is maybe easiest to explain by negative example, as in the linked article from the other answers -StackOverFlow. Huh, the more you know

  28. Ashok Gujjuri July 1, 2017 at 5:09 am - Reply


Leave A Comment