

InterviewSolution
Saved Bookmarks
1. |
In a database, a foreign key is ?(a) A data element/attribute within a data field of a data record that is not unique, and cannot be used to distinguish one data record in a database from another data record within a database table(b) A data element/attribute within a data field of a data record within a database table that is a secondary key in another database table(c) A data element/attribute within a data field of a data record within a database table that is a primary key in another database table(d) A data element/attribute within a data field of a data record that enables a database to uniquely distinguish one data record in a database from another data record within a database tableThe question was posed to me at a job interview.I'm obligated to ask this question of Foreign, Candidate, Primary, Composite, Unique Keys topic in chapter Planning Oracle Applications of Oracle |
Answer» <html><body><p>The correct choice is (c) A data element/attribute within a data <a href="https://interviewquestions.tuteehub.com/tag/field-987291" style="font-weight:bold;" target="_blank" title="Click to know more about FIELD">FIELD</a> of a data record within a database table that is a <a href="https://interviewquestions.tuteehub.com/tag/primary-1165403" style="font-weight:bold;" target="_blank" title="Click to know more about PRIMARY">PRIMARY</a> key in another database table<br/><br/>The <a href="https://interviewquestions.tuteehub.com/tag/best-390038" style="font-weight:bold;" target="_blank" title="Click to know more about BEST">BEST</a> I can explain: A FOREIGN KEY <a href="https://interviewquestions.tuteehub.com/tag/constraint-930945" style="font-weight:bold;" target="_blank" title="Click to know more about CONSTRAINT">CONSTRAINT</a> can reference columns in tables in the same database or within the same table. These are called self-referencing tables. For example, consider an employee table that contains three columns: employee_number, employee_name, and manager_employee_number. Because the manager is also an employee, there is a foreign key <a href="https://interviewquestions.tuteehub.com/tag/relationship-1183331" style="font-weight:bold;" target="_blank" title="Click to know more about RELATIONSHIP">RELATIONSHIP</a> from the manager_employee_number column to the employee_number column.</p></body></html> | |