COMPUTER SCIENCE AND ENGINEERING
SQL
Question
[CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
|
|
True
|
|
False
|
|
Either A or B
|
|
None of the above
|
Detailed explanation-1: -Answer: False. Explanation: We can’t have a Primary Key column with a NULL value.
Detailed explanation-2: -The major difference between the two occurs when it comes to null values. While we can have blank cells in a unique key, we can’t let that happen in a primary key. We can also have more than one unique key in a table.
Detailed explanation-3: -null = True. Means there is no constraint of database for the field to be filled, so you can have an object with null value for the filled that has this option. blank = True. Means there is no constraint of validation in django forms.
Detailed explanation-4: -A primary key column cannot have NULL values. A table can have only one primary key, which may consist of single or multiple fields. When multiple fields are used as a primary key, they are called a composite key.
Detailed explanation-5: -null=True will set the field’s value to NULL i.e., no data. It is basically for the databases column value. blank=True determines whether the field will be required in forms. This includes the admin and your own custom forms.