pmit-6102 advanced database systems by- jesmin akhter assistant professor, iit, jahangirnagar...

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

Upload: randolf-king

Post on 13-Dec-2015

239 views

Category:

Documents


0 download

TRANSCRIPT

PMIT-6102Advanced Database Systems

By-Jesmin Akhter

Assistant Professor, IIT, Jahangirnagar University

Class Test -01Solution

It is not guaranteed that all the solutions are correct.

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

Slide 4

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

(BUDGET>2,00000 (PROJ))

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)

Solution

Slide 6

customer-name (branch-name = “Perryridge”

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

customer-name(depositor)

Slide 7

Tutorial Q3. Normalize the following relation

EMP_DEPT_PROJ

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

D

2NF:

Slide 9

SolutionStep 2:

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

Slide 10

Solution

3 NF:

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

remove them.

Slide 11

Solution

Boyce-Codd normal form (BCNF):

Slide 12

Tutorial Q4. Normalize the following relation

PART

Part_ID Descr Price Comp_ID No

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

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

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

Slide 15

Tutorial Q

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

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

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

Slide 18

Tutorial Q

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

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

Thank You

Slide 21