Back

Sanskar

Keen Learner and Exp...ย โ€ขย 2m

Day 25 of learning python as a beginner. Topic: database handling. I used to write simple programs which just showed some text in the console when I started learning python. I didn't used to store that data somewhere because I didn't know how to. Then I got introduced to File I/O in python and I aggressively started using .txt files to store data however it was very time consuming and code extensive to perform operations on that data. Then someone told me to check out JSON files and this reduced a lot of code from my program as I am now able to perform CURD operation more easily. However I still can't use it as a database that's when someone guided me to learn about Database handling in python by using SQL at that time I decided to focus on the basics however I have decided to learn them in future and today's that day. I decide to learn PostgreSQL with SQLAlchemy (I haven't even seen a drop of it just learned to install and connect it to python and use it as a simple database). There's a lot more things learn in this. As we all know database is an organised set of information stored efficiently and for effective future use. first I have downloaded and imported psycopg2 which is a popular library to help python programs to connect and interact with PostgreSQL. Then I connected psycopg2 with my data base by giving all the necessary details (hid the password of course). The I wrote my first SQL query and according to my experience unlike python SQL is not case sensitive i.e. it can also be written in small case letters. Also the queries of SQL to me seemed to me more like just writing English sentences with a few technical jargons. .cursor is used to execute the command in the actual database and .commit saves all the changes in the database. It is a good practice to close both so that they can get a signal that we are done for now and I also created a small database of people using python. And here's my code and its database.

Reply

More like this

Recommendations from Medial

Vansh Khandelwal

Full Stack Web Devel...ย โ€ขย 11m

๐„๐ฑ๐ฉ๐ฅ๐จ๐ซ๐ข๐ง๐  ๐๐จ๐ฌ๐ญ๐ ๐ซ๐ž๐’๐๐‹: ๐“๐ก๐ž ๐€๐๐ฏ๐š๐ง๐œ๐ž๐ ๐Ž๐ฉ๐ž๐ง-๐’๐จ๐ฎ๐ซ๐œ๐ž ๐‘๐ƒ๐๐Œ๐’ PostgreSQL, or Postgres, is a powerful, open-source relational database management system (RDBMS) with over 30 years of development. Known for its SQL

See More
Reply
4

Sanskar

Keen Learner and Exp...ย โ€ขย 2m

Day 26 of learning python as a beginner. Topic: CRUD operations in python postgreSQL. I had tried to explore SQL database handling in python and someone suggested me that I should also try performing CRUD (Create, Read, Update and Delete) operation

See More
Reply
Image Description

Comet

#freelancerย โ€ขย 6m

Top YouTube Channels to Learn AI for Free in 2025 1. freeCodeCamp org : Learn more Learn coding for free through hands-on projects and tutorials in web development, data science, and more. 2. Tech With Tim : Learn More Fun and accessible programmin

See More
1 Reply
5
12

Comet

#freelancerย โ€ขย 11m

Company Name : PayU Batch : 2025/2026 passouts Role : Data Internship Skillset required : Python and SQL Link :

Reply
3

Adarsh Gupta

Co-Founder Apploydย โ€ขย 5m

Introducing Apployd DB: Next-Generation Serverless PostgreSQL We're excited to announce Apployd DB, our modern serverless PostgreSQL platform designed to revolutionize how developers work with databases. ๐Ÿš€ After extensive development and testing,

See More
Reply
1

Vikas Jaiswal

MIS executive| Power...ย โ€ขย 7m

Hi focks, I am looking to grow myself as a data analyst in an MNC. To gain and grow, I need assistance to learn POWER BI and SQL. Can anyone tell me what all topics I should cover to become a data analyst?

Reply
2
Image Description
Image Description

Comet

#freelancerย โ€ขย 11m

What is SQL? "Guys, ever wondered how data analysts 'talk' to databases? Itโ€™s with SQL! Think of SQL as the language of data. Just like English or Hindi helps us communicate, SQL lets us interact with databases. Hereโ€™s the cool part: SQL is super

See More
3 Replies
5

Ankit

Turning Data into De...ย โ€ขย 3m

Hi everyone! ๐Ÿ‘‹ Iโ€™m Ankit Rai, currently pursuing my MCA with a specialization in Data Science and have recently completed โ€œThe Ultimate Job Ready Data Science Courseโ€ by CodeWithHarry, focusing on real-world projects using Python, SQL, Machine Learn

See More
Reply
6

Sanskar

Keen Learner and Exp...ย โ€ขย 2m

Day 28 of learning python as a beginner. Topic: web scraping with postgreSQL database. When I posted my first web scraping project I just had the result on console however I wanted it to be stored somewhere where it can be reviewed later that's whe

See More
Reply
1

Download the medial app to read full posts, comements and news.