Foreign keys , Database Management System

Foreign Keys and NULL

Let us take the relation:                

DEPT

DEPT ID

DNAME

BUDGET

D1

Marketing

10M

D2

Development

12M

D3

Research

5M

 

EMP

EMP

ID

ENAME

DEPT

ID

SALARY

E1

Rahul

D1

40K

E2

Aparna

D1

42K

E3

Ankit

D2

30K

E4

Sangeeta

 

35K

Assume that Sangeeta is not assigned any section. In the EMP tuple corresponding to Sangeeta, thus, there is no genuine section number that can serve as the appropriate value for the DEPTID foreign key. Thus, one cannot verify BUDGET and DNAME for Sangeeta's department as those values are NULL. This may be actual circumstances where the person has newly joined and is undergoing training and will be allocated to a department only on finishing of the training. Thus, NULL in foreign key values might not be a logical error.

Thus, the foreign key definition may be redefined to conatin NULL as an acceptable value in the foreign key for which there is no require to find a matching tuple.

Is there any other constraint that may be applicable on the attribute values of the entities?

Yes, these constraints are mostly linked to the domain and termed as the domain constraints.

Posted Date: 3/7/2013 1:39:57 AM | Location : United States







Related Discussions:- Foreign keys , Assignment Help, Ask Question on Foreign keys , Get Answer, Expert's Help, Foreign keys Discussions

Write discussion on Foreign keys
Your posts are moderated
Related Questions
Write a Query that uses the UNION Operator 1. Use the Software Experts database to:   a. Display the first and the last name of all consultants who worked on any projects f

Differentiate between the object oriented decomposition and the structured decomposition? Process-oriented (structural) decomposition divides a complex process, function or tas

Boyce-Code Normal Form (BCNF) A relationship is said to be in BCNF if it is already in 3NF and the left hand side of each dependency is a candidate key. A relation who is in 3N

Eliminate Redundant Data In the "Database Relation" above, the primary key is made up of the D-ID and the Emp-ID. The database-name relies only on the D-ID. The similar databas

Define the following constraints for the table client. (i) BAL_DUE must be at least 1000. (ii) NAME is a unique key. (i)ALTER TABLE CLIENT ADD CONSTRAINT CLIENT_BAL_DUE_C1

Explain the term- Periodic recomputation Periodic recomputation:  Base values are often updated in bunches. Sometimes, it is possible to just recompute all derived attributes p

What is Structured Query Langauge (SQL)? SQL is a powerful set-oriented language which was formed by IBM research for the databases that adhere to the relational model. It havi

Text Processing: Use readLines to read SOU.txt into R. Create a vector called Pres containing the names of the presidents giving each speech. To do this, rst identify the lin

For the question given below, you are required to submit design and implementation documentation as described over the page. Design, implement (in Java), test and document a set of

What are object interaction diagrams? Object interaction diagrams are the diagrams that used to describe order in which messages are communicated in execution of an operation,