1. ADVANCED DATABASE MANAGEMENT SYSTEM
PSDA
Submitted to: SK Jha Submitted By : Vaastav Talwar
Asst. Professor A010145020052
AIIT M.C.A.
2. PSDA 1
Distributed Database Design Case Study
Consider the distributed database architecture for a software company to manage
various projects under development at different locations. There are two tables
where different information is stored
EMP (Emp No, Emp_name, Emp_address, Salary, Proj_no ).
Project ( Proj_no , Proj_name . Proj_Incharge , Proj_HeadOffice , Proj_category ,
Proj_Completion_time )
Employee Table is horizontally fragmented based on Project No. Each Fragment
of employee table is stored at two location one at Bangalore and other at local
project site.
Project Table is fragmented in hybrid manner. First it is fragmented Horizontally
based on category. All project handled by company is divided into three category
based on completion time. Jamshedpur , Noida and Chennai is handling project
of less than six month duration . At bangalore site all project duration is six month
to one year . At Singapore project duration is more than one year.
Further horizontal fragment is divided into two part where project duration is
more than one year.
Part1 ( ( Proj_no , Proj_name . Proj_Incharge , Project HO)
part2 ( ( Proj_no , , Proj_category , ) Proj_Completion_time )
Part1 STORED AT SINGAPORE and Part2 at Bangalore
Draw a Database schema which is best suitable for above distribution
Communicati
on Network
Site 4
Noida
Site 5
Chennai
Site 1
Bangalore
Site 3
Jamshedpur
Site 2
Singapore
3. BANGALORE
EMP NO
EMP NAME
EMP ADDRESS
SALARY
PROJECT NO
CHENNAI
EMP NO
EMP NAME
EMP
ADDRESS
SALARY
PROJECT NO
SINGAPORE
EMP NO
EMP NAME
EMP
ADDRESS
SALARY
PROJECT NO
JAMSHEDPUR
EMP NO
EMP NAME
EMP ADDRESS
SALARY
PROJECT NO
NOIDA
EMP NO
EMP NAME
EMP
ADDRESS
SALARY
PROJECT NO
COMMUNIC
ATION
NETWORK
4. EMP TABLE
Emp_no Emp_name Emp_address Salary Proj_no
111 Vaastav Noida 50000 1
222 Ram Mumbai 45000 2
333 Shyam Chennai 65000 1
444 Ravi Delhi 25000 2
555 Raj Kerala 15000 3
666 Ramesh Mumbai 30000 4
777 Suresh Chennai 65000 3
888 Virat Noida 55000 5
999 Rohit UP 25000 4
EMPLOYEE TABLE AFTER FRAGMENTATION :
Every one of these fragments are stored at Bangalore site.
Emp_no Emp_name Emp_address Salary Proj_no
111 Vaastav Noida 50000 1
333 Shyam Chennai 65000 1
222 Ram Mumbai 45000 2
444 Ravi Delhi 25000 2
555 Raj Kerala 15000 3
777 Suresh Chennai 65000 3
666 Ramesh Mumbai 30000 4
999 Rohit UP 25000 4
888 Virat Noida 55000 5
5. These projects are stored at local project site as follows:
BANGALORE:
Emp_no Emp_name Emp_address Salary Proj_no
111 Vaastav Noida 50000 1
333 Shyam Chennai 65000 1
SINGAPORE:
Emp_no Emp_name Emp_address Salary Proj_no
222 Ram Mumbai 45000 2
444 Ravi Delhi 25000 2
JAMSHEDPUR:
Emp_no Emp_name Emp_address Salary Proj_no
555 Raj Kerala 15000 3
777 Suresh Chennai 65000 3
NOIDA:
Emp_no Emp_name Emp_address Salary Proj_no
666 Ramesh Mumbai 30000 4
999 Rohit UP 25000 4
CHENNAI:
Emp_no Emp_name Emp_address Salary Proj_no
888 Virat Noida 55000 5
6. PROJECT TABLE
Proj_no Proj_name Proj_incharge Proj_ho Proj_category Proj_comp
1 Project A Modi Bangalore C1 3
2 Project B Mahesh Singapore C1 4
3 Project C Amitabh Jamshedpur C1 5
4 Project D Rakesh Noida C2 10
5 Project E Bhavesh Chennai C3 15
PROJECT TABLE AFTER FRAGMENTATION:
Proj_no Proj_name Proj_incharge Proj_ho Proj_category Proj_comp
1 Project A Modi Bangalore C1 3
2 Project B Mahesh Singapore C1 4
3 Project C Amitabh Jamshedpur C1 5
4 Project D Rakesh Noida C2 10
5 Project E Bhavesh Chennai C3 15
7. It is further divided into three parts based on completion time:
1. Less than six months
Proj_no Proj_name Proj_incharge Proj_ho Proj_category Proj_comp
1 Project A Modi Bangalore C1 3
2 Project B Mahesh Singapore C1 4
3 Project C Amitabh Jamshedpur C1 5
2. More than six months but less than twelve months
Proj_no Proj_name Proj_incharge Proj_ho Proj_category Proj_comp
4 Project D Rakesh Noida C2 10
3. More than twelve months
Proj_no Proj_name Proj_incharge Proj_ho Proj_category Proj_comp
5 Project E Bhavesh Chennai C3 15
There is further horizontal fragmentation where project
completion time is more than one year :
8. Stored at Singapore:
Proj_no Proj_name Proj_incharge Proj_ho
5 Project E Bhavesh Chennai
Stored at Bangalore:
Proj_no Proj_category Proj_comp
5 C3 15
9. PSDA 2
Q The table Mentioned below records detail of orders for various items. Each order is placed on a
given date, and may include a multiplicity of items in different quantities.
Orders
OrderNo
Item
No Description Date Quantity
1 12 Screw Jan 6th 100
1 15 Bolt Jan 6th 50
2 7 Flange Feb 2nd 10
2 15 Bolt Feb 2nd 40
2 12 Screw Feb 2nd 80
Q-1Give an example of an insertion anomaly and an example of update anomaly that might occur
in the above table.
Q-2 Explain why this table is not in 2nd Normal Form.
Q-3 Transform the table into 2nd Normal Form
create table o2 ( order_no int , item_no int , description varchar(10), order_date varchar(15), quantity
int );
insert into o2( order_no , item_no , description , order_date , quantity ) values ( 1 , 12 , 'screw' ,'jan 6'
,100), (1, 15,'bolt','jan 6' , 50) , (2 , 7 , 'flange', 'feb 2' , 10) , (2 , 15 , 'bolt' ,' feb 2' , 40) , ( 2 , 12 ,
'screw' , ' feb 2 ' , 80);
alter table o2
-> modify order_no int NOT NULL;
ALTER TABLE O2 add constraint PRIMARY KEY (order_no , item_no);
10. ANS -1 An insertion anomaly is the inability to add data to the
database due to absence of other data. For example:
Updation anomaly are generated by the addition of, change to, or
deletion of data from a database table. For example:
There is also updation anomaly as if we try to change the quantity of
item number 15 of order number 1 it will change the value of item
number 2 also.
ANS-2 This table is not in 2NF as primary key is repeating and there
is partial dependency in the table orders.
ANS-3 We can transform the table into 2NF by dividing into two
tables order and items.
11.
12. PSDA 3
Q- Explain library management system with the help of dfd?
LEVEL - 0
LEVEL - 1
14. PSDA 4
You are hired to design a database for a MNC named Kingsway Solutions dealing with software
development and deployment of computers. The Company delivers various products to its
customers. The Company employs various experts, consultants and supporting staff. All
personnel are employed on long-term basis. For each project a project team is selected, grouping
employees from different departments, and a Project Manager (also an employee of the
Company) is appointed who is entirely and exclusively responsible for the control of the project,
quite independently of the Company's hierarchy. The following is a brief statement of some facts
and policies adopted by the Company.
• Each employee works in some department.
• An employee may possess a number of skills
• Every manager (including the MD) is an employee
• A department may participate in none/one/many projects.
• At least one department participates in a project.
• An employee may be engaged in none/one/many projects
• Project teams consist of at least one member.
For the above business stories, you are expected to create the following.
1. Analyze the data required.
2. Normalize the attributes.
15.
16. EMPLO
YEE
ID
EMPLOYE
E
NAME
EMPL
OYEE
AGE
EMPLO
YEE
SALARY
EMPLO
YEE
PNO
EMPLOYE
E
SKILLS
DEPT
NO
DEPT
NAME
PROJEC
T
ID
PROJEC
T
NAME
PROJECT
LEADER
1 VAASTAV 21 55000 98437532
83
JAVA, C,
C++
1 DEPT1 001 PROJECT
1
VAASTAV
2 RAM 35 85000 88345325
67
C, C++ 2 DEPT2 001 PROJECT
1
VAASTAV
3 RAHUL 30 60000 93213456
79
JAVA 3 DEPT3 002 PROJECT
2
SHYAM
4 SHYAM 25 35000 88235312
45
JAVA, PHP 2 DEPT2 002 PROJECT
2
SHYAM
5 RAVI 28 45000 88321564
24
PYTHON,
C
1 DEPT1 003 PROJECT
3
RAVI
TABLE AFTER NORMALISATION:
EMPLOYEE TABLE
EMPLOYEE
ID
EMPLOYEE
NAME
EMPLOYEE
AGE
EMPLOYEE
SALARY
EMPLOYEE
PNO
EMPLOYEE
SKILLS
1 VAASTAV 21 55000 9843753283 JAVA, C, C++
2 RAM 35 85000 8834532567 C, C++
3 RAHUL 30 60000 9321345679 JAVA
4 SHYAM 25 35000 8823531245 JAVA, PHP
5 RAVI 28 45000 8832156424 PYTHON, C
DEPARTMENT TABLE:
DEPT NO DEPT NAME
1 DEPT1
2 DEPT2
3 DEPT3