Is Python suitable for database applications
Python and databases
Python offers the use of database management systems (DBMS) very easily. In the following, the term database system is used instead of the awkward word. What is the advantage of a database system?
We thereby separate data from the program and do not have to worry about:
- the storage of the data
- the management of the data
We simply transfer our data to our database and then we can then use our program to determine what should happen with the data. Most of the time you want to evaluate them in some form or just output them. Whereby a selection takes place during the output so that only the data that is currently required is displayed.
Concrete example that we are implementing step by step
How does that look in a specific example?
We want program a birthday warning that saves its data in a database. For this we need the first name, last name and the date of the birthday. If you like, you can also include your phone number and e-mail in the data. In the first step, it must be possible to enter and save the data using a form.
This data can be searched.
In addition, the data can be output with the desired sorting order, e.g. by first name or surname or date of birth.
And the next 3 birthdays should always be displayed as a candy when the program starts. So here we have a selection of the data according to a certain criterion and a sorted output.
And last but not least, we want to be able to change data again (typing errors occur) and delete it (you don't want to congratulate some people on their birthday anymore).
About the function. What does Python offer us when it comes to databases?
Different database systems
With Python we can use different database systems like MySQL, SQLite, Oracle, PostgreSQL and other databases.
Data can be managed very easily via a database system. This includes:
- Create records
- Delete records
- change data
- Find data
- Sort data
In the following chapter we want to work with SQLite. This variant is an optimal introduction to the topic of databases. The basic programming is the same for all databases. The advantage of SQLite is that it already exists as a module in Python and is embedded directly as a file in the software project. If you want to look in the file system - it is a ".db" file.
The big advantage for beginners is: We don't have to install a client-server database, as is the case with MySQL, for example. In this way, the application with the database and data that has already been recorded can be passed on very easily.
But step by step.
Our learning application for database usage
In the following, we want to program the “Birthday Warner” application that manages birthdays. We use the following data fields for this:
- First name
The following actions are available:
- Create data record
- to change
- sort by
We will do this step by step in the following chapters and learn how to use databases in Python.
Recommend • Social Bookmarks • Thank you
- What are the different perspectives on consciousness
- What is your most exciting driving experience
- What kind of abortion is safe
- What Happens When You Eat Green Mold
- What will the Intel graphics card look like?
- In which environments do bacteria live
- When does the Age of Reason begin?
- Do some Sinhalese support federalism?
- Who drove the Jews out of Jerusalem?
- How does a gretsch drum sound
- What kind of writing makes people think
- Who rates school teachers or parents
- What makes a violinist exceptional?
- What is a good hungry iOS development company
- What do Australians think of Jordan Peterson
- Which Marvel Comics characters play musical instruments
- Why do we use surgical amplifiers
- What cars do tech billionaires use
- How has fiction changed your life
- Why was Ephesus important to Christians
- Dinosaurs had feathers
- Is astrology wrong
- Which is older Mario or Luigi
- What is the lowest point in asia
- How can I become a smart speaker
- What makes reed croet poisonous to dogs
- Should I buy a carded product?
- What are the estimated returns of A16Z for LPs
- Loathe the Australian cricket team
- When did people start traveling by plane?
- What are the general kernel functions
- Who is the most famous billiards player
- The systems engineering profession is dying
- Password managers are not hackable