Webmaster Forum Rules | Posting Guide | Contact Us | Testimonials | Contributing Geek Program | Advertise on Geek/Talk
Welcome to the GeekTalk Webmaster Discussion Forums from GeekVillage.com

Click Here To Register. It's Free!

Go Back   geek/talk: Signature-free discourse for serious web publishers > YOUR CREATION: Building & Maintaining A Web Site > Web Development - Programming / Coding
User Name
Password
Register FAQ Calendar Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Display Modes
Old 01-30-2017, 05:07 AM   #1
beingchinmay
Registered User
 
Join Date: Jun 2015
Posts: 245
Arrow What's the difference between a primary key and a unique key in SQL?

Both primary key and unique enforce uniqueness of the column on which they are defined. But by default primary key creates a clustered index on the column, where are unique creates a nonclustered index by default. Another major difference is that, primary key does not allow NULLs, but unique key allows one NULL only.






Asthi jivak | Fat Cutter
beingchinmay is offline   Reply With Quote
Old 08-17-2017, 12:13 AM   #2
ketul
Registered User
 
Join Date: Aug 2014
Location: bangalore
Posts: 391
Default

Primary Key is used to identify a row (record) in a table,

whereas Unique-key is to prevent duplicate values in a column (with the exception of a null entry). 2. Indexing: By default SQL-engine creates Clustered Index on primary-key if not exists and Non-Clustered Index on Unique-key
ketul is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
MYSQL Primary Key ccole Web Development - Programming / Coding 3 11-26-2001 12:53 AM
Extracting a 3DES key from an IBM 4758 DaveUK geek/yak 0 11-09-2001 03:30 PM
Key Internet Journal Shuts Down hammer Making Money with CPC and/or CPM Programs 0 08-18-2001 08:36 AM
What is the Key to Getting Traffic to Message Boards? affiliateblunders Marketing Your Website Online 10 07-04-2000 11:45 PM
What is the Key to Getting Traffic to Message Boards? affiliateblunders Making Money with CPC and/or CPM Programs 2 06-29-2000 05:24 PM

Please support our advertisers. They ensure our survival.

All times are GMT -5. The time now is 02:50 PM.


GeekVillage.com is copyright © 1998-2015 Curiosity Cave - Science gifts for clever kids. All rights reserved.
Powered by vBulletin® Version 3.7.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.