ACSG 552 Assignment #1 Spring 2009 Diana Oboikovitz Due in class on Thursday, Jan. 22: Read course syllabus Read Chapters 1, 2, 3 Read lecture notes Submit answers to the following review questions & problems from Chapters 1 & 2: o Chapter 1 Review Questions, p. 27: 2, 3, 10, 12 Problems, pp. 28-29: 5 8; 10 o Chapter 2 Review Questions, pp. 54-55: 2, 5, 6, 9, 18, 19 Problems, pp. 55-59: 1, 2; 12-15; 19-21; 22; 25abcde Chapter 1 Review Questions: 2. What is data redundancy and what characteristics of the file system can lead to it? Data redundancy is when the same data is present in multiple locations within the database. The problem with this is data integrity. For example, if a person's phone number is in two different places in the database, when a change is requested, it would require changing the information in multiple locations. The result is often referred to by database developers as islands of information. I experienced this first hand when working as a banker. We used an IBM mainframe database. Often, one client might have two customer records. If found we would have to use a code to combine the records. 3. What is data independence, and why is it lacking in file systems? Data independence is when changes can be made to the data storage characteristics, without the need to change the application program that accesses the data. Files systems show structural dependence, which means that access to the data is dependent on the structure. If changes are made to the file structure the applications to access that data must also be changed. The same is true for the data characteristics. Since they are also data dependent, any changes made to the characteristics of the data field, require a program change. This is a disadvantage of the file system. 10. What is metadata? Metadata is data about data. An example of metadata is the column heading titles. These are descriptions of what is contained in the column. The type of data contained with in the field is also metadata. For example, text, numeric or date. 12. What are the potential costs of implementing a database system? The costs of implementing a database system are extensive. They range from hardware and software to highly skilled professionals to manage the database. Some of the items to consider when implementation a database are the training, licensing, regulation compliance, security, maintenance, vendor dependency and replacement. Management should consider the costs with respect to the goals of the company. If the database advances the overall objectives of the company, it may make sense to support the costs. Chapter 1 Problems
5. Identify and discuss the serious data redundancy problems exhibited by the file structure shown in Figure P1.5. For the figure, multiple records exist for each client. It appears a client record exists for each project the client is associated. There are multiple places to maintain information. For example, the client's phone number for employee number 105 has two entries. One is under the Hurricane project and the other is under the Satellite project. If the client were to change any information, it is possible the integrity of data would be compromised, because it is unlikely it would be changed in every project. 6. Looking at the EMP_NAME and EMP_PHONE contents in Figure P1.5, what change(s) would you recommend? I would recommend a table for client information and a table for project information. I would use the EMP_NUM as the primary key for the employee table and the foreign key in the project table. This would mean the phone number would only exist in the employee table and would only be maintained in the employee record. This solution would eliminate redundant data and islands of information. 7. Identify the various data sources in the file you examined in Problem 5. The data sources in the file system would be personal, payroll and project. 8. Given your answer to Problem 7, what new files should you create to help eliminate the data redundancies found in the file shown in Figure P1.5? The new files needed are one file for each project, that could be tied to existing personal and payroll records. 10. Given the file structure shown in Figure P1.9, what problem(s) might you encounter if building KOM were deleted? If building code KOM were deleted, the rooms would be orphaned. A student would be able to find the teacher and room, but would not know what building the class is located. The building and the room should be a one to many relationship. Chapter 2 Review Question 2. What is a business rule, and what is its purpose in data modeling? A business rule defines the distinguishing characteristics of the data. When developing a database for a business, the designer should understand the rules by which the company operates. These are the business rules. For example, a customer of a bank can have many accounts. Or one statement is generated for each bank account monthly. 5. What three languages were adopted by the DBTG to standardize the basic network data model, and why was such standardization important to users and designers? The three languages adopted by the DBTG were: Data definition language enables the database administrator to define the schema components. Subschema DDL allows the application programs to define the database components that will be used by the application. Data manipulation language works with the data in the database. Without standardization, portability of databases and applications that accessed them was an issue. Also, development of better database models was impeded because of the disorganization.
6. Describe the basic features of the relational data model and discuss their importance to the end user and the designer. The relational data model is base on the concept of how data is related. The model introduced tables of records, that can be connected by a common data field. This is a field that is the same in both tables and ties the information together. The importance of this type of database is that it is inviable to the end user. The database engine is a powerful tool used to produce queries easily by the end user, but at the same time complex enough to allow for better design of databases. 9. Why is an object said to have greater semantic content than an entity? The object has greater semantic content than an entity because an object contains more meaningful information about the relationships between the facts within the object as well as information about its relationships with other objects. A relationship entity does not contain information about other entities. 18. What is logical independence? Logical independence is the state when you can change the internal model without affecting the conceptual model. 19. What is physical independence? Physical independence is when you can change the physical model without affecting the internal model. For example, you can change the physical storage device without any changes needed to the software. Chapter 2 Problems 1. Write the business rule(s) that govern the relationship between the AGENT and CUSTOMER. An agent can have many customers A customer can have only one agent 2. Given the business rule(s) you wrote in Problem 1, create the basic Crow's Foot ERD. 12. Using the hierarchical representation shown in Figure P2.12, answer a, b and c. a. Identify the segment types. PAINTER (root- parent) PAINTING (child) b. Identify the components that are equivalent to the file system's fields. PAINTER number, name and phone PAINTIING number and title c. Describe the hierarchical path for the occurrence of the third PAINTING segment. The third PAINTING is a child of the PAINTER record of Josephine G Artiste.
13. The hierarchical diagram shown in Figure P2.13 depicts a single record occurrence of a patient named Judy D. Johanssen. Typically, a patient staying in a hospital receives medications that have been ordered by a particular doctor. Because the patient often receives several medications per day, there is a 1:M relationship between PATIENT and ORDER. Similarly, each order can include several medications, creating a 1:M relationship between ORDER and MEDICATION. Given the structure shown in Figure P2.13: a. Identify the segment types. PATIENT (root- parent level 1) to ORDER (child- level 2) ORDER (parent level 2) to MEDICATION (child- level 3) b. Identify the business rules for PATIENT, ORDER and MEDICATION. A PATIENT can have many ORDERS An ORDER can have many MEDICATIONS Many MEDICATIONS can be on one ORDER An ORDER can belong to one PATIENT 14. Expand the model in Problem 13 to include a DOCTOR segment; then draw its hierarchical structure. (Identify all segments.) (Hint:A patient can have several doctors assigned to his or her case, but the patient named Judy D. Johanssen occurs only once in each of those doctors' records.) DOCTORS PATIENT ORDER ORDER MEDICATION MEDICATION MEDICATION 15. Suppose you want to write a report that shows: a. All patients treated by each doctor. b. All doctors who treated each patient. Evaluate the hierarchical structure you drew in Problem 14 in terms of its search efficiency in producing the report. With the hierarchical structure as a M:M between DOCTORS and PATIENT, the information to search all patients by each doctor and for all doctors who treated each patient is attainable because the relationship exists.
19. Using a Crow's Foot ERD, convert the network database model in Figure 2.2 into a design for a relational database model. Show all entities and relationships. 20. Using the ERD from Problem 19, create the relational schema. (Create an appropriate collection of attributes for each of the entities. Make sure you use the appropriate naming conventions to name the attributes. 21. Convert the ERD from Problem 19 into the corresponding UML class diagram. 22. Describes the relationships (identify the business rules) depicted in the Crow's Foot ERD shown in Figure P2.22 SALESREP create multiple INVOICE
CUSTOMER has many INVOICE one CUSTOMER makes multiple PAYMENT one INVOICE has multiple INV_LINE each INV_LINE contains one PRODUCT 25. Create a Crow's Foot ERD for each of the following descriptions. (Note: The word many merely means more then one in the database modeling environment.) a. Each of the MegaCo Corporation's divisions is composed of many departments. Each department has many employees assigned to it, but each employee works for only one department. Each department is managed by one employee, and each of those managers can mange only one department at a time. b. During some period of time, a customer can rent many video-tapes from the BigVid store. Each of the BigVid's videotapes can be rented to many customers during thatperiod of time. A customer can rent many video tapes at a time, but each tape can only go to one customer at a time. c. An airliner can be assigned to fly many flights, but each flight is flown by only one airliner.
d. The KwikTite Corporation operates many factories. Each factory is located in a region. Each region can be home to many of KwikTite's factories. Each factory employs many employees, but each of those employees is employed by only one factory. e. An employee may have earned many degrees, and each degree may have been earned by many employees.