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
Concurrency issues Data integrity: Threads accessing same object need to be synchronized, such as: banking account. Deadlock: One or more threads in system are perman

Importance Of File Organisation In Database To execute a database efficiently, there are various design tradeoffs needed. One of the most vital ones is the file Organisation. F

Express the subsequent query in SQL assumes which the data is stored within EMPLOYEE table with relevant fields (i) Display name, job, salary, and hire date of employee who are

a publishing company produce scientific books on various subjects. the books are written by authors who specialize in one particular subject. the company employs editors who, not n

Explain trivial dependency? Functional dependency of the form α ->β. is trivial if α C β. Trivial functional dependencies are satisfied by all the relations.

Explain the term High level DML? High level DML A high-level or non-procedural DML permit the user to specify what data is needed without specifying how it is to be acquired.

Give two profit of Reuse of Code. Reusing the implementation . Place existing class directly inside a new class. The new class can be made up of any number and type of the oth

Define query optimization. Query optimization refers to the process of search the lowest -cost method of evaluating a given query.

What is Oracle databse structure? Oracle database structure: The relational model has three main aspects: Structures: Structures are well-defined objects which store th

What does the cardinality ratio specify? Mapping cardinalities or cardinality ratios state the number of entities to which another entity can be associated. Mapping cardinaliti