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
Q1: Explain the different database structures in database management system (DBMS) Q2: What are the roles...
Q1: Explain the different database structures in database management system (DBMS) Q2: What are the roles of OSI layers to transmit data from one computer to another computer?
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.
Discussion Using a Database Management System View “The database tutorial for beginners” on youtube(5:32 mints) and...
Discussion Using a Database Management System View “The database tutorial for beginners” on youtube(5:32 mints) and discuss how database management systems are different from spreadsheets. Describe one experience you have had working with data.
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 |...
Please use an Access database with two tables to answer the following: use an example to...
Please use an Access database with two tables to answer the following: use an example to discuss the difference between a right, left, and inner join. Next, perform the left joint, right joint, and inner joint all on the each of the two tables.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT