Skip to main content

What is a database


Databases are like large buckets that store data in an organized manner. A few examples of when we would like to create a database:

  • A database for a university to save data about students, courses, and lecturers.
  • A database for a car agency to track sales, car storage, and workers.
  • A database for a hospital to save information about patient's history to provide good health care
  • And many more

Inside a database there are tables, and each table has a name, column names, and rows. For example, this is a workers table:

  firstname lastname age exp_years gender
1 Ghully Thuas 29 2.3 Female
2 Bostal Shkolky 32 0.2 Male
3 Qaostu Malop 21 4 Female

The workers table has 5 columns and 3 rows. We don't need any tool to know that we have 3 workers and it is easy to calculate the average age of all of them (29 + 32 + 21) / 3 but what happens when we have a thousand rows or even a million rows?

 

For that, we have databases and the SQL language. database stores all of the tables and SQL extracts the data.