on 10-29-2012 3:27 PM
is it always compulsory to have primary key in the table??
Hi Akshay,
Primary key are defined in SQL as an UNIQUE constraint with NOT NULL columns.
Only one set of primary keys is allowed on one table.
In simple words, primary keys are fields that are unique. it is very much necessary, it helps in uniquely identifying every record in a table.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi
Basically primary key is used to relate the tables,in future you may come across a situation where you need to get the table contents which you have created ,in those cases the declaration of primary key is
helpful.
It is up to you that whether you need the table in future or not.
it is advisable to declare.
Regards,
ASIF.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Akshay,
It looks like specifying a primary key is not required while defining a table. I checked it on HANA.
I didnot specify primary key and created table.
It will be interesting to think how each row will be considered unique, indexed. Also how the data changes will be handled.
Thanks,
Sreejith Balakrishnan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
12 | |
7 | |
3 | |
2 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.