Question

In: Computer Science

Database Management System Complete the following exercises in Connolly & Begg: 4.8 The following tables from...

Database Management System

Complete the following exercises in Connolly & Begg:

4.8 The following tables from part of a database held in a relational DBMS

Hotel (hotelNo, hotelName, city)

Room (roomNo, hotelNo, type, price)

Booking (hotelNo, guestNo, dateFrom, dateTo, roomNo)

Guest (guestNo, guestName, guestAddress)

a) Identify the foreign keys in this schema.

b) Explain how the entity integrity rule and the referential integrity rule apply to these relations.

5.8 Describe the relations that would be produced by the following relational algebra operations. In your description, make clear what attribute your relations have, and explain what each relation represents in the real world.

a) πhotelNoprice > 50(Room))

b) σHotel.hotelno = Room.hotelNo(Hotel × Room)

c) πhotelName(Hotel ⨝ Hotel.hotelNo = Room.hotelNoprice > 50(Room)))

The following tables form part of a Library database held in an RDBMS:

Book (ISBN, title, edition, year)

BookCopy (copyNo, ISBN, available)

Borrower (borrowerNo, borrowerName, borrowerAddress)

BookLoan (copyNo, dateOut, dateDue, borrowerNo)


Formulate the following queries in relational algebra:

5.24 List all book titles

5.25 List all book titles published in the year 2012.

5.27 List all copies of book titles that are available for borrowing.

5.30 List the names of borrowers with overdue book.s

Solutions

Expert Solution

4.8

a. Foreign keys

Hotel ----- none

Room ----- hotelNo

Booking ----- hotelNo, guestNo, roomNo

Guest ----- none

b. Entity integrity rule and the referential integrity rule

The primary keys of Tables Hotel(hotelNo), Room(roomNo), Guest(guestNo) are unique and not null. This satisfies entity integrity rule.

The referential integrity rule deals with foreign keys of the table . The primary key attribute in a table should match the foreign key attribute value in other table which is satisfied in the tables.

5.8

a)Display hotelNo whose price is greater than 50

b) Display all hotels where rooms are available.

c) Display all hotels names where rooms are available and of price greater than 50.

5.24

title(Book)

5.25

title( year = 2012 ( Book))

5.27

title( Book BookCopy Borrower )

5.30

borrowerName( dateDue < dateOut (BookLoan Borrower ))

Do ask if any doubt. Please upvote.


Related Solutions

The following tables form part of a database (Flights Database) held in a relational DBMS: employee...
The following tables form part of a database (Flights Database) held in a relational DBMS: employee (empNo, empName, empSalary, empPosition) aircraft (aircraftNo, acName, acModel, acFlyingRange) flight (flightNo, aircraftNo, fromAirport, toAirport, flightDistance, departTime, arriveTime) certified (empNo, aircraftNo) Where:  employee contains details of all employees (pilots and non-pilots) and empNo is the primary key;  aircraft contains details of aircraft and C is the primary key.  flight contains details of flights and (flightNo, aircraftNo) form the primary key.  certified...
'driver', 'car', 'accident' and 'report' are names of some tables in the insurance database system. These...
'driver', 'car', 'accident' and 'report' are names of some tables in the insurance database system. These tables were created by executing the following SQL creation statements. CREATE TABLE driver( driverID INT NOT NULL PRIMARY KEY, name VARCHAR(30) NOT NULL, cityAddress VARCHAR(25) ); CREATE TABLE car( plateID INT NOT NULL PRIMARY KEY, model VARCHAR(20) NOT NULL, year YEAR(4) NOT NULL ); CREATE TABLE accident( reportNumber INT NOT NULL PRIMARY KEY, date Date NOT NULL, location VARCHAR(20) NOT NULL ); CREATE TABLE...
Database Design Design a database and show the relationship between each tables. I need multiple tables....
Database Design Design a database and show the relationship between each tables. I need multiple tables. *Must meet the requirements for Third Normal Form. These are the information for employee DB. Employee Number, First Name, Last Name, Date of birth, Address, city, state, zip, department, job title, supervisor, health insurance number, health insurance provider, dental insurance number, dental insurance provider, spouse/partner, children, children's ages.
Explain why a database and a database management system are fundamental to business operations. Short Essay...
Explain why a database and a database management system are fundamental to business operations. Short Essay Question
QUESTION: The following tables describe the content of a relational database: a) Identify and classify the...
QUESTION: The following tables describe the content of a relational database: a) Identify and classify the tables as either entity or relationship The first step in building an E-R model is to identify the entities. Having identified the entities, the next step is to identify all the relationships that exist between these entities. Using the content of the relational database above: b) Using the relations in the relational database, explain how one can transform relationship in E-R model into a...
A general-purpose database management system (DBMS) has 5 basic responsibilities: Interaction with the file management system...
A general-purpose database management system (DBMS) has 5 basic responsibilities: Interaction with the file management system Integrity enforcement Security enforcement Backup and Recovery Concurrency control For each responsibility, explain the problems that would arise if the DBMS did not execute these responsibilities. Be descriptive and give examples where appropriate.
Question 2. The following tables provide some example data that will be kept in the database....
Question 2. The following tables provide some example data that will be kept in the database. Write the INSERT commands necessary to place the following data in the tables that were created in Question 1. Alternatively provide the text files (copy and pasted into your final report) and the open/insert from file commands.. Table: actor act_id | act_fname | act_lname | act_gender 101 | James | Stewart | M 102 | Deborah | Kerr | F 103 | Peter |...
Explain the advantages of using Database Management System (DBMS) [10 marks]
Explain the advantages of using Database Management System (DBMS) [10 marks]
Discuss the disadvantages of a distributed database management system (DDBMS), in terms of “Security”.
Discuss the disadvantages of a distributed database management system (DDBMS), in terms of “Security”.
In the same file, complete the following exercises in the author’s pseudocode as presented in the...
In the same file, complete the following exercises in the author’s pseudocode as presented in the text book and material on Blackboard in this chapter, and following all requirements for good program design that were shown in Chapter 2 and all examples since then. At the Summer Olympic Games every four years, for historical reasons, athletes represent National Olympic Committees (NOCs) rather than strictly countries. For the sake of convenience in our program, let us refer to them simply as...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT