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

What are the parts of sql language, What are the parts of SQL language? ...

What are the parts of SQL language? The SQL language has various parts: data - definitition language  Data manipulation language  View definition  Transaction contr

Define granularity and hierarchy of granularity of locks, Define granularit...

Define granularity, hierarchy of granularity of locks & multiple granularity locking. Explain the modified two phase locking along with multiple granularity locking. Ans: The s

Draw the dependency diagram for the relation, Consider the subsequent relat...

Consider the subsequent relation   Professor (Pfcode, dept, head, time)   It is assumed that      (i) A professor can work in much more than one

Define weak and strong entity sets, Define weak and strong entity sets? ...

Define weak and strong entity sets? Weak entity set: entity set that do not have key attribute of their own are known as weak entity sets. Strong entity set: Entity set that

Built online transaction processing, Question: A DBMS built for Online ...

Question: A DBMS built for Online Transaction Processing (OLTP) is generally regarded as unsuitable for data warehousing. Each system is designed with a different set of requir

What is a query tree, What is a query tree?     Ans:  A query tree, as ...

What is a query tree?     Ans:  A query tree, as well known as operator graph, is a tree data structure that corresponds to a relational algebra expression. It denotes the inpu

Define multivalued dependency and 4nf, Define multivalued dependency and 4N...

Define multivalued dependency and 4NF.  Ans:  Multivalued Dependency - Assume R be a relation schema and let α ⊆ R and β ⊆ R. The multivalued dependency  α →→β   holds o

Reflects organisational structure, Reflects organisational structure: Many ...

Reflects organisational structure: Many organizations are distributed over various locations. If an organisation has many offices in dissimilar cities, databases used in such an ap

External failure-database recovery and security, External failure : A failu...

External failure : A failure can also result because of an external cause, such as earthquakes, fire, floods, etc. The database must be duly backed up to avoid troubles occurring d

Compare three clustering algorithms in weka, Compare three clustering algor...

Compare three clustering algorithms in Weka. For this comparison, you will need to use at least two different datasets. Run the algorithms on the datasets, and use the visual

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