SQLite Databases With Python - Full Course

แชร์
ฝัง
  • เผยแพร่เมื่อ 21 ก.ค. 2024
  • In this course you’ll learn the basics of using SQLite3 with Python. SQLite is an easy-to-use database engine included with Python.
    You’ll learn how to create databases and tables, add data, sort data, create reports, pull specific data, and more. For this course you should already have a basic knowledge of Python programming, but you don’t need to know anything at all about databases or SQLite.
    💻Code: github.com/flatplanet/Intro-T...
    🎥Course created by Codemy.com. Check out their TH-cam channel: / codemycom
    ⭐️Course Contents ⭐️
    ⌨️ (0:00:00) What Is A Database
    ⌨️ (0:03:39) Install Python
    ⌨️ (0:07:07) Install Git Bash Terminal
    ⌨️ (0:11:52) Connect to Database in Python
    ⌨️ (0:17:39) Create A Table
    ⌨️ (0:28:13) Insert One Record Into Table
    ⌨️ (0:31:25) Insert Many Records Into Table
    ⌨️ (0:34:41) Query and Fetchall
    ⌨️ (0:37:02) Format Your Results
    ⌨️ (0:44:39) Primary Key
    ⌨️ (0:47:51) Use The Where Clause
    ⌨️ (0:51:17) Update Records
    ⌨️ (0:56:42) Delete Records
    ⌨️ (0:58:27) Order Results
    ⌨️ (1:01:37) And/Or
    ⌨️ (1:04:57) Limiting Results
    ⌨️ (1:07:27) Delete (Drop) A Table And Backups
    ⌨️ (1:09:14) Unit 18 Our App - Show All Function
    ⌨️ (1:14:16) Unit 19 Our App - Add A Record Function
    ⌨️ (1:17:51) Unit 20 Our App - Delete a Record Function
    ⌨️ (1:21:23) Unit 21 Our App - Add Many Records Function
    ⌨️ (1:24:57) Unit 22 Our App - Where Clause Function
    --
    Learn to code for free and get a developer job: www.freecodecamp.org
    Read hundreds of articles on programming: freecodecamp.org/news
    And subscribe so you don't miss any tutorials: th-cam.com/users/subscription_cent...

ความคิดเห็น • 536

  • @redfordwilson5042
    @redfordwilson5042 4 ปีที่แล้ว +647

    I didn't know Walter White was also skilled in programming. Cool!

    • @hellelo.5840
      @hellelo.5840 3 ปีที่แล้ว +26

      I am the danger, Walter said while talking to his wife about hacking

    • @zl7289
      @zl7289 3 ปีที่แล้ว +6

      This comment deserves more likes! 😂

    • @ShaileshKumar-fk8cu
      @ShaileshKumar-fk8cu 3 ปีที่แล้ว +3

      Hahahahahahahaha

    • @ayushjadaun4964
      @ayushjadaun4964 3 ปีที่แล้ว

      Maybe he is planning to hack Pentagon. This time

    • @CavanLeeSears
      @CavanLeeSears 3 ปีที่แล้ว +5

      You'll notice that almost every skilled programmer is a bald be-speckled goatie (stubble too) wearing guy. Including myself. :)

  • @byleexs1991
    @byleexs1991 ปีที่แล้ว +72

    Cursors in sqlite3 python are objects that act as a pointer to the results of a query. They enable you to fetch, add, modify or delete data from a database. The cursor can also be used to traverse through the rows of a query result.

  • @Ricocase
    @Ricocase 4 ปีที่แล้ว +52

    He already created a time outline of specific concepts in the video = instant upvote!
    Down-to-earth explanations > boss move!

  • @tymothylim6550
    @tymothylim6550 3 ปีที่แล้ว +29

    Thank you John for this video! I watched the whole thing and it was really a well-planned lesson! This really helps me grasp the basics for sqlite3!

  • @vhoover3609
    @vhoover3609 4 ปีที่แล้ว +19

    Hint: the print function accepts multiple arguments where each one is separated by a space when printed. I.e. print( item[0], item[1]) will print Jon Elders to the screen.

  • @WillNicholson
    @WillNicholson ปีที่แล้ว +2

    Thanks John, this was really helpful. Just want to note something I got hung up on; if you delete the last row in a table, that rowid will be REUSED when you add a new item to the table UNLESS you use the AUTOINCREMENT keyword. In other words, if the last rowid is 6, and you delete it (and all of that person's data)... then the last rowid is 5. But, if you add a new item, the new person's data will be added to a row that ALSO has the rowid of 6. This can cause issues when referencing data by rowid later on.

  • @dimjim2365
    @dimjim2365 ปีที่แล้ว +2

    Wow, just wow. This is one superb course for beginners like myself. I followed the whole instructions and created an employees db. I reached a little far trying to incorporate nulls and blobs which caused me probs at the end. Ha. Had to drop back to the text and email demos but everything worked the first time after I corrected my typos. Ha. Thank you for a marvelous tutorial!

  • @espressoshot21
    @espressoshot21 4 ปีที่แล้ว +7

    Thank you for this super helpful video! Keep up the awesome work. I've been really enjoying your courses on TH-cam. You're such an awesome instructor!

  • @shivangivishwasrao1983
    @shivangivishwasrao1983 2 ปีที่แล้ว +5

    Simply loved how crisp and to the point this course was. Thank you so much!

  • @boa2145
    @boa2145 2 ปีที่แล้ว

    Hi John, I watched all clips. Thx for your full course "Sqlite databases with Python". Well done!!!

  • @pleabargain
    @pleabargain 3 ปีที่แล้ว +4

    I worked through all of the code examples. Thank you! I have learned a lot!

  • @ABMA79
    @ABMA79 3 ปีที่แล้ว +4

    amazing course and productive.
    Thanks for the wonderful lesson.
    I have learned so many things in one hour from you.
    Expecting more amazing stuff like this in the future
    Thanks a lot

  • @shrishailgharat1964
    @shrishailgharat1964 4 ปีที่แล้ว +2

    John hope you are eating well and are healthy. Really loved the course. Thanks for the video and keeping it simple and short.

  • @FlowGrapher
    @FlowGrapher 4 ปีที่แล้ว

    Just started a new project in React-Native this SQLite course will help a lot for mobile dev. Thanks 🙏

  • @tzwacdastag8223
    @tzwacdastag8223 4 ปีที่แล้ว +31

    ⭐️Course Contents ⭐️
    ⌨️ (0:00:00) What Is A Database
    ⌨️ (0:03:39) Install Python
    ⌨️ (0:07:07) Install Git Bash Terminal
    ⌨️ (0:11:52) Connect to Database in Python
    ⌨️ (0:17:39) Create A Table
    ⌨️ (0:28:13) Insert One Record Into Table
    ⌨️ (0:31:25) Insert Many Records Into Table
    ⌨️ (0:34:41) Query and Fetchall
    ⌨️ (0:37:02) Format Your Results
    ⌨️ (0:44:39) Primary Key
    ⌨️ (0:47:51) Use The Where Clause
    ⌨️ (0:51:17) Update Records
    ⌨️ (0:56:42) Delete Records
    ⌨️ (0:58:27) Order Results
    ⌨️ (1:01:37) And/Or
    ⌨️ (1:04:57) Limiting Results
    ⌨️ (1:07:27) Delete (Drop) A Table And Backups
    ⌨️ (1:09:14) Unit 18 Our App - Show All Function
    ⌨️ (1:14:16) Unit 19 Our App - Add A Record Function
    ⌨️ (1:17:51) Unit 20 Our App - Delete a Record Function
    ⌨️ (1:21:23) Unit 21 Our App - Add Many Records Function
    ⌨️ (1:24:57) Unit 22 Our App - Where Clause Function

    • @ferax4598
      @ferax4598 ปีที่แล้ว +3

      nice job copying the description

  • @sabilislam7629
    @sabilislam7629 3 ปีที่แล้ว

    You Rock I roll... Seriously, This guy's videos are most helpful in the entire TH-cam!

  • @larslover6559
    @larslover6559 11 หลายเดือนก่อน

    Thank you so much John for the lesson! Your calm natural way of teaching is great!

  • @draganmilinov7495
    @draganmilinov7495 3 ปีที่แล้ว

    Thank you very much on this video!
    It helped me.
    I'm beginner in programming.
    Python is my first programming language.

  • @MahdeenSky
    @MahdeenSky 4 ปีที่แล้ว +4

    this is very easy to understand, good job, very few sqlite3 tutorials actually show the syntax of the sql knowledge and doesn't assume we learned the sql language beforehand, and this is one of them. Fantastic!

    • @MahdeenSky
      @MahdeenSky 4 ปีที่แล้ว

      may i ask how do i move on from this tutorial into more functional sql?

    • @atomiccow1906
      @atomiccow1906 ปีที่แล้ว

      @@MahdeenSky howd it go

  • @darthvoda
    @darthvoda 2 ปีที่แล้ว

    Very good introductory course! Thank you for sharing, the energy end enthusiasm is contagious! Looking forward to learn slqite more in depth, but at a first glance I didn't found an advanced course on codemy..

  • @franklecky6570
    @franklecky6570 ปีที่แล้ว

    Really easy to understand course. Some very useful bits in there. Thanks John!

  • @junioradi6554
    @junioradi6554 3 ปีที่แล้ว +2

    Super and simple course which permits to understand the use of database into an application written using Python. Thank you sir

  • @Surferdudeoh
    @Surferdudeoh 3 ปีที่แล้ว +7

    Thanks a lot for this, seriously you are an incredible teacher.

  • @uucea
    @uucea 4 ปีที่แล้ว +82

    This is the type of channel that will mold the next Bill Gates
    Few of us watching will create something revolutionary

    • @marcus.the.younger
      @marcus.the.younger 3 ปีที่แล้ว +1

      hopefully :)

    • @davidt01
      @davidt01 2 ปีที่แล้ว +2

      Not sure if we want another one of him though.

  • @louisyang185
    @louisyang185 3 ปีที่แล้ว +1

    this is sooooo useful. thank you so much. you're an incredible teacher!

  • @srinjoyghosh7273
    @srinjoyghosh7273 2 ปีที่แล้ว

    I saw his TKinter playlist too. Amazing teacher !

  • @026maheshkumars7
    @026maheshkumars7 ปีที่แล้ว

    I have finished this course...I have enjoyed every second in this course and i have learned lot of details... thankyou very much..

  • @pipedreamsnetwerk5110
    @pipedreamsnetwerk5110 ปีที่แล้ว

    This was awesome. I was trying to figure out sqlite3. Thanks!!!

  • @anzhelazenaishvili7380
    @anzhelazenaishvili7380 4 ปีที่แล้ว

    Hello ,I am starting to learn Data science,so I am beginer and this course it's very good for beginers,thank you very much!!!

  • @miltondias6617
    @miltondias6617 ปีที่แล้ว

    Very simple and straight forward. Congrats!

  • @aidynskullz4139
    @aidynskullz4139 4 ปีที่แล้ว +7

    What kind of witch sorcery is this channel? As soon as I need to learn something for a project, a new course is released on the topic. This is insane and might be the tenth time it's happening.
    Keep up the good work!!!

    • @freecodecamp
      @freecodecamp  4 ปีที่แล้ว +20

      When deciding what course to post, our first thought is always "What does Aidyn Skullz need to learn right now?" 😀

    • @aidynskullz4139
      @aidynskullz4139 4 ปีที่แล้ว +3

      @@freecodecamp haha LOL. Thanks for replying though XD.

    • @euphoric-therapeuticmusic5374
      @euphoric-therapeuticmusic5374 3 ปีที่แล้ว

      @@freecodecamp so you guys have everything ready? why not post all of them.

  • @myriamt6340
    @myriamt6340 2 ปีที่แล้ว +5

    WALTER WHITE teaching me SQLITE, what a time to be alive :D

  • @cloudtechhills
    @cloudtechhills 2 ปีที่แล้ว +2

    I appreciate your work on this tutorial. Thanks mate!

  • @brianburch8062
    @brianburch8062 2 ปีที่แล้ว

    Ah, thank you. This video cleared up a lot of things I was confused about.

  • @dexternepo
    @dexternepo 3 ปีที่แล้ว +2

    At 37:21 he mispronounces tuple as "toople" and then corrects himself after immediately remembering the correct pronunciation. As a non-native speaker of English from India, this brings a smile to my face. Because this is exactly what we do at times. When we learn English from textbooks, we have our pronunciation for some words, and then after watching native speakers pronounce it differently we try to remember the correct pronunciation. But still end up pronuncing it the way we first learned it in spite of knowing the correct way. The word that immediately comes to my mind that I personally mispronounce is "environment".

    • @MrMoKhalaf
      @MrMoKhalaf 4 หลายเดือนก่อน

      🤣🤣🤣

  • @EpicGamer-ux1tu
    @EpicGamer-ux1tu ปีที่แล้ว

    Great video mate, I learned SQL and sqlite3 from you, thanks

  • @techsutra4917
    @techsutra4917 ปีที่แล้ว

    thanks alot that was such an awesome video to learn basics about sql lite with python

  • @jimcallahan448
    @jimcallahan448 2 ปีที่แล้ว +1

    Made sense to me, but that was because I already knew SQL and the SQLite command line.
    Might be easier to demonstrate SQLite command line and then ask what if we want to do this as part of a larger Python program? At the SQLite command line one can immediately demonstrate the newly created table with:
    SELECT customers *;
    If a student asks, why not do everything in SQL? Ask the student, "What if you want to graph the data?" SQL doesn't have matplotlib or even the tools to produce a formatted report. So, Python and SQL (SQLite) make a good team.

  • @franciscofurey4878
    @franciscofurey4878 2 ปีที่แล้ว +1

    Amazing course! such a big teacher and explanation method!

  • @selikiekone9975
    @selikiekone9975 3 ปีที่แล้ว

    You are a champion if you have any python course I will go for it.
    Thank you for your bright knowledge.

  • @Lennardish
    @Lennardish 3 ปีที่แล้ว

    Hello John,
    Your course is MOST helpful. Thanks a lot. Cristal clear :)))

  • @OnDoitConnaitre
    @OnDoitConnaitre 3 ปีที่แล้ว +1

    This Course is really easy to follow and super useful for people who want to start using SQLite, but I wanted to understand 'JOIN' concept which is not explained neither mentioned here, so i guess I will look for some more content.

  • @ariansoltani6079
    @ariansoltani6079 10 หลายเดือนก่อน

    Thank you for publishing this video and teaching smoothly .....very practical and useful 👌

  • @federicobau8651
    @federicobau8651 4 ปีที่แล้ว +4

    Ohh man...it feels so great when understand everything!! I like how you teach really smooth and understandable. Soon I will gotta buy some of your courses

  • @dragonarch0
    @dragonarch0 4 ปีที่แล้ว +89

    Me thinking about learning python
    TH-cam : I see you wanna learn python,here you go

  • @i_am_dumb1070
    @i_am_dumb1070 4 หลายเดือนก่อน

    Really easy to follow along course loved the simple explanation thankyou

  • @johannesperez9548
    @johannesperez9548 2 ปีที่แล้ว +1

    Thanks John! Super useful! I learned a lot!!!

  • @MullahJeelan
    @MullahJeelan ปีที่แล้ว

    You are amazing and you are way of teaching is brilliant and time saving

  • @sambidao88
    @sambidao88 ปีที่แล้ว

    Thank you! The author made me understand to use Python that do CRUD a database incredibly

  • @souzafelix
    @souzafelix ปีที่แล้ว +2

    Didn't know Walter white was so good at teaching sqlite! Great video!

  • @conermos
    @conermos 3 ปีที่แล้ว

    Thanks so much. This video was very informative and was very well-structured

  • @jamestang1737
    @jamestang1737 4 ปีที่แล้ว +1

    informative video! quick question: if i have a csv file and want to create a connection for sqlite3 to query, do i have to save the csv first as a database in either SMSS etc, then export the .db to a working directory? trying to understand the best way to read_csv in pandas but with SQL. Thanks

  • @captainpenny2122
    @captainpenny2122 10 หลายเดือนก่อน

    Thank you so much for this videos, it was well planned and really helped me!!!

  • @Meta910
    @Meta910 3 ปีที่แล้ว +1

    AMAZING....#just got re-candled again😊

  • @noir371
    @noir371 2 ปีที่แล้ว

    Really appreciate everything this channel does!

  • @whatisleansixsigmabydr.sal4884
    @whatisleansixsigmabydr.sal4884 3 ปีที่แล้ว

    You did such a great job. I loved it.

  • @johndoe-rq4gf
    @johndoe-rq4gf 3 ปีที่แล้ว +1

    Hi! just a remark: contrary to what you say in the first part, SublimeText is free for evaluation but if you do read the little popup window (or the website) you have to buy a license for continuous usage, it's not a donation, it's a license.

  • @gabrielade775
    @gabrielade775 ปีที่แล้ว

    Great hands on course, thank you John

  • @aniruddhakulkarni700
    @aniruddhakulkarni700 3 ปีที่แล้ว +3

    Thank you for this Walter!

  • @JuanThomasAlvarez
    @JuanThomasAlvarez 2 ปีที่แล้ว +5

    It would be good to show readonly vs read+write connections to the sqlite3 database file, which comes in handy if you're creating a flask web app which will be used by multiple individuals at once.

  • @argjendsejfullai8541
    @argjendsejfullai8541 3 ปีที่แล้ว +1

    you know i might pass my exam because of you sir , you earn my respect :D

  • @ilyastrojnov7627
    @ilyastrojnov7627 3 ปีที่แล้ว

    Thx for video! I think that best way for use database functions is optional args connection, we just create one connection and use it in all functions

  • @tehreemqasim2204
    @tehreemqasim2204 2 ปีที่แล้ว

    Excellent tutorial. Many thanks for the great videos.

  • @marwanrabi5450
    @marwanrabi5450 ปีที่แล้ว

    What a CrashCourse man!!
    AWESOME!!

  • @xxl0o
    @xxl0o ปีที่แล้ว +2

    Great course! Thanks a lot!

  • @Schecter1989
    @Schecter1989 4 ปีที่แล้ว +1

    In the Delete Records video, I had created 7 records and deleted rowid = 4. My updated table had the following rowid's: 1, 2, 3, 5, 6, 7. I was assuming the rowid's would have stayed the same and the records would have simply shifted up. Is there any way to get that rowid 4 back or is gone forever? Thanks for the great course and I look forward to your response.

  • @francescoroccocrisafi6617
    @francescoroccocrisafi6617 3 ปีที่แล้ว

    Great tutorial! Thank you for sharing it

  • @gamesandstuff7724
    @gamesandstuff7724 2 ปีที่แล้ว +1

    Many thanks, great video!

  • @Langeta-kun
    @Langeta-kun 4 หลายเดือนก่อน

    this was amazing! granted Im a comp sci student and I finished sql and python. But i had no idea what I was doing! This was smooooth(I still had issues btw but I guess that is just SQL)

  • @auusiebatman
    @auusiebatman 2 ปีที่แล้ว

    Loved this video, thank you.

  • @walternyc
    @walternyc 3 ปีที่แล้ว

    Thanks. This is an excellent reference video.

  • @nickjakes8663
    @nickjakes8663 2 ปีที่แล้ว

    Absolutely fantastic! Thank you

  • @ruvixreyez
    @ruvixreyez 3 ปีที่แล้ว

    Hi, about 1:26:15 , Why does it needs to have a coma(email,)? other example like delete_one use only the function var and also rowid is in the tuple so why?

  • @rahulgovindkumar3105
    @rahulgovindkumar3105 2 ปีที่แล้ว +1

    Thank you for this super helpful video!

  • @utkarshrastogi8791
    @utkarshrastogi8791 4 ปีที่แล้ว +2

    Massive respect for these guys

  • @nickeax
    @nickeax 4 ปีที่แล้ว +1

    Thanks for the brilliant guide.

  • @sanjayraj1700
    @sanjayraj1700 2 ปีที่แล้ว

    Thank you John. It was really helpful :)

  • @vw2385
    @vw2385 2 ปีที่แล้ว

    Thank you very much for your videos ! I have an issue when using sqlite3 and python at work. I'd like to importe datas in my table only if they are not in the table yet so I w'ont like to have same rows in my data base. How could I do that ? Thanks in advance !

  • @GameKnightOTRT
    @GameKnightOTRT 6 หลายเดือนก่อน +1

    This is an older video but i found it very helpful so thank you first off! Secondly, if any of you are using VS Code instead of sublime you will need to make sure you are physically inside of the folder through the explorer tab. Once inside select the sqlite folder then go to git bash and follow his steps from there!

    • @logeszz_07
      @logeszz_07 5 หลายเดือนก่อน

      Bro how to run vscode instead of sublime please give proper steps

  • @mr.dineshlee
    @mr.dineshlee 3 ปีที่แล้ว +1

    Very Easy to Understand this one...🙏🏻

  • @tridevjha255
    @tridevjha255 ปีที่แล้ว

    Really helpful Video
    Made the bridge of knowledge which I needed from a long time
    One more time thank you

  • @Capitan_Cavernicola_1
    @Capitan_Cavernicola_1 ปีที่แล้ว

    I have downloaded SQLite for Mac.
    I use a iso layout keyboard where I need to press option + 2 to enter “@“.
    Unfortunately, when I use that combination in SQLite that triggers a keyboard shortcut instead.
    That means that I cannot write @.
    Anybody knows a work around? Thanks for any advice.

  • @OlivierSuire
    @OlivierSuire 3 ปีที่แล้ว

    17:44 it seems to me that databases really start making sense when they are comprised of MULTIPLE tables.
    I wish you would have touched this subject. Other than that : fantastic video ; it really helped.

  • @l.kennethwells2138
    @l.kennethwells2138 ปีที่แล้ว

    when i run the for loop for item in items it printed the whole list and in your gitbash terminal it only printed 5?

  • @inan5255
    @inan5255 5 หลายเดือนก่อน

    thank you for upload this video, very educational.

  • @user-hb2ih2hb9g
    @user-hb2ih2hb9g 7 หลายเดือนก่อน

    Thank you for this great course...

  • @buckbuck2773
    @buckbuck2773 11 หลายเดือนก่อน

    c.execute("INSERT INTO Customers VALUES (?,?,?)", (List))
    sqlite3.ProgrammingError: Incorrect number of bindings supplied. The current statement uses 3, and there are 2 supplied.
    I've rewound the video like dozens of times now and watched it. Finally I noticed that I'm using execute() instead of executemany(). c.executemany("INSERT INTO Customers VALUES (?,?,?)", List) now it works.

  • @vasileantoniupop5476
    @vasileantoniupop5476 ปีที่แล้ว

    First helpful tutorial on this topic

  • @hanasheto1520
    @hanasheto1520 2 ปีที่แล้ว

    Well done! Thank you so much

  • @asthmatic2455
    @asthmatic2455 2 ปีที่แล้ว

    Hi,
    technical only - if you look at the contents of the sqlite database in any editor (even text), the data stored in it is freely readable, not encoded in any way.
    how to solve it ?

  • @robertopulido9557
    @robertopulido9557 3 ปีที่แล้ว

    thank you, you make so much easier, i know there it is more ways to do it but i just get confused thank you

  • @otabekjunashaliev
    @otabekjunashaliev 2 ปีที่แล้ว

    super helpful and understandable, Thanks a lot

  • @splungedude
    @splungedude 4 ปีที่แล้ว +3

    1:29:36 if you use:
    id = str(id) in the delete_one function the input will be converted to an interger

  • @tensukashi
    @tensukashi 3 ปีที่แล้ว

    I can't find the sqlite in the directory and if I look for it myself its not there either. what file am I looking for?

  • @theBATfamiliar
    @theBATfamiliar 4 ปีที่แล้ว +1

    Thank you guys for sharing

  • @usmantariq5615
    @usmantariq5615 2 ปีที่แล้ว

    Excellent dude.. Very good course for beginners.

  • @prasadnirmal6426
    @prasadnirmal6426 3 ปีที่แล้ว

    wow! you are good teacher! it's amazing

  • @sanjaisrao484
    @sanjaisrao484 2 ปีที่แล้ว

    Thank you very much for exellent explaination

  • @oqant0424
    @oqant0424 3 ปีที่แล้ว

    truely commendable...thanks a bunch

  • @Lucaischz
    @Lucaischz 3 ปีที่แล้ว +11

    As far as I know, docstrings aren't the same as triple quote strings. Docstrings are indeed expressed on tripple quote strings, but it means something more specific, which is the on code documentation for classes and functions, actually working as source code comments, but the syntax accepts this particular case because it's industry standard.
    Edit: also, as far as I know, SQL is case INSENSITIVE, actually, but it's good practice to capitalize reserved words to distinguish it from context defined elements (names, parameters, etc).

    • @pepijnkrijnsen4
      @pepijnkrijnsen4 3 ปีที่แล้ว +2

      Six months later but you're absolutely right