Which of the following constraints cannot take NULL values?
Which of the following constraints cannot take NULL values?
Solution
The primary key uniquely identifies each row, so it can never be NULL. This is the entity integrity rule: no attribute of a primary key may hold a NULL value.
Foreign key: it can be NULL when a row has no related row in the parent table, and it only needs to match a parent key value when it is not NULL.
Candidate key and Super key: these only need to identify rows uniquely. In SQL, columns declared UNIQUE can hold NULL, and only the candidate key chosen as the primary key gets the NOT NULL restriction.
Related questions:
2025: 21 May Shift 1
2025: 16 May Shift 1
2026: 24 May Shift 1
Calculate the degree and cardinality of the given relation below:
| ID | Name | Address | Phone No. | |
|---|---|---|---|---|
| 001 | Ajay | [email protected] | A1-Shakti Nagar, Bangalore | 55218936 |
| 002 | Amit | [email protected] | C32- Indira Nagar, Lucknow | 45321789 |
| 003 | Ashu | [email protected] | 117/82 Patel Nagar, Delhi | 98567894 |
| 004 | Ashok | [email protected] | 249-250, Motinagar, Gujrat | 97698541 |
2026: 29 May Shift 1