The Relational Model 1:
Introduction, QBE, and Relational Algebra
Answers to Review Questions
Note: Answers to odd-numbered review questions are found in Appendix D of the textbook. 1.
A relation is a two-dimensional table in which (1) the entries in the table are single-valued; (2) each column has a distinct name; (3) all of the values in a column are values of the same attribute; (4) the order of the columns is immaterial; (5) each row is distinct; and (6) the order of the rows is immaterial. 2.
A relational database is a collection of relations.
An unnormalized relation is a structure that satisfies all the properties of a relation except the restriction that entries must be single-valued. It is not a relation. 4.
Attribute is another term for a column in a table.
In the shorthand representation, each table is listed, and after each table, all the columns of the table are listed in parentheses. Primary keys are underlined.
Branch (BranchNum, BranchName, BranchLocation, NumEmployees)
Publisher (PublisherCode, PublisherName, City)
Author (AuthorNum, AuthorLast, AuthorFirst)
Book (BookCode, Title, PublisherCode, Type, Price, Paperback)
Wrote (BookCode, AuthorNum, SequenceNum)
Inventory (BookCode, BranchNum, OnHand)
To qualify a field name means to indicate the table to which it belongs by preceding the field name with the table name and a period. To qualify the Street field in the Customer table, you would enter Customer.Street. 7.
The primary key is the column or collection of columns that uniquely identifies a given row. The primary key of the Branch table is BranchNum. The primary key of the Publisher table is PublisherCode. The primary key of the Author table is AuthorNum. The primary key of the Book table is BookCode. The primary key of the Wrote table is the concatenation (combination) of BookCode and AuthorNum. The primary key of the Inventory table is the concatenation of BookCode and BranchNum. 8.
Include the field in the design grid and make sure the field’s Show check box contains a check mark. 9.
Enter the criteria in the Criteria row for the appropriate field name. 10.
To combine criteria with AND, enter the conditions on the same Criteria row in the design grid. To combine criteria with OR, enter the conditions on different Criteria rows in the design grid. 11.
Type the computation instead of a field name in the design grid. Alternatively, you can enter the computation in the Zoom dialog box. 12.
To calculate functions, click the Totals button in the Show/Hide group on the Query Tools Design tab, and then add one of the following functions to the Total row for the column: Count, Sum, Avg (average), Max (largest value), Min (smallest value), StDev (standard deviation), Var (variance), First, and Last. 13.
Indicate the appropriate sort order (Ascending or Descending) in the Sort row of the design grid. 14.
When sorting on more than one field in an Access query, the sort key to the left in the design grid is the major key and the sort key to the right is the minor key. The data is sorted on the major key. Within those rows with the same value in the major key, the data is sorted by the minor key. 15.
Include the field lists from both tables in the query design. Provided the tables have matching fields, a join line will connect the tables. Include the desired fields from either table in the design grid. 16.
Use an update query when you want to make the same change to all rows satisfying some criteria. 17.
Use a delete query when you want to delete all rows satisfying some criteria. 18.
Use a make-table query to save the results of a query as a table. 19.
Relational algebra is a theoretical way of manipulating a relational database. Relational algebra includes operations that act on existing tables to produce new tables, similar to the way the operations of addition and subtraction act on numbers to produce new numbers in the mathematical algebra with which you are...
Please join StudyMode to read the full document