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
What is jdbc url for mysql?
What happens if we don't close the connection in jdbc?
What's the benefit for specifying constraints like not null, primary key explicitly instead of specifying it against the column ?
How does jdbc connect to database?
How do I receive a ResultSet from a stored procedure?
How can we maintain the integrity of a database by using jdbc?
What does adapter class provide?
Can resultset be null in java?
What are the measures to connect to the db using jdbc?
How do I retrieve a whole row of data at once, instead of calling an individual ResultSet.getXXX method for each column?
Give a way to check that all result sets have bin accessed and update counts are generated by execute method.
Is jdbc and orm?
What is the query used to display all tables names in SQL Server (Query analyzer)?
How we can you use preparedstatement.
What is an SQL Locator?