What is a database?
While a thorough overview of databases is beyond the scope of this book, let's learn (or for some readers, refresh ourselves) about what databases are. According to Wikipedia, "a database is an organized collection of data, generally stored and accessed electronically from a computer system" (https://en.wikipedia.org/wiki/Database). Databases have been around for decades, and today, there are many different types of databases for different use cases.
Traditionally, the most common type of database has been the relational database. Relational databases are made up of tables, which can be thought of as spreadsheets. Tables are rectangular, meaning they have rows and columns. The relational part comes from how the tables link to one another, as depicted in Figure 4.1. Note how in Figure 4.1, we have an orders
table and an users
table, linked together by id_user
. Rather than store all the user information for each order (such as name...