Review Questions
3.1 Discuss each of the following concepts in the context of the relational data model:
(a) Relation (b) Attribute (c) Domain (d) Tuple (e) Intension and Extension (f) Degree and Cardinality.
Each term defined in Section 3.2.1.
Domain – Set of atomic (indivisible) values.
Attribute – it describes a component of the database, such as a table or a field.
N-tuple – in mathematics, an ordered set of n elements called its components or coordinates.
Relation Schema – It is representation of database highlighting relationships that we have created.
Relation State – set of tuples that have the same attributes. …show more content…
Discuss the difference between a view and a base relation.
View is the dynamic result of one or more relational operations operating on the base relations to produce another relation. Base relation exists as a set of data in the database. A view does not contain any data, rather a view is defined as a query on one or more base relations and a query on the view is translated into a query on the associated base relations.
Exercises
The following tables form 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)
where Hotel contains hotel details and hotelNo is the primary key; Room contains room details for each hotel and (roomNo, hotelNo) forms the primary key; Booking contains details of the bookings and (hotelNo, guestNo, dateFrom) forms the primary key; and Guest contains guest details and guestNo is the primary key.
3.8 Identify the foreign keys in this schema. Explain how the entity and referential integrity rules apply to these