Index in table

Indexes An index are created in a table to find data more quickly and efficiently. This will increase performance when there is huge amount of data in a table. SQL CREATE UNIQUE INDEX Syntax Creates a unique index on a table. Duplicate values are not allowed: Syntax CREATE UNIQUE INDEX index_name ON table_name (column_name); Example…

Details

Constraints in Table

SQL constraints are used to specify rules for the data in a table, We have following constraints NOT NULL – Indicates that a column cannot store NULL value Example CREATE TABLE employee ( emp_no int NOT NULL, emp_name varchar(255) NOT NULL, emp_address varchar(255) ); SQL restrict the “emp_no” column and the “emp_name” column to not…

Details