Реляційні бази даних (РБД)
Relational databases organize data into tables with predefined schemas, establishing relationships between these tables through keys, enabling efficient data retrieval, manipulation, and ensuring data...
Relational databases are a type of database that stores and provides access to data points that are related to one another. They are based on the relational model, an intuitive, straightforward way of representing data in tables. A relational database organizes data into one or more tables (or 'relations') of columns and rows, with a unique key identifying each row. Each table column holds a specific kind of data (e.g., 'name', 'age', 'address'), and each row represents a record with a value for each column. Relationships between tables are established using foreign keys, which are columns in one table that refer to the primary key (a unique identifier) in another table. This structure allows for efficient querying and manipulation of data using Structured Query Language (SQL). Key advantages include data integrity (enforced through constraints like primary keys, foreign keys, and data types), data consistency, ease of data retrieval through joins, and support for complex transactions (ACID properties: Atomicity, Consistency, Isolation, Durability). Examples include MySQL, PostgreSQL, Oracle Database, and SQL Server.
graph LR
Center["Реляційні бази даних (РБД)"]:::main
Pre_data_structures["data-structures"]:::pre --> Center
click Pre_data_structures "/terms/data-structures"
Pre_logic["logic"]:::pre --> Center
click Pre_logic "/terms/logic"
Center --> Child_sql["sql"]:::child
click Child_sql "/terms/sql"
Center --> Child_postgresql["postgresql"]:::child
click Child_postgresql "/terms/postgresql"
Rel_nosql["nosql"]:::related -.-> Center
click Rel_nosql "/terms/nosql"
Rel_data_warehouse["data-warehouse"]:::related -.-> Center
click Rel_data_warehouse "/terms/data-warehouse"
Rel_relational_database["relational-database"]:::related -.-> Center
click Rel_relational_database "/terms/relational-database"
classDef main fill:#7c3aed,stroke:#8b5cf6,stroke-width:2px,color:white,font-weight:bold,rx:5,ry:5;
classDef pre fill:#0f172a,stroke:#3b82f6,color:#94a3b8,rx:5,ry:5;
classDef child fill:#0f172a,stroke:#10b981,color:#94a3b8,rx:5,ry:5;
classDef related fill:#0f172a,stroke:#8b5cf6,stroke-dasharray: 5 5,color:#94a3b8,rx:5,ry:5;
linkStyle default stroke:#4b5563,stroke-width:2px;
🧒 Простими словами
📊 Уявіть велику книгу Excel, де кожен аркуш — це окрема категорія (наприклад, 'Клієнти' або 'Замовлення'). Замість того, щоб копіювати адресу клієнта в кожне замовлення, ви просто ставите 'ID клієнта'. Комп'ютер використовує цей код, щоб 'пов'язати' дані. Це робить систему надійною і запобігає помилкам.
🤓 Expert Deep Dive
Головною рисою систем управління реляційними базами даних (СУРБД) є дотримання принципів ACID: Атомарність, Узгодженість, Ізольованість та Довговічність. Для запобігання аномаліям використовується Нормалізація — процес розбиття великих таблиць на дрібніші логічні одиниці. Сучасні СУРБД, такі як PostgreSQL, використовують механізм MVCC для одночасної обробки тисяч запитів без втрати продуктивності.