PART III SOLUTIONS TO REVIEW QUESTIONS AND EXERCISES

Size: px
Start display at page:

Download "PART III SOLUTIONS TO REVIEW QUESTIONS AND EXERCISES"

Transcription

1 PART III SOLUTIONS TO REVIEW QUESTIONS AND EXERCISES

2 Solutions to Review Questions and Exercises Part One Background 4 Chapter 1 Introduction to Databases... 4 Chapter 2 Database Environment... 6 Chapter 3 The Relational Model... 8 Chapter 4 Database Planning, Design, and Administration Part Two Methodology 14 Chapter 5 Entity-Relationship Modeling Chapter 6 Normalization Chapter 7 Methodology - Conceptual Database Design Chapter 8 Methodology - Logical Database Design for Relational Model Chapter 9 Methodology - Physical Database Design for Relational DBMSs Chapter 10 Conceptual Database Design Methodology - Worked Example Chapter 11 Logical Database Design Methodology - Worked Example Chapter 12 Physical Database Design Methodology Worked Example Part Three Database Languages 33 Chapter 13 SQL Chapter 14 Advanced SQL Chapter 15 QBE Part Four Selected Database Issues 47 Chapter 16 Security Chapter 17 Transaction Management Chapter 18 Query Processing Part Five Current Trends 62 Chapter 19 Distributed DBMSs - Concepts and Design Chapter 20 Distributed DBMSs - Advanced Concepts Chapter 21 Introduction to Object DBMSs Chapter 22 Object-Oriented DBMSs

3 Chapter 23 Object-Relational DBMSs Part Six Future Trends 89 Chapter 24 Web Technology and DBMSs Chapter 25 Data Warehousing Chapter 26 OLAP and Data Mining

4 Review Questions Part One Background Chapter 1 Introduction to Databases 1.1 List four examples of database systems other than those listed in Section 1.1. Some examples could be: A system that maintains component part details for a car manufacturer; An advertising company keeping details of all clients and adverts placed with them; A training company keeping course information and participants' details; An organization maintaining all sales order information. 1.2 Discuss each of the following terms: Data For end users, this constitutes all the different values connected with the various objects/entities that are of concern to them. (See also Section 1.3.3) Database (See Section 1.3.1) Database Management System (See Section 1.3.2) Data Independence Security Integrity Views This is essentially the separation of underlying file structures from the programs that operate on them, also called program-data independence. (See also Sections and 1.3.1) The protection of the database from unauthorized users, which may involve passwords and access restrictions. (See also Section 1.6) The maintenance of the validity and consistency of the database by use of particular constraints that are applied to the data. (See also Section 1.6) These present only a subset of the database that is of particular interest to a user. Views can be customized, for example, field names may change, and they also provide a level of security preventing users from seeing certain data. (See also Section 1.3.2) 1.3 Describe the approach taken to the handling of data in the early file-based systems. Discuss the disadvantages of this approach. Focus was on applications for which programs would be written, and all the data required would be stored in a file or files owned by the programs. (See also Section 1.2). Clearly, each program was responsible for only its own data, which could be repeated in other program s data files. Different programs could be written in different languages, and would not be able to access another program s files. This would be true even for those programs written in the same language, because a program needs to know the file structure before it can access it. (See also Section 1.2.2). 1.4 Describe the main characteristics of the database approach and contrast it with the file-based approach. Focus is now on the data first, and then the applications. The structure of the data is now kept separate from the programs that operate on the data. This is held in the system catalog or data dictionary. Programs can now share data, which is no longer fragmented. There is also a reduction in redundancy, and achievement of program-data independence. (See also Section 1.3) 1.5 Describe the five components of the DBMS environment and discuss how they relate to each other. See Section Discuss the roles of the following personnel in the database environment: 4

5 Data Administrator See Section Database Administrator See Section Logical Database Designer See Section Physical Database Designer See Section Application Programmer See Section End Users See Section Discuss the advantages and disadvantages of database processing. Exercises See Section Interview some users of database systems. Which DBMS facilities do they find most useful and why? Which DBMS facilities do they find least useful and why? What do these users perceive to be the advantages and disadvantages of the DBMS? Select a variety of users for a particular DBMS. If the users are using different DBMSs, group the answers for the different systems, which will give an overall picture of specific systems. 1.9 Write a small program that allows entry and display of renter details including a renter number, name, address, telephone number, preferred number of rooms and maximum rent. The details should be stored in a file. Enter a few records and display the details. Now repeat this process but rather than writing a special program, use any DBMS that you have access to. What can you conclude from these two approaches? The program can be written in any appropriate programming language, such as Pascal, FORTRAN, C. It should adhere to basic software engineering principles including being wellstructured, modular, and suitably commented. It is important to appreciate the process involved even in developing a small program such as this. The DBMS facilities to structure, store, and retrieve data are used to the same effect. The differences in the approaches, such as the effort involved, potential for extension, ability to share the data should be noted Study the DreamHome case study presented in Section 1.7. In what ways would a DBMS help this organization? What data can you identify that needs to be represented in the database? What relationships exist between the data? What queries do you think are required? It may be useful to review the file-based approach and the database approach here before tackling the first part of the exercise. Careful reading and thinking about how people might use the applications should help in carrying out the rest of the exercise Study the Wellmeadows Hospital case study presented in Appendix A. In what ways would a DBMS help this organization? What data can you identify that needs to be represented in the database? What relationships exist between the data? The approach used for Exercise 1.10 should be used for this exercise also. 5

6 Review Questions Chapter 2 Database Environment 2.1 Discuss the concept of data independence and explain its importance in a database environment. See Section To address the issue of data independence, the ANSI-SPARC 3-level architecture was proposed. Compare and contrast the 3 levels of this model. See Section What is a data model? Discuss the main types of data models. An integrated collection of concepts for describing data, relationships between data and constraints on the data in an organization. (See also Section 2.3). Object-based data models such as the entity-relationship model (see Section 2.3.1). Record-based data models such as the relational data model, network data model, and hierarchical data model (see Section 2.3.2). 2.4 Discuss the function and importance of conceptual modeling. See Section Describe the types of facilities you would expect to be provided in a multi-user Database Management System. Data Storage, Retrieval and Update A User-Accessible Catalog Transaction Support Concurrency Control Services Recovery Services Authorization Services Support for Data Communication Integrity Services Services to Promote Data Independence Utility Services See also Section Of the facilities in 2.4, which ones do you think would not be needed in a standalone PC Database Management System? Provide justification for your answer. Concurrency Control Services - only single user. Authorization Services - only single user, but may be needed if different individuals are to use the DBMS at different times. Utility Services - limited in scope. Support for Data Communication - only standalone system. 2.7 Describe the main components in a DBMS and suggest which components are responsible for each facility identified in question 2.5. Query Processor, DML Preprocessor, Query Optimizer, Data Manager Dictionary Manager Data Manager Scheduler Utilities Authorization Control Utilities Integrity Checker Database Manager, DDL Compiler, File Manager Data Storage, Retrieval and Update A User-Accessible Catalog Transaction Support Concurrency Control Services Recovery Services Authorization Services Support for Data Communication Integrity Services Services to Promote Data Independence 6

7 Utility Services See also Sections 2.5 and What is meant by the term "client-server architecture" and what are the advantages of this approach? Compare the client-server architecture with two other architectures. The client is a process that requires some resource, and the server provides the resource. Neither need reside on the same machine. Advantages include: Better performance Likely reduction in hardware costs Reduction in communication costs Better consistency See also Section Discuss the function and importance of the data dictionary. Exercises See Section Analyze the DBMSs that you are currently using. Determine each system s compliance with the functions that we would expect to be provided by a DBMS. What types of languages does each system provide? What type of architecture does each DBMS use? Check the accessibility and extensibility of the data dictionary. Is it possible to export the data dictionary to another system? To do this you will need to obtain appropriate information about each system. There should be manuals available or possibly someone in charge of each system who could supply information Write a program that stores names and telephone numbers in a database. Write another program that stores names and addresses in a database. Modify the programs to use external, conceptual, and internal schemas. What are the advantages and disadvantages of this modification? The programs can be written in any suitable language and should be well structured and appropriately commented. Two distinct files result. The structures can be combined into one containing name, address, and tel_no, which can be the representation of both the internal and conceptual schemas. The conceptual schema should be created separately with a routine to map the conceptual to the internal schema. The two external schemas also must be created separately with routines to map the data between the external and the conceptual schema. The two programs should then use the appropriate external schema and routines Write a program that stores names and dates of birth in a database. Extend the program so that it stores the format of the data in the database; in other words, create a data dictionary. Provide an interface that makes this data dictionary accessible to external users. Again, the program can be written in any suitable language. It should then be modified to add the data format to the original file. This should not be difficult, if the original program is well structured. The interface for other users operates on the data dictionary and is separate from the original program. A menu-based interface is adequate How would you modify this program to conform to a client-server architecture? What would be the advantages and disadvantages of this modification? The server should hold the data dictionary and the programs that operate on it. The user interface should be separate, on the client, and call the data dictionary programs. 7

8 Review Questions Chapter 3 The Relational Model 3.1 Discuss each of the following concepts in the context of the relational data model: (a) (b) (c) (d) (e) Relation Attribute Tuple Intension and Extension Degree and Cardinality. Each term defined in Section Discuss the differences between the candidate keys and the primary key of a relation. Explain what is meant by a foreign key. How do foreign keys of relations relate to candidate keys? The primary key is the candidate key that is selected to identify tuples uniquely within a relation. A foreign key is an attribute or set of attributes within one relation that matches the candidate key of some (possibly the same) relation. 3.3 Define the two principal integrity rules for the relational model. Discuss why it is desirable to enforce these rules. Two rules are Entity Integrity (Section 3.3.2) and Referential Integrity (Section 3.3.3). 3.4 Define the five basic relational algebra operations. Define the remaining three relational algebra operations in terms of the five basic operations. Five basic operations are: Selection and Projection (Unary) Cartesian Product, Union and Set Difference (Binary). There is also the Join, Intersection and Division operations: Can rewrite θ-join in terms of the basic selection and Cartesian product operations: R F S = σ F (R S) Can express the intersection operator in terms of the set difference operation: R S = R - (R - S) Can express the division operator in terms of the basic operations: T 1 = Π C (R) T 2 = Π C ( (S x T 1 ) - R) T = T 1 - T What is a view? Discuss the difference between a view and a base relation. Explain what happens when a user accesses a database through a view. 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. 8

9 Exercises The following tables form part of a database held in a relational DBMS:- Hotel Room Booking Guest (Hotel_No, Name, Address) (Room_No, Hotel_No, Type, Price) (Hotel_No, Guest_No, Date_From, Date_To, Room_No) (Guest_No, Name, Address) where and Hotel contains hotel details and Hotel_No is the primary key Room contains room details for each hotel and (Hotel_No, Room_No) forms the primary key Booking contains details of the bookings and the primary key comprises (Hotel_No, Guest_No, and Date_From) Guest contains guest details and Guest_No is the primary key. 3.6 Generate the relational algebra for the following queries: (a) List all hotels. HOTEL (b) List all single rooms with a price below 20 per night. σ type='s' AND price < 20 (ROOM) (c) List the names and addresses of all guests. Π name, address (GUEST) (d) List the price and type of all rooms at the Grosvenor Hotel. Π price, type (ROOM hotel_no (σ name='grosvenor Hotel' (HOTEL))) (e) List all guests currently staying at the Grosvenor Hotel. GUEST guest_no (σ date_from <= ' ' AND date_to >= ' ' ( BOOKING hotel_no (σ name='grosvenor Hotel' (HOTEL)))) (substitute ' ' for today s date). (f) List the details of all rooms at the Grosvenor Hotel, including the name of the guest staying in the room, if the room is occupied. (ROOM hotel_no (σ name='grosvenor Hotel' (HOTEL)) // Outer Join Π guest.name, hotel.hotel_no, room.room_no ( (GUEST guest_no (σ date_from <= ' ' AND date_to >= ' ' ( BOOKING hotel_no (σ name='grosvenor Hotel' (HOTEL)))) (substitute ' ' for today s date). (g) List the guest details (Guest_No, Name and Address) of all guests staying at the Grosvenor Hotel. Π guest_no, name, address (GUEST guest_no (σ date_from <= ' ' AND date_to >= ' ' ( BOOKING hotel_no (σ name='grosvenor Hotel' (HOTEL))))) (substitute ' ' for today s date). 9

10 3.7 Using relational algebra, create a view of all rooms in the Grosvenor Hotel, excluding price details. What would be the advantages of this view? Π room_no, hotel_no, type (ROOM hotel_no (σ name='grosvenor Hotel' (HOTEL))) Security - hides the price details from people who should not see it. Reduced complexity - a query against this view is simpler than a query against the two underlying base relations. 3.8 Produce the equivalent tuple and domain relational calculus statements for the above queries. Tuple Relational Calculus (a) (b) (c) (d) (e) (f) (g) RANGE OF H IS HOTEL {H} RANGE OF R IS ROOM {R R.Type = 'S' AND R.Price < 20} RANGE OF G IS GUEST {G.Name, G.Address} RANGE OF H IS HOTEL RANGE OF R IS ROOM {R.Price, R.Type H (R.Hotel_No = H.Hotel_No AND H.Name = 'Grosvenor Hotel')} RANGE OF H IS HOTEL RANGE OF G IS GUEST RANGE OF B IS BOOKING {G B ((B.Date_From <= ' ' AND B.Date_To >= ' ') AND (B.Guest_No = G.Guest_No) AND H (B.Hotel_No = H.Hotel_No AND H.Name = 'Grosvenor Hotel'))} Need to use Union of a relation containing all Rooms that are occupied with a relation extended by a NULL name for all unoccupied rooms. RANGE OF H IS HOTEL RANGE OF G IS GUEST RANGE OF B IS BOOKING {G.Guest_No, G.Name, G.Address B((B.Date_From <= ' ' AND B.Date_To >= ' ') AND (B.Guest_No = G.Guest_No) AND H (B.Hotel_No = H.Hotel_No AND H.Name = 'Grosvenor Hotel'))} Domain Relational Calculus (a) (b) (c) (d) {Hotel_No, Name, Address Hotel_No, Name, Address (HOTEL(Hotel_No, Name, Address)} {Room_No, Hotel_No, Type, Price Room_No, Hotel_No, Type, Price (ROOM(Room_No, Hotel_No, Type, Price) AND Type = 'S' AND Price < 20)} {Name, Address Name, Address (GUEST(Name, Address)} {Price, Type Room_No, Type, Price, Hotel_No 10

11 (ROOM(Hotel_No, Type, Price) AND Name (HOTEL(Hotel_No, Name) AND Name = 'Grosvenor Hotel')} (e) (f) {Guest_No, Guest.Name, Guest.Address Guest_No, Name, Address, (GUEST(Guest_No, Name, Address) AND Date_From, Date_To, Hotel_No (BOOKING(Hotel_No, Guest_No, Date_From, Date_To) AND Date_From <= ' ' AND Date_To >= ' ') AND Name (HOTEL(Hotel_No, Name) AND Name = 'Grosvenor Hotel')))} Rest similar to above. 3.9 Explain how the entity and referential integrity rules apply to these relations. For each relation, the primary key must not contain any nulls. Room is related to Hotel through the attribute Hotel_No. Therefore, the Hotel_No in Room should either be null or contain the number of an existing hotel in the Hotel relation. In this case study, it would probably be unacceptable to have a Hotel_No in Room with a null value. Booking is related to Hotel through the attribute Hotel_No. Therefore, the Hotel_No in Booking should either be null or contain the number of an existing hotel in the Hotel relation. However, because Hotel_No is also part of the primary key, a null value for this attribute would be unacceptable. Similarly for Guest_No. Booking is also related to Room through the attribute Room_No Analyze the RDBMSs that you are currently using. Determine the support the system provides for primary keys, alternate keys, foreign keys, relational integrity and views. What types of relational languages does the system provide? For each of the languages provided, what are the equivalent operations for the eight relational algebra operations? This is a small student project, the result of which is dependent on the system analyzed. 11

12 Review Questions Chapter 4 Database Planning, Design, and Administration 4.1 Discuss the relationship between the information system lifecycle and the database application lifecycle. See Sections 4.1 and Describe the purpose of each of the stage of the database application lifecycle. See Section Identify some of the techniques available to help document the users' requirements specification. See Section Describe the main aims of the conceptual and logical database design phases. The aims of conceptual database design are described in Section and the aims of logical database design are described in Section Explain why it is necessary to select the target database management system before commencing with the physical database design phase. Describe the main aims of physical database design. Physical database design is tailored to a specific DBMS, therefore it is essential the DBMS is determined before the physical design phase can begin. The aims of physical database design are described in Section Describe the prototype approach and identify the potential advantages of using this approach. See Section Outline the procedure for selecting a DBMS. See Section Define the purpose and tasks associated with data administration and database administration. Exercises See Section Produce a corporate data model for the Wellmeadows Hospital case study described in Appendix A. 12

13 Hospital Supplies Patient Management Doctor M 1 Refers M Item 1 M M 1 1 Drug Form Medication Takes Patient 1 Has M RelatedT Clinic NOK d GoesT 1 Attend 1 1 Is M M M Provides N Supplier Supply OPClinic Appointmt InPatient M 1 M M M M M WorksIn Examine AssignedTo Requires I For M 1 M 1 1 M M N Requisitio Makes Staff WorksIn Ward Has Bed M Receives Assume that you are responsible for selecting a new DBMS product for a group of users in your organization. To undertake this exercise, you must first establish a set of requirements Ward Management for the group and then identify a set of features that a DBMS product must provide to fulfill the requirements. Describe the process of evaluating and selecting the best DBMS product. The student should follow the approach to DBMS selection described in Section 4.6 and produce a report that identifies a suitable DBMS product that meets the requirements of the organization. The selection should be fully justified Assume that you are responsible for selecting a DBMS product for the Wellmeadows Hospital case study. Describe the process of evaluating and selecting the best DBMS product. The student should follow the approach to DBMS selection described in Section 4.6 and produce a report that identifies a suitable DBMS product that meets the requirements of the Wellmeadows Hospital case study. The selection should be fully justified and any assumptions made about the case study should be highlighted Investigate whether data administration and database administration exists as distinct functional areas within your organization. If identified, describe the organization, responsibilities, and tasks associated with each functional area. The student should investigate the organization and identify whether data administration and database administration exists as distinct functional areas. However, the student should be careful to note that these functions may be named differently, merged as a single function or included as part of a larger IT/IS function. If identified, the student should compile a report documenting the organization, responsibilities, and tasks. 13

14 Review Questions Part Two Methodology Chapter 5 Entity-Relationship Modeling 5.1 Describe the purpose of high-level data models in database design. The main purpose for developing a high-level data model is to support a user s perception of data and to conceal the more technical aspects associated with database design. Furthermore, a conceptual data model is independent of the particular DBMS and hardware platform that is used to implement the database. 5.2 Describe the basic concepts of the Entity-Relationship (ER) model. Present the diagrammatic representation of these concepts. The basic concepts of the Entity-Relationship model include entity types, relationship types, and attributes. See Section Describe the constraints that may be placed on participating entities in a relationship. There are two main types of restrictions on relationships called cardinality and participation constraints. See Section Describe the problems that may occur when creating an ER model. Problems may occur due to the misinterpretation of the meaning of certain relationships and these problems are referred to as connection traps. There are two main types of connection traps called fan traps and chasm traps. See Section Describe the main concepts associated with the Enhanced Entity-Relationship model. Present the diagrammatic representation of these concepts. Exercises The main concepts of the EER model are specialization/generalization, aggregation and categorization. However, in the accompanying textbook, we focus only on specialization/ generalization and categorization, which is associated with the related concepts of entity types described as superclasses or subclasses and the process of attribute inheritance. See Section 5.4 The University Accommodation Office Case Study The Director of the University Accommodation Office requires you to design a database to assist with the administration of the office. The requirements collection and analysis phase of the database design process based on the Director s view has provided the following requirements specification for the Accommodation Office database. (1) The data stored on each full-time student includes the matriculation number, name (first and last name), home address (street, city/town, postcode), date of birth, sex, category of student (for example, first year undergraduate (1UG), postgraduate (PG)), nationality, smoker (yes or no), special needs, any additional comments, current status (placed/waiting), and what course the student is studying on. The student information stored relates to those currently renting a room 14

15 and those on the waiting list. Students may rent a room in a university owned hall of residence or student flat. When a student joins the University he or she is assigned to a member of staff who acts as his or her Advisor of Studies. The Advisor of Studies is responsible for monitoring the student s welfare and academic progress. The data held on a student s Advisor includes their full name, position, name of department, internal telephone number, and room number. (2) Each hall of residence has a name, address, telephone number, and a hall manager who supervises the operation of the hall. The halls provide only single rooms, which have a room number, place number, and monthly rent rate. The place number uniquely identifies each room in all the halls controlled by the Accommodation Office and is used when renting a room to a student. (3) The Accommodation Office also offers student flats. These flats are fully furnished and provide single room accommodation for groups of 3, 4, or 5 students. The information held on student flats includes a flat number, address, and the number of single bedrooms available in each flat. The flat number uniquely identifies each flat. Each bedroom in a flat has a monthly rent rate, a room number, and a place number. The place number uniquely identifies each room available in all student flats and is used when renting a room to a student. (4) A student may rent a room in a hall or student flat for various periods of time. New lease agreements are negotiated at the start of each academic year with a minimum rental period of one semester (15 weeks) and a maximum rental period of one year, which includes Semesters 1, 2, and the Summer Semester. Each individual lease agreement between a student and the Accommodation Office is uniquely identified using a lease number. The data stored on each lease includes the lease number, duration of the lease (given as semesters), name, and matriculation number of the student, place number, room number, address details of the hall or student flat, the date the student wishes to enter the room, and the date the student wishes to leave the room (if known). (5) Student flats are inspected by staff on a regular basis to ensure that the accommodation is well maintained. The information recorded for each inspection is the name of the member of staff who carried out the inspection, the date of inspection, an indication of whether the property was found to be in a satisfactory condition (yes or no), and any additional comments. (6) Some information is also held on members of staff on the Accommodation Office and includes the staff number, name (first and last name), home address (street, city/town, postcode), date of birth, sex, position (for example, Hall Manager, Administrative Assistant, Cleaner), and location (for example, Accommodation Office or Hall). (7) The Accommodation Office also stores a limited amount of information on the courses run by the University including the course number, course title (including year), course leader s name, internal telephone number, and room number, and department name. Each student is associated with a single course. (8) Whenever possible, information on a student s next-of-kin is stored which includes the name, relationship, address (street, city/town, postcode), and contact telephone number. 5.6 Create an Enhanced Entity Relationship (EER) model to represent the data requirements of the University Accommodation Office case study. Develop the model using the following the steps: (a) Identify entity types. (b) Identify relationship types and determine the cardinality and participation constraints of the relationships. (c) Identify attributes and associate attributes with entity or relationship types. (d) Determine candidate and primary key attributes. (e) Specialize / generalize entity types (where appropriate). (f) Categorize entity types (where appropriate). (g) Draw the EER diagram. State any assumptions you made when creating the EER model. An example of a possible ER model for the University Accommodation Office case study is shown below. 15

16 Accomm adatio 1 M 1 Provid Room Fo M Lease Lease HallN d FlatN Place M Reques 1 Manag Hall 1 Works Flat 1 O M Inspecti IDat NOK 1 1 Advis Related M 1 Studen M Studi Matric 1 M M 1 1 Accom Staff StaffN 1 M Located Undertak 1 AcdStaff Office Academi Staff 1 Run M Cours Course The student should identify any ambiguities in the specification for the University Accommodation Office and state clearly his or her assumptions. For example, we may assume that we only hold information on a single next-of-kin per student and that some students do not provide this information. 16

17 Review Questions 6.1 Describe the purpose of normalizing data. Chapter 6 Normalization When we design a database for a relational system, the main objective in developing a logical data model is to create an accurate representation of the data, its relationships and constraints. To achieve this objective, we must identify a suitable set of relations. A technique that we can use to help identify such relations is called normalization. Normalization is a technique for producing a set of relations with desirable properties, given the data requirements of an enterprise. Normalization supports database designers by presenting a series of tests, which can be applied to individual relations so that a relational schema can be normalized to a specific form to prevent the possible occurrence of update anomalies. See also Sections 6.1 and Describe the problems that are associated with redundant data. A major aim of relational database design is to group attributes into relations so as to minimize information redundancy and thereby reduce the file storage space required by the base relations. Another serious difficulty using relations that have redundant information is the problem of update anomalies. These can be classified as insertion, deletion, or modification anomalies. See Section Describe the concept of functional dependency. Functional dependency describes the relationship between attributes in a relation. For example, if A and B are attributes of relation R, B is functionally dependent on A (denoted A B), if each value of A in R is associated with exactly one value of B in R. Functional dependency is a property of the meaning or semantics of the attributes in a relation. The semantics indicate how the attributes relate to one another and specify the functional dependencies between attributes. When a functional dependency is present, the dependency is specified as a constraint between the attributes. See also Section How is the concept of functional dependency associated with the process of normalization? Normalization is a formal technique for analyzing relations based on their primary key (or candidate keys in the case of BCNF) and functional dependencies. Normalization is often performed as a series of tests on a relation to determine whether it satisfies or violates the requirements of a given normal form. Three normal forms were initially proposed, which are called first (1NF), second (2NF) and third (3NF) normal form. Subsequently, a stronger definition of third normal form was introduced and is referred to as Boyce-Codd normal form (BCNF). All of these normal forms are based on the functional dependencies among the attributes of a relation. 6.5 Provide a definition for first, second, third and Boyce-Codd normal forms. First Normal Form (1NF) is a relation in which the intersection of each row and column contains one and only one value. Second Normal Form (2NF) is a relation that is in first normal form and every non-primary-key attribute is fully functionally dependent on the primary key. Third Normal Form (3NF) is a relation that is in first and second normal form in which no nonprimary-key attribute is transitively dependent on the primary key. 17

18 Boyce-Codd Normal Form (BCNF) is a relation in which every determinant is a candidate key. See also Sections 6.5 to Describe the purpose of fourth (4NF) and fifth (5NF) normal form. For 4NF see Section 6.11 and for 5NF see Section Exercises The table shown in Figure 6.25 lists dentist/patient appointment data. A patient is given an appointment at a specific time and date with a dentist located at a particular surgery. On each day of patient appointments, a dentist is allocated to a specific surgery for that day. StaffNo DentistName PatNo PatName Appointment Date Time SurgeryNo S1011 Tony Smith P100 Gillian White 12/9/ S15 S1011 Tony Smith P105 Jill Bell 12/9/ S15 S1024 Helen Pearson P108 Ian MacKay 12/9/ S10 S1024 Helen Pearson P108 Ian MacKay 14/9/ S10 S1032 Robin Plevin P105 Jill Bell 14/9/ S15 S1032 Robin Plevin P110 John Walker 15/9/ S13 Figure 6.25: Lists Dentist/Patient Appointment Data. 6.7 The table shown in Figure 6.25 is susceptible to update anomalies. Provide examples of insertion, deletion, and update anomalies. The student should provide examples of insertion, deletion and update anomalies using the data shown in the table. An example of a deletion anomaly is if we delete the details of the dentist called 'Helen Pearson', we also lose the appointment details of the patient called 'Ian MacKay'. 6.7 Describe and illustrate the process of normalizing the table shown in Figure 6.25 to Boyce-Codd normal forms. State any assumptions you make about the data shown in this table. The student should state any assumptions made about the data shown in the table. For example, we may assume that a patient is registered at only one surgery. Also, a patient may have more than one appointment on a given day. 18

19 1NF PK StaffNo ADate ATime DName PatNo PName SurgeryNo fd1 fd2 fd3 fd4 fd5 fd2 and fd4 violates 2NF 2NF StaffNo ADate ATime PatNo PName StaffNo ADate SurgeryNo StaffNo DName Fd3 violates 3NF 3NF / BCNF FK PK FK PK StaffNo ADate ATime PatNo StaffNo DName fd1 fd2 fd5 FK PK PK StaffNo ADate SurgeryNo PatNo PName fd4 Fd3 19

20 An agency called Instant Cover supplies part-time/temporary staff to hotels within Strathclyde Region. The table shown in Figure 6.26 lists the time spent by agency staff working at various hotels. The National Insurance Number (NIN) is unique for every member of staff. NIN ContractNo Hours EName H_No H_Loc 1135 C Smith J H25 East Kilbride 1057 C Hocine D H25 East Kilbride 1068 C White T H4 Glasgow 1135 C Smith J H4 Glasgow Figure 6.26: Instant Cover s Contracts. 6.8 The table shown in Figure 6.26 is susceptible to update anomalies. Provide examples of insertion, deletion, and update anomalies. The student should provide examples of insertion, deletion and update anomalies using the data shown in the table. An example of an update anomaly is if we wish to change the name of the employee called 'Smith J', we may only change the entry in the first row and not the last with the result that the database becomes inconsistent. 6.9 Describe and illustrate the process of normalizing the table shown in Figure 6.26 to Boyce-Codd Normal Form. State any assumptions you make about the data shown in this table. The student should state any assumptions made about the data shown in the table. For example, we may assume that a hotel may be associated with one or more contracts. 20

21 1NF PK NIN Contract_No Hours EName H_No H_Loc fd1 fd2 fd3 fd4 fd2 and fd3 violates 2NF 2NF NIN Contract_No Hours Contract_No H_No H_Loc NIN EName fd4 violates 3NF 3NF / BCNF FK FK PK PK FK NIN Contract_No Hours Contract_No H_No fd1 fd3 PK PK NIN EName H_No H_ Loc fd2 fd4 21

22 Review Questions Chapter 7 Methodology - Conceptual Database Design 7.1 Describe the purpose of a design methodology. A structured approach that uses procedures, techniques, tools, and documentation aids, to support and facilitate the process of design. A design methodology consists of phases that contain steps, which guide the designer in the choice of techniques that are appropriate at each stage of the project and also helps to plan, manage, control and evaluate database development projects. Furthermore, it is a structured approach for analyzing and modeling a set of requirements for a database in a standardized and organized manner. See Section Describe the main phases involved database design. See Section Identify important factors in the success of logical database design. See Section Discuss the important role played by users in the process of database design. The users' involvement throughout the database design phase is critical to providing the 'correct' system. In particular, the user should clarify any ambiguities in the specification that describes the required system and also review continually the development of the database design. The process of developing the database design is repeated until the user is prepared to 'sign-off' the design as being a 'true' representation of the part of the enterprise that is being modeling. See Sections and Describe the main objective of conceptual database design. See Section 7.3 Step Describe what a user view represents and the approaches that may be used to identify user views. User views can be identified using various methods. First, by examining the data flow diagrams that should have been produced previously to identify functional areas and possibly individual functions. Alternatively, by interviewing users, examining procedures, reports, forms, and/or observing the enterprise in operation. See also Section Identify the main tasks associated with conceptual database design. See Section Discuss the purpose of specialization/generalization of entity types, and discuss why this is an optional step in conceptual database design. See Section 7.3 Step Identify and describe the purpose of the documentation generated during conceptual database design. See Section 7.3 and in particular note the documentation generated at the end of each step. 22

23 Review Questions Chapter 8 Methodology - Logical Database Design for Relational Model 8.1 Identify the three main phases of database design and discuss the purpose of logical database design. The three main phases of database design are conceptual, logical, and physical. For purpose of logical database design see Section Describe the steps involved in refining a conceptual data model into a logical data model. See Section 8.1 Step Describe the rules for deriving relations that represent strong entity types, weak entity types, one-to-one binary relationship types, one-to-many relationship types, multi-valued attributes, and superclass/subclass relationships. See Section 8.1 Step Discuss how the technique of normalization can be used to validate the logical data model and the relations derived from the model. The logical data model can be validated using the technique of nomalization and against the transactions that the model is required to support. Normalization is used to improve the model so that it satisfies various constraints that avoid unnecessary duplication of data. Normalization ensures that the resultant model is a closer model of the enterprise that it serves, it is consistent, and has minimal redundancy and maximum stability. See also Section 8.1 Step Discuss two approaches that can be used to validate that the logical data model is capable of supporting the transactions required by the user s view. Two possible approaches to ensure that the logical data model supports the required transactions include: checking that all the information (entities, relationships and their attributes) required by each transaction is provided by the model in documenting a description of each transaction s requirements, and diagrammatically representing the pathway taken by each transaction directly on the ER diagram. See also Section 8.1 Step Describe the purpose of integrity constraints and identify the five main types of constraints. The main types of constraints include: There are five types of integrity constraints: required data, attribute domain constraints, entity integrity, referential integrity, and enterprise constraints. See also Section 8.1 Step Describe the alternative strategies that can be applied if there exists a child occurrence referencing a parent occurrence that we wish to delete. There are several strategies to consider when there exists a child occurrence referencing the parent occurrence that we are attempting to delete: NO ACTION, CASCADE, SET NULL, SET DEFAULT, and NO CHECK. See also Section 8.1 Step Identify the tasks typically associated with merging local logical data models into a global logical model. 23

24 See Section 8.1 Step 3 and in particular Step

25 Review Questions Chapter 9 Methodology - Physical Database Design for Relational DBMSs 9.1 Explain the difference between logical and physical database design. Why might these tasks be carried out by different people? Logical database design is concerned with building the data model for the organization that is completely independent of any DBMS. Physical database design, however, is concerned with actually defining the data model using the DDL of a particular DBMS. Consequently, logical database design focuses on what the data model represents, whereas physical database design focuses on how the data model is to be implemented. Different skills are required to undertake these design phases, which are often found in different people. See Section Describe the inputs and outputs of physical database design. The inputs are the global logical data model and the data dictionary. The outputs are the base relations, integrity rules, file organization specified, secondary indexes determined, user views and access rules. See Section Describe the purpose of the main steps in the physical design methodology presented in this chapter. Step 4 Step 5 Step 6 Step 7 Produces a relational database schema from the global logical data model. This includes integrity rules. Determines the file organizations for the base relations. This takes account of the nature of the transactions to be carried out, which also determine where secondary indexes will be of use. As a result of analyzing the transactions, the design may be altered by incorporating controlled redundancy into it. Designs the security measures for the database implementation. This includes designing the user views and the access rules on the relations and views. Monitors the database application systems and improves performance by making amendments to the design as appropriate. See also Section "One of the main objectives of physical database design is to store data in an efficient way." How might we measure efficiency in this context? This can be measured by the number of transactions that can be processed by the system in a given time frame, or by the length of time it takes to complete one transaction, or by the amount of disk storage taken up by the database files. See also Section 9.3 Step Under what circumstances would we want to denormalize a logical data model? Use examples to illustrate your answer. Generally, if overall performance needs to be improved, controlled redundancy can be introduced. See also Section 9.3 Step 5.4. Examples: If queries on staff always required the branch address, this attribute could be posted into staff. The effect on updating would be minimal if branch data was relatively static, and it removes a join from the query. 25

26 If the number of staff for each branch was often required with branch details, a derived attribute could be placed in branch. This would remove the need to access and repeatedly count the relevant records in staff. When staff joined or left a branch, this attribute would required updating. 26

27 Exercises Chapter 10 Conceptual Database Design Methodology - Worked Example The Wellmeadows Hospital case study 10.1 Identify user views for the Medical Director and Charge Nurse in the Wellmeadows Hospital case study, described in Appendix A. See Appendix A 10.2 List the users' requirements specification for each of these views. The student should examine the case study in detail and identify and compile a user specification for the Medical Director s and the Charge Nurse s views. As an additional task the student may also compile a specification for the Personnel Officer s view. Of course to complete this exercise will require that the student makes some ascertions about the precise requirements of each user view. Any assumption should be documented along with each view. Examples of specification for the Medical Director s and Charge Nurse s views are shown below. Medical Director The Director is responsible for the overall management of the hospital and must maintain control over the use of resources (including staff, beds, and supplies) in the provision of cost-effective treatment for all patients. 1. The hospital is composed of many wards. Each ward is managed by a Charge Nurse. The information to be held on each ward includes the ward name, number (e.g. W1), phone number, location (e.g. Block E), number of beds and the name of the Charge Nurse. 2. Each ward is allocated staff including (e.g. Charge nurse, senior and junior nurses, doctors, consultants, auxiliaries). 3. The hospital maintains a central stock of surgical (e.g. syringe, bandages) and nonsurgical (e.g. plastic bags, aprons). The details of surgical and non-surgical supplies includes item number and name, item description, quantity in stock, re-order level, cost per unit. The supplies used by each ward is monitored. The hospital also maintains a stock of pharmaceutical supplies (e.g. antibiotics, pain killers). The details of pharmaceutical supplies includes drug number and name, description, dosage, quantity in stock, re-order level, cost per unit. The pharmaceutical supplies used by each ward is monitored. 4. The details of the suppliers of the surgical, non-surgical and pharmaceutical items are stored. The information stored includes the supplier name and number, address, phone and fax number. 5. Patients are normally referred to the hospital for treatment by their local doctor. The details of local doctors are stored including the their name, clinic number, address and phone number. 6. The details of patients referred to the hospital includes the patient number, name (first and last name), address, phone number, date of birth, martial status, next-of-kin details (name, relationship, address and phone number). 27

28 7. When a patient is referred by their doctor to attend the hospital, the patient is given an appointment and is examined by a consultant. The details of the appointment are stored including the consultant s name and number, appointment number, date, time and examination room (e.g. Room E112). As a result of the examination, the patient is either recommended to attend the outpatient clinic or placed on a waiting list until a bed can be found in a particular ward. 8. The details of outpatients are stored. The information stored includes the patient details as stated earlier (see 6) and the date and time of the appointment at the outpatient clinic. 9. The details of patients currently placed in a ward and those on the waiting list for a place on a ward are stored. The information stored includes the patient details as stated earlier (see 6) and the date placed on waiting list, ward required, expected duration of stay, date placed in the ward and date left the ward. Charge Nurse The Charge Nurse has overall responsibility for the management of a single ward. The Charge Nurse is allocated a budget to run the ward and must ensure that all resources (staff, beds and supplies) are used effectively in the care of patients. The Charge Nurse and other senior medical staff are responsible for the allocation of beds to patients on the waiting list. 1. The information to be held on each ward includes the details of staff allocated to each ward including the staff number, name, address, phone number, position, number of hours worked per week and shift (e.g. early, late). 2. The information stored on each patient on the waiting list includes the patient number, name (first and last name), address, phone number, date of birth, martial status, next-ofkin details, date placed on waiting list, required ward, date placed in ward, expected duration of stay, date left ward. 3. When a patient enters the ward they are allocated a bed with a unique bed number. Each patient is prescribed medication and the details of this medication includes the patient number, drug number and name, units per day, start and finish date. The medication (pharmaceutical supplies) given to each patient is monitored. 4. Staff are allocated to work in wards, as required. The Charge Nurse of each ward is responsible for creating a staff rota which ensures that the correct complement of staff are on duty for each shift (early, late, night). Nursing staff may be specifically allocated to patients who required specialist care. 5. When required the Charge Nurse may obtain surgical, non-surgical and pharmaceutical supplies from the central stock of supplies held by the hospital. The information to be stored includes the requisition number, staff name and number, ward number, item number (or drug number), quantity required, date ordered and date received Create local conceptual data models for each of the user views. State any assumptions necessary to support your design. The student should create local conceptual data models using the requirements specification for the Medical Director and the Charge Nurse. This should include an ER model representing each user view and the supporting documentation that describes the models. Throughout the process of design, the student should clearly state any assumptions necessary to support his or her design. 28

Objective. The goal is to review material covered in Chapters 1-5. Do the following questions from the book.

Objective. The goal is to review material covered in Chapters 1-5. Do the following questions from the book. CSCE 4523 Assignment 2 - Due Sunday, Feb. 19, 2017; 11:59pm on Blackboard This assignment may be done in pairs (undergrads only). Grad students must do the assignment individually. Objective The goal is

More information

CS317 File and Database Systems

CS317 File and Database Systems CS317 File and Database Systems Lecture 9 Conceptual, Logical, and Physical DBMS Design http://dev.mysql.com/downloads/workbench October 22, 2017 Sam Siewert Reminders Assignment #4 Due Friday Assignment

More information

Lecture 03. Spring 2018 Borough of Manhattan Community College

Lecture 03. Spring 2018 Borough of Manhattan Community College Lecture 03 Spring 2018 Borough of Manhattan Community College 1 2 Outline 1. Brief History of the Relational Model 2. Terminology 3. Integrity Constraints 4. Views 3 History of the Relational Model The

More information

Lecture 03. Fall 2017 Borough of Manhattan Community College

Lecture 03. Fall 2017 Borough of Manhattan Community College Lecture 03 Fall 2017 Borough of Manhattan Community College 1 2 Outline 1 Brief History of the Relational Model 2 Terminology 3 Integrity Constraints 4 Views 3 History of the Relational Model The Relational

More information

Full file at

Full file at PART II POINTS TO EMPHASIZE AND TEACHING HINTS 25 Points to Emphasize Part 1 Background 28 Chapter 1 Introduction to Databases 29 Chapter 2 Database Environment 31 Part 2 The Relational Model and Languages

More information

SOLUTIONS TO REVIEW QUESTIONS AND EXERCISES FOR PART 3 - DATABASE ANALYSIS AND DESIGN (CHAPTERS 10 15)

SOLUTIONS TO REVIEW QUESTIONS AND EXERCISES FOR PART 3 - DATABASE ANALYSIS AND DESIGN (CHAPTERS 10 15) Instant download and all chapters Solutions Manual Database Systems A Practical Approach to Design, Implementation, and Management 6th Edition Thomas Connolly https://testbankdata.com/download/solutions-manual-database-systems-practicalapproach-design-implementation-management-6th-edition-thomas-connolly/

More information

Database Systems. A Practical Approach to Design, Implementation, and Management. Database Systems. Thomas Connolly Carolyn Begg

Database Systems. A Practical Approach to Design, Implementation, and Management. Database Systems. Thomas Connolly Carolyn Begg Database Systems A Practical Approach to Design, Implementation, and Management For these Global Editions, the editorial team at Pearson has collaborated with educators across the world to address a wide

More information

Logical Database Design. ICT285 Databases: Topic 06

Logical Database Design. ICT285 Databases: Topic 06 Logical Database Design ICT285 Databases: Topic 06 1. What is Logical Database Design? Why bother? Bad logical database design results in bad physical database design, and generally results in poor database

More information

OBJECTIVES. How to derive a set of relations from a conceptual data model. How to validate these relations using the technique of normalization.

OBJECTIVES. How to derive a set of relations from a conceptual data model. How to validate these relations using the technique of normalization. 7.5 逻辑数据库设计 OBJECTIVES How to derive a set of relations from a conceptual data model. How to validate these relations using the technique of normalization. 2 OBJECTIVES How to validate a logical data model

More information

CS403- Database Management Systems Solved Objective Midterm Papers For Preparation of Midterm Exam

CS403- Database Management Systems Solved Objective Midterm Papers For Preparation of Midterm Exam CS403- Database Management Systems Solved Objective Midterm Papers For Preparation of Midterm Exam Question No: 1 ( Marks: 1 ) - Please choose one Which of the following is NOT a feature of Context DFD?

More information

CS403- Database Management Systems Solved MCQS From Midterm Papers. CS403- Database Management Systems MIDTERM EXAMINATION - Spring 2010

CS403- Database Management Systems Solved MCQS From Midterm Papers. CS403- Database Management Systems MIDTERM EXAMINATION - Spring 2010 CS403- Database Management Systems Solved MCQS From Midterm Papers April 29,2012 MC100401285 Moaaz.pk@gmail.com Mc100401285@gmail.com PSMD01 CS403- Database Management Systems MIDTERM EXAMINATION - Spring

More information

Entity Relationship Modeling

Entity Relationship Modeling Chapter 12 Entity Relationship Modeling Chapter Objectives In this chapter you will learn: How to use Entity Relationship (ER) modeling in database design. The basic concepts associated with the ER model:

More information

Chapter 6. SQL: SubQueries

Chapter 6. SQL: SubQueries Chapter 6 SQL: SubQueries Pearson Education 2009 Definition A subquery contains one or more nested Select statements Example: List the staff who work in the branch at 163 Main St SELECT staffno, fname,

More information

1 P a g e D a t a b a s e o l d p a p e r b y w a s i m

1 P a g e D a t a b a s e o l d p a p e r b y w a s i m 1 P a g e D a t a b a s e o l d p a p e r b y w a s i m Q#1. What is concurrency control? Ans: Concurrency control (CC) is a process to ensure that data is updated correctly andappropriately when multiple

More information

1. Considering functional dependency, one in which removal from some attributes must affect dependency is called

1. Considering functional dependency, one in which removal from some attributes must affect dependency is called Q.1 Short Questions Marks 1. Considering functional dependency, one in which removal from some attributes must affect dependency is called 01 A. full functional dependency B. partial dependency C. prime

More information

8) A top-to-bottom relationship among the items in a database is established by a

8) A top-to-bottom relationship among the items in a database is established by a MULTIPLE CHOICE QUESTIONS IN DBMS (unit-1 to unit-4) 1) ER model is used in phase a) conceptual database b) schema refinement c) physical refinement d) applications and security 2) The ER model is relevant

More information

DATABASE MANAGEMENT SYSTEM SHORT QUESTIONS. QUESTION 1: What is database?

DATABASE MANAGEMENT SYSTEM SHORT QUESTIONS. QUESTION 1: What is database? DATABASE MANAGEMENT SYSTEM SHORT QUESTIONS Complete book short Answer Question.. QUESTION 1: What is database? A database is a logically coherent collection of data with some inherent meaning, representing

More information

A7-R3: INTRODUCTION TO DATABASE MANAGEMENT SYSTEMS

A7-R3: INTRODUCTION TO DATABASE MANAGEMENT SYSTEMS A7-R3: INTRODUCTION TO DATABASE MANAGEMENT SYSTEMS NOTE: 1. There are TWO PARTS in this Module/Paper. PART ONE contains FOUR questions and PART TWO contains FIVE questions. 2. PART ONE is to be answered

More information

MIDTERM EXAMINATION Spring 2010 CS403- Database Management Systems (Session - 4) Ref No: Time: 60 min Marks: 38

MIDTERM EXAMINATION Spring 2010 CS403- Database Management Systems (Session - 4) Ref No: Time: 60 min Marks: 38 Student Info StudentID: Center: ExamDate: MIDTERM EXAMINATION Spring 2010 CS403- Database Management Systems (Session - 4) Ref No: 1356458 Time: 60 min Marks: 38 BC080402322 OPKST 5/28/2010 12:00:00 AM

More information

Chapter 11 Database Concepts

Chapter 11 Database Concepts Chapter 11 Database Concepts INTRODUCTION Database is collection of interrelated data and database system is basically a computer based record keeping system. It contains the information about one particular

More information

DATABASE MANAGEMENT SYSTEM

DATABASE MANAGEMENT SYSTEM DATABASE MANAGEMENT SYSTEM For COMPUTER SCIENCE DATABASE MANAGEMENT. SYSTEM SYLLABUS ER model. Relational model: relational algebra, tuple calculus, SQL. Integrity constraints, normal forms. File organization,

More information

Course Outline Faculty of Computing and Information Technology

Course Outline Faculty of Computing and Information Technology Course Outline Faculty of Computing and Information Technology Title Code Instructor Name Credit Hours Prerequisite Prerequisite Skill/Knowledge/Understanding Category Course Goals Statement of Course

More information

King Fahd University of Petroleum and Minerals

King Fahd University of Petroleum and Minerals Exam 1 March 16, 2008 Page 1 of 7 King Fahd University of Petroleum and Minerals Department of Information and Computer Science ICS 324: Database Systems Spring 2007-2008 Date: 16-March-2008 Major Exam

More information

Conceptual Database Design

Conceptual Database Design Conceptual Database Design Fall 2009 Yunmook Nah Department of Electronics and Computer Engineering Dankook University Conceptual Database Design Methodology Chapter 15, Connolly & Begg Steps to Build

More information

4. Entity Relationship Model

4. Entity Relationship Model 4. Entity Relationship Model a) ER-Model: Used to construct conceptual data model, representing the structure and constraints of a database, which is not dependent on a software (like DBMS) or any data

More information

Chapter 3. The Relational database design

Chapter 3. The Relational database design Chapter 3 The Relational database design Chapter 3 - Objectives Terminology of relational model. How tables are used to represent data. Connection between mathematical relations and relations in the relational

More information

Lecture 01. Fall 2018 Borough of Manhattan Community College

Lecture 01. Fall 2018 Borough of Manhattan Community College Lecture 01 Fall 2018 Borough of Manhattan Community College 1 2 Introduction A database (DB) is a collection of related data. A database management system (DBMS) is the software that manages and controls

More information

Data about data is database Select correct option: True False Partially True None of the Above

Data about data is database Select correct option: True False Partially True None of the Above Within a table, each primary key value. is a minimal super key is always the first field in each table must be numeric must be unique Foreign Key is A field in a table that matches a key field in another

More information

Database Systems. A Practical Approach to Design, Implementation, and Management. Database Systems. Thomas Connolly Carolyn Begg

Database Systems. A Practical Approach to Design, Implementation, and Management. Database Systems. Thomas Connolly Carolyn Begg Database Systems A Practical Approach to Design, Implementation, and Management For these Global Editions, the editorial team at Pearson has collaborated with educators across the world to address a wide

More information

Database Management System Prof. Partha Pratim Das Department of Computer Science & Engineering Indian Institute of Technology, Kharagpur

Database Management System Prof. Partha Pratim Das Department of Computer Science & Engineering Indian Institute of Technology, Kharagpur Database Management System Prof. Partha Pratim Das Department of Computer Science & Engineering Indian Institute of Technology, Kharagpur Lecture - 19 Relational Database Design (Contd.) Welcome to module

More information

IS 263 Database Concepts

IS 263 Database Concepts IS 263 Database Concepts Lecture 4: Normalization Instructor: Henry Kalisti 1 Department of Computer Science and Engineering Limitations of E- R Designs Provides a set of guidelines, does not result in

More information

Distributed Database Systems By Syed Bakhtawar Shah Abid Lecturer in Computer Science

Distributed Database Systems By Syed Bakhtawar Shah Abid Lecturer in Computer Science Distributed Database Systems By Syed Bakhtawar Shah Abid Lecturer in Computer Science 1 Distributed Database Systems Basic concepts and Definitions Data Collection of facts and figures concerning an object

More information

Lecture 02. Fall 2017 Borough of Manhattan Community College

Lecture 02. Fall 2017 Borough of Manhattan Community College Lecture 02 Fall 2017 Borough of Manhattan Community College 1 2 Introduction A major aim of a database system is to provide users with an abstract view of data, hiding certain details of how data is stored

More information

The University of British Columbia

The University of British Columbia The University of British Columbia Computer Science 304 Midterm Examination February 23, 2005 Time: 50 minutes Total marks: 50 Instructor: George Tsiknis Name (PRINT) (Last) (First) Signature This examination

More information

Detailed Data Modelling: Attribute Collection and Normalisation of Data

Detailed Data Modelling: Attribute Collection and Normalisation of Data Detailed Data Modelling IMS1002 /CSE1205 Systems Analysis and Design Detailed Data Modelling: Attribute Collection and Normalisation of Data The objective of detailed data modelling is to develop a detailed

More information

GUJARAT TECHNOLOGICAL UNIVERSITY

GUJARAT TECHNOLOGICAL UNIVERSITY Seat No.: Enrolment No. GUJARAT TECHNOLOGICAL UNIVERSITY BE - SEMESTER III (NEW) - EXAMINATION SUMMER 2017 Subject Code: 21303 Date: 02/06/2017 Subject Name: Database Management Systems Time: 10:30 AM

More information

Relational Model: History

Relational Model: History Relational Model: History Objectives of Relational Model: 1. Promote high degree of data independence 2. Eliminate redundancy, consistency, etc. problems 3. Enable proliferation of non-procedural DML s

More information

TMA01 Fall 2011 (Cut-off date 8 Dec 2011)

TMA01 Fall 2011 (Cut-off date 8 Dec 2011) M359 Relational databases: theory and practice TMA01 Fall 2011 (Cut-off date 8 Dec 2011) 1. Rules and Guidelines This section contains general rules and guidelines for completing and submitting your TMA.

More information

Northern India Engineering College, New Delhi Question Bank Database Management System. B. Tech. Mechanical & Automation Engineering V Semester

Northern India Engineering College, New Delhi Question Bank Database Management System. B. Tech. Mechanical & Automation Engineering V Semester 1. List four significant differences between a file-processing system and a DBMS. 2. Explain the difference between physical and logical data independence. 3. What are five main functions of a database

More information

Relational Model History. COSC 304 Introduction to Database Systems. Relational Model and Algebra. Relational Model Definitions.

Relational Model History. COSC 304 Introduction to Database Systems. Relational Model and Algebra. Relational Model Definitions. COSC 304 Introduction to Database Systems Relational Model and Algebra Dr. Ramon Lawrence University of British Columbia Okanagan ramon.lawrence@ubc.ca Relational Model History The relational model was

More information

The Relational Model

The Relational Model The Relational Model What is the Relational Model Relations Domain Constraints SQL Integrity Constraints Translating an ER diagram to the Relational Model and SQL Views A relational database consists

More information

Review for Exam 1 CS474 (Norton)

Review for Exam 1 CS474 (Norton) Review for Exam 1 CS474 (Norton) What is a Database? Properties of a database Stores data to derive information Data in a database is, in general: Integrated Shared Persistent Uses of Databases The Integrated

More information

The DBMS accepts requests for data from the application program and instructs the operating system to transfer the appropriate data.

The DBMS accepts requests for data from the application program and instructs the operating system to transfer the appropriate data. Managing Data Data storage tool must provide the following features: Data definition (data structuring) Data entry (to add new data) Data editing (to change existing data) Querying (a means of extracting

More information

Top 88 Question Asked in Part I of MIS 150 EXAM #1 (Chapter 1-4, Appendix C) Exams questions gathered from old tests dating back to Fall 2000

Top 88 Question Asked in Part I of MIS 150 EXAM #1 (Chapter 1-4, Appendix C) Exams questions gathered from old tests dating back to Fall 2000 Top 88 Question Asked in Part I of MIS 150 EXAM #1 (Chapter 1-4, Appendix C) Exams questions gathered from old tests dating back to Fall 2000 1. Name one data model that emphasizes the concept of reusable

More information

CS 338 The Enhanced Entity-Relationship (EER) Model

CS 338 The Enhanced Entity-Relationship (EER) Model CS 338 The Enhanced Entity-Relationship (EER) Model Bojana Bislimovska Spring 2017 Major research Outline EER model overview Subclasses, superclasses and inheritance Specialization and generalization Modeling

More information

Detailed Data Modelling. Detailed Data Modelling. Detailed Data Modelling. Identifying Attributes. Attributes

Detailed Data Modelling. Detailed Data Modelling. Detailed Data Modelling. Identifying Attributes. Attributes IMS1002 /CSE1205 Systems Analysis and Design Detailed Data Modelling The objective of detailed data modelling is to develop a detailed data structure that: Detailed Data Modelling: Attribute Collection

More information

ER Model. Objectives (2/2) Electricite Du Laos (EDL) Dr. Kanda Runapongsa Saikaew, Computer Engineering, KKU 1

ER Model. Objectives (2/2) Electricite Du Laos (EDL) Dr. Kanda Runapongsa Saikaew, Computer Engineering, KKU 1 ER Model Asst. Prof. Dr. Kanda Runapongsa Saikaew (krunapon@kku.ac.th) Dept of Computer Engineering Khon Kaen University Objectives (1/2) Relational Data Model Terminology of relational data model How

More information

Course on Database Design Carlo Batini University of Milano Bicocca

Course on Database Design Carlo Batini University of Milano Bicocca Course on Database Design Carlo Batini University of Milano Bicocca 1 Carlo Batini, 2015 This work is licensed under the Creative Commons Attribution NonCommercial NoDerivatives 4.0 International License.

More information

Chapter. Chapter Objectives

Chapter. Chapter Objectives Chapter 2 Database Environment Chapter Objectives In this chapter you will learn: The purpose and origin of the three-level database architecture. The contents of the external, conceptual, and internal

More information

Database Management Systems (Classroom Practice Booklet Solutions)

Database Management Systems (Classroom Practice Booklet Solutions) Database Management Systems (Classroom Practice Booklet Solutions) 2. ER and Relational Model 4 ssn cid 01. Ans: (b) Professor Teaches course 02. Ans: (c) Sol: Because each patient is admitted into one

More information

DATABASE DEVELOPMENT (H4)

DATABASE DEVELOPMENT (H4) IMIS HIGHER DIPLOMA QUALIFICATIONS DATABASE DEVELOPMENT (H4) December 2017 10:00hrs 13:00hrs DURATION: 3 HOURS Candidates should answer ALL the questions in Part A and THREE of the five questions in Part

More information

UNIT I. Introduction

UNIT I. Introduction UNIT I Introduction Objective To know the need for database system. To study about various data models. To understand the architecture of database system. To introduce Relational database system. Introduction

More information

E-R Model. Hi! Here in this lecture we are going to discuss about the E-R Model.

E-R Model. Hi! Here in this lecture we are going to discuss about the E-R Model. E-R Model Hi! Here in this lecture we are going to discuss about the E-R Model. What is Entity-Relationship Model? The entity-relationship model is useful because, as we will soon see, it facilitates communication

More information

The University of Nottingham

The University of Nottingham The University of Nottingham SCHOOL OF COMPUTER SCIENCE AND INFORMATION TECHNOLOGY A LEVEL 1 MODULE, SPRING SEMESTER 2006-2007 DATABASE SYSTEMS Time allowed TWO hours Candidates must NOT start writing

More information

THE RELATIONAL DATABASE MODEL

THE RELATIONAL DATABASE MODEL THE RELATIONAL DATABASE MODEL Introduction to relational DB Basic Objects of relational model Properties of relation Representation of ER model to relation Keys Relational Integrity Rules Functional Dependencies

More information

Mahathma Gandhi University

Mahathma Gandhi University Mahathma Gandhi University BSc Computer science III Semester BCS 303 OBJECTIVE TYPE QUESTIONS Choose the correct or best alternative in the following: Q.1 In the relational modes, cardinality is termed

More information

B.C.A DATA BASE MANAGEMENT SYSTEM MODULE SPECIFICATION SHEET. Course Outline

B.C.A DATA BASE MANAGEMENT SYSTEM MODULE SPECIFICATION SHEET. Course Outline B.C.A 2017-18 DATA BASE MANAGEMENT SYSTEM Course Outline MODULE SPECIFICATION SHEET This course introduces the fundamental concepts necessary for designing, using and implementing database systems and

More information

Chapter 12. Entity-Relationship Modeling

Chapter 12. Entity-Relationship Modeling Chapter 12 Entity-Relationship Modeling Chapter 12 - Objectives How to use Entity Relationship (ER) modeling in database design. Basic concepts associated with ER model. Diagrammatic technique for displaying

More information

SQL DDL. Intro SQL CREATE TABLE ALTER TABLE Data types Service-based database in Visual Studio Database in PHPMyAdmin

SQL DDL. Intro SQL CREATE TABLE ALTER TABLE Data types Service-based database in Visual Studio Database in PHPMyAdmin SQL DDL Intro SQL CREATE TABLE ALTER TABLE Data types Service-based database in Visual Studio Database in PHPMyAdmin Steen Jensen, autumn 2017 Languages Languages for relational DBMSs are: SQL QBE Structured

More information

CISC 3140 (CIS 20.2) Design & Implementation of Software Application II

CISC 3140 (CIS 20.2) Design & Implementation of Software Application II CISC 3140 (CIS 20.2) Design & Implementation of Software Application II Instructor : M. Meyer Email Address: meyer@sci.brooklyn.cuny.edu Course Page: http://www.sci.brooklyn.cuny.edu/~meyer/ CISC3140-Meyer-lec4

More information

COMP Instructor: Dimitris Papadias WWW page:

COMP Instructor: Dimitris Papadias WWW page: COMP 5311 Instructor: Dimitris Papadias WWW page: http://www.cse.ust.hk/~dimitris/5311/5311.html Textbook Database System Concepts, A. Silberschatz, H. Korth, and S. Sudarshan. Reference Database Management

More information

Chapter 4. The Relational Model

Chapter 4. The Relational Model Chapter 4 The Relational Model Chapter 4 - Objectives Terminology of relational model. How tables are used to represent data. Connection between mathematical relations and relations in the relational model.

More information

Chapter 17. Methodology Logical Database Design for the Relational Model

Chapter 17. Methodology Logical Database Design for the Relational Model Chapter 17 Methodology Logical Database Design for the Relational Model Chapter 17 - Objectives How to derive a set of relations from a conceptual data model. How to validate these relations using the

More information

CS317 File and Database Systems

CS317 File and Database Systems CS317 File and Database Systems Lecture 3 Relational Model & Languages Part-1 September 7, 2018 Sam Siewert More Embedded Systems Summer - Analog, Digital, Firmware, Software Reasons to Consider Catch

More information

Transforming ER to Relational Schema

Transforming ER to Relational Schema Transforming ER to Relational Schema Transformation of ER Diagrams to Relational Schema ER Diagrams Entities (Strong, Weak) Relationships Attributes (Multivalued, Derived,..) Generalization Relational

More information

Chapter 14. Chapter 14 - Objectives. Purpose of Normalization. Purpose of Normalization

Chapter 14. Chapter 14 - Objectives. Purpose of Normalization. Purpose of Normalization Chapter 14 - Objectives Chapter 14 Normalization The purpose of normalization. How normalization can be used when designing a relational database. The potential problems associated with redundant data

More information

D.K.M COLLEGE FOR WOMEN(AUTONOMOUS),VELLORE DATABASE MANAGEMENT SYSTEM QUESTION BANK

D.K.M COLLEGE FOR WOMEN(AUTONOMOUS),VELLORE DATABASE MANAGEMENT SYSTEM QUESTION BANK D.K.M COLLEGE FOR WOMEN(AUTONOMOUS),VELLORE DATABASE MANAGEMENT SYSTEM QUESTION BANK UNIT I SECTION-A 2 MARKS 1. What is meant by DBMs? 2. Who is a DBA? 3. What is a data model?list its types. 4. Define

More information

Essay Question: Explain 4 different means by which constrains are represented in the Conceptual Data Model (CDM).

Essay Question: Explain 4 different means by which constrains are represented in the Conceptual Data Model (CDM). Question 1 Essay Question: Explain 4 different means by which constrains are represented in the Conceptual Data Model (CDM). By specifying participation conditions By specifying the degree of relationship

More information

Techno India Batanagar Computer Science and Engineering. Model Questions. Subject Name: Database Management System Subject Code: CS 601

Techno India Batanagar Computer Science and Engineering. Model Questions. Subject Name: Database Management System Subject Code: CS 601 Techno India Batanagar Computer Science and Engineering Model Questions Subject Name: Database Management System Subject Code: CS 601 Multiple Choice Type Questions 1. Data structure or the data stored

More information

SYED AMMAL ENGINEERING COLLEGE

SYED AMMAL ENGINEERING COLLEGE CS6302- Database Management Systems QUESTION BANK UNIT-I INTRODUCTION TO DBMS 1. What is database? 2. Define Database Management System. 3. Advantages of DBMS? 4. Disadvantages in File Processing System.

More information

ADVANCED DATABASES ; Spring 2015 Prof. Sang-goo Lee (11:00pm: Mon & Wed: Room ) Advanced DB Copyright by S.-g.

ADVANCED DATABASES ; Spring 2015 Prof. Sang-goo Lee (11:00pm: Mon & Wed: Room ) Advanced DB Copyright by S.-g. 4541.564; Spring 2015 Prof. Sang-goo Lee (11:00pm: Mon & Wed: Room 301-203) ADVANCED DATABASES Copyright by S.-g. Lee Review - 1 General Info. Text Book Database System Concepts, 6 th Ed., Silberschatz,

More information

Basant Group of Institution

Basant Group of Institution Basant Group of Institution Visual Basic 6.0 Objective Question Q.1 In the relational modes, cardinality is termed as: (A) Number of tuples. (B) Number of attributes. (C) Number of tables. (D) Number of

More information

Do not turn over until you are told to do so by the invigilator. Module Contact: Dr. Beatriz de la Iglesia (CMP)

Do not turn over until you are told to do so by the invigilator. Module Contact: Dr. Beatriz de la Iglesia (CMP) UNIVERSITY OF EAST ANGLIA School of Computing Sciences January PG Examination 2013-14 DATABASE MANIPULATION CMPSMB11 Time allowed: 3 hours Answer THREE questions. All questions carry equal weight. Notes

More information

Chapter 2: Entity-Relationship Model

Chapter 2: Entity-Relationship Model Chapter 2: Entity-Relationship Model! Entity Sets! Relationship Sets! Design Issues! Mapping Constraints! Keys! E-R Diagram! Extended E-R Features! Design of an E-R Database Schema! Reduction of an E-R

More information

Relational Model History. COSC 416 NoSQL Databases. Relational Model (Review) Relation Example. Relational Model Definitions. Relational Integrity

Relational Model History. COSC 416 NoSQL Databases. Relational Model (Review) Relation Example. Relational Model Definitions. Relational Integrity COSC 416 NoSQL Databases Relational Model (Review) Dr. Ramon Lawrence University of British Columbia Okanagan ramon.lawrence@ubc.ca Relational Model History The relational model was proposed by E. F. Codd

More information

SAMPLE FINAL EXAM SPRING/2H SESSION 2017

SAMPLE FINAL EXAM SPRING/2H SESSION 2017 SAMPLE FINAL EXAM SPRING/2H SESSION 2017 School of Computing, Engineering and Mathematics Complete your details in this section when instructed by the Exam Supervisor at the start of the exam. You should

More information

Relational Database design. Slides By: Shree Jaswal

Relational Database design. Slides By: Shree Jaswal Relational Database design Slides By: Shree Jaswal Topics: Design guidelines for relational schema, Functional Dependencies, Definition of Normal Forms- 1NF, 2NF, 3NF, BCNF, Converting Relational Schema

More information

Informal Design Guidelines for Relational Databases

Informal Design Guidelines for Relational Databases Outline Informal Design Guidelines for Relational Databases Semantics of the Relation Attributes Redundant Information in Tuples and Update Anomalies Null Values in Tuples Spurious Tuples Functional Dependencies

More information

Database Design Process

Database Design Process Database Design Process Real World Functional Requirements Requirements Analysis Database Requirements Functional Analysis Access Specifications Application Pgm Design E-R Modeling Choice of a DBMS Data

More information

3 February 2011 CSE-3421M Test #1 p. 1 of 14. CSE-3421M Test #1. Design

3 February 2011 CSE-3421M Test #1 p. 1 of 14. CSE-3421M Test #1. Design 3 February 2011 CSE-3421M Test #1 p. 1 of 14 CSE-3421M Test #1 Design Sur / Last Name: Given / First Name: Student ID: Instructor: Parke Godfrey Exam Duration: 75 minutes Term: Winter 2011 Answer the following

More information

Database Applications (15-415)

Database Applications (15-415) Database Applications (15-415) The Relational Model Lecture 3, January 18, 2015 Mohammad Hammoud Today Last Session: The entity relationship (ER) model Today s Session: ER model (Cont d): conceptual design

More information

DBMS Chapter Three IS304. Database Normalization-Comp.

DBMS Chapter Three IS304. Database Normalization-Comp. Database Normalization-Comp. Contents 4. Boyce Codd Normal Form (BCNF) 5. Fourth Normal Form (4NF) 6. Fifth Normal Form (5NF) 7. Sixth Normal Form (6NF) 1 4. Boyce Codd Normal Form (BCNF) In the first

More information

Contact Hours / week: 4 Total hours: 64. Table of Contents Architecture 3 Data Modeling Using the Entity-

Contact Hours / week: 4 Total hours: 64. Table of Contents Architecture 3 Data Modeling Using the Entity- Govt. of Karnataka, Department of Technical Education Diploma in Information Science & Engineering Fourth Semester Subject: DATABASE MANAGEMENT SYSTEMS Contact Hours / week: 4 Total hours: 64 Table of

More information

Relational Database Model. III. Introduction to the Relational Database Model. Relational Database Model. Relational Terminology.

Relational Database Model. III. Introduction to the Relational Database Model. Relational Database Model. Relational Terminology. III. Introduction to the Relational Database Model Relational Database Model In 1970, E. F. Codd published A Relational Model of Data for Large Shared Data Banks in CACM. In the early 1980s, commercially

More information

Chapter 1: The Database Environment

Chapter 1: The Database Environment Chapter 1: The Database Environment Modern Database Management 6 th Edition Jeffrey A. Hoffer, Mary B. Prescott, Fred R. McFadden Prentice Hall, 2002 1 Definitions Data: Meaningful facts, text, graphics,

More information

Database Management System (15ECSC208) UNIT I: Chapter 2: Relational Data Model and Relational Algebra

Database Management System (15ECSC208) UNIT I: Chapter 2: Relational Data Model and Relational Algebra Database Management System (15ECSC208) UNIT I: Chapter 2: Relational Data Model and Relational Algebra Relational Data Model and Relational Constraints Part 1 A simplified diagram to illustrate the main

More information

VALLIAMMAI ENGINEERING COLLEGE

VALLIAMMAI ENGINEERING COLLEGE VALLIAMMAI ENGINEERING COLLEGE III SEMESTER - B.E COMPUTER SCIENCE AND ENGINEERING QUESTION BANK - CS6302 DATABASE MANAGEMENT SYSTEMS UNIT I 1. What are the disadvantages of file processing system? 2.

More information

2.8.1 Practicals Question Bank Algebra Unit-I 1. Show that {1, 2, 3} under multiplication modulo 4 is not a group but that {1, 2, 3, 4} under multiplication modulo 5 is a group. 2. Let G be a group with

More information

0. Database Systems 1.1 Introduction to DBMS Information is one of the most valuable resources in this information age! How do we effectively and efficiently manage this information? - How does Wal-Mart

More information

Relational Database Systems Part 01. Karine Reis Ferreira

Relational Database Systems Part 01. Karine Reis Ferreira Relational Database Systems Part 01 Karine Reis Ferreira karine@dpi.inpe.br Aula da disciplina Computação Aplicada I (CAP 241) 2016 Database System Database: is a collection of related data. represents

More information

Entity-Relationship Modelling. Entities Attributes Relationships Mapping Cardinality Keys Reduction of an E-R Diagram to Tables

Entity-Relationship Modelling. Entities Attributes Relationships Mapping Cardinality Keys Reduction of an E-R Diagram to Tables Entity-Relationship Modelling Entities Attributes Relationships Mapping Cardinality Keys Reduction of an E-R Diagram to Tables 1 Entity Sets A enterprise can be modeled as a collection of: entities, and

More information

Database Technology Introduction. Heiko Paulheim

Database Technology Introduction. Heiko Paulheim Database Technology Introduction Outline The Need for Databases Data Models Relational Databases Database Design Storage Manager Query Processing Transaction Manager Introduction to the Relational Model

More information

A7-R3: INTRODUCTION TO DATABASE MANAGEMENT SYSTEMS

A7-R3: INTRODUCTION TO DATABASE MANAGEMENT SYSTEMS A7-R3: INTRODUCTION TO DATABASE MANAGEMENT SYSTEMS NOTE: 1. There are TWO PARTS in this Module/Paper. PART ONE contains FOUR questions and PART TWO contains FIVE questions. 2. PART ONE is to be answered

More information

Relational Database Management Systems Oct I. Section-A: 5 X 4 =20 Marks

Relational Database Management Systems Oct I. Section-A: 5 X 4 =20 Marks Relational Database Management Systems Oct 2015 1 I. Section-A: 5 X 4 =20 Marks 1. Data Consistency Files and application programs are created by different programmers over a long period of time, the files

More information

CMP-3440 Database Systems

CMP-3440 Database Systems CMP-3440 Database Systems Logical Design Lecture 03 zain 1 Database Design Process Application 1 Conceptual requirements Application 1 External Model Application 2 Application 3 Application 4 External

More information

DATABASE DEVELOPMENT (H4)

DATABASE DEVELOPMENT (H4) IMIS HIGHER DIPLOMA QUALIFICATIONS DATABASE DEVELOPMENT (H4) Friday 3 rd June 2016 10:00hrs 13:00hrs DURATION: 3 HOURS Candidates should answer ALL the questions in Part A and THREE of the five questions

More information

Bachelor in Information Technology (BIT) O Term-End Examination

Bachelor in Information Technology (BIT) O Term-End Examination No. of Printed Pages : 6 I CSI-14 I Bachelor in Information Technology (BIT) O Term-End Examination cn Cn1 June, 2010 CD cp CSI-14 : DATA ANALYSIS AND DATABASE DESIGN Time : 3 hours Maximum Marks : 75

More information

DATABASE TECHNOLOGY - 1DL124

DATABASE TECHNOLOGY - 1DL124 1 DATABASE TECHNOLOGY - 1DL124 Summer 2007 An introductury course on database systems http://user.it.uu.se/~udbl/dbt-sommar07/ alt. http://www.it.uu.se/edu/course/homepage/dbdesign/st07/ Kjell Orsborn

More information

CPS510 Database System Design Primitive SYSTEM STRUCTURE

CPS510 Database System Design Primitive SYSTEM STRUCTURE CPS510 Database System Design Primitive SYSTEM STRUCTURE Naïve Users Application Programmers Sophisticated Users Database Administrator DBA Users Application Interfaces Application Programs Query Data

More information

Computer Science 597A Fall 2008 First Take-home Exam Out: 4:20PM Monday November 10, 2008 Due: 3:00PM SHARP Wednesday, November 12, 2008

Computer Science 597A Fall 2008 First Take-home Exam Out: 4:20PM Monday November 10, 2008 Due: 3:00PM SHARP Wednesday, November 12, 2008 Computer Science 597A Fall 2008 First Take-home Exam Out: 4:20PM Monday November 10, 2008 Due: 3:00PM SHARP Wednesday, November 12, 2008 Instructions: This exam must be entirely your own work. Do not consult

More information