Let's begin with learning how to read data from SQL databases. Before we begin, we will have to create a database called personal.db
. We are going to use a DB browser for SQLite that allows us to create new SQLite databases, edit them, add new records, and so on. You can find more information about the tool and download it from http://sqlitebrowser.org/. It is a free tool and it works with Windows, macOS, and Linux. Let's begin with an example. Check out the following screenshot:
Here, we have just one table, called profile
. Working on this table will be sufficient for us to learn how to interact with the SQLite database, and then you can use the same techniques to interact with MySQL or SQL Server. If you check the screenshot, you can see that we have three records and four columns: ProfileId
, FirstName
, LastName
, and Age
. The FirstName
and LastName
columns are a string, or text, the Age
column is a number, and the ProfileId
is our primary key; it isalso an integer...