Plzz telll this I will mark u as brainlist in 500 words
Answers
A primary key’s main features are:
It must contain a unique value for each row of data.It cannot contain null values.
A primary key is either an existing table column or a column that is specifically generated by the database according to a defined sequence
That's all what I know.
Hope it will help you...
Short notes on primary key:
(i) A primary key is a single field or combination of fields that uniquely defines a record.
(ii) It doesn't allow duplicate and null values.
(iii) Primary key is a combination of UNIQUE and NOT NULL.
(iv) Primary key can be declared for combination of columns then it is called composite primary key.
Restriction:
(i) A table can have only one primary key.
(ii) It cannot be implemented on columns having Lob,long,long raw, varray,nested table, object,ref,timestamp with time zone.
(iii) The size of primary key can not be exceed one database block.
(iv) The same column or combination of columns can not be designed both as primary key and unique.
(v) We can add primary key constraint in all three levels:
- Column Level
- Table Level
Declaring Primary key at Column Level:
Create table Demo(empno number constraint con Primary Key, ename varchar2(10));
Declaring Primary key at Table level:
Create table Demo(empno number constraint con Primary key, ename varchar2(10), constraint con Primary key(empno);
Advantages of Primary key:
(i) It prevents to enter null data
(ii) It prevents to enter duplicate data.
(iii) It is used for indexing the table for faster data access.
(iv) It helps in making faster access for database to locate records in a table.
(v) It helps to force integrity constraints.
Disadvantages of primary key:
(i) During updation of table index need to be adjusted accordingly.This process makes the updation slower.
******************* Happy Republic Day *****************