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


prototype of a distributed information system for a national car part retail outlet chain.

The ER diagram clearly showing the additional tables you have implemented. SQL table creation scripts for the tables you have set up. SQL scripts showing the sample data you

What is Relational DBMS This is our subject of study. A DBMS is relational if the data is organized into relations, that is, tables. In RDBMS, all data are kept in the well-kno

What is the use of unique function? UNIQUE function: If UNIQUE is specified then only unique values are used to computed the mean.

Attribute Preservation This is a easy and obvious necessity that includes preserving all the attributes that were there in the relation that is being decomposed.

What is called as recursive partitioning? The system repeats the splitting of the input unless each partition of the build input fits in the memory. Such partitioning is known

Suppose R is a relation with attributes A1, A2,..., An. As a function of n, tell how many superkeys R has, if: 1.1 The only key is A1. 1.2 The only key is A1 and A2. 1.3 The o

I have been given 8 differebt data warehouseing failure case studies. I need to question 4 questions for each