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
Consider the following six relation schemes and their corresponding sets of functional dependencies. In each case identify a. All the candidate keys b. The highest normal for

What's the difference between a primary key and a unique key? Both primary key and unique key enforces uniqueness of the column on which they are explained. But by default prim

Let us now talk about the relational operations: SELECT The select operation is used to select few specific record from the database based on different criteria, This is a un

Define According to the levels of abstraction, the schema at the intermediate level is called  Ans: As per to the levels of abstraction, the schema at the intermediate level is

Which is the properties of entities? Attributes is the properties of entities.

What are the costs to be considered when a transaction has to be rolled back when recovering from deadlock?         Ans: A few transaction will must rolled back (made a victim)


Query Processor The query language processor is responsible for taking query language statements or shifting them from the English-like syntax of the query language to a form

Events4Fun is an event management company in Europe with branches in South America as well. The company is well-known for its efficiency, good-quality services, and affordable char

What are the different integrity constraints in RDBMS? The various integrity constraints in RDBMS are as: Primary Key: primary key is a grouping of one or more attributes