From 79a656e1718fbae5b435d16eefb3a207b78a1fdd Mon Sep 17 00:00:00 2001 From: Akash Sharma <35839624+Adaverse@users.noreply.github.com> Date: Tue, 12 Sep 2023 20:57:19 +0530 Subject: [PATCH] Fixing `PRIMARY_KEY` `NULL` constraint (#4465) --- .../roadmaps/sql/content/105-data-constraints/102-unique.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/data/roadmaps/sql/content/105-data-constraints/102-unique.md b/src/data/roadmaps/sql/content/105-data-constraints/102-unique.md index 74db5f63e..0d0c0cf97 100644 --- a/src/data/roadmaps/sql/content/105-data-constraints/102-unique.md +++ b/src/data/roadmaps/sql/content/105-data-constraints/102-unique.md @@ -2,7 +2,7 @@ The `UNIQUE` constraint ensures that all values in a column are different; that is, each value in the column should occur only once. -Both the `UNIQUE` and `PRIMARY KEY` constraints provide a guarantee for uniqueness for a column or set of columns. However, a primary key can contain only `NULL`, and each table can have only one primary key. On the other hand, a `UNIQUE` constraint allows for one `NULL` value, and a table can have multiple `UNIQUE` constraints. +Both the `UNIQUE` and `PRIMARY KEY` constraints provide a guarantee for uniqueness for a column or set of columns. However, a primary key cannot contain `NULL` since it uniquely identifies each row, and each table can have only one primary key. On the other hand, a `UNIQUE` constraint allows for one `NULL` value, and a table can have multiple `UNIQUE` constraints. ## Syntax ```sql @@ -51,4 +51,4 @@ ALTER TABLE table_name DROP CONSTRAINT constraint_name; ``` -Here, `constraint_name` is the name of the `UNIQUE` constraint that you want to drop. \ No newline at end of file +Here, `constraint_name` is the name of the `UNIQUE` constraint that you want to drop.