primary key and foreign key

download primary key and foreign key

of 4

Transcript of primary key and foreign key

  • 7/29/2019 primary key and foreign key

    1/4

  • 7/29/2019 primary key and foreign key

    2/4

    Foreign key will allow "Null values" and "Duplicatevalues"and it refers to a primary key in another table.

    what is the difference between primary key & foreign key?

    Answer#9

    primary key is used to identify a row and it doesnot allownull values. It avoids duplication of rows.

    whereas foreign key refers to a column or combination ofcolumns included in the defenition of referential integrity.

    what is the difference between primary key & foreign key?

    Answer#10

    Primary key is used to identify a row in a table and itdoesnot allow null values. It avoids duplication of rows.

    whereas foreign key refers to a column or combination ofcolumns included in the defenition of referential integrity

    what is the difference between primary key & foreign key?

    Answer#11

    foreign key is NULLforeign key reference as Primary key in another table

    Primary key is uniqueprimary key is not NULL and

    what is the difference between primary key & foreign key?

    Answer

    #12

    primary key is a keyword .that refers to the unique

    valuein the particular record.it cant have null

    foreign key is always keyword that refers primary key.ithasnull value.its refers to another table

    what is the difference between primary key & foreign key?

    Answer#13

    foregin key reference a primary key in another table

    and primary key is used to identify a row.

    what is the difference between primary key & foreign key?

    Answer#14

    primary key does not allow duplicate and null valuesbut foreign key allows null values it refers primary key

    what is the difference between primary key & foreign key?

    Answer primary key is a constraint key that can not contain a

    http://www.allinterview.com/viewpost/79217.htmlhttp://www.allinterview.com/viewpost/79217.htmlhttp://www.allinterview.com/viewpost/82502.htmlhttp://www.allinterview.com/viewpost/82502.htmlhttp://www.allinterview.com/viewpost/85036.htmlhttp://www.allinterview.com/viewpost/85036.htmlhttp://www.allinterview.com/viewpost/90108.htmlhttp://www.allinterview.com/viewpost/90108.htmlhttp://www.allinterview.com/viewpost/101679.htmlhttp://www.allinterview.com/viewpost/101679.htmlhttp://www.allinterview.com/viewpost/106551.htmlhttp://www.allinterview.com/viewpost/106551.htmlhttp://www.allinterview.com/viewpost/79217.htmlhttp://www.allinterview.com/viewpost/82502.htmlhttp://www.allinterview.com/viewpost/85036.htmlhttp://www.allinterview.com/viewpost/90108.htmlhttp://www.allinterview.com/viewpost/101679.htmlhttp://www.allinterview.com/viewpost/106551.html
  • 7/29/2019 primary key and foreign key

    3/4

    #15 nullor duplicate values.foriegn key is a reference key ,before referencing theforiegn key parent table field or fields must have primarykey.If u can try to insert a value in referencing field,newrecord that must contain parent field

    what is the difference between primary key & foreign key?

    Answer#16

    primary key is the unique value,but its not nul values..this kry is avoided dublicate values

    foreign key is always references the primary key.

    what is the difference between primary key & foreign key?

    Answer#17

    Primary is unique one. Each table has only one primarykey.But not allow null values.

    Foreign key is opposite of primary. It is reference ofprimary key from another table. It allow Null value. Eachtable can have more than one foreign key.

    Foreign key is used to link one to another table.

    what is the difference between primary key & foreign key?

    Answer#18

    primary key of a relation is a candidate key that hasbeendesignated as the main key.It doesn't has null value.

    A foreign key is an attribute in a relation that can beused as a key to another relation.It allow null andduplicate value.

    what is the difference between primary key & foreign key?

    Answer#19

    Foreign key = Florida Keys (Keys in a foreign land)Primary Key = The main key you use to enter you home

    what is the difference between primary key & foreign key?

    Answer#23 Primary key is a keyword.It should not have null value and duplicate value.We can have only one primary key in a table and thevalueshould be unique.

    Foreign key is a keyword.It can have null value and duplicate value.We can have more than one foreign key for a table andthis

    http://www.allinterview.com/viewpost/111703.htmlhttp://www.allinterview.com/viewpost/111703.htmlhttp://www.allinterview.com/viewpost/132537.htmlhttp://www.allinterview.com/viewpost/132537.htmlhttp://www.allinterview.com/viewpost/146411.htmlhttp://www.allinterview.com/viewpost/146411.htmlhttp://www.allinterview.com/viewpost/149910.htmlhttp://www.allinterview.com/viewpost/149910.htmlhttp://www.allinterview.com/viewpost/151023.htmlhttp://www.allinterview.com/viewpost/151023.htmlhttp://www.allinterview.com/viewpost/182878.htmlhttp://www.allinterview.com/viewpost/182878.htmlhttp://www.allinterview.com/viewpost/111703.htmlhttp://www.allinterview.com/viewpost/132537.htmlhttp://www.allinterview.com/viewpost/146411.htmlhttp://www.allinterview.com/viewpost/149910.htmlhttp://www.allinterview.com/viewpost/151023.htmlhttp://www.allinterview.com/viewpost/182878.html
  • 7/29/2019 primary key and foreign key

    4/4

    froeign key table references the primary key table

    what is the difference between primary key & foreign key?

    Answer#25

    A primary key is an combination of attributes thatuniquelyidentifies each row in a relation. A primary key isdesignated by underlining the attribute name. The

    primarykey of an entity set allows us to distinguish among thevarious entities of the set.

    A foreign key is an attribute in a relation of databasethat serves as the primary key of another relation in thesame database.

    Foreign Key

    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, onlyvalues that are supposed to appear in the database are permitted.For example, say we have two tables, a CUSTOMER table that includes all customer data, and anORDERS table that includes all customer orders. The constraint here is that all orders must beassociated with a customer that is already in the CUSTOMER table. In this case, we will place aforeign key on the ORDERS table and have it relate to the primary key of the CUSTOMER table.This way, we can ensure that all orders in the ORDERS table are related to a customer in theCUSTOMER table. In other words, the ORDERS table cannot contain information on a customerthat is not in the CUSTOMER table.

    primary keyThe primary key of a relational table uniquely identifies each record in the table. It can eitherbe a normal attribute that is guaranteed to be unique (such as Social Security Number in atable with no more than one record per person) or it can be generated by the DBMS (such as aglobally unique identifier, or GUID, in Microsoft SQL Server). Primary keys may consist of asingle attribute or multiple attributes in combination.

    Candidate Key

    -- A candidate key is a combination of attributes that can be uniquely used to identify adatabase record without any extraneous data. Each table may have one or more candidatekeys. One of these candidate keys is selected as the table primary key.

    What is Normalization?

    Normalization is the process of efficiently organizing data in a database. There aretwo goals of the normalization process: eliminating redundant data (forexample, storing the same data in more than one table) and ensuring datadependencies make sense (only storing related data in a table). Both of theseare worthy goals as they reduce the amount of space a database consumes andensure that data is logically stored.

    http://www.allinterview.com/viewpost/195147.htmlhttp://www.allinterview.com/viewpost/195147.htmlhttp://databases.about.com/library/glossary/bldef-table.htmhttp://www.allinterview.com/viewpost/195147.htmlhttp://databases.about.com/library/glossary/bldef-table.htm