Documente Academic
Documente Profesional
Documente Cultură
PRINCIPLES OF DATABASES
CONTENTS / INHOUD:
SCHOOL OF COMPUTING
1. Answers to Assignment 1
Question 1
Answer to 1.1:
Normalization is the process for assigning attributes to entities. Properly
executed, the normalization process eliminates uncontrolled data redundancies,
thus eliminating the data anomalies and the data integrity problems that are
produced by such redundancies.
Answer to 1.2:
A table is in 1NF when all the key attributes are defined (no repeating groups in
the table) and when all remaining attributes are dependent on the primary key.
However, a table in 1NF still may contain partial dependencies, i.e.,
dependencies based on only part of the primary key and/or transitive
dependencies that are based on a non-key attribute.
Answer to 1.3:
A table is in 2NF when it is in 1NF and it includes no partial dependencies.
However, a table in 2NF may still have transitive dependencies, i.e.,
dependencies based on attributes that are not part of the primary key.
Answer to 1.4:
A table is in 3NF when it is in 2NF and it contains no transitive dependencies.
Answer to 1.5:
A table is in Boyce-Codd Normal Form (BCNF) when it is in 3NF and every
determinant in the table is a candidate key. For example, if the table is in 3NF
and it contains a nonprime attribute that determines a prime attribute, the BCNF
requirements are not met.This description clearly yields the following conclusions:
If a table is in 3NF and it contains only one candidate key, 3NF and BCNF
are equivalent.
BCNF can be violated only if the table contains more than one candidate
key. Putting it another way, there is no way that the BCNF requirement
can be violated if there is only one candidate key.
2
INF3703/202/01/2011
Question 2
2.1 Using the INVOICE table structure shown in table 1, write the relational
schema, draw its dependency diagram and identify all dependencies
(including all partial and transitive dependencies). You can assume that the
table does not contain repeating groups and that any invoice number may
reference more than one product. (Hint: This table uses a composite primary
key.)
Table 1
Attribute Name Sample Sample Value Sample Value Sample Value Sample Value
Value
INV_NUM 211347 211347 211347 211348 211349
PROD_NUM AA- QD-300932X RU-995748G AA-E3422QW GH-778345P
E3422QW
SALE_DATE 15-Jan-2006 15-Jan-2006 15-Jan-2006 15-Jan-2006 16-Jan-2006
PROD_LABEL Rotary 0.25-in. drill bit Band saw Rotary sander Power drill
sander
VEND_CODE 211 211 309 211 157
VEND_NAME NeverFail, NeverFail, Inc. BeGood, Inc. NeverFail, Inc. ToughGo, Inc.
Inc.
QUANT_SOLD 1 8 1 2 1
PROD_PRICE $49.95 $3.45 $39.99 $49.95 $87.75
Answer to 2.1:
3
INF3703/202/01/2011
2.2 Using the initial dependency diagram drawn in question 2.1, remove all partial
dependencies, draw the new dependency diagrams, and identify the normal
forms for each table structure you created.
Answer to 2.2:
2.3 Using the table structures you created in question 2.2, remove all transitive
dependencies and draw the new dependency diagrams. Also identify the
normal forms for each table structure you created
Answer to 2.3:
4
INF3703/202/01/2011
Question 3
Some Tiny University staff employees are information technology (IT) personnel.
Some IT personnel provide technology support for academic programs. Some IT
personnel provide technology infrastructure support. Some IT personnel provide
technology support for academic programs and technology infrastructure support. IT
personnel are not professors. IT personnel are required to take periodic training to
retain their technical expertise. Tiny University tracks all IT personnel training by
date, type, and results (completed vs. not completed). Given that information, create
the complete ERD containing all primary keys, foreign keys, and main attributes.
Answer:
5
INF3703/202/01/2011
Question 4
Answer to 4.1:
A transaction is a logical unit of work that must be entirely completed of
aborted; no intermediate states are accepted. In other words, a transaction,
composed of several database requests, is treated by the DBMS as a unit of
work in which all transaction steps must be fully completed if the transaction is
to be accepted by the DBMS.
Acceptance of an incomplete transaction will yield an inconsistent database
state. To avoid such a state, the DBMS ensures that all of a transaction's
database operations are completed before they are committed to the
database. For example, a credit sale requires a minimum of three database
operations:
Answer to 4.2:
Concurrency control is the activity of coordinating the simultaneous execution
of transactions in a multiprocessing or multi-user database management
system. The objective of concurrency control is to ensure the serializability of
transactions in a multi-user database management system. (The DBMS's
scheduler is in charge of maintaining concurrency control.) Because it helps to
guarantee data integrity and consistency in a database system, concurrency
control is one of the most critical activities performed by a DBMS. If
concurrency control is not maintained, three serious problems may be caused
by concurrent transaction execution: lost updates, uncommitted data, and
inconsistent retrievals.
Answer to 4.3:
Data are located near the greatest demand site
Faster access
Faster data access
Growth facilitation
Answer to 4.4:
Complexity of management and control
Security
Lack of standards
Increased storage requirements
6
INF3703/202/01/2011
Question 5
Answer to 5.1:
Distributed processing, a database’s logical processing is shared among
two or more physically independent sites that are connected through a
network. For example the data input/output(I/O), data selection and data
validation might be performed on one computer, and a report based on that
data might be on another computer. Distributed database, on the other
hand, stores a logically related database over two or more physically
independent sites. The sites are connected via computer network.
Answer to 5.2:
7
INF3703/202/01/2011
Reference one or more of those fragments with only one request. In other
words, we must have fragmentation transparency.
The distributed request feature also allows a single request to reference a
physically partitioned table.
Answer to 5.3:
Answer to 5.4:
Extensible Markup Language (XML) is a metalanguage used to represent and
manipulate data elements. XML is designed to facilitate the exchange of
structured documents, such as orders and invoices, over the internet.
8
INF3703/202/01/2011
9
INF3703/202/01/2011
Answer to Question 1:
Solution to Problem 7 on page 200.
10
INF3703/202/01/2011
Answer to Question 2:
Solution to Problem 7on page 238
11
INF3703/202/01/2011
Answer to Question 3:
Solution to Problem 11 & 12 on page 284
Transitive Dependencies
Continued….
Continued….
Transitive Dependencies
EMPLOYEE
DEPARTMENT
QUALIFICATION EDUCATION
DEPENDENT
JOB
12
INF3703/202/01/2011
EDUCATION(EDUC_CODE, EDUC_DESCRIPTION)
UNISA 2011
13