Account
Categories

PRIMARY INDEX


1. PRIMARY INDEX:
It refers to an index that is automatically created when you define a primary key on a column.
For example, in the student table, when you set the id column as the primary key, this column will act as the primary index.
It ensures that each entry (row) in the table has a unique and non-empty value in the indexed column (in this case, the id column).
This avoids duplication of values and ensures that every entry in the table can be uniquely identified.

Syntax:

CREATE TABLE table_name (
column_name datatype PRIMARY KEY
);