what is primary key,unique key, foreign key? can u teach me
in simple language?
Answer Posted / mansi valani
A Foreign Key is a field in a relational table that matches
a candidate key of another table. The foreign key can be
used to cross-reference tables.
The foreign key identifies a column or set of columns in one
(referencing) table that refers to a column or set of
columns in another (referenced) table. The columns in the
referencing table must reference the columns of the primary
key or other superkey in the referenced table. The values in
one row of the referencing columns must occur in a single
row in the referenced table. Thus, a row in the referencing
table cannot contain values that don't exist in the
referenced table (except potentially NULL). This way
references can be made to link information together and it
is an essential part of database normalization. Multiple
rows in the referencing table may refer to the same row in
the referenced table. Most of the time, it reflects the one
(parent table or referenced table) to many (child table, or
referencing table) relationship.
The referencing and referenced table may be the same table,
i.e. the foreign key refers back to the same table. Such a
foreign key is known in SQL:2003 as a self-referencing or
recursive foreign key.
A table may have multiple foreign keys, and each foreign key
can have a different referenced table. Each foreign key is
enforced independently by the database system. Therefore,
cascading relationships between tables can be established
using foreign keys.
| Is This Answer Correct ? | 1 Yes | 1 No |
Post New Answer View All Answers
How do I setup a database connection?
How to fetch/retrieve the data from hieranchical database and put it into the relational database? for e.g I want to extract the data from IMS DB2 database which is a hierarchical db and load that data into the relational database which is a SQL server.Are there any tools available for directing extracting data from hierarchical db and loading into the relational database (SQL server)?
What is the DIF format and when we will use in teradata
Re: Where can i get informatica certification Exam dumps and details? please forward it to emailid:
Can you create a database in word?
What will happen non-clustered index will be created on clustered index?
What is a super key?
wHat Is THE difference between MOVEL and MOVEL(P)……….. CAN ANYONE EXPLAIN ME..
what is ad-hoc access? what is the diff b/w managed query and ad-hoc access?
If the master device is full, how do I make the master database bigger?
Which database does facebook use?
Explain the record term used in database.
How is image stored in database?
WHAT IS THE PURPOSE OF TESTING INTEGRITY OF THE UNIVERSE?
What are different types of resources?