Concepts of Database Management, Sixth Edition

Solutions 7-1

Chapter 7 DBMS Functions Solutions
Answers to Review Questions
Note: Answers to odd-numbered review questions are found in Appendix D of the textbook. 1. In updating and retrieving data, users do not need to know how data is physically structured on disk nor what processes the DBMS uses to manipulate the data. These structures and manipulations are solely the responsibility of the DBMS. Metadata is data about the data in a database. The catalog component of a DBMS maintains metadata about tables, fields, table relationships, views, indexes, users, privileges, and replicated data. Most PC-based DBMSs contain a catalog that maintains metadata about tables, fields, table relationships, views, indexes, users, privileges, and replicated data. Large, expensive DBMSs usually contain a data dictionary that serves as a super catalog containing the same metadata as a catalog and additional metadata such as that needed to track fragmented data. Concurrent update occurs when multiple users make updates to the same database at the same time. A lost update could occur in a concurrent update situation when two users attempt to update the same data at the same time, and the DBMS does not does not have concurrency update features such as two-phase locking or timestamping. Locking denies access by other users to data while the DBMS processes one user’s updates to the database. A DMBS uses locking to prevent lost updates. A transaction is a set of steps completed by a DBMS that accomplishes a single user task; the DBMS must successfully complete all transaction steps or none at all for the database to remain in a correct state. Two-phase locking is an approach for handling locks to prevent lost updates. During the first (or growing) phase, the DBMS locks more rows and releases none of the locks. After the DBMS acquires all the locks needed for the transaction and has completed all database updates, there is a second (or shrinking) phase in which the DBMS releases all the locks and acquires no new locks. Deadlock occurs in a concurrent update situation when the first user is waiting for data that has been locked by a second user, and the second user is waiting for data that has been locked by the first user. Unless outside action occurs, each user could wait for the other’s data forever. Deadlock occurs when each of the two users is attempting to access data that is locked by the other user. With timestamping the DBMS assigns to each database update the unique time when the update started; this time is called a timestamp. In addition, every database row includes the timestamp associated with the last update to the row. The DBMS processes updates to the database in timestamp order. If two users try to change the same row at the same time, the DBMS processes the change with the earlier timestamp. The other transaction is restarted and assigned a new timestamp value. Recovery is the process of returning the database to a state that is known to be correct from a state known to be incorrect. The journaling feature of a DBMS involves maintaining a journal or log of all updates to a database; the DBMS uses the journal to recover the database. The journal is a file separate from the database, so that the journal is still available if a catastrophe destroys the database. The two types of images output by a DBMS to

2. 3.

4. 5.

6. 7. 8.

9.

10.

11. 12.

the DBMS forward recovery feature uses the log to apply after images for committed transactions. to a database. the DBMS exchanges all updated data between the master database and a replica in a process called synchronization. Privacy and security are related because it is only through appropriate security measures that privacy can be ensured. If a database has not been destroyed and transactions updated the database incorrectly or were stopped in midstream. 16. 20. which then determines how to accomplish it. services that provide support for easy-to-use edit and query capabilities. the DBA copies the most recent database backup over the live database. Integrity constraints can be handled in four ways: (1) Integrity constraints can be ignored. and a DBA usually assigns appropriate permissions to workgroups. authorized users accessing the data using the DBMS have no problem viewing and working with the data. . When you use a procedural language. screen generators. and support for an easy-to-use menu-driven or switchboard-driven interface that allows users to tap into the power of the DBMS without having to resort to a complicated set of commands. 24. Security is the prevention of unauthorized access. After a user updates an individual replica in a replica set. biometrics. Three types of authentication are passwords. 19. 23. 21. Replication lets users at different sites use and modify copies of a database and then share their changes with the other users. the last is the most desirable. and programmers don’t have to build the logic to enforce the constraints in the programs they create. either intentional or accidental. The DBMS backward recovery feature uses the log to apply before images for the problem transactions to undo their updates.Concepts of Database Management. (2) The responsibility for enforcing integrity constraints can be assigned to users. that is. users would have to take great care not to enter invalid data. A DBA uses forward recovery when a catastrophe destroys a database. 13. Forward recovery consists of two steps. facilities that let you use the services available from your operating system. support for both procedural and nonprocedural languages. and facial characteristics. they see only the encrypted version of the data. First. you describe the task you want accomplished to the computer. Permissions specify what kind of access a user has to objects in a database. Authentication refers to techniques for identifying the person who is attempting to access the DBMS. A password is a string of characters assigned by the DBA to a user that the user must enter to access to the database. 17. voiceprints. Integrity constraints are rules that a DBMS must follow so that it updates data accurately and consistently. you must tell the computer precisely how a given task is to be accomplished. Authorization rules specify which users have what type of access to which data in a database. and database passwords. The user is prevented from accessing any data not contained in the view. However. and so on. he or she only has access to the data contained in the view. 22. 25. Sixth Edition Solutions 7-2 its journal are before images (what the data in records looked like in the database before updates) and after images (what the data in records looked like in the database after updates). (3) Programs can enforce integrity constraints. A database password is a string of characters assigned by the DBA to a database that users must enter before they can access the database. 18. A workgroup is a group of users. 26. 14. Some utility services that a DBMS should provide include: services that let you change the database structure. Of these four ways to handle integrity constraints. services that let you add new indexes and delete indexes that are no longer needed. Privacy refers to the right of individuals to have certain information about them kept confidential. 15. When you use a nonprocedural language. Biometrics identify users by physical characteristics such as fingerprints. Encryption converts the data in a database to a format that’s indecipherable to a word processor or other program and stores it in an encrypted format. then a DBA uses backward recovery to undo the updates for the transactions. Data independence is a property that lets you change a database structure without requiring you to change the programs that access the database. Second. If a user is accessing a database through a view. When the DBMS enforces integrity constraints. services that let you export data to and import data from other software products. report generators. If unauthorized users attempt to bypass the DBMS and get to the data directly. (4) The DBMS can enforce integrity constraints. handwritten signatures. users don’t have to guard against entering incorrect data.

face images. . only if there were at least five records within the sample used for the statistic. f) The DBMS calculates the total balance from Steps a.350 for Pat—the displayed total is $200 higher than the actual total. dirty read. Suppose further that a $200 order from the third customer was entered for the first customer by mistake. or biometrics. Because Valerie is the only rep living in Grove FL. From these two averages. by obtaining a statistic. e) The DBMS reads the third customer’s $700 balance for Pat’s transaction. and $700. however. handwritten signatures. The problem with statistical databases is that you can obtain information about individual records in the database. b) The DBMS reduces the first customer’s $900 balance to $700 for Elena’s transaction. (The new customer balances will be $700. and $500 for a total of $2. It might seem you could avoid this problem by reporting a statistic only when there was a minimum number of values upon which the statistic was calculated. suppose Pat’s transaction involves calculating the total balance for all customers. and so on) about the data in the database. or inconsistent read) occurs when a user’s retrieval transaction reads a set of data that other users’ transactions have partially updated. $750. and that Elena’s update transaction will change the customer for that order from the first to the third customer. 3. and that she wants to find out Valerie Kaiser’s commission.Concepts of Database Management. d) The DBMS increases the third customer’s $500 balance to $700 for Elena’s transaction. and wrist vein or thermal images. For example. 2. you should not be able to infer information about any individual record in the database. suppose that the commissions earned by Premiere Products reps are confidential to Pat. The answer depends on the particular DBMS used at your school. Many examples of situations when replication would prove useful are possible. The answer depends on the specific source material used by the student. however. To rollback the transaction. include voiceprints. Pat could calculate Valerie’s commission.) An unrepeatable read will occur if the DBMS processes the two transactions as follows: a) The DBMS reads the first customer’s $900 balance for Pat’s transaction. 5. Researchers have proposed other solutions to the confidentiality problem. Suppose Premiere Products has six reps and Valerie is the only female rep. the DBMS deletes the three added records.150. but it would give an answer if Pat requested the average commission of all male reps because five reps are involved. eye images. maximums. Biometric identification techniques. c) The DBMS read the second customer’s $750 balance for Pat’s transaction. fingerprints. 4. the DBMS started it at 8:01. For example. You can search your DBMS vendor’s Web site or its literature to find current information about the DBMS. 2. that Pat can use only statistical queries against the Rep table. thus circumventing the confidentiality controls built into the DBMS. Thus. but no solution works perfectly in all situations. If the database contains confidential data. Answers to Henry Books Case 1. averages. c. An unrepeatable read (also called an inconsistent retrieval. and added an OrderLine table record at 8:09. and an executive might need a replica as part of a presentation to other executives. The answer depends on the particular DBMS comparison used. Sixth Edition Solutions 7-3 Answers to Premiere Products Exercises 1. $750. added an OrderLine table record at 8:05. the DBMS would give the answer because six reps are involved in the query. Even this might not be good enough. added an Orders table record at 8:02. auditors might need their own replicas to review the status of data at the end of a reporting period. The DBMS could report an average commission. For example. counts. Pat can infer information about an individual. for example. hand geometry images. and the customer balances are $900. You use a statistical database to produce only statistics (sums. Pat can determine Valerie’s commission by requesting the average commission for reps in Grove FL. The DBMS would not give an answer if Pat requested the average commission of all female reps. keystroke/signature dynamics. If Pat requested the average commission of all reps. and e and displays the total customer balance of $2. In transaction 2. palm images.

First. SlipNum. Address. The recovery program would use Transactions 1 and 3 to update the restored database. If Transaction 3 at 11:08 moved to 11:14. You can search the Web for IBM for DB2.Concepts of Database Management.OwnerNum . Transaction 2 modifies the Marina (change) and MarinaSlip (change) tables. Transaction 1 modifies the ServiceRequest (add) table. Transaction 4 modifies the MarinaSlip (change) and Owner (change) tables. MySQL. Sixth Edition 3. Answers to Alexamara Marina Group Case 1. Oracle. State.OwnerNum=BoatOwner. FirstName. MarinaNum. The resulting database design for the affected tables would be as follows: Owner (OwnerNum. for example. Transaction 3 modifies the Owner (change) and MarinaSlip (change) tables. 2. BoatName FROM Owner. RentalFee. Transactions 3 and 4 could have created deadlock. Length. 3. deadlock would occur. BoatType) BoatOwner (BoatName. LastName. BoatName) The defining query for the view would be as follows: CREATE VIEW OwnerBoat AS SELECT Owner. Zip) Boat (BoatName. BoatOwner WHERE Owner.. City. . Second.OwnerNum. LastName. 4. or Sybase to find current information about the DBMS. Uses would have to reenter Transactions 2 and 4. FirstName. it would be best for all boat-related data to be stored in a Boat table and to pull that data out of the MarinaSlip table. Solutions 7-4 The answer depends on the particular DBMS selected. there would be a many-to-many relationship between the Boat and Owner tables. OwnerNum) MarinaSlip (SlipID. and a BoatOwner table would be the intersection table for this relationship.

Sign up to vote on this title
UsefulNot useful

Master Your Semester with Scribd & The New York Times

Special offer for students: Only $4.99/month.

Master Your Semester with a Special Offer from Scribd & The New York Times

Cancel anytime.