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
What is schema

What is called query processing? Query processing refers to the range of activities included in extracting data from a database.

The Incident table, with an auto-incrementing incident number, etc, looks like: incident_num reporter date time incide

After going by the database architecture, let us now dwell on an important query: how is the data organised in a database? There are a lot of basic structures that exist in a datab

Your OS has a set of queues, each of which is protected by a lock. To enqueue or dequeue an item, a thread must hold the lock associated to the queue. You need to implement an a

Replication : It is definite as a copy of a relation. Every replica is stored at a dissimilar site. The alternative to replication is to store only single copy of a relation which

Explain the three data models namely relational, network and hierarchical and evaluate their relative advantages and disadvantages. Hierarchical Model: In hierarchical model, da

Give the limitations of SQL authorization. The code for checking authorization becomes intermixed with the rest of the application code. Implementing authorization by applic

What is Specialization? Specialization: Specialization permits you to describe new types of information (new structural types or latest domains of information), although reusin

Write short notes on Schema diagram.  A database schema along with primary key and foreign key dependencies can be depicted pictorially by schema  diagram. Every relation appea