{"id":1316,"date":"2025-10-28T19:50:07","date_gmt":"2025-10-28T16:50:07","guid":{"rendered":"https:\/\/khusseintakhmazov24.thkit.ee\/wp\/eng\/?p=1316"},"modified":"2025-10-30T20:28:43","modified_gmt":"2025-10-30T17:28:43","slug":"keys","status":"publish","type":"post","link":"https:\/\/khusseintakhmazov24.thkit.ee\/wp\/eng\/?p=1316","title":{"rendered":"Keys"},"content":{"rendered":"\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_85 counter-hierarchy ez-toc-counter ez-toc-grey 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\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/khusseintakhmazov24.thkit.ee\/wp\/eng\/?p=1316\/#PRIMARY_KEY\" >PRIMARY KEY<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/khusseintakhmazov24.thkit.ee\/wp\/eng\/?p=1316\/#CANDIDATE_KEY\" >CANDIDATE KEY<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/khusseintakhmazov24.thkit.ee\/wp\/eng\/?p=1316\/#FOREIGN_KEY\" >FOREIGN KEY<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/khusseintakhmazov24.thkit.ee\/wp\/eng\/?p=1316\/#COMPOUND_KEY\" >COMPOUND KEY<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/khusseintakhmazov24.thkit.ee\/wp\/eng\/?p=1316\/#COMPOSITE_KEY\" >COMPOSITE KEY<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/khusseintakhmazov24.thkit.ee\/wp\/eng\/?p=1316\/#SUPER_KEY\" >SUPER KEY<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/khusseintakhmazov24.thkit.ee\/wp\/eng\/?p=1316\/#UNIQUE_KEY\" >UNIQUE KEY<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/khusseintakhmazov24.thkit.ee\/wp\/eng\/?p=1316\/#SIMPLE_KEY\" >SIMPLE KEY<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/khusseintakhmazov24.thkit.ee\/wp\/eng\/?p=1316\/#Links\" >Links<\/a><\/li><\/ul><\/nav><\/div>\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"PRIMARY_KEY\"><\/span>PRIMARY KEY<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>PRIMARY KEY<\/strong> \u2013 is a column or group of columns in a table that uniquely identifies each row in the table. A primary key cannot be duplicated, which means that the same value cannot appear more than once in the table. A table cannot have more than one primary key.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The Aircraft table uses aircraftID as the primary key to uniquely identify each aircraft.<br>Each record must have a different ID \u2013 duplicates are not allowed.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: sql; title: ; notranslate\" title=\"\">\nCREATE TABLE Lennuk (\n    lennukID INT AUTO_INCREMENT,   -- Unique ID for each aircraft\n    mudel VARCHAR(50),             -- Name of the aircraft model\n    istekohtade_arv INT,           -- Number of seats on the plane\n    PRIMARY KEY (lennukID)         -- primary key\n);\n<\/pre><\/div>\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" src=\"https:\/\/khusseintakhmazov24.thkit.ee\/wp\/wp-content\/uploads\/2025\/10\/image-20.png\" alt=\"\" class=\"wp-image-1405\"\/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Rules for defining the primary key:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>No two rows may have the same primary key value.<\/li>\n\n\n\n<li>Each row must have a primary key value.<\/li>\n\n\n\n<li>The primary key field cannot be empty.<\/li>\n\n\n\n<li>The value of the primary key column must never be changed or updated if any foreign key references that primary key.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>ALTERNATE KEY<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>ALTERNATE KEYS<\/strong> &#8211; is a column or group of columns in a table that uniquely identifies each row in the table. A table can have multiple primary key options, but only one can be designated as the primary key. All keys that are not primary keys are called alternate keys.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In AircraftAlternate, aircraftID is the primary key, while registration_number is an alternate key \u2013 a second unique identifier that was not selected as the primary key.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: sql; title: ; notranslate\" title=\"\">\nCREATE TABLE LennukAlternate (\n    lennukID INT AUTO_INCREMENT,       -- Master key\n    registreerimis_number VARCHAR(20) UNIQUE,  -- Alternative key\n    PRIMARY KEY (lennukID)\n);\n<\/pre><\/div>\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" src=\"https:\/\/khusseintakhmazov24.thkit.ee\/wp\/wp-content\/uploads\/2025\/10\/image-28.png\" alt=\"\" class=\"wp-image-1413\"\/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"CANDIDATE_KEY\"><\/span>CANDIDATE KEY<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>CANDIDATE KEY<\/strong> &#8211; In SQL, it is a set of attributes that uniquely identifies tuples in a table. A candidate key is a superkey that has no duplicate attributes. The primary key should be selected from among the candidate keys. Each table must have at least one candidate key. A table can have multiple candidate keys, but only one primary key.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Candidate key features:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>It must contain unique values.<\/li>\n\n\n\n<li>In SQL, a candidate key can have multiple attributes.<\/li>\n\n\n\n<li>It must not contain null values.<\/li>\n\n\n\n<li>It should contain the minimum number of fields to ensure uniqueness.<\/li>\n\n\n\n<li>It must uniquely identify each record in the table.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">In AircraftCandidate, both aircraftID and registration_number are candidate keys.<br>Either could be used as the primary key \u2013 we chose aircraftID.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: sql; title: ; notranslate\" title=\"\">\nCREATE TABLE LennukCandidate (\n    lennukID INT AUTO_INCREMENT,       -- Possible master key\n    registreerimis_number VARCHAR(20), -- Another possible key\n    PRIMARY KEY (lennukID),            -- Selected as primary key\n    UNIQUE (registreerimis_number)     -- Candidate key (second option)\n);\n\n<\/pre><\/div>\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" src=\"https:\/\/khusseintakhmazov24.thkit.ee\/wp\/wp-content\/uploads\/2025\/10\/image-23.png\" alt=\"\" class=\"wp-image-1408\"\/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" src=\"https:\/\/khusseintakhmazov24.thkit.ee\/wp\/wp-content\/uploads\/2025\/10\/image-3.png\" alt=\"\" class=\"wp-image-1357\"\/><\/figure>\n\n\n\n<p class=\"has-small-font-size wp-block-paragraph\">(see sait oli selle hea n\u00e4ide)<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"FOREIGN_KEY\"><\/span>FOREIGN KEY<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>FOREIGN KEY <\/strong>&#8211; is a column that creates a link between two tables. The purpose of a foreign key is to maintain data integrity and enable navigation between two different entities. It acts as a cross-reference between two tables, as it refers to the primary key of the other table.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In the FlightSchedule table, the flightID is a foreign key that references the Aircraft table.<br>This creates a relationship whereby each flight must belong to an existing aircraft.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: sql; title: ; notranslate\" title=\"\">\nCREATE TABLE LennuGraafik (\n    lendID INT AUTO_INCREMENT,     -- Flight table ID\n    lennukID INT,                  -- Connection to the Aircraft table\n    kuupaev DATE,                  -- Flight date\n    PRIMARY KEY (lendID),          -- Master key\n    FOREIGN KEY (lennukID) REFERENCES Lennuk(lennukID) -- Foreign key\n);\n<\/pre><\/div>\n\n\n<p class=\"wp-block-paragraph\">In this DBMS example, we have two tables: teachers and departments in a school. However, it is not possible to see which search works in which department.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In this table, we can add the foreign key Deptcode to the teacher&#8217;s name and create a link between the two tables.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" src=\"https:\/\/khusseintakhmazov24.thkit.ee\/wp\/wp-content\/uploads\/2025\/10\/image-24.png\" alt=\"\" class=\"wp-image-1409\"\/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">This concept is also known as reference integrity.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"COMPOUND_KEY\"><\/span>COMPOUND KEY<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>COMPOUND KEY<\/strong> &#8211; There are two or more attributes that allow you to reliably identify a specific record. It is possible that each column is not unique in the database on its own. However, when combined with another column or columns, the combination of composite keys becomes unique. The purpose of a composite key in a database is to uniquely identify each record in a table.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In FlightCrew, flightID and pilotID together form a composite key.<br>This uniquely identifies which pilot is assigned to which flight.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: sql; title: ; notranslate\" title=\"\">\nCREATE TABLE LennuMeeskond (\n    lendID INT,                    -- Flight ID\n    pilootID INT,                  -- Pilot ID\n    PRIMARY KEY (lendID, pilootID) -- Compound key\n);\n<\/pre><\/div>\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" src=\"https:\/\/khusseintakhmazov24.thkit.ee\/wp\/wp-content\/uploads\/2025\/10\/image-25.png\" alt=\"\" class=\"wp-image-1410\"\/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"COMPOSITE_KEY\"><\/span>COMPOSITE KEY<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>COMPOSITE KEY<\/strong> &#8211; is a combination of two or more columns that uniquely identifies rows in a table. The combination of columns ensures uniqueness, although individual uniqueness is not guaranteed. Therefore, they are combined to uniquely identify records in a table.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The difference between a composite key and a composite key is that any part of a composite key can be a foreign key, but a composite key may or may not be part of a foreign key.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full is-resized\"><img decoding=\"async\" src=\"https:\/\/khusseintakhmazov24.thkit.ee\/wp\/wp-content\/uploads\/2025\/10\/image-8.png\" alt=\"\" class=\"wp-image-1362\" style=\"width:410px;height:auto\"\/><\/figure>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: sql; title: ; notranslate\" title=\"\">\nCREATE TABLE LennuAjad (\n    lennukID INT,                  -- Airplane ID\n    kuupaev DATE,                  -- Flight date\n    PRIMARY KEY (lennukID, kuupaev) -- Composite key\n);\n<\/pre><\/div>\n\n\n<p class=\"wp-block-paragraph\">LennuAjadis uses a composite key consisting of two columns: aircraft ID and date.<br>Together, these make each entry unique \u2013 an aircraft can fly on multiple days, but not twice on the same day.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" src=\"https:\/\/khusseintakhmazov24.thkit.ee\/wp\/wp-content\/uploads\/2025\/10\/image-26.png\" alt=\"\" class=\"wp-image-1411\"\/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"SUPER_KEY\"><\/span>SUPER KEY<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>SUPER KEY<\/strong> &#8211; A set of one or more attributes (columns) that uniquely identifies a record is known as a superkey. It may contain additional attributes that are not important in terms of uniqueness, but which nevertheless uniquely identify the row. For example, STUD_NO, (STUD_NO, STUD_NAME), etc.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>A superkey is a group of one or more keys that identifies the uniqueness of rows in a table. It supports NULL values in rows.<\/li>\n\n\n\n<li>A superkey may contain additional attributes that are not necessary to ensure uniqueness.<\/li>\n\n\n\n<li>For example, if the column &#8220;STUD_NO&#8221; can uniquely identify a student, adding &#8220;SNAME&#8221; to it still forms a valid superkey, even though it is not necessary.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">AircraftSuperkeys allow both the aircraftID and registration_number to uniquely identify each entry.<br>Any combination of columns that guarantees uniqueness is called a superkey.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: sql; title: ; notranslate\" title=\"\">\nCREATE TABLE LennukSuperkey (\n    lennukID INT,\n    registreerimis_number VARCHAR(20),\n    mudel VARCHAR(50),\n    PRIMARY KEY (lennukID)         -- This is one possible super key\n);\n<\/pre><\/div>\n\n\n<figure class=\"wp-block-image size-full is-resized\"><img decoding=\"async\" src=\"https:\/\/khusseintakhmazov24.thkit.ee\/wp\/wp-content\/uploads\/2025\/10\/image-10.png\" alt=\"\" class=\"wp-image-1364\" style=\"width:535px;height:auto\"\/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"UNIQUE_KEY\"><\/span>UNIQUE KEY<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>UNIQUE KEY<\/strong> &#8211; ensures that all values in a column or group of columns are unique throughout the entire table. In addition, if a unique key is applied to multiple columns at once, every combination of values in those columns must be unique throughout the entire table.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Another feature of unique keys is that, unlike primary keys, they can contain NULL values, which can be unique. However, duplicate non-null values are not allowed.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Let&#8217;s look at a table called Student, using the desc command to display the column with a unique key:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">desc Student;<br>+-----------------+-------------+------+-----+---------+-------+<br>| Field           | Type        | Null | Key | Default | Extra |<br>+-----------------+-------------+------+-----+---------+-------+<br>| id              | int(11)     | YES  | UNI | NULL    |       |<br>| name            | varchar(60) | YES  |     | NULL    |       |<br>| national_id     | bigint(20)  | NO   |     | NULL    |       |<br>| birth_date      | date        | YES  |     | NULL    |       |<br>| enrollment_date | date        | YES  |     | NULL    |       |<br>| graduation_date | date        | YES  |     | NULL    |       |<br>+-----------------+-------------+------+-----+---------+-------+<br><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Here, the column id is marked with the UNI key, which indicates that it is a unique key. In addition, we see the YES mark under the Null column, which means that the id column may contain NULL values.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Another example:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In the Pilot table, the personal code is marked as unique, which means that two pilots cannot have the same personal code.<br>This ensures data consistency without it being the primary key.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: sql; title: ; notranslate\" title=\"\">\nCREATE TABLE Piloot (\n    pilootID INT AUTO_INCREMENT,   -- Piloodi ID\n    isikukood VARCHAR(11) UNIQUE,  -- Iga piloodi isikukood on unikaalne\n    nimi VARCHAR(100),             -- Pilot&#039;s name\n    PRIMARY KEY (pilootID)         -- Master key\n);\n<\/pre><\/div>\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"SIMPLE_KEY\"><\/span>SIMPLE KEY<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>SIMPLE KEY<\/strong> &#8211; is a single attribute or column that uniquely identifies each row or record in a table. For example, a student ID can be a simple key in a student table, as no two students can have the same ID. A simple key is also called a primary key and usually has some restrictions, such as not allowing null values or duplicate values. A simple key can also be referenced by other tables as a foreign key to create a relationship between them.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" src=\"https:\/\/khusseintakhmazov24.thkit.ee\/wp\/wp-content\/uploads\/2025\/10\/image-11.png\" alt=\"\" class=\"wp-image-1365\"\/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Table The airport uses a simple key \u2013 one column (stationID) \u2013 as its primary key.<br>Each airport is identified by a unique ID.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: sql; title: ; notranslate\" title=\"\">\nCREATE TABLE Lennujaam (\n    jaamID INT AUTO_INCREMENT,     -- Airport ID\n    jaama_nimi VARCHAR(100),       -- Airport name\n    linn VARCHAR(100),             -- town\n    PRIMARY KEY (jaamID)           -- Simple key (one column)\n);\n<\/pre><\/div>\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" src=\"https:\/\/khusseintakhmazov24.thkit.ee\/wp\/wp-content\/uploads\/2025\/10\/image-27.png\" alt=\"\" class=\"wp-image-1412\"\/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Links\"><\/span>Links<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>DBMS Keys: Candidate, Super, Primary, Foreign Key Types with Example \u2013 <a href=\"https:\/\/www.guru99.com\/dbms-keys.html\">https:\/\/www.guru99.com\/dbms-keys.html<\/a><\/li>\n\n\n\n<li>Keys in Relational Model \u2013&nbsp;<a href=\"https:\/\/www.geeksforgeeks.org\/dbms\/types-of-keys-in-relational-model-candidate-super-primary-alternate-and-foreign\">https:\/\/www.geeksforgeeks.org\/dbms\/types-of-keys-in-relational-model-candidate-super-primary-alternate-and-foreign<\/a><\/li>\n\n\n\n<li>Understanding MySQL Keys: MUL, PRI, and UNI Explained \u2013&nbsp;<a href=\"https:\/\/www.baeldung.com\/sql\/mysql-keys-mul-pri-uni\">https:\/\/www.baeldung.com\/sql\/mysql-keys-mul-pri-uni<\/a><\/li>\n\n\n\n<li>What is the difference between a composite key and a simple key? &#8211; <a href=\"https:\/\/www.linkedin.com\/advice\/0\/what-difference-between-composite-key-simple-txnce#:~:text=A%20simple%20key%20is%20also,establish%20a%20relationship%20between%20them.\">https:\/\/www.linkedin.com\/advice\/0\/what-difference-between-composite-key-simple-txnce#:~:text=A%20simple%20key%20is%20also,establish%20a%20relationship%20between%20them.<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>PRIMARY KEY PRIMARY KEY \u2013 is a column or group of columns in a table that uniquely identifies each row in the table. A primary key cannot be duplicated, which means that the same value cannot appear more than once in the table. A table cannot have more than one primary key. The Aircraft table [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[23],"tags":[],"class_list":["post-1316","post","type-post","status-publish","format-standard","hentry","category-database"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.9 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Keys - Hussein Tahmazov portfolio eng<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/khusseintakhmazov24.thkit.ee\/wp\/eng\/?p=1316\" \/>\n<meta property=\"og:locale\" content=\"en_GB\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Keys - Hussein Tahmazov portfolio eng\" \/>\n<meta property=\"og:description\" content=\"PRIMARY KEY PRIMARY KEY \u2013 is a column or group of columns in a table that uniquely identifies each row in the table. A primary key cannot be duplicated, which means that the same value cannot appear more than once in the table. A table cannot have more than one primary key. The Aircraft table [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/khusseintakhmazov24.thkit.ee\/wp\/eng\/?p=1316\" \/>\n<meta property=\"og:site_name\" content=\"Hussein Tahmazov portfolio eng\" \/>\n<meta property=\"article:published_time\" content=\"2025-10-28T16:50:07+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-10-30T17:28:43+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/khusseintakhmazov24.thkit.ee\/wp\/wp-content\/uploads\/2025\/10\/image-20.png\" \/>\n<meta name=\"author\" content=\"Hussein\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Hussein\" \/>\n\t<meta name=\"twitter:label2\" content=\"Estimated reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"7 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/khusseintakhmazov24.thkit.ee\\\/wp\\\/eng\\\/?p=1316#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/khusseintakhmazov24.thkit.ee\\\/wp\\\/eng\\\/?p=1316\"},\"author\":{\"name\":\"Hussein\",\"@id\":\"https:\\\/\\\/khusseintakhmazov24.thkit.ee\\\/wp\\\/eng\\\/#\\\/schema\\\/person\\\/f75baafdedeb73cd9ef1d8d87311bbb0\"},\"headline\":\"Keys\",\"datePublished\":\"2025-10-28T16:50:07+00:00\",\"dateModified\":\"2025-10-30T17:28:43+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/khusseintakhmazov24.thkit.ee\\\/wp\\\/eng\\\/?p=1316\"},\"wordCount\":1171,\"commentCount\":0,\"image\":{\"@id\":\"https:\\\/\\\/khusseintakhmazov24.thkit.ee\\\/wp\\\/eng\\\/?p=1316#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/khusseintakhmazov24.thkit.ee\\\/wp\\\/wp-content\\\/uploads\\\/2025\\\/10\\\/image-20.png\",\"articleSection\":[\"Database\"],\"inLanguage\":\"en-GB\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/khusseintakhmazov24.thkit.ee\\\/wp\\\/eng\\\/?p=1316#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/khusseintakhmazov24.thkit.ee\\\/wp\\\/eng\\\/?p=1316\",\"url\":\"https:\\\/\\\/khusseintakhmazov24.thkit.ee\\\/wp\\\/eng\\\/?p=1316\",\"name\":\"Keys - Hussein Tahmazov portfolio eng\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/khusseintakhmazov24.thkit.ee\\\/wp\\\/eng\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/khusseintakhmazov24.thkit.ee\\\/wp\\\/eng\\\/?p=1316#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/khusseintakhmazov24.thkit.ee\\\/wp\\\/eng\\\/?p=1316#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/khusseintakhmazov24.thkit.ee\\\/wp\\\/wp-content\\\/uploads\\\/2025\\\/10\\\/image-20.png\",\"datePublished\":\"2025-10-28T16:50:07+00:00\",\"dateModified\":\"2025-10-30T17:28:43+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/khusseintakhmazov24.thkit.ee\\\/wp\\\/eng\\\/#\\\/schema\\\/person\\\/f75baafdedeb73cd9ef1d8d87311bbb0\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/khusseintakhmazov24.thkit.ee\\\/wp\\\/eng\\\/?p=1316#breadcrumb\"},\"inLanguage\":\"en-GB\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/khusseintakhmazov24.thkit.ee\\\/wp\\\/eng\\\/?p=1316\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-GB\",\"@id\":\"https:\\\/\\\/khusseintakhmazov24.thkit.ee\\\/wp\\\/eng\\\/?p=1316#primaryimage\",\"url\":\"https:\\\/\\\/khusseintakhmazov24.thkit.ee\\\/wp\\\/wp-content\\\/uploads\\\/2025\\\/10\\\/image-20.png\",\"contentUrl\":\"https:\\\/\\\/khusseintakhmazov24.thkit.ee\\\/wp\\\/wp-content\\\/uploads\\\/2025\\\/10\\\/image-20.png\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/khusseintakhmazov24.thkit.ee\\\/wp\\\/eng\\\/?p=1316#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/khusseintakhmazov24.thkit.ee\\\/wp\\\/eng\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Keys\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/khusseintakhmazov24.thkit.ee\\\/wp\\\/eng\\\/#website\",\"url\":\"https:\\\/\\\/khusseintakhmazov24.thkit.ee\\\/wp\\\/eng\\\/\",\"name\":\"Hussein Tahmazov portfolio eng\",\"description\":\"Junior Software Developer\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/khusseintakhmazov24.thkit.ee\\\/wp\\\/eng\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-GB\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/khusseintakhmazov24.thkit.ee\\\/wp\\\/eng\\\/#\\\/schema\\\/person\\\/f75baafdedeb73cd9ef1d8d87311bbb0\",\"name\":\"Hussein\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-GB\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/e10dcd9bae99726932e7824a93117d2a279e021c0f4ff3cc2972016580127314?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/e10dcd9bae99726932e7824a93117d2a279e021c0f4ff3cc2972016580127314?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/e10dcd9bae99726932e7824a93117d2a279e021c0f4ff3cc2972016580127314?s=96&d=mm&r=g\",\"caption\":\"Hussein\"},\"sameAs\":[\"https:\\\/\\\/khusseintakhmazov24.thkit.ee\\\/wp\"],\"url\":\"https:\\\/\\\/khusseintakhmazov24.thkit.ee\\\/wp\\\/eng\\\/?author=1\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Keys - Hussein Tahmazov portfolio eng","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/khusseintakhmazov24.thkit.ee\/wp\/eng\/?p=1316","og_locale":"en_GB","og_type":"article","og_title":"Keys - Hussein Tahmazov portfolio eng","og_description":"PRIMARY KEY PRIMARY KEY \u2013 is a column or group of columns in a table that uniquely identifies each row in the table. A primary key cannot be duplicated, which means that the same value cannot appear more than once in the table. A table cannot have more than one primary key. The Aircraft table [&hellip;]","og_url":"https:\/\/khusseintakhmazov24.thkit.ee\/wp\/eng\/?p=1316","og_site_name":"Hussein Tahmazov portfolio eng","article_published_time":"2025-10-28T16:50:07+00:00","article_modified_time":"2025-10-30T17:28:43+00:00","og_image":[{"url":"https:\/\/khusseintakhmazov24.thkit.ee\/wp\/wp-content\/uploads\/2025\/10\/image-20.png","type":"","width":"","height":""}],"author":"Hussein","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Hussein","Estimated reading time":"7 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/khusseintakhmazov24.thkit.ee\/wp\/eng\/?p=1316#article","isPartOf":{"@id":"https:\/\/khusseintakhmazov24.thkit.ee\/wp\/eng\/?p=1316"},"author":{"name":"Hussein","@id":"https:\/\/khusseintakhmazov24.thkit.ee\/wp\/eng\/#\/schema\/person\/f75baafdedeb73cd9ef1d8d87311bbb0"},"headline":"Keys","datePublished":"2025-10-28T16:50:07+00:00","dateModified":"2025-10-30T17:28:43+00:00","mainEntityOfPage":{"@id":"https:\/\/khusseintakhmazov24.thkit.ee\/wp\/eng\/?p=1316"},"wordCount":1171,"commentCount":0,"image":{"@id":"https:\/\/khusseintakhmazov24.thkit.ee\/wp\/eng\/?p=1316#primaryimage"},"thumbnailUrl":"https:\/\/khusseintakhmazov24.thkit.ee\/wp\/wp-content\/uploads\/2025\/10\/image-20.png","articleSection":["Database"],"inLanguage":"en-GB","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/khusseintakhmazov24.thkit.ee\/wp\/eng\/?p=1316#respond"]}]},{"@type":"WebPage","@id":"https:\/\/khusseintakhmazov24.thkit.ee\/wp\/eng\/?p=1316","url":"https:\/\/khusseintakhmazov24.thkit.ee\/wp\/eng\/?p=1316","name":"Keys - Hussein Tahmazov portfolio eng","isPartOf":{"@id":"https:\/\/khusseintakhmazov24.thkit.ee\/wp\/eng\/#website"},"primaryImageOfPage":{"@id":"https:\/\/khusseintakhmazov24.thkit.ee\/wp\/eng\/?p=1316#primaryimage"},"image":{"@id":"https:\/\/khusseintakhmazov24.thkit.ee\/wp\/eng\/?p=1316#primaryimage"},"thumbnailUrl":"https:\/\/khusseintakhmazov24.thkit.ee\/wp\/wp-content\/uploads\/2025\/10\/image-20.png","datePublished":"2025-10-28T16:50:07+00:00","dateModified":"2025-10-30T17:28:43+00:00","author":{"@id":"https:\/\/khusseintakhmazov24.thkit.ee\/wp\/eng\/#\/schema\/person\/f75baafdedeb73cd9ef1d8d87311bbb0"},"breadcrumb":{"@id":"https:\/\/khusseintakhmazov24.thkit.ee\/wp\/eng\/?p=1316#breadcrumb"},"inLanguage":"en-GB","potentialAction":[{"@type":"ReadAction","target":["https:\/\/khusseintakhmazov24.thkit.ee\/wp\/eng\/?p=1316"]}]},{"@type":"ImageObject","inLanguage":"en-GB","@id":"https:\/\/khusseintakhmazov24.thkit.ee\/wp\/eng\/?p=1316#primaryimage","url":"https:\/\/khusseintakhmazov24.thkit.ee\/wp\/wp-content\/uploads\/2025\/10\/image-20.png","contentUrl":"https:\/\/khusseintakhmazov24.thkit.ee\/wp\/wp-content\/uploads\/2025\/10\/image-20.png"},{"@type":"BreadcrumbList","@id":"https:\/\/khusseintakhmazov24.thkit.ee\/wp\/eng\/?p=1316#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/khusseintakhmazov24.thkit.ee\/wp\/eng"},{"@type":"ListItem","position":2,"name":"Keys"}]},{"@type":"WebSite","@id":"https:\/\/khusseintakhmazov24.thkit.ee\/wp\/eng\/#website","url":"https:\/\/khusseintakhmazov24.thkit.ee\/wp\/eng\/","name":"Hussein Tahmazov portfolio eng","description":"Junior Software Developer","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/khusseintakhmazov24.thkit.ee\/wp\/eng\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-GB"},{"@type":"Person","@id":"https:\/\/khusseintakhmazov24.thkit.ee\/wp\/eng\/#\/schema\/person\/f75baafdedeb73cd9ef1d8d87311bbb0","name":"Hussein","image":{"@type":"ImageObject","inLanguage":"en-GB","@id":"https:\/\/secure.gravatar.com\/avatar\/e10dcd9bae99726932e7824a93117d2a279e021c0f4ff3cc2972016580127314?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/e10dcd9bae99726932e7824a93117d2a279e021c0f4ff3cc2972016580127314?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/e10dcd9bae99726932e7824a93117d2a279e021c0f4ff3cc2972016580127314?s=96&d=mm&r=g","caption":"Hussein"},"sameAs":["https:\/\/khusseintakhmazov24.thkit.ee\/wp"],"url":"https:\/\/khusseintakhmazov24.thkit.ee\/wp\/eng\/?author=1"}]}},"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/khusseintakhmazov24.thkit.ee\/wp\/eng\/index.php?rest_route=\/wp\/v2\/posts\/1316","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/khusseintakhmazov24.thkit.ee\/wp\/eng\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/khusseintakhmazov24.thkit.ee\/wp\/eng\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/khusseintakhmazov24.thkit.ee\/wp\/eng\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/khusseintakhmazov24.thkit.ee\/wp\/eng\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1316"}],"version-history":[{"count":3,"href":"https:\/\/khusseintakhmazov24.thkit.ee\/wp\/eng\/index.php?rest_route=\/wp\/v2\/posts\/1316\/revisions"}],"predecessor-version":[{"id":1322,"href":"https:\/\/khusseintakhmazov24.thkit.ee\/wp\/eng\/index.php?rest_route=\/wp\/v2\/posts\/1316\/revisions\/1322"}],"wp:attachment":[{"href":"https:\/\/khusseintakhmazov24.thkit.ee\/wp\/eng\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1316"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/khusseintakhmazov24.thkit.ee\/wp\/eng\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1316"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/khusseintakhmazov24.thkit.ee\/wp\/eng\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1316"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}