Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Introduction to Relational Databases | Working with Databases
Spring Boot Backend
course content

Course Content

Spring Boot Backend

Spring Boot Backend

1. Backend Development Basics
2. Spring Boot Basics
3. RESTful API
4. Working with Databases
5. Testing Backend Applications

Introduction to Relational Databases

The concept of relativity in the context of databases refers to the way data is organized and managed. The main idea behind relational databases is the use of tables for storing data and defining relationships between them.

In relational databases, data is stored in tables consisting of rows and columns, where each table contains related information, such as customer details. Tables are linked through keys: a primary key uniquely identifies records, while a foreign key connects tables.

Basic Concepts

A table is the fundamental element of a relational database, consisting of a set of rows and columns. Each row in a table is called a record, and each column is referred to as a field.

A record is a row in a table that holds information about a specific object or event. Each record consists of fields, which are the columns in the table. For example, the name field will only contain client names.

A key in a relational database is a fundamental concept used to identify, access, and relate data stored in tables.

A primary key guarantees the uniqueness of each record within the table, ensuring that no two rows can have the same value for the primary key field(s). It's essential for maintaining the integrity of the data.

A foreign key is used to establish relationships between tables. It refers to the primary key in another table, allowing you to create connections between related data, enabling consistency and referential integrity across the database.

Some Popular Relational Databases

Some popular relational databases include various database management systems, each with its own features. MySQL and PostgreSQL are open-source DBMS, with MySQL being popular for web applications and PostgreSQL offering advanced capabilities.

On the other hand, Oracle Database and Microsoft SQL Server are commercial systems that provide high performance and scalability, making them suitable for large enterprise applications.

The main differences between them lie in licensing and additional features, such as integration with other systems and support for complex functionalities.

Note

We will be using MySQL for future examples, although you can choose any other database.

Difference from Non-Relational Databases

Relational databases store data in tables with a fixed schema and support SQL for queries. They are well-suited for structured data with clear relationships between them.

Non-relational databases (NoSQL) can use various data storage models (documents, graphs, key-value) and do not require a fixed schema. They are well-suited for unstructured data and large volumes of data that require high scalability and flexibility.

Application of Relational Databases

Relational databases are best used when there is a need to store clearly structured data, where each piece of information is related to another. They are ideal for situations where data integrity is important and accuracy needs to be guaranteed.

Additionally, relational databases become essential when complex queries need to be executed and transactions managed, ensuring the reliability of operations and adherence to all relationships between the data.

1. What is the main element of a relational database?
2. Which key ensures the uniqueness of each record in a table?
3. When are relational databases most suitable?

What is the main element of a relational database?

Select the correct answer

Which key ensures the uniqueness of each record in a table?

Select the correct answer

When are relational databases most suitable?

Select the correct answer

Everything was clear?

Section 4. Chapter 1
We're sorry to hear that something went wrong. What happened?
some-alt