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
How many objectname will be created for a single table drop function? Why 'flashback' query giving error "ORA-38312: original name is used by an existing object" while getting the table?
What is a system tablespace and when it is created?
What is meant by joins? List out the types of joins.
Hi this srilatha. I comlpeted my Oracle-hrms. can u provide me interview questions on Core hr, payroll,sshr,OLM etc..
What is Trigger in Oracle?
What is a trigger and what are its types?
How to lock and unlock a user account in oracle?
Does oracle charge for java?
How to create an oracle database?
How many file formats are supported to export data?
Which dictionary view(s) would you first look at to understand or get a high-level idea of a given Advanced Replication environment?
When do you get a .pll extension in oracle?
How to write a query with a left outer join in oracle?
Explain mutating triggers.
How to shutdown your 10g xe server?