0% found this document useful (0 votes)
13 views5 pages

Cat2 Q

The document outlines the Continuous Assessment Test II for the Advanced Database Management Systems course, detailing the exam structure, questions, and answers related to database fragmentation, query cost estimation, multimedia database queries, and mobile database management. It includes SQL queries for employee data fragmentation, cost calculations for database queries, and considerations for mobile database systems. Additionally, it discusses the role of database servers in mobile databases and the implications of integrating them with base stations.

Uploaded by

swatheeee7
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)
13 views5 pages

Cat2 Q

The document outlines the Continuous Assessment Test II for the Advanced Database Management Systems course, detailing the exam structure, questions, and answers related to database fragmentation, query cost estimation, multimedia database queries, and mobile database management. It includes SQL queries for employee data fragmentation, cost calculations for database queries, and considerations for mobile database systems. Additionally, it discusses the role of database servers in mobile databases and the implications of integrating them with base stations.

Uploaded by

swatheeee7
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/ 5

Winter Semester 2023-2024

Continuous Assessment Test – II-- KEY

Course Name & code: Advanced Database Management Systems & CSI2004 Slot: C1+TC1
Programme Name & Branch : M.Tech. (Integrated) CSE
Class Number: VL2023240501818 / 1814 / 1817 Faculty Name: Profs. ILAYARAJA V /
RAMANATHAN L / ANAND BIHARI
Exam Duration: 90 min Maximum Marks: 50

Q.No. Question Max


Marks
1 The EMP table of TCS is as follows. 10

EMPID Name LOC Salary DOB Department


1001 Ajay Chennai 25000 4-12-2000 House
Keeping
1002 Prakash Bangalore 35000 04-01-1990 HR
1003 Mahesh Chennai 43000 05-02-2001 House
Keeping
1004 Ramesh Hyderabad 53000 15-11-1995 Production
1005 John Bangalore 67000 25-10-1995 Accounts
1006 Smith Hyderabad 55000 19-11-1999 Production
1007 Murgan Bangalore 34000 15-06-1995 Accounts
1008 Allena Hyderabad 70000 17-11-1998 Accounts

TCS management wants to implement a distributed database to increase the system's


performance. Consider the above table and answer the following with the appropriate
fragmentation method and SQL query.

(i) It is decided to maintain the employee salary (EMPID and Salary) data at
their headquarters’ server, which is located in Chennai. (2.5 Marks)
Ans: create table EMPSAL as select EMPID, Salary from EMP;
Fragmentation method is Vertical Fragmentation.
(ii) It is decided that information for a given employee (except Salary) should
be stored in the DBMS server at the branch office where that employee
works. (2.5 Marks)
Ans: create table EMP_Chennai as select EMPID, name, loc, dob, department from
EMP where LOC=’Chennai’;
Fragmentation method is Hybrid Fragmentation.

create table EMP_ Hyderabad as select EMPID, name, loc, dob, department from
EMP where LOC=’ Hyderabad’;
Fragmentation method is Hybrid Fragmentation.

create table EMP_ Bangalore as select EMPID, name, loc, dob, department from
EMP where LOC=’ Bangalore;
Fragmentation method is Hybrid Fragmentation.

Or

create table EMP_data as select EMPID, name, loc, dob, department from EMP;
This is vertical fragmentation.

create table EMP_Chennai as select * from EMP_data where LOC=’Chennai’;


Fragmentation method is Horizontal Fragmentation.

create table EMP_ Hyderabad as select * from EMP_data where LOC=’ Hyderabad’;
Fragmentation method is Horizontal Fragmentation.

create table EMP_ Bangalore as select * from EMP_data where LOC=’ Bangalore;
Fragmentation method is Horizontal Fragmentation.

(iii) It is decided to store all HR related employee at Hyderabad server. (2.5


Marks)
Ans.: Create table EMP_HR as select * from EMP where Department =
‘HR’; Fragmentation method is Horizontal Fragmentation.

(iv) Let us assume that the given table is fragmented into two tables’ a salary
table and a non-salary table. The salary table contains only the ID and
salary, and the Non-Salary table contains all attributes except Salary. Now,
it is decided to fragment the non-salary table into two tables. One table
must contain all employee information whose salary is greater than 50000,
and the other table must contain the rest of the data. (2.5 Marks)
Ans:

create table EMP_data as select EMPID, name, loc, dob, department from EMP;
create table EMP_sal as select EMPID, salary from EMP;

This is vertical fragmentation.

Create table emp1 as select * from EMP_data where EMPID in (select EMPID from
EMP_sal where salary >50000)

Create table emp2 as select * from EMP_data where EMPID in (select EMPID from
EMP_sal where salary <=50000)

This is derived fragmentation.

2 Consider the below schema. 10


Customer (Cid, Cname, DOB, IFSC_no)
Bank ( IFSC_no, Bank_name, City)
Each tuple of Customer is 30 bytes long, and a total of 900 Customer tuples are present
in the Customer table. Each tuple of Bank is 20 bytes long, and a total of 300 Bank
tuples are present. Assume that the data are stored in Distributed DBMS environment
and the Bank table is maintained at Mumbai and Customer table is
maintained at Chennai.
Consider the query:
Select * from Bank B, Customer C where B.IFSC_no= C.IFSC_no;
Find the cost of answering this query using each of the following planes.
a. Execute the query at Chennai site and send the result to Cochin site using
nested loop join. [5 marks]
Answer key
Moving relation and Page Oriented Nested Loop
Join: 100(2td+ts)+ 100td+(900*100)(td+ts)
Moving Result: 200*900 = 180000 tuples
Each tuple = (20+30) = 50 bytes long
Page size = 20*300 = 6000 bytes
6000/50=120 tuples fit in a page
Result size: 180000/120 = 1500 pages
TotalCost:100(2td+ts)+ 100td+(900*100)(td+ts) + 1500ts

b. Execute Query at Cochin site by calling both the table at Cochin site using
sort merge join. [5 Marks]
Answer key
100(2td+ts)+900(2td+ts)+3(100+900)td+1500 ts

Note: if any additional parameter is required for cost estimation you can assume that
value and give the proper justification.

3 Assume that you are working in TCS and assigned a project to develop a website for 10
selling a wide variety of Samsung products. Samsung India sells Mobile Phones, TVs
and AV, Home Appliances, screens, etc. This application requires displaying all side
images of the appliances, product description (both in English and national language)
and Product demo videos that help users understand the product functionality and
features. Using multimedia database, write the multimedia query for the following:
Answer key:
a. Create a table for the given scenario using multimedia data type for storing
product details.
CREATE TABLE product_details (product_id NUMBER(6), product_name
VARCHAR(20), prod_desc_hindi NCLOB, prod_desc CLOB,
product_photo BLOB, prod_video BFILE);

b. Customer want to know about the product description of the


PRODUCT_NAME = “SAMSUNG LED 49’ TV”.
SELECT product_name, prod_desc FROM product_details WHERE
product_name = ‘SAMSUNG LED 49 TV’

c. Employer want to update the photos of a particular product with


PRODUCT_ID=10.
CREATE DIRECTORY IMAGES AS 'C:\PICTURES';
GRANT READ ON DIRECTORY IMAGES TO PUBLIC;
UPDATE product_details SET product_photo = bfilename(‘IMAGES’,
‘smith.jpg’) WHERE product_id=10;
d. Customer want to view the Product description in his local language for the
PRODUCT_NAME = “Samsung Galaxy S24 Ultra 5G”.

SELECT product_name, prod_desc_hindi FROM product_details WHERE


product_name = ‘Samsung Galaxy S24 Ultra 5G’
4 A Courier company (BlueDart) consists of various branches in and around the city. 10
The delivery person collects the parcel regularly from different branches in different
locations and delivers it to the customer. The company has provided a mobile
application named “My Blue Dart App” to help the delivery person reach out with the
parcel to customers in and around the city. This application automatically allocates the
delivery schedule to the delivery person based on their location. This software helps
the delivery person to find their daily schedule and provide the route to reach the
destination on time without any hassle. Explain which spatial model and geometric
objects are planned to use for mobile application, and justify your answer.

Ans:
Geospatial database is suitable for this application. Application designer can
implement Entity based model or Spaghetti Model to design the database. Designer
can use one dimensional or liner object to store the location and path. To store the
location of branch office and customer house, designer can use geometry data object.

5 Discuss the role of DBS in managing the database in mobile database. Do you think 10
DBS’s should be made a part of BS’s (housed in BS’s)? First explain if it is possible
to make them as a part of BSs and then comment on the benefits of this architecture.
Suggest another location for DBS’s that works fine without affecting functionality of
the cellular system.

Ans: Role of DBS in managing the database in mobile database:


A Mobile Database System (MDS) provides full database and mobile communication
functionalities. It allows a mobile user to initiate transactions from
anywhere and at any time and guarantees their consistency preserving execution. In
the case of any kind of failure (transaction, system, and media), MDS guarantees
database recovery.
An MDS is a distributed multidatabase client/server system based on PCS or GSM.
There are some differences in GSM and PCS architecture, however, they do not
affect MDS. Database functionality is provided by a set of DBSs (database servers)
which are incorporated without affecting any aspect of the generic mobile network.
In MDS a set of general-purpose computers are interconnected through a high- speed
wired network. These computers are categorized into Fixed Hosts (FH) and Base
Stations (BS) or Mobile Support Stations (MSS). FHs are not fitted with
transceivers, so they do not communicate with mobile units. One or more BSs are
connected with a Base Station Controller or Cell Site Controller (BSC), which
coordinates the operation of BSs using its own stored software programs when
commanded by the MSC (Mobile Switching Center). To coordinate with database
servers, some additional simple data processing capability is incorporated in BSs.

Do you think DBS’s should be made a part of BS’s (housed in BS’s)?

Database servers (DBSs) can be installed (a) inside BSs or (b) inside FHs.
There are a number of problems with this setup. BSs or FHs are switches and they
have specific switching tasks to perform; incorporating database capability in them
would interfere in their switching tasks.
Besides, the size of a BS varies and inhibits incorporating complete database
functionalities in smaller BSs, and the entire architecture of a BS (hardware and
software) may have to be revised. Such a major change in a cellular platform would
be unacceptable from a mobile communication viewpoint. So, storing DBs inside the
BSs is not much profitable. In this case data switching is more. So, it would be better
to make DBs as the part of FHs.(fixed hosts). Diagram is given in above.

You might also like