Challenger App

No.1 PSC Learning App

★
★
★
★
★
1M+ Downloads
A database designer wants to ensure that no two customers can have the some Aadhaar Number in a table. Identify the SQL constraint suitable for this requirement.

AUNIQUE

BNOT NULL

CCHECK

DDEFAULT

Answer:

A. UNIQUE

Read Explanation:

SQL Constraint for Uniqueness

  • The UNIQUE constraint is specifically designed to ensure that all values in a column are different, preventing duplicate entries across rows.
  • When applied to an Aadhaar Number field, it ensures data integrity by enforcing that no two records share the same identifier, which is critical for identity verification systems.
  • Key Characteristics of UNIQUE:
    1. It allows NULL values (unless a NOT NULL constraint is also explicitly applied).
    2. A table can have multiple UNIQUE constraints defined on different columns.
    3. It automatically creates a unique index on the specified column to optimize query performance during data retrieval and validation.
  • Comparison with PRIMARY KEY:
    • A PRIMARY KEY constraint also enforces uniqueness but automatically implies NOT NULL and allows only one such key per table.
    • While a PRIMARY KEY is used to uniquely identify a row, the UNIQUE constraint is preferred for columns like Aadhaar Number, PAN, or Email that are unique but not necessarily the primary identifier of the record.

Related Questions:

Which HTTP method used in the following URL?

www.example.com? lang= ML&page= 2

Program used to make executable file from a source file is called:
....... describes the physical storage structure of a database.

വാദം (A): HTML പ്ലാറ്റ്ഫോം സ്വതന്ത്രമാണ്

കാരണം (R): വെബ് ബ്രൗസർ ഉപയോഗിച്ച് ഏത് സിസ്റ്റത്തിലും HTML ഡോക്യുമെന്റുകൾ കാണാൻ കഴിയും

In a relational database, a Foreign Key is primarily used to