Consider the following statements :

I - The primary key of a relation cannot contain null values.

II - Unique Key can have null values.

Which among the following is true ? 

This question was previously asked in
NIELIT Scientific Assistant CS 5 Dec 2021 Official Paper
View all NIELIT Scientific Assistant Papers >
  1. Both I and II are true
  2. Both I and II are false
  3. Only I is true
  4. Only II is true

Answer (Detailed Solution Below)

Option 1 : Both I and II are true
Free
NIELIT Scientific Assistant Quantitative Aptitude Mock Test
0.5 K Users
20 Questions 20 Marks 30 Mins

Detailed Solution

Download Solution PDF

The correct answer is Both I and II are true.

key-point-image Key Points

  • The primary key of a relation cannot contain null values. This is because the primary key uniquely identifies each record in a database table, and having a null value would violate this uniqueness constraint.
  • A unique key can have null values. While unique keys ensure that all values in a column are different, they do allow for null values, as nulls are not considered equal to any other value, including other nulls.

additional-information-image Additional Information

  • Primary keys are used to establish and enforce entity integrity, ensuring that each record in a table is unique and identifiable.
  • Unique keys help in ensuring the uniqueness of the column values but can be used in scenarios where null values are permissible.
  • Both primary keys and unique keys can be used to enforce constraints and indexes, improving the performance of database queries.
  • In a relational database, both primary and unique keys are crucial for maintaining data integrity and efficient data retrieval.
Latest NIELIT Scientific Assistant Updates

Last updated on Feb 20, 2025

-> A total number of 113 revised vacancies have been announced for the post of Scientific Assistant in Computer Science (CS), Information Technology (IT), and Electronics & Communication (EC) streams.

-> Online application form, last date has been extended up to from 17th April 2025.

->The NIELT has revised the Essential Qualifications for the post of Scientific Assistant. Candidates must possess (M.Sc.)/ (MS)/ (MCA) / (B.E.)/ (B.Tech) in relevant disciplines.

 

-> The NIELIT Scientific Assistant 2025 Notification has been released by the National Institute of Electronics and Information Technology (NIELIT).

Get Free Access Now
Hot Links: happy teen patti teen patti master 2025 teen patti 100 bonus teen patti rummy 51 bonus