9
Al Akhawayn University School of Science and Engineering CSC 3326 Database Systems, Fall 2003 Individual Homework assignment 1 Question 1 Multiple Choice Identify the letter of the choice that best completes the statement or answers the question. 1) When designing a new database, it is a good idea to a. Avoid data redundancy. b. Include redundant fields. c. Include a common field in all tables. d. Use composite keys. 2) Of the database system environment, which of the following is not considered part of the people component? a. Salesmen b. Administrators c. Designers d. End Users 3) DBMSs are important because a. We need good ways of managing such data. b. They contain a query language that makes it possible to produce ad hoc queries. c. They help create an environment for end users to have access to more data. d. All of the above e. None of the above

assignment1_fs03ans

Embed Size (px)

DESCRIPTION

database

Citation preview

Page 1: assignment1_fs03ans

 Al Akhawayn University

School of Science and Engineering

CSC 3326 Database Systems, Fall 2003

Individual Homework assignment 1

Question 1

Multiple Choice Identify the letter of the choice that best completes the statement or answers the question. 1) When designing a new database, it is a good idea to a. Avoid data redundancy.b. Include redundant fields.c. Include a common field in all tables.d. Use composite keys.  2) Of the database system environment, which of the following is not considered part of the people component? a. Salesmenb. Administratorsc. Designersd. End Users

3) DBMSs are important because a. We need good ways of managing such data.b. They contain a query language that makes it possible to produce ad hoc queries.c. They help create an environment for end users to have access to more data.d. All of the abovee. None of the above  

4) IBM bought another database company in 2001. The DBMS that they got as part of the acquisition is

a) DB2 b) UDB c) SQL Anywhere d) Informix e) Teradata

5) A primary key a. Consists of only one field.b. Has the same value for all records.

Page 2: assignment1_fs03ans

c. Must contain a unique value for each record within the table.d. Is defined automatically

6) The most important advantages of the hierarchical database model are a. Conceptual simplicity, security, integrity, diversity, and security.b. Security, efficiency, diversity, simplicity, and integrity.c. Integrity, efficiency, diversity, independence, and simplicity.d. Conceptual simplicity, security, independence, integrity, and efficiency.  7) The network database models have  a. A navigational system that yields simple design.b. A simple system that promotes efficiency.c. An owner/member relationship that promotes database integrity.d. a and be. b and c  8) The entity relationship model  a. Has unlimited constraint representation.b. Has unlimited relationship representation.c. Has data manipulation language.d. Has visual representation that makes it an effective communications tool. 

 9) The entity integrity rule requires that a. All entries are unique.b. A part of the key may be null.c. Foreign key values do not reference primary key values.d. Duplicate object values are allowed.  10) In the context of a database table, the statement "A determines B" indicates that a. Knowing the value of attribute A you can not look up the value of attribute B.b. You do not need to know the value of attribute A in order to look up the value of attribute B.c. Knowing the value of attribute B you can look up the value of attribute A.d. Knowing the value of attribute A you can look up the value of attribute B. 

Question 2

1. What are the main objectives of data management?

Providing data definition and manipulation functions, and facilities for recovery, concurrency, consistency, and security.

Page 3: assignment1_fs03ans

2. What are the main components of database environment?

DBMS, data, applications, supporting hardware, DBAs, programmers, and users.

3. Explain the concepts of logical and physical data independence? Give examples of both.

Logical data independence implies that the conceptual model can be changed without impacting on existing external schemas. Logical data independence protects the application from logical changes in the model, e.g. a new table or column. Physical data independence implies that the physical storage structures can be changed without impacting on the conceptual model. Physical data independence protects logical model against physical changes, e.g. dropping an index.

4. Briefly discuss the main characteristics of the hierarchical, network, relational and object data models. What are the advantages and disadvantages of each approach?

The four models reflect the historical development of database technology.

Hierarchical model: stores data in the form of hierarchies. Not all systems fit into a hierarchy and this leads to redundancy. Main problem - inflexibility.

Network (Codasyl) model: stores data as a network of inter-linked sets. Main problem complexity and inflexibility.

Relational model: data represented as a set of tables. Advanced theoretical support, simplicity and elegance. Limitation: only suitable for relatively simple data structures.

Object model: treats data as objects with methods, etc. Benefits with complex data structures.

5. Describe the properties of relations. Which integrity rules apply to the relational model?

Order of attributes (columns) and tuples (rows) has no significance; all attribute values are atomic; there are no duplicate tuples. Domain integrity, entity integrity, and referential integrity.

Page 4: assignment1_fs03ans

6. Discuss the concept of data dictionary. What is its purpose and how is it implemented? Can users update the data dictionary?

Data dictionary records all database elements (ie tables, indexes, etc.). Data dictionary is a

collection of system tables; users can read the data dictionary but may not update directly.

7. How relationships are represented in relational and object databases?

Relational: 1:1 and 1:m relationships are represented as primary/foreign keys pair; m:n relationships are represented as a new relation with it composite primary key as foreign keys of the participants of the relationships. OO: all relationships are represented as OIDs (with the help of collection type if necessary)

8. What is the difference between OODBMS and Object-Relational DBMS?

ORDBMS are basically relational DBMS with some object-oriented features (complex, abstract data types, ability to handle unstructured data to some extent etc.)

9. Explain the difference between transactional and decision support databases.

A transactional database is primarily designed to support “immediate response” transactions such as product or service sales, payments, and supply purchases.In contrast a decision support database focuses primarily on the production of information required to make tactical or strategic decisions at middle and high management levels.

Page 5: assignment1_fs03ans

Question 34 PT

Problem 1

1. Using the table below, what data redundancies do you detect, and how could these redundancies lead to anomalies? (be specific in your discussion – don’t just list the types of anomalies)

What data redundancies do you detect, and how could these redundancies lead to anomalies?Note that the manager named Holly B. Parker occurs three times, indicating that she manages three projects coded 21-5Z,25-9T, and 29-2D, respectively. (The occurrences indicate that there is a 1:M relationship between PROJECT and MANAGER: each project is managed by only one manager but, apparently, a manager may manage more than one project.) Ms. Parker's phone number and address also occur three times. If Ms. Parker moves and/or changes her phone number, these changes must be made more than once and they must all be made correctly... without missing asingle occurrence. If any occurrence is missed during the change, the data are "different" for the same person. After some time, it may become difficult to determine what the correct data are. In addition, multiple occurrences invitemisspellings and digit transpositions, thus producing the same anomalies. The same problems exist for the multiple occurrences of George F. Dorts.

Problem 22. Given the table structure shown below, what problem(s) might you encounter if you deleted all records with building_code KOM?

If the foreign key of the corresponding building_code KOM is in another table, we can not delete those records without deleting there matching entries found in the other table. So as a sequence, we should delete the records of building_code Kom from both tables.

Page 6: assignment1_fs03ans

Question 47 PT

Problems 1 to 7 of chapter 2 of your textbook (The relational database model) page 95- 96

Problem solutions from1 up to 6

Prob. 1

For each table in the database, identify the primary key and the foreign key(s). If a table does not have a foreign key, write NONE in the assigned space.

 Table Primary key Foreign Key(s)

EMPLOYEE EMP_CODE JOB_CODE

BENEFIT EMP_CODE + PLAN_CODE  EMP_CODE,                                                              PLAN_CODE

JOB JOB_CODE NONE

PLAN PLAN_CODE NONE

 

Prob. 2

 

Prob. 3

Relational Schema

 

Prob. 4

Table Entity Integrity?  Explanation 

EMPLOYEE Yes  Each EMP_CODE value is                                                  unique and there are no nulls

BENEFIT Yes Each combination of

Page 7: assignment1_fs03ans

                                                    EMP_CODE and PLAN_CODE                                                    values are unique and there                                                     are no nulls

JOB Yes Each JOB_CODE value is                                                 unique and there are no nulls

PLAN Yes Each PLAN_CODE value is                                                 unique and there are no nulls

Prob. 5

TableReferential Integrity

Explanation

EMPLOYEE YesEach JOB_CODE value in EMPLOYEE points to an existing JOB_CODE valuein JOB.

BENEFIT Yes

Each EMP_CODE value in BENEFIT points to an existing EMP_CODE value in EMPLOYEE and each PLAN_CODE value in BENEFIT points to an existing PLAN_CODE value in PLAN.

JOB NA  

PLAN NA  

Prob. 6