Question:

While creating a table, which constraint does not allow insertion of duplicate values in the table?

Show Hint

Use UNIQUE for preventing duplicates,
PRIMARY KEY combines UNIQUE and NOT NULL.
  • UNIQUE
  • DISTINCT
  • NOT NULL
  • HAVING
Hide Solution
collegedunia
Verified By Collegedunia

The Correct Option is A

Solution and Explanation

In database management, constraints are rules enforced on columns to ensure data integrity.
The UNIQUE constraint ensures that all values in a column are different.
It prevents duplicate values from being inserted into that column.
For example, you might set the email column to be UNIQUE so that no two records can have the same email address.
The DISTINCT keyword is used in SELECT queries to remove duplicate rows from the result but is not a constraint.
NOT NULL ensures that a column cannot have NULL values but allows duplicates.
HAVING is used with GROUP BY to filter groups, not to enforce data integrity on insert.
Therefore, the only option that prevents duplicate values at the table level is UNIQUE.
So, the correct answer is option (A).
Was this answer helpful?
0
0

Top Questions on SQL

View More Questions

Questions Asked in CBSE CLASS XII exam

View More Questions