Database Systems and Design: Assignment Solution - [University Name]

Verified

Added on  2019/10/09

|5
|681
|166
Homework Assignment
AI Summary
This assignment solution addresses key database concepts. It begins by defining and differentiating transaction failures, including logical and system errors. The solution then explores database fragmentation, providing examples of horizontal fragmentation for an employee table and identifying minimal predicates. An XML example is also included, demonstrating the structure of department and department location data. Furthermore, the assignment covers object methods applicable to a hotel system, defining data types and methods for entities such as hotels, rooms, guests, and bookings. This comprehensive solution offers valuable insights into database design and management, providing students with a clear understanding of the covered topics.
Document Page
Answer.1)
A transaction failure is a method where transaction needs to be stopped when it
neglects to execute, and put an incorrect input , deadlock or where it can’t move
further after reaching a point. It causes a transaction to fail.
It has two types:-
Logical Error: When transaction can no longer finish with the execution if it has
some internal condition like no data found, incorrect input etc., and it also gives
wrong result. It is a logical error.
Eg : Any student data, employee data
System Error: when system enters in unpleasant state, it itself aborts the
transaction with the execution because of this system condition the database is also
not ready to do further execution. It’s called system Error.
Eg : deadlock state.
Answer 2)
Part A:
Part B:
Horizontal fragmentation for employee table
Fragment 1:
Fragment 2:
Minimal Predicates:
pr = {Sex = 'M' ,Sex = 'F', Salary <= 45000, Salary >= 50000, deptNo = 11,
DeptNo = 10}
There could not be any mininmal predicate possible in this manner.
Project table:
pr = {contractPrice = 100000, contractPrice = 100000}
This is the minimal pridacts.
tabler-icon-diamond-filled.svg

Paraphrase This Document

Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
Document Page
Answer.3)
<?xml version="1.0" encoding="UTF-8"?>
<Department>
<Dnumber ="5">
<Dname>Research</Dname>
<Mgr_ssn>333445555</Mgr_ssn>
<Mgr_start_date>1988-05-22</Mgr_start_date>
</Dnumber >
<Dnumber ="4">
<Dname>Administration</Dname>
<Mgr_ssn>987654321</Mgr_ssn>
<Mgr_start_date>1995-01-01</Mgr_start_date>
</Dnumber>
<Dnumber="1">
<Dname>Headquarters</Dname>
<Mgr_ssn>988665565</Mgr_ssn>
<Mgr_start_date>1981-06-19</Mgr_start_date>
</Dnumber>
</Department>
<DEPT_LOCATION>
<Dnumber="1">
<Dlocation>Houstan</Dlocation>
</Dnumber>
<Dept ID ="4">
Document Page
<Dlocation>Stafford</Dlocation>
</Dept>
<Dnumber="5">
<Dlocation>Bellaire</Dlocation>
</Dnumber>
<Dnumber ="5">
<Dlocation>Sugarfand</Dlocation>
</Dnumber>
<Dnumber="5">
<Dlocation>Houstan</Dlocation>
</Dnumber>
</DEPT_LOCATION>
Answer.5)
Document Page
Answer.3)
A.) Methods that would be applicable to the system:
Object Methods
Hotel Set
Get
Room Get
Assign
Booking Book
Save
Guest Set
Save
Define type Hotel
tuple ( hotelNo: integer;
hotelName: string;
City: char;
Methods :
SethotelNo() : integer;
SethotelName() :string;
GetCity(): string;
GethotelNo(): integer;
GethotelName(): string;
GetCity(): string;
);
Define type Room
tuple ( RoomNo: integer;
hotelNo: integer;
tabler-icon-diamond-filled.svg

Paraphrase This Document

Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
Document Page
type: string;
price: integer; );
Methods:
SetRoomNo() : integer;
SetType() : string;
SetPrice() : integer;
GetRoomNo() : integer;
GethotelNo: integer;
Gettype: string;
Getprice: integer;
);
Define type Guest
Tuple ( guestNo : integer;
guestNmae : String;
guestAddress : String;
Methods :
GetguestNo() : integer;
SetguestName : String;
SetguestAddress : string; );
Define type Booking
tuple ( hotelNo : integer;
guestNo : integer;
dateFrom : DATE;
dateTo : DATE;
roomNo : integer;
Hotel: set(Hotel)
Room: set(Room)
Guest: set(Guest)
Booking : Book (int,int,DATE,DATE,int);
);
chevron_up_icon
1 out of 5
circle_padding
hide_on_mobile
zoom_out_icon
[object Object]