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
Gyan Gurukul is a software company that provides software related solution. Ashutosh Dubey who is the director of Gyan Gurukul want a three-level schema architecture for the Gyan G

Describe the four main ways of optimising disk block access. Ans: a. Disk  b. Non-volatile writes buffers c. File organization (Clustering) d. Log-based file system

Define the Attribute Inheritance The attributes of a higher level entity set are inherited through a lower level entity set made by specialization-generalization hierarchy. Nam

Define identify relationship? Identifying relationship: An identifying relationship means in which the child table cannot be uniquely recognize without the parent. For exampl

Describe how you can simplify Operations. To simplify operation, one should use inheritance, where possible to use, to reduce the quantity of distinct operations. Introduce new

Define page. The database is partitioned into some number of fixed-length blocks, which are referred to as pages.

Is it mandatory to declare all the tables in Report by the key word tables for all the tables that exist in the structure of LDB, and are being explained in the Database part of LD

Provide Examples of different types of Time and Date formats.  It's most common store dates using a dash (-) as a colon (:)and the delimiter as the time delimiter. The given fo

1) Define a job scheduling strategy that will meet business requirement of reporting availability by 6am CST for the following cubes? Show the job scheduling dependencies in a pict

Which two files are used during operation of the DBMS? Data dictionary and transaction log are two files used during operation of the DBMS.