Search
 
SCRIPT & CODE EXAMPLE
 

SQL

difference between primary key and unique key

Primary Key: 
1. Primary Key is used to identify all the records in a relation uniquely.
2. Primary key can not have null value.
3. Primary key can be only one per table.
4. Primary key creats clustered index.

Unique key: 
1. Unique key is also used to identify a records uniquely.
2. Unique key can accept one null value.
3. Unique key can be multiple in a table.
4. Unique key creates non-clustered index.
Comment

PREVIOUS NEXT
Code Example
Sql :: Cast for print sql 
Sql :: postgres select duplicate columns 
Sql :: date format mysql 
Sql :: index column size too large. the maximum column size is 767 bytes. mysql 
Sql :: how to query date in sql server 
Sql :: mysql check date range 
Sql :: empty table sqlite 
Sql :: output table plsql 
Sql :: ERROR 1046 (3D000): No database selected 
Sql :: oracle drop job if exists 
Sql :: check database size in gb mysql 
Sql :: postgresql subtract date/hours 
Sql :: mysql regexp match word 
Sql :: count in sql and diff 
Sql :: postgres update multiple columns 
Sql :: sql select count distinct 
Sql :: mysql remove auto increment 
Sql :: sql order by alphabetical 
Sql :: if column value is null then in mysql 
Sql :: commit in sql 
Sql :: mysql date format 
Sql :: sql database connectivity 
Sql :: pagination in sql 
Sql :: sql alter table order by 
Sql :: df to sql pandas sql achemy 
Sql :: postgres trigger insert into another table 
Sql :: mysql auto increment column 
Sql :: insert into auto increment mysql 
Sql :: create empty table from existing table 
Sql :: there is no unique constraint matching given keys for referenced table 
ADD CONTENT
Topic
Content
Source link
Name
7+2 =