![]() ![]() ![]() A table can have only one column on which the AUTO_INCREMENT property can be assigned.This will lead to faster and quick retrieval of the resultset. Most often, the datatype of the column that is used to define the primary key is kept integer because MySQL works very fast with integers.Any table in MySQL can have only one or none of the primary key defined on it.If we try inserting or updating such columns with NULL value then MySQL will issue an error. Hence, the NULL value cannot be stored in the columns that define the primary key. When the primary key is defined on the column then implicitly the NOT NULL constraint is applied for the column or columns on which the primary key constraint is defined.When a single column is used for defining the primary key then it must contain the unique values stored in each of the rows of the table while in case of defining the primary key on multiple columns the combination of the value of all the columns on which the primary key is defined should have unique value together. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |