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 advantages of object oriented databases, What are the advantag...

What are the advantages of object oriented databases in comparison with others? Why it is still not widely used? Object oriented designs are coherent, efficient and less prone

Synonyms, Synonyms It allows short names or alternative names for objects....

Synonyms It allows short names or alternative names for objects. Example :               CREATE SYNONYM D30               FOR EMPD30;   Now if we give command:

What is storage manager, What is storage manager? A storage manager is ...

What is storage manager? A storage manager is a program module that gives the interface among the low level data keeps in a database and the application programs and queries su

What is d command work in the respect of qbe, What is D command work in the...

What is D command work in the respect of QBE? D: It is the command inside QBE to delete tuple(s) from the relation.

Three level architecture of dbms-logical architecture, Three Level Architec...

Three Level Architecture of DBMS or Logical DBMS Architecture The logical architecture defines how data in the database is perceived by users. It is not deals with how the da

Components of a typical database environment, Question: (a) List four d...

Question: (a) List four disadvantages of the File Processing System as compared to the Database Systems. (b) The integrity of a database is enforced by integrity rules. One

Example of transaction? , Example :; transfers transfer_amount from x's acc...

Example :; transfers transfer_amount from x's account to y's account ; Supposes x&y both accounts exist TRANSACTION (x, y, transfer_amount) Start transaction IF X AND Y

Write a short note on qbe, Write a short note on QBE? Stands for "Quer...

Write a short note on QBE? Stands for "Query By Example." QBE is a feature involved along with various database applications which gives user-friendly techniques of running da

Ddl compiler-database management system, DDL Compiler The DDL compile...

DDL Compiler The DDL compiler changes the data definition statements (such as CREATE TABLE .... in SQL) into a set of tables having metadata tables. These tables have infor

Define a view and a trigger, Define a view and a trigger. Construct a view ...

Define a view and a trigger. Construct a view for the above relations that have the information about suppliers and the elements they supply. The view holds the S#, SNAME, P# , PNA

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