Wednesday, November 20, 2013

SQL

Primary Key:-
  • A column or a group of columns in a table which uniquely identifies a row. 
  • It can not accept null value
  • It is created as
    CONSTRAINT pk_name PRIMARY KEY (column1, column2, ...)
  • A table can have only one primary key column(s)
  • It created a clustered index by default
  • It can be referred as a foreign key in some other table

Unique Key:-
  •  A column or a group of columns in a table which uniquely identifies a row.
  •  It can  accept null value
  • It is created as
    CONSTRAINT uk_name UNIQUE (column1, column2, ...)
  • A table can have more than one unique key column(s)
  • It creates a non clustered index by default
  • It can not be referred as a foreign key in other table 


No comments:

Post a Comment

SpringBoot Application Event Listeners

When a spring boot application starts few events occurs in below order ApplicationStartingEvent ApplicationEnvironmentPreparedEvent Applicat...