Difference between primary key and unique key ?
Answer Posted / madhumita majhi
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 non-clustered index by default.
Another major difference is that, primary key doesn't allow
NULLs, but unique key allows one NULL only.
Unique Key: Identify the row by uniquely, means if you are
inserting a records into the table suppose you already
inserted a record with ID 101 and another record you are
inserting with the same ID then it will give an error
(unique key voilation).
Prmary Key:Once you define a primay key on a particular
column then a column become a mandatory field.That means
you need to insert something on it, you can not leave as a
blank otherwise it will give an error as primary key
voilation.
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
What query tells you how much space a tablespace named test is taking up, and how much space is remaining?
Can a parameter be passed to a cursor?
How to connect asp pages to oracle servers?
How do I uninstall oracle client from windows?
How to delete multiple rows from a table in oracle?
How to invoke the data pump export utility?
interview questions with answer for cts
What the is the diff between local index and global index. give some example.
I have some query regarding Report generation from Oracle Apps "PO module". I have to generate a report where table columns are as below: Vendor_name Invoice No PO Number Item_Quantity Value of Goods Date of Shipping Name_of_the_transport Date_of_receipt_issued. Now my questions is :from which table/column I can get the information of "Name_of_the_transport" column. Thanks in advance.
Please send me Informatica 8.1 certification dumps, my mail id mona85gupta@gmail.com
How to convert times to characters in oracle?
while i take backup using ibm tsm the following errors occurred: rman-03009 ora-19513 ora-27206 ora-19502 ora-27030 ora-ora19511
What are the different types of partitions in oracle?
Explain the use of rows option in exp command.
Can you create a synonym without having a table?