Junior — Middle
Explain what a relational database is and how it is structured.
sobes.tech AI
Answer from AI
A relational database (RDB) is a database management system where data is organized into tables (relations). Each table consists of rows (records) and columns (attributes).
Main characteristics of a relational database:
- Tables: data is stored in tables, where each row represents a separate object or record, and each column represents its property.
- Keys: each table has a primary key that uniquely identifies a record.
- Relations: tables can be linked to each other through foreign keys, allowing modeling of relationships between data.
- Query language: SQL (Structured Query Language) is used for working with data.
Example of a "Users" table structure:
| ID (PK) | Name | |
|---|---|---|
| 1 | Ivan | ivan@mail.com |
| 2 | Maria | maria@mail.com |
Thus, a relational database is structured as a set of interconnected tables, which ensures ease of storage, search, and data management.