Computer Science, asked by aarchi82, 1 year ago

Plzz telll this I will mark u as brainlist in 500 words

Attachments:

Answers

Answered by omsinghrock999
1
A primary key is a special relational database table column (or combination of columns) designated to uniquely identify all table records.

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...
Answered by siddhartharao77
7

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 *****************

Similar questions