[Note: This post does not include any affiliates link, just a free course link at the bottom]
Any application needs to store and retrieve data. Is actually the point of creating an application is to help people store and process the data in a meaningful way. To do so we need to have a place to store all these data. This place is the Database where we store our data and we can define relations among this data.
Some articles you might like
How To Learn A Programming Language
advancedsoftwareofficial ・ Nov 24 '20 ・ 2 min read
Database
Is the collection of tables and the related database objects that are used to store and retrieve the data. Tables are the main building block of the database. The database has some different types for example there is SQL database, NoSQL, Graph, and other types. No need to know them all we will focus on SQL Database as it is one of the well-known and widely used.
There are different vendors for SQL Databases such as Oracle, SQL Server, Postgres, and MySQL. You can choose any of them they are a lot similar.
Tables
The tables in the SQL Database (Called Documents in NoSQL) contains columns that you create and store the data inside them. The columns have types so you can set the correct data type such as string or date.
To uniquely identify the row in the database we use a Primary Key column to uniquely identify each row. It will not be repeated and you can use it to directly access the row as it is much faster. It will be auto-generated so we don't need to insert it.
Below is a sample table created in SQL Server
After we create the table, we can add edit, or delete the data via SQL. SQL is the language used to modify or add the data in the database.
ER Diagram
Entity Relationship Diagram is a representation of all the tables inside a database. Usually, before starting to work on a database we design its tables and relations so we make sure we are creating a good database design.
If you a new software developer, join our free course to help you get started
https://landing.advancedsoftware.io/software-developer-guide
Top comments (0)