wahts is mean by primary key and unique key?

Answer Posted / bhausaheb.chate

Primary Key:- Primary Key is an attribute or a set of
attributes in a table which uniquely identifies a record
(row) in a table and no two records (rows) in the table can
have the same values for all the columns comprising the
primary key.

Unique Key:- A unique key is a key which stores unique
values (no duplicates) for that particular column.

Difference between Primary Key & Unique Key:-

1. A Unique key can store a null value and primary key
cannot store any null value.

2. A primary key can be references to another table as a
Foreign Key.

Is This Answer Correct ?    7 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is jdbc url for mysql?

588


What happens if we don't close the connection in jdbc?

483


What's the benefit for specifying constraints like not null, primary key explicitly instead of specifying it against the column ?

478


How does jdbc connect to database?

474


How do I receive a ResultSet from a stored procedure?

521






How can we maintain the integrity of a database by using jdbc?

535


What does adapter class provide?

523


Can resultset be null in java?

506


What are the measures to connect to the db using jdbc?

461


How do I retrieve a whole row of data at once, instead of calling an individual ResultSet.getXXX method for each column?

596


Give a way to check that all result sets have bin accessed and update counts are generated by execute method.

478


Is jdbc and orm?

499


What is the query used to display all tables names in SQL Server (Query analyzer)?

514


How we can you use preparedstatement.

551


What is an SQL Locator?

587