Question
Download Solution PDFConsider 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 ?
Answer (Detailed Solution Below)
Detailed Solution
Download Solution PDFThe correct answer is Both I and II are true.
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
- 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.
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).