Database
Database
An entity is a person, place, thing, concept, or event about which data will be
collected and stored • An attribute is a characteristic of an entity • A
relationship describes an association among entities • The following are
three different types of relationships: • One-to-many (1:M or 1..*) relationship
• Many-to-many (M:N or *..*) relationship • One-to-one (1:1 or 1..1)
relationship. • A constraint is a restriction placed on the data • Constraints
help ensure data integrity •Constraints are normally expressed in the form of
rules.
3. What are the sources of business rules, and what is the database
designer's role with regard to business rules?
• The main sources of business rules are company managers, policy makers,
department managers, and written documentation such as company
procedures. • Business rules are essential to database design due to the
following reasons: • It helps to standardize the company’s view of data • It
can be a communication tool between users and designers • It allows the
designer to understand the nature, role, and scope of the data • It allows the
designer to understand business processes • It allows the designer to
develop appropriate relationship participation rules and constraints and to
create an accurate data model
The end user interface – the interface allows the end user to interact with the
data 2. A collection of tables stored in the database – the tables “present”
the data to the end user in a way that is easy to understand 3. SQL engine –
the SQL engine executes all queries or data requests
6. Describe what metadata are and what value they provide to the
database system
7. What are the advantages of having the DBMS between the end user's
applications and the database?
• The DBMS presents the end user with a single, integrated view of the data
in the database • A DBMS provides the following advantages: • Improved
data sharing • Improved data security • Better data integration • Minimized
data inconsistency • Improved data access • Improved decision making •
Increased end-user productivity
• Database design refers to the activities that focus on the design of the
database structure that will be used to store and manage end-user data •
Designing appropriate data repositories of integrated information using the
two-dimensional table structures found in most databases is a process of
decomposition • The integrated data must be decomposed properly into its
constituent parts • A well-designed database facilitates data management
and generates accurate and valuable information • A poorly designed
database causes difficult-to-trace errors that may lead to poor decision
making
9. What are the problems associated with file systems? How do they
challenge the types of information that can be created from the data
as well as the accuracy of the information?
• The following problems with file systems challenge the types of information
that can be created from data as well as information accuracy: • Lengthy
development times • Difficulty of getting quick answers • Complex system
administration • Lack of security and limited data sharing • Extensive
programming
12. Define entity integrity. What are the two requirements to ensure
entity integrity?
Entity integrity is the condition in which each row in the table has its own
known, unique identity. Requirement: All primary key entries are unique, and
no part of a primary key may be null. Purpose: Each row will have a known,
unique identity, and foreign key values can properly reference primary key
values. Example: No invoice can have a duplicate number, nor can it be null;
in short, all invoices are uniquely identified by their invoice number.
• A null is the absence of any data value, and it is never allowed in any part
of a primary key. A null could represent any of the following: • An unknown
attribute value • A known, but missing, attribute value • A “not applicable”
condition.
INTERSECT is an operator used to yield only the rows that are common to
two union compatible tables. As with UNION, the tables must be union-
compatible to yield valid results. For example, you cannot use INTERSECT if
one of the attributes is numeric and one is character-based. For the rows to
be considered the same in both tables and appear in the result of the
INTERSECT, the entire rows must be exact duplicates.
The term 1NF describes the tabular format in which the following occur: • All
key attributes are defined • There are no repeating groups in the table • All
attributes are dependent on the primary key • All relational tables satisfy
1NF requirements
Conversion to 2NF occurs only when the 1NF has a composite primary key •
If the 1NF has a single-attribute primary key, then the table is automatically
in 2NF • The 1NF-to-2NF conversion is simple, you take the following steps: •
Step 1: Make new tables to eliminate partial dependencies • Step 2:
Reassign corresponding dependent attributes • A table is in 2NF under the
following circumstances : • When it is in 1NF • When it includes no partial
dependencies
22. What steps are involved in the conversion to the third normal
form?
Isolation means that the data used during the execution of a transaction
cannot be used by a second transaction until the first one is completed. In
other words, if transaction T1 is being executed and is using the data item X,
that data item cannot be accessed by any other transaction until T1 ends.
This property is particularly useful in multiuser database environments
because several users can access and update the database at the same
time.
A deadlock occurs when two transactions wait indefinitely for each other to
unlock data. • The three basic techniques to control deadlocks are the
following: • Deadlock prevention • Deadlock detection • Deadlock avoidance
• The choice of which deadlock control method to use depends on the
database environment
• Database checkpoints are operations in which the DBMS writes all of its
updated buffers in memory to disk. While this is happening, the DBMS does
not execute any other requests. A checkpoint operation is also registered in
the transaction log. As a result, the physical database and the transaction log
will be in sync. This synchronization is required because update operations
update the copy of the data in the buffers and not in the physical database.
Checkpoints are automatically and periodically executed by the DBMS
according to certain operational parameters but can also be executed
explicitly (as part of a database transaction statement) or implicitly (as part
of a database backup operation).
28. What are the modes that an optimizer can create and describe
query optimization?