Example of primary key, Database Management System

Assignment Help:

Suppose that in an organisation, an employee may do different roles in dissimilar projects. Say, RAM is doing coding in one project and doing designing in another. Suppose that the information is set by the organisation in 3 different relations named EMPLOYEE, PROJECT and ROLE. The ROLE relation tells the different roles needed in any project.

Suppose that the relational schema for the above 3 relations are:

EMPLOYEE (EMPID, Name, Designation)

PROJECT (PROJID, Proj_Name, Details)

 ROLE (ROLEID, Role_description)

In the relations over EMPID, PROJID and ROLEID are not NULL and unique, respectively. As we can clearly see, we can recognize the complete instance of the entity set employee by the attribute EMPID. Thus EMPID is the primary key of the relation EMPLOYEE. Likewise PROJID and ROLEID are the primary keys for the relations PROJECT and ROLE respectively.

Let ASSIGNMENT is a relationship among entities EMPLOYEE and PROJECT

and ROLE, Explain which employee is working on which project and what the

role of the employee is in the given project. Figure shows the E-R diagram for these entities and relationships.

821_Example of Primary Key.png

Figure: E-R diagram for employee role in development team

Let us consider sample relation instances as

 PROJECT

PROJID

Proj_name

Details

TCS

Traffic Control

System

For traffic

shaping.

LG

Load Generator

To simulate load

for input in TCS.

B++1

B++_TREE

ISS/R turbo sys

 

EMPLOYEE  

EMPID

Name

Designation

101

RAM

Analyst

102

SITA

Receptionist

103

ARVIND

Manager

ASSIGNMENT

ROLEID

Role_descrption

1000

Design

2000

Coding

3000

Marketing

 

 

Role

PROJID

Proj_name

Details

101

TCS

1000

101

LG

2000

102

B++1

3000

We can describe the relational scheme for the relation ASSIGNMENT as follows: ASSIGNMENT (EMPID, PROJID, and ROLEID)

Please note down now that in the relation ASSIGNMENT (as per the definition to be taken as R2) EMPID is the foreign key in ASSIGNMENT relation; it references the relation EMPLOYEE (as per the definition to be taken as R1) where EMPID is the primary key. Likewise ROLEID and PROJID in the relation ASSIGNMENT are foreign keys referencing the relation ROLE and PROJECT respectively.

Now after defining the theory of foreign key, we can proceed to talk about the real integrity constraints namely Entity Integrity and Referential Integrity.


Related Discussions:- Example of primary key

In tuple relational calculus p1- p2 is equivalent to, In tuple relational ...

In tuple relational calculus P1 → P2 is equivalent to ? A In tuple relational calculus P1→  P2 is equivalent to ¬P1 V P2. (The logical implication expression A  B, meaning

Define data independence, Data independence seems that "the application is...

Data independence seems that "the application is independent of the access strategy and storage structure of data". In other words, the ability to change the schema definition in o

Many-to-many relationship, Many-to-many : Entities in A and B are related w...

Many-to-many : Entities in A and B are related with any number of entities from each other. Example: Taught_by Relationship among course and faculty. One faculty member ca

Explanation of system architecture of dbms, Q.   With the help of a suitabl...

Q.   With the help of a suitable diagram gives module wise explanation of system architecture of DBMS. Sol. A Database management is a collection of interrelated data and col

What is explicit update, What is Explicit update In explicit update,...

What is Explicit update In explicit update, each derived attribute is defined with respect to one, or more fundamental base object(s). The object designer determines that de

What is dbms and what are functions of dbms, What is DBMS and what are func...

What is DBMS and what are functions of DBMS? DBMS consist of collection of integrated data and set of program to admission those data. The functions performed by a typical

The result of the union operation between r1 and r2, The result of the UNIO...

The result of the UNION operation between R1 and R2 is a relation that includes? The result of the operation between R1 and R2 includes all the tuples of R1 and R2 which have c

Define the immediate update, Define the Immediate Update The immediate...

Define the Immediate Update The immediate update methods may apply changes to the database on disk before the transaction arrives a successful conclusion. Though, these change

Disadvantages or unsecure, In Database software have only pure security or ...

In Database software have only pure security or some dis secured by administrator?

Relational schema, crete a data base relationship model Entity: ...

crete a data base relationship model Entity: Students; Professors; Dormitories buildings; Attributes of students: Name; Address; Dorm;

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd