Top Banner
PMIT-6102 Advanced Database Systems By- Jesmin Akhter Assistant Professor, IIT, Jahangirnagar University
21

PMIT-6102 Advanced Database Systems By- Jesmin Akhter Assistant Professor, IIT, Jahangirnagar University.

Dec 13, 2015

Download

Documents

Randolf King
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: PMIT-6102 Advanced Database Systems By- Jesmin Akhter Assistant Professor, IIT, Jahangirnagar University.

PMIT-6102Advanced Database Systems

By-Jesmin Akhter

Assistant Professor, IIT, Jahangirnagar University

Page 2: PMIT-6102 Advanced Database Systems By- Jesmin Akhter Assistant Professor, IIT, Jahangirnagar University.

Class Test -01Solution

It is not guaranteed that all the solutions are correct.

Page 3: PMIT-6102 Advanced Database Systems By- Jesmin Akhter Assistant Professor, IIT, Jahangirnagar University.

Tutorial Q1. Find the employee numbers of those employees who

are assigned to all the projects that have a budget greater than $200,000

Slide 3

Page 4: PMIT-6102 Advanced Database Systems By- Jesmin Akhter Assistant Professor, IIT, Jahangirnagar University.

Slide 4

Solution ENO, PNO,PNAME,BUDGET (ASGP ROJ)

(BUDGET>2,00000 (PROJ))

Page 5: PMIT-6102 Advanced Database Systems By- Jesmin Akhter Assistant Professor, IIT, Jahangirnagar University.

Slide 5

Tutorial Q2. Find the names of all customers who have a loan at the

Perryridge branch but do not have an account at any branch of the bank. The Banking Examples are given bellow:

branch (branch-name, branch-city, assets)

customer (customer-name, customer-street, customer-city)

account (account-number, branch-name, balance)

loan (loan-number, branch-name, amount)

depositor (customer-name, account-number)

borrower (customer-name, loan-number)

Page 6: PMIT-6102 Advanced Database Systems By- Jesmin Akhter Assistant Professor, IIT, Jahangirnagar University.

Solution

Slide 6

customer-name (branch-name = “Perryridge”

(borrower.loan-number = loan.loan-number(borrower x loan))) –

customer-name(depositor)

Page 7: PMIT-6102 Advanced Database Systems By- Jesmin Akhter Assistant Professor, IIT, Jahangirnagar University.

Slide 7

Tutorial Q3. Normalize the following relation

EMP_DEPT_PROJ

Page 8: PMIT-6102 Advanced Database Systems By- Jesmin Akhter Assistant Professor, IIT, Jahangirnagar University.

Solution

Step 1: Since ENO and PNO composite key attributes

determine the all non key attributes So the given relation is in 1 NF.

Slide 8

Page 9: PMIT-6102 Advanced Database Systems By- Jesmin Akhter Assistant Professor, IIT, Jahangirnagar University.

D

2NF:

Slide 9

SolutionStep 2:

Page 10: PMIT-6102 Advanced Database Systems By- Jesmin Akhter Assistant Professor, IIT, Jahangirnagar University.

Step 3: Let us now identify the transitive dependency and remove it.

Slide 10

Solution

3 NF:

Page 11: PMIT-6102 Advanced Database Systems By- Jesmin Akhter Assistant Professor, IIT, Jahangirnagar University.

Step 4: Let us now identify the non key determinants and

remove them.

Slide 11

Solution

Boyce-Codd normal form (BCNF):

Page 12: PMIT-6102 Advanced Database Systems By- Jesmin Akhter Assistant Professor, IIT, Jahangirnagar University.

Slide 12

Tutorial Q4. Normalize the following relation

PART

Part_ID Descr Price Comp_ID No

Page 13: PMIT-6102 Advanced Database Systems By- Jesmin Akhter Assistant Professor, IIT, Jahangirnagar University.

Solution Part_ID Description

Part_ID Price

Part_ID, Comp_ID No Since Part_ID does not determine all the non key

attributes. So relation is not in 1 NF.

1 NF:

PART

Part_ID Descr Price Comp_ID No

Part_ID DESCR Price Part_ID Comp_ID No

Slide 13

Page 14: PMIT-6102 Advanced Database Systems By- Jesmin Akhter Assistant Professor, IIT, Jahangirnagar University.

Solution 2 NF: No partial dependency

3 NF: No transitive dependency

Slide 14

Part_ID DESCR Price Part_ID Comp_ID No

Part_ID DESCR Price Part_ID Comp_ID No

Page 15: PMIT-6102 Advanced Database Systems By- Jesmin Akhter Assistant Professor, IIT, Jahangirnagar University.

5. Define Distributed Computing Systems. What is being Distributed?

Slide 15

Tutorial Q

Page 16: PMIT-6102 Advanced Database Systems By- Jesmin Akhter Assistant Professor, IIT, Jahangirnagar University.

Solution

Distributed Computing systems:

A number of autonomous processing elements that are interconnected by a computer network and that cooperate in performing their assigned tasks.

The “processing element” referred to a computing device that can execute a program on its own.

Slide 16

Page 17: PMIT-6102 Advanced Database Systems By- Jesmin Akhter Assistant Professor, IIT, Jahangirnagar University.

What is being distributed?

Processing logic: processing logic or processing elements are distributed

Functions: Various functions of a computer system could be delegated to various pieces of hardware or software

Data: Data used by a number of applications may be distributed to a number of processing sites

Control: The control of the execution of various tasks might be distributed instead of being performed by one computer system.

Solution

Slide 17

Page 18: PMIT-6102 Advanced Database Systems By- Jesmin Akhter Assistant Professor, IIT, Jahangirnagar University.

6. What do you mean by Fully transparent access ? Describe Replication Transparency

Slide 18

Tutorial Q

Page 19: PMIT-6102 Advanced Database Systems By- Jesmin Akhter Assistant Professor, IIT, Jahangirnagar University.

Solution

SELECT ENAME,AMT

FROM EMP,ASG,SAL

WHERE DUR > 12

AND EMP.ENO = ASG.ENO

AND SAL.TITLE = EMP.TITLE

Paris projects

Paris employees

Paris assignments

Boston employees

Montreal projects

Paris projects

New York projects

with budget > 200000

Montreal employees

Montreal assignments

Boston

Communication

Network

Montreal

Paris

New York

Boston projects

Boston employees

Boston assignments

Boston projects

New York employees

New York projects

New York assignments

Tokyo

Fully Transparent Access:

Example:

The users can still create the above query as usual manner.

A transparent system “hides” the implementation details from users.

Fully transparent access means that the users can still create the query without paying any attention to the fragmentation, location, or replication of data, let the system worry about resolving these issues.

Slide 19

Page 20: PMIT-6102 Advanced Database Systems By- Jesmin Akhter Assistant Professor, IIT, Jahangirnagar University.

Replication Transparency

Data are replicated, the transparency issue is: The users should not be aware of the existence of

copies and the system should handle the management of copies.

The users not to be involved with handling copies and having to specify the fact that a certain action can and/or should be taken on multiple copies.

Solution

Slide 20

Page 21: PMIT-6102 Advanced Database Systems By- Jesmin Akhter Assistant Professor, IIT, Jahangirnagar University.

Thank You

Slide 21