what is the difference between primary key & foreign key?

Answer Posted / pravin

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.

Examples:
Imagine we have a STUDENTS table that contains a record for
each student at a university. The student's unique student
ID number would be a good choice for a primary key in the
STUDENTS table. The student's first and last name would not
be a good choice, as there is always the chance that more
than one student might have the same name.

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

what is the need of indexing topic in oracle? where do we use in a Java project? any other option other than using this to get the same result where we use indexing ?

2042


What are a cluster and non-cluster index?

572


What is tns name?

543


1) What is ONE_SIZE_FITS_ALL approach? 2) Explain the Common & Variable Header of DATA FILE? 3) What are the Drawbacks to using OMF DB? and the Advantages? 4) List out the Advantages of Undo T.spaces over the Undo SEGMENT? 5) Difference between the Temporary tablespace with TEMPFILE and the Tablespace with TEMPORARY Keyword? 6) What are the situation extents are freeing for reuse.

1605


How to bring a tablespace online?

518






Can you have more than one content canvas view attached with a window ?

1815


Can we create database in oracle using command line ?

581


State some uses of redo log files?

554


What happens internally when the user types userID/password@string in SQL PLUS Thanks-Bhaskar

3823


How to recover a dropped table in oracle?

603


What are the restrictions on external table columns?

547


How do you get nicely formatted results from an oracle procedure that returns a reference cursor?

548


What is Redo Log Buffer in Oracle?

627


How to end the current transaction in oracle?

552


What's dateware house and what's clustor with practicle example

1635