Data is everywhere and is one of the most valuable things in the world. According to techjury,in 2021, people created 2.5 quintillion bytes of data every day. Data is been created every second and it is very valuable but without using this data, it is completely useless.
There is, therefore, a need to capture this data that is generated every second, this is what we call a database.A database is a collection of data and a method to manipulate and access the data.
The database is just a computer, it is both hardware and software. The hardware is the mechanical part and the software is the code that allows us to collect any user data that is useful and important.
We can say a pen and paper is a database which is a way traditional way to store data. Google Sheets and Microsoft Excel too are databases.
Some of the databases we have are Microsoft SQL Server, MongoDB,elasticsearch, MariaDB, SQLite, Redis, and so on.
Different career path in tech uses data based on different business or industry need, ranging from a data analyst, a data scientist, machine learning engineer, a software developer, product manager, and so on.
One of the commonest ways to work with databases is to ask the database questions, this term is called QUERY, also known as SQL statement.
We have databases that support day-to-day business and transactions, this is called Online Transaction Processing(OLTP).We have databases that support analysis this is called Online Analytical processing(OLAP), which drives future decisions.
Examples of OLTP
A database is being used to log orders and customers
A database is being used to keep track of logged-in users.
Examples of OLAP
A database is being used to figure out what new products we should offer
A database is being used to derive statistics for reporting to the executives
A database Management system (DBMS)is software used to manage the database, it receives instructions like CRUD(Create, Read, Update and Delete) operations.
Definition of some common terms
A relational DataBase Management System(RDBMS) is a subset of a Database Management system
Structured Query Language(SQL) is a language to interact with Relational Database Management systems.
We have 5 main types of databases
1. Relational model -this works well with SQL
2. Document model database holds more data eg MongoDB
3. Key-Value model database e.g Reddis
4. Graph model database
5. Wide columnar model database eg Apache
What is SQL
SQL is a programming language used to interact with relational databases. A database is a structured form of storing data.SQL is known as a declarative programming language.
A declarative language is a language used to say what will happen but we don’t have an idea of how it will happen while in the imperative programming language, we know how it will happen.
A database Model is a way to organize and store data.
We have the following Database Model which includes: Hierarchical, networking,entity-relationship, relational, object-oriented, etc
The hierarchical model stores and organize data in a tree-like structure.
The networking Model is the expansion of the Hierarchical model.
A relational Model is a model that has a relationship between tables. Here data are stored in a flat table and relationships are between them.
A table in a relational model is a representation of objects in rows and columns. Every table has a name that gives the summary of what the data in the table entail. Each column represents every piece.
Column: A collection of different columns is called a degree.Each column stores a specific type of data. We have a constraint in columns, this constraint are been specific to the domain of the column. Every table has a column or multiple columns.
Rows- This can also be called a tuple. A tuple is a single row of data while tuples are multiple rows of data.
To create rows means we are inserting data into the database.
Each tuple follows column constraint.
In Relational models, there are relationships between data.
Some of the characteristics of relational models are:
Primary key: These keys uniquely identify every piece of data.
Foreign keys: These keys are the referenced primary key from a different table.