0% found this document useful (0 votes)
497 views15 pages

Arid Agriculture University, Rawalpindi: Q.No. Marks Obtained

The resulting fragments from the original predicates do not fulfill the correctness rules of fragmentation because: - The fragments are not disjoint - An employee can satisfy multiple predicates (e.g. an employee can be a manager and have a salary > $1500) and would be placed in multiple fragments. To modify the predicates to obey the correctness rules: 1) Apply COM-MIN to the predicates: P1': Job-Title = 'PRESIDENT' P2': Job-Title = 'MANAGER' AND Salary < $1500 P3': Job-Title = 'ANALYST' P4': Salary < $1500 P5': Salary >= $1500 AND Commission =

Uploaded by

musab
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
497 views15 pages

Arid Agriculture University, Rawalpindi: Q.No. Marks Obtained

The resulting fragments from the original predicates do not fulfill the correctness rules of fragmentation because: - The fragments are not disjoint - An employee can satisfy multiple predicates (e.g. an employee can be a manager and have a salary > $1500) and would be placed in multiple fragments. To modify the predicates to obey the correctness rules: 1) Apply COM-MIN to the predicates: P1': Job-Title = 'PRESIDENT' P2': Job-Title = 'MANAGER' AND Salary < $1500 P3': Job-Title = 'ANALYST' P4': Salary < $1500 P5': Salary >= $1500 AND Commission =

Uploaded by

musab
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 15

Pir Mehr Ali Shah

Arid Agriculture University, Rawalpindi


Office of the controller of Examinations
Mid Exam / Spring 2020 (Paper Duration 48 hours)
To be filled by Teacher

Course No.: CS-600 Course Title: Distributed Database Systems


Total Marks: 12 Date of Exam: 20-06-2020
Degree: BSCS/BSIT Semester: 6 (M) Section: A
Marks
Q.No. 1 2 3 4 5 6 7 8 9 10 Obtained/
Total Marks
Marks
Obtained
Total Marks in Words:
Name of the teacher: SAB Un Nisa
Who taught the course: Signature of teacher / Examiner:

To be filled by Student

Registration No.: ………………………………………….……… Name: ………………………………………………..

Note: Copy paste will carry 0 marks, do not share your assignment with any one, only
upload on university LMS after completing your assignment.

Answer the following questions.

Q.No.1. Consider the following scenarios and answer the given questions? (Marks 03)
Case 1:

The Inter Board Committee of Chairmen (IBCC) was established in 1972 under a resolution of
the Ministry of Education to exchange information among member education and textbook
Boards, coordination activities of the Boards, achieve fair of uniformity of academics,
evaluation and curricula standards and to promote curricula and co-curricular activities on
the inter-board basis.

IBCC also grant equivalence to foreign qualification with corresponding Pakistani certificates
at Secondary School Certificate (SSC) and Higher Secondary School Certificate (HSSC). IBCC
also attests certificates and diplomas, issued by Boards of Intermediate and Secondary
Education and Boards of Technical Education in Pakistan.

Specific to the certificates and diplomas attestation the IBBC work as per the following
manner.p

The certificates and diplomas are sent to the relevant board there are different certificate
awarding and awarding boards in Pakistan. All boards have their databases. The certificates
and diplomas are checks by the relevant board official with the help of their Owen databases,
then the attested certificates and diplomas are sent back to the IBBC.
During the current COVID-19 pandemic this process has many hurdles.to ease the certificates
and diplomas attestation process during this COVID-19 pandemic the management has
decided to distribute the systems so that all the board is connected with each other through
the distributed database system.

Case 2:

BigStore is a very large online mart dealing with multiple products online. This store has a
large chain of branches across the country.

Currently, BigStore operates with a centralized database system. This database is placed at
the server resides at the head office. All the branches are connected with the main head
office. All major operations (inventory management) takes place at a central site.

During the COVID-19 pandemic, the online users are increasing rapidly and the number of
requests is very large. Due to this situation, there is a reliability and performance issue with
the BigStore database systems.

Now the management has decided to convert the centralized database into a distributed
database system to overcome the issues regarding reliability and performance.

Suppose you are the system analyst, keeping in mind the system Please answer the following
questions. Please justify your answer with proper logical reasoning.

i. Which architecture you prefer for case 1 and case 2


ii. Which design approach you prefer for case 1 and case 2 (draw diagram of your design
approach for this system)
iii. Which distribution you may prefer for case 1 and case 2 (Please consider the reliability and
performance factor in your mind)
Answer:

Q.No.2. Consider the STUDENT table with sample data: (Marks 05)
STUDENT

StRoll StName StAddress StClass StGPA CR

101 Muhammad Ashraf Kotli BSCS 2.65


102 Bilal Ahmed Qazi Rawalpindi BSIT 3.45 101
103 Mohammad Zahid Iqbal Islamabad BSCS 3.68
104 Muhammad Bilal Ahmad Lahore BSSE 3.00 103
Write SQL Queries

iv. Create table with given attributes


CREATE TABLE STUDENT (
StRoll int primary key,
StName varchar(255),
StAddress varchar(255),
StClass varchar(255),
StGPA float,
CR int
);
v. Insert given data in the table

INSERT INTO STUDENT (StRoll, StName, StAddress, StClass, StGPA, CR)


VALUES (101, ‘Muhammad Ashraf’, ‘Kotli’,’BSCS’,2.65,’ ’);

INSERT INTO STUDENT (StRoll, StName, StAddress, StClass, StGPA, CR)


VALUES (102, ‘Bilal Ahmed Qazi’, ‘rawalpind’,’BSIT’,3.45,’101’);

INSERT INTO STUDENT (StRoll, StName, StAddress, StClass, StGPA, CR)


VALUES (103, ‘Mohammad Zahid Iqbal’, ‘islambad’,’BSCS’,3.68,’ ’);

INSERT INTO STUDENT (StRoll, StName, StAddress, StClass, StGPA, CR)


VALUES (104, ‘Muhammad Bilal Ahmad’, ‘lahore’,’BSSE’,3.00,’103’);

vi. Display records of students whose name start with “Muhammad” or “Mohammad”
SELECT * FROM STUDENT WHERE StName LIKE ’Muhammad%’ OR StName
LIKE’Mohammad%’;
vii. Delete records of students whose name contain “Ahmad” or “Ahmed
DELETE * FROM STUDENT WHERE StName LIKE ‘%Ahmad%’ OR StName LIKE ‘%Ahmed%’
viii. Display name of the Students represented by Roll# 101 and 102 and name of their CR
SELECT StName FROM STUDENT WHRERE StRoll=101 and StRoll=102
UNION
SELECT Stname FROM STUDENT WHERE StRoll=101 and StRoll=102 and CR IS NOT NULL;

OR
SELECT StName , cr.Stname FROM STUDENT
WHRERE StRoll=101 and StRoll=102
CR IN ( SELECT cr.Stname
FROM STUDENT cr
WHERE StRoll=101 and StRoll=102 and CR IS NOT NULL);

Answer:

Q.No.3.

EMPLOYEE

Emp-Id Emp-Name Job-Title Hire-Date Salary Commission


1001 M. Junaid PRESIDENT 1991-11-18 6000.00 USD
1002 M. Usman MANAGER 1991-05-01 2750.00 USD
1003 M. Awais MANAGER 1991-06-09 2550.00 USD
1004 M. Jawad MANAGER 1991-04-02 2957.00 USD
1005 M. Ali ANALYST 1997-04-19 3100.00 USD
1006 M. Azhar ANALYST 1991-12-03 3100.00 USD
1007 M. Adeel CLERK 1990-12-18 900.00 USD
1008 M. Imran SALESMAN 1991-02-20 1700.00 USD 400.00 USD
1009 M. Nazer SALESMAN 1991-02-22 1350.00 USD 600.00 USD
1010 M. Asad SALESMAN 1991-09-28 1350.00 USD 1500.00USD
1011 M. Sadiq SALESMAN 1991-09-08 1600.00 USD 0.00 USD
1012 M. Kamarn CLERK 1997-05-23 1200.00 USD
7j M. Khuram CLERK 1991-12-03 1050.00 USD
8i76671013
1014 M. Usama CLERK 1992-01-23 1400.00 USD

Consider relation EMPLOYEE. Suppose there are two applications that access EMPLOYEE. The first is
issued at four sites and attempts to find the Salary of employee by given their numbers. Assume that
we have set the simple predicates for application 1 are P1: Job-Title= PRESIDENT,P2: Job-Title=
MANAGER, P3: Job-Title= ANALYST The second application is issued at two sites where the employee
with a salary less than 15,00 USD are managed at one site, whereas those with salary grater then 15,
00 USD are managed at a second site. Suppose we set the simple predicates for site 2 are P4:
Salary<15,00 USD, P5: Salary>=15,00 USD and P6: Commission= 400.00 USD.

1. Perform a horizontal fragmentation of relation EMP with respect to the predicates above.
2. Explain why the resulting fragments of Employee does not fulfill the correctness rules of
fragmentation.
3. Modify the predicates so that they partition EMP obeying the correctness rules of
fragmentation. To do this, modify the predicates (apply COM-MIN), compose all minterm
predicates and deduce the corresponding implications, and then perform a horizontal
fragmentation of EMP based on these minterm predicates. Finally, show that the result has
completeness, reconstruction and disjointness properties. (Marks 04)

Answer:
Explain why the resulting fragments of Employee does not fulfill the correctness rules of
fragmentation.
Modify the predicates so that they partition EMP obeying the correctness rules of
fragmentation. To do this, modify the predicates (apply COM-MIN), compose all minterm
predicates and deduce the corresponding implications, and then perform a horizontal
fragmentation of EMP based on these minterm predicates. Finally, show that the result has
completeness, reconstruction and disjointness properties.

You might also like