What is data?

Data refers to distinct pieces of information, usually formatted in a special way. In the broadest sense, data is any set of characters that has been gathered and translated for some purpose, usually analysis. It can come in any form, including numbers, text, bits and bytes, images, and sounds. Data can be qualitative or quantitative and is typically used to represent the attributes or variables of entities and phenomena. When data is processed, organized, structured, or presented in a given context to make it useful, it is called information. In the realm of computing and technology, data is the foundation of information, knowledge, and digital processes, serving as the raw input that can be processed by algorithms and systems to produce outputs or insights.

What is a database?

A database is a systematic collection of data that is stored and accessed electronically. It is designed to manage, store, and retrieve information efficiently. Databases allow users to input, search, update, and manage data quickly and securely. They are structured to facilitate the storage, retrieval, modification, and deletion of data in conjunction with various data-processing operations.

Databases typically use a database management system (DBMS) to handle the data along with providing functionalities such as implementing data integrity, security, and backup processes. There are various types of databases, including relational databases, NoSQL databases, distributed databases, and more, each with its own organization method and use case. In essence, databases are foundational elements in the information and computing landscapes, supporting everything from simple websites to complex banking systems and data analytics projects.

I am putting to concept of Data and Databases in its own section. While it may have the appearance of a programming language, it warrants its own discuss. Data (digital data, that is) is such an important and broad field that is often tangled up with computer programming, but I do think it requires a distinct way of thinking and planning. Usually, you will design and setup a database for a particular type of data and then your computer program will interact with that data and database to accomplish some type of goal.

In our wierd food and cooking analog. Data is like the ingredients we use to cook up a meal. It is the food we consume. It requires proper management and storage in a pantry or kitchen(database), but we have distinct tools for interacting with it. The knives and pots and pans are going to be all the tools that we build using code to perform cooking and consuming like actions.

Why have databases in your web applications?

Web applications are often built around a lot of data that change frequently. The data is usually organized in entities related in some way. For example, entities such as users are related to products by the act of purchasing, music albums are related to a specific artist by authoring, users are related to other users by befriending, etc.

Relational databases offer robust and efficient data management. A usual relational database consists of tables that represent entities and/or relationships amongst entities. The attributes of entities are constrained (for example, NAME attribute is a string, and a user’s PASSWORD should not be empty). The way a database is organized in entities, attributes and relationships, without data being present, is called the database schema.

Database schema design: A simple book club scenario

You want to create a personal book club application. Each month you pick a book your friends can review and rate. Your web app manages registered readers, the list of books you choose each month, and the ratings the readers write for those books. Moreover, you can show the annotations your friends made while reading the suggested books.

The schema for this problem is shown on the right. Inspect the schema by following the instructions below.

Untitled

SQLite