{"id":9424,"date":"2026-06-02T10:08:28","date_gmt":"2026-06-02T08:08:28","guid":{"rendered":"https:\/\/mybox.com\/help\/?post_type=manual_kb&#038;p=9424"},"modified":"2026-06-02T10:08:29","modified_gmt":"2026-06-02T08:08:29","slug":"cum-functioneaza-o-baza-de-date-relationala","status":"publish","type":"manual_kb","link":"https:\/\/mybox.com\/help\/ro\/knowledgebase\/how-does-a-relational-database-work\/","title":{"rendered":"Cum func\u021bioneaz\u0103 o baz\u0103 de date rela\u021bional\u0103?"},"content":{"rendered":"<div class=\"translation-block translation-block-merged\">\n<p class=\"wp-block-paragraph\">A relational database stores data in tables that contain rows and columns. This structure makes it easy to organize, search, and manage related information.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Each table represents a specific type of data, such as customers, products, or orders.<\/p>\n\n\n\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_86 ez-toc-wrap-left counter-hierarchy ez-toc-counter ez-toc-custom ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/mybox.com\/help\/ro\/knowledgebase\/how-does-a-relational-database-work\/#Tables_Rows_and_Columns\" >Tables, Rows, and Columns<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/mybox.com\/help\/ro\/knowledgebase\/how-does-a-relational-database-work\/#Relationships_Between_Tables\" >Relationships Between Tables<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/mybox.com\/help\/ro\/knowledgebase\/how-does-a-relational-database-work\/#Using_SQL_to_Access_Data\" >Using SQL to Access Data<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/mybox.com\/help\/ro\/knowledgebase\/how-does-a-relational-database-work\/#Data_Integrity\" >Data Integrity<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/mybox.com\/help\/ro\/knowledgebase\/how-does-a-relational-database-work\/#Entity_Integrity\" >Entity Integrity<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/mybox.com\/help\/ro\/knowledgebase\/how-does-a-relational-database-work\/#Referential_Integrity\" >Referential Integrity<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/mybox.com\/help\/ro\/knowledgebase\/how-does-a-relational-database-work\/#Benefits_of_the_Relational_Model\" >Benefits of the Relational Model<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/mybox.com\/help\/ro\/knowledgebase\/how-does-a-relational-database-work\/#Summary\" >Summary<\/a><\/li><\/ul><\/nav><\/div>\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Tables_Rows_and_Columns\"><\/span>Tables, Rows, and Columns<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<\/div>\n\n<div id=\"mybox-3671439676\" class=\"mybox-content mybox-entity-placement\"><div class=\"early-access-banner-inpost\">\r\n  <div class=\"banner-left-inpost\">\r\n    <div class=\"icon-box-inpost\">\r\n      <img decoding=\"async\" src=\"https:\/\/mybox.com\/help\/wp-content\/uploads\/2026\/02\/square-info-icon.svg\" alt=\"Info\">\r\n    <\/div>\r\n    <div class=\"text-box-inpost\">\r\n      <span class=\"label-inpost\"><span class=\"translation-block translation-block-banner-text\">Acces timpuriu<\/span><\/span>\r\n      <h4><span class=\"translation-block translation-block-banner-text\">Mai ave\u021bi nevoie de ajutor?<\/span><\/h4>\r\n      <p><span class=\"translation-block translation-block-banner-text\">Contacta\u021bi echipa noastr\u0103 de servicii pentru clien\u021bi.<\/span><\/p>\r\n    <\/div>\r\n  <\/div>\r\n\r\n  <div class=\"banner-right-inpost\">\r\n    <a href=\"https:\/\/panel.mybox.com\/helpdesk2\/v\/list\/\" class=\"banner-button-inpost\"><span class=\"translation-block translation-block-banner-text\">Trimite mesaj<\/span><\/a>\r\n  <\/div>\r\n<\/div><\/div>\n\n<div class=\"translation-block translation-block-merged\"><p class=\"wp-block-paragraph\">A relational database consists of one or more tables.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Columns define the attributes or properties of the data.<\/li>\n\n\n\n<li>Rows contain individual records.<\/li>\n\n\n\n<li>Each record is uniquely identified by a key, usually called a primary key.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">For example, a customer table might contain:<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>Customer ID<\/th><th>Name<\/th><th>Email<\/th><\/tr><\/thead><tbody><tr><td>1001<\/td><td>John Smith<\/td><td><a>john@example.com<\/a><\/td><\/tr><tr><td>1002<\/td><td>Jane Doe<\/td><td><a>jane@example.com<\/a><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">In this example:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>Customer ID<\/code> is the primary key.<\/li>\n\n\n\n<li>Each row represents a unique customer.<\/li>\n\n\n\n<li>Each column stores a specific attribute of that customer.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Relationships_Between_Tables\"><\/span>Relationships Between Tables<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Relational databases connect related information using keys.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For example:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Customers Table<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>Customer ID<\/th><th>Name<\/th><\/tr><\/thead><tbody><tr><td>1001<\/td><td>John Smith<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Orders Table<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>Order ID<\/th><th>Customer ID<\/th><th>Product<\/th><\/tr><\/thead><tbody><tr><td>5001<\/td><td>1001<\/td><td>Laptop<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">The <code>Customer ID<\/code> in the Orders table links the order to the customer in the Customers table. This relationship allows data to be connected without duplicating information.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Using_SQL_to_Access_Data\"><\/span>Using SQL to Access Data<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Relational databases are typically managed using SQL (Structured Query Language).<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">SQL allows users and applications to:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Retrieve data<\/li>\n\n\n\n<li>Add new records<\/li>\n\n\n\n<li>Update existing information<\/li>\n\n\n\n<li>Delete records<\/li>\n\n\n\n<li>Generate reports<\/li>\n\n\n\n<li>Manage database structure<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">For example, a simple SQL query can retrieve all customers:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>SELECT * FROM customers;<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Or display all orders placed by a specific customer:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>SELECT * FROM orders<br>WHERE customer_id = 1001;<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Data_Integrity\"><\/span>Data Integrity<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Relational databases use built-in rules to ensure that data remains accurate and consistent.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Common integrity rules include:<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Entity_Integrity\"><\/span>Entity Integrity<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Every table must have a primary key.<\/li>\n\n\n\n<li>Primary key values must be unique.<\/li>\n\n\n\n<li>Primary key values cannot be empty (NULL).<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Referential_Integrity\"><\/span>Referential Integrity<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Foreign key values must correspond to valid records in related tables.<\/li>\n\n\n\n<li>Relationships between tables remain consistent.<\/li>\n\n\n\n<li>Invalid or orphaned records are prevented.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Benefits_of_the_Relational_Model\"><\/span>Benefits of the Relational Model<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Because data is organized into related tables, relational databases provide:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Efficient data storage<\/li>\n\n\n\n<li>Reduced data duplication<\/li>\n\n\n\n<li>Fast querying and reporting<\/li>\n\n\n\n<li>Consistent data management<\/li>\n\n\n\n<li>Strong security and access controls<\/li>\n\n\n\n<li>Reliable relationships between datasets<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Summary\"><\/span>Summary<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">A relational database works by storing data in structured tables connected through relationships. Each record is identified by a unique key, and SQL is used to manage and retrieve information. This approach provides an efficient, reliable, and scalable way to store and organize data for websites, applications, and business systems.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n<\/div>","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"template":"","format":"standard","manualknowledgebasecat":[42],"manual_kb_tag":[805,1742,5475,5477,5478,5481,5482,5483,585,804],"class_list":["post-9424","manual_kb","type-manual_kb","status-publish","format-standard","hentry","manualknowledgebasecat-miscellaneous","manual_kb_tag-structured-query-language","manual_kb_tag-data-integrity","manual_kb_tag-relational-model","manual_kb_tag-primary-key","manual_kb_tag-foreign-key","manual_kb_tag-rows-and-columns","manual_kb_tag-referential-integrity","manual_kb_tag-entity-integrity","manual_kb_tag-database-tables","manual_kb_tag-relational-database"],"_links":{"self":[{"href":"https:\/\/mybox.com\/help\/ro\/wp-json\/wp\/v2\/manual_kb\/9424","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mybox.com\/help\/ro\/wp-json\/wp\/v2\/manual_kb"}],"about":[{"href":"https:\/\/mybox.com\/help\/ro\/wp-json\/wp\/v2\/types\/manual_kb"}],"author":[{"embeddable":true,"href":"https:\/\/mybox.com\/help\/ro\/wp-json\/wp\/v2\/users\/1"}],"version-history":[{"count":1,"href":"https:\/\/mybox.com\/help\/ro\/wp-json\/wp\/v2\/manual_kb\/9424\/revisions"}],"predecessor-version":[{"id":9425,"href":"https:\/\/mybox.com\/help\/ro\/wp-json\/wp\/v2\/manual_kb\/9424\/revisions\/9425"}],"wp:attachment":[{"href":"https:\/\/mybox.com\/help\/ro\/wp-json\/wp\/v2\/media?parent=9424"}],"wp:term":[{"taxonomy":"manualknowledgebasecat","embeddable":true,"href":"https:\/\/mybox.com\/help\/ro\/wp-json\/wp\/v2\/manualknowledgebasecat?post=9424"},{"taxonomy":"manual_kb_tag","embeddable":true,"href":"https:\/\/mybox.com\/help\/ro\/wp-json\/wp\/v2\/manual_kb_tag?post=9424"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}