what is primary key,unique key, foreign key? can u teach me
in simple language?
Answer Posted / pappu
The primary key of a relational table uniquely identifies
each record in the table. It can either be a normal
attribute that is guaranteed to be unique (such as Social
Security Number in a table with no more than one record per
person) or it can be generated by the DBMS (such as a
globally unique identifier, or GUID, in Microsoft SQL
Server). Primary keys may consist of a single attribute or
multiple attributes in combination
a unique key can uniquely identify each row in a table,
and is closely related to the Superkey concept. A unique
key comprises a single column or a set of columns. No two
distinct rows in a table can have the same value (or
combination of values) in those columns if NULL values are
not used. Depending on its design, a table may have
arbitrarily many unique keys but at most one primary key.
Unique keys do not enforce the NOT NULL constraint in
practice. Because NULL is not an actual value (it
represents the lack of a value), when two rows are
compared, and both rows have NULL in a column, the column
values are not considered to be equal. Thus, in order for a
unique key to uniquely identify each row in a table, NULL
values must not be used, however a column defined as unique
key column allows only one null value, which in turn can
uniquely identify that row/tuple.
A foreign key is a field (or fields) that points to the
primary key of another table. The purpose of the foreign
key is to ensure referential integrity of the data. In
other words, only values that are supposed to appear in the
database are permitted.
Is This Answer Correct ? | 2 Yes | 0 No |
Post New Answer View All Answers
What is odm in database?
Explain the various types of normalization.
What is the concept of Virtual field?
How many types of normalization? What is the use of it?
How to produce such kind of file?
How to shrink a database?
Design an ETL process( batch job/script)from source to starting that u will not be dependent on the source in the near future?please elobarate details on what are things to consider.if you'd like to do a diagram that will be great.please answer it
What are the advantages of normalizing a database.
How to do performance tunning a database in DB2 V8.2 UDB in linux
Re: Where can i get informatica certification Exam dumps and details? please forward it to emailid:
What are the types of joins?
What is a database lookup?
What are different types of clusters present?
define primary key index, bitmap index, hash index,virtual indwx
What is Object Oriented model?