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

Use MYSQL to create the set of database tables of the relational database model and complete...
Use MYSQL to create the set of database tables of the relational database model and complete the associated queries given. Procedure: 1) Write all the SQL statements, necessary to create all tables and relationships, with Primary & Foreign keys. 2) Execute each statement in the correct order to create the relational database in MYSQL. 3)Insert some data into each table. 4) Use all your SQL create and Insert statements (from MS Word) to execute in the MYSQL WorkBench 5) Write...
1. Discuss the elements of a database system. Like The database schema Schema objects Indexes Tables...
1. Discuss the elements of a database system. Like The database schema Schema objects Indexes Tables Fields and columns Records and rows Keys Relationships Data types 2. Discuss the key components of a database management system architecture and how they collaborate. 3. Discuss why a database management system needs a good query optimizer.
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...
Describe what a database is. Explain components of a database management system - (DBMS). Setup a...
Describe what a database is. Explain components of a database management system - (DBMS). Setup a database to manage a hypothetical business. Create between 5 – 7 categories/ groups of functional areas for your business. For e.g., Personnel, Suppliers, Products, Fleet, Customers Add 20 entries. You may build this database in MS Excel, or MS Access. please with no plagrism
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
mySQL database question.. I have a database that has the following tables: User (Id, Name, Gender)...
mySQL database question.. I have a database that has the following tables: User (Id, Name, Gender) Primary key = Id Friends (Id1, Id2, Startdate) Primary key = (Id1, Id2) Foreign keys are also Id1, Id2 pointing to User(Id) Comments (CommentId, Poster, Recipient, Text, PostDate) Primary key = (CommentId) Foreign Keys are Poster, Recipient pointing to User(Id) I need to answer the following queries: 5. List Users who have posted comments to all female users 6. List User(s) who have received...
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...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT