Вы находитесь на странице: 1из 9

Question 2: What are the major disadvantages of a database system.

Answer:

Setup of the database system requires much more knowledge, money, skills, and time

Complexity of the database may result in poor performance

Question 3: Explain the difference between physical and logical data independence.

Answer:

Physical data independence is the ability to modify the physical schema without making it
necessary to rewrite application programs. E.G., changing from unblocked to blocked record
storage, or from sequential to random-access files.

Logical data independence is the ability to modify the conceptual schema without making it
necessary to rewrite application programs. E.G., adding a new field to a record. An application
programs view hides this change from the program.

A superkey is any set of attributes such that the values of the attributes (taken together) uniquely
identify one entity in the entity set.

A candidate key is a minimal superkey a superkey with no redundant attributes. In other words,
if any one of the attributes is removed, the set of attributes that remain no longer form a
superkey.

A primary key is one of the candidate keys, designated by the database designer.

Every primary key is also a candidate key; every candidate key is also a superkey, but not vice
versa.

2nd Answer:

A superkey is a set of one or more attributes that, taken collectively, allows us to identify uniquely
an entity in the entity set. A superkey may contain extraneous attributes. If K is a superkey, then
so is any superset of K. A superkey for which no proper subset is also a superkey is called a
candidate key. It is possible that several distinct sets of attributes could serve as candidate keys.
The primary key is one of the candidate keys that is chosen by the database designer as the
principal means of identifying entities within an entity set

Question 6: Explain the difference between a weak and a strong entity set.

Answer: A strong entity set has a primary key. All tuples in the set are distinguishable by that key.
A weak entity set has no primary key unless attributes of the strong entity set on which it depends
are included. Tuples in a weak entity set are partitioned according to their relationship with tuples
in a strong entity set. Tuples within each partition are distinguishable by a discriminator, which is a
set of attributes.
Question 7: We can convert any weak entity set to a strong entity set by simply adding
appropriate attributes.Why, then, do we have weak entity sets?

Answer: We have weak entities for several reasons:

We want to avoid the data duplication and consequent possible inconsistencies

caused by duplicating the key of the strong entity.

Weak entities reect the logical structure of an entity being dependent on

another entity.

Weak entities can be deleted automaticallywhen their strong entity is deleted.

Weak entities can be stored physically with their strong entities.

Question 8: Defi-ne the concept of aggregation. Give two examples of where this concept is useful.

Answer: Aggregation is an abstraction through which relationships are treated as higher-level


entities. Thus the relationship between entities

and is treated as if it were an entity . Some examples of this are:

a. Employees work for projects. An employee working for a particular project uses various
machinery.
b. Manufacturers have tie-ups with distributors to distribute products. Each tie-up has speci-ed for
it the set of products which are to be distributed.

Question 9: When designing an E-R diagram for a particular enterprise, you have several
alternatives from which to choose. What criteria should you consider in making the appropriate
choice?

Answer:

The criteria to use are intuitive design, accurate expression of the real-world concept and
ef-ciency. A model which clearly outlines the objects and relationships in an intuitive manner is
better than one which does not, because it is easier to use and easier to change. Deciding between
an attribute and an entity set to represent an object, and deciding between an entity set and
relationship set, inuence the accuracy with which the real-world concept
is expressed. If the right design choice is not made, inconsistency and/or loss of information will

result. A model which can be implemented in an efficient manner is to be preferred for obvious
reasons.

Question 2 :

(a) A university registrar s office maintains data about the following entities:

(a) courses, including number, title, credits, syllabus, and prerequisites;

(b) course offerings, including course number, year, semester, section number,
instructor(s), timings, and classroom;

(c) students, including student-id, name, and program; and

(d) instructors, including identif-cation number, name, department, and title.

Further, the enrollment of students in courses and grades awarded to students in each course they
are enrolled for must be appropriately modeled. Construct an E-R diagram for the registrar s
of-ce.Document all assumptions

that you make about the mapping constraints.

(b) Construct appropriate tables for the above ER Diagram :

Answer (a):
In the answer given here, the main entity sets are student, course, course-offering, and instructor.
The entity set course-offering is a weak entity set dependent on course. The assumptions made
are :

a. a class meets only at one particular place and time. This E-R diagram cannot

model a class meeting at different places at different times.

b. There is no guarantee that the database does not have two classes meeting

at the same place and time.

Solution (b):

University registrar s tables:

student (student-id, name, program)

course (courseno, title, syllabus, credits)

course-offering (courseno, secno, year, semester, time, room)

instructor (instructor-id, name, dept, title)


enrols (student-id, courseno, secno, semester, year, grade)

teaches (courseno, secno, semester, year, instructor-id)

requires (maincourse, prerequisite)

DIFFERENCE BETWEEN PHYSICAL AND LOGICAL DATA INDEPENDENCE

One of the biggest advantages of database is data independence. It means we can change the
conceptual schema at one level without affecting the data at other level. It means we can change
the structure of a database without affecting the data required by users and program. This feature
was not available in file oriented approach. There are two types of data independence and they
are:

1. Physical data independence

2. Logical data independence

Data Independence The ability to modify schema definition in on level without affecting
schema definition in the next higher level is called data independence. There are two levels of
data independence:

1. Physical data independence is the ability to modify the physical schema without causing
application programs to be rewritten. Modifications at the physical level are occasionally
necessary to improve performance. It means we change the physical storage/level without
affecting the conceptual or external view of the data. The new changes are absorbed by mapping
techniques.

2. Logical data independence in the ability to modify the logical schema without causing
application program to be rewritten. Modifications at the logical level are necessary whenever the
logical structure of the database is altered (for example, when money-market accounts are added
to banking system).

Logical Data independence means if we add some new columns or remove some columns from
table then the user view and programs should not changes. It is called the logical independence.
For example: consider two users A & B. Both are selecting the empno and ename. If user B add a
new column salary in his view/table then it will not effect the external view user; user A, but
internal view of database has been changed for both users A & B. Now user A can also print the
salary.

Difference between File processing system and DBMS:

1. A database management system coordinates both the physical and the logical access to the
data, whereas a file-processing system coordinates only the physical access.

2. A database management system reduces the amount of data duplication by ensuring that a
physical piece of data is available to all programs authorized to have access to it, whereas data
written by one program in a file-processing system may not be readable by another program.

3. A database management system is designed to allow flexible access to data (i.e., queries),
whereas a file-processing system is designed to allow predetermined access to data (i.e., compiled
programs).

4. A database management system is designed to coordinate multiple users accessing the same
data at the same time. A file-processing system is usually designed to allow one or more programs
to access different data files at the same time. In a file-processing system, a file can be accessed by
two programs concurrently only if both programs have read-only access to the file.

5. Redundancy is control in DBMS, but not in file system

6. Unauthorized access is restricted in DBMS but not in file system.

7. DBMS provide back up and recovery. When data is lost in file system then it not recover.

8. DBMS provide multiple user interfaces. Data is isolated in file system,

Five main functions of a database administrator are:

To create the scheme definition

To define the storage structure and access methods

To modify the scheme and/or physical organization when necessary

To grant authorization for data access


To specify integrity constraints

: List two reasons why null values might be introduced into the database.

Answer:

Null values might be introduced into database because:

1.

The actual value is unknown.

2.

The actual value is does not exist.

For example, if employee change his mobile number but the new one not yet known should be

retained with null mobile number. If employee tuples have a composite aribute department, and
a

parcular employee has no department , then the tuple's department aributes should given a null

value.

Q3: What are two advantages of encrypng data stored in the database?

Answer:

The two advantages of encrypng data stored in the data base:

1.

Protecng informaon and authencaon of users and websites.

2.

Authencaon of users to applicaons, of websites to users, and for digital signature.

Key Differences Between Generalization and Specialization in DBMS

The fundamental difference between generalization and specialization is that Generalization is a


bottom-up approach. However, specialization is a top-down approach.

Generalization club all the entities that share some common properties to form a new entity. On
the other hands, specialization spilt an entity to form multiple new entities that inherit some
properties of the spiltted entity.

In generalization, a higher entity must have some lower entities whereas, in specialization, a
higher entity may not have any lower entity present.

Generalization helps in reducing the size of schema whereas, specialization is just opposite it
increases the number of entities thereby increasing the size of a schema.
Generalization is always applied to the group of entities whereas, specialization is always applied
on a single entity.

Generalization results in a formation of a single entity whereas, Specialization results in the


formation of multiple new entities.

Definition of Generalization

Generalization, this term is often used while designing any relational Schema. If designing
proceeds in a bottom-up manner then it is featured as Generalization. If the entities, that are
figured out to create a schema shares some similar features, then they are combined to form a
higher-level entity

Definition of Specialization

Specialization is a designing procedure that proceeds in a top-down manner. Specialization is just


opposite to Generalization. In specialization, we split an entity to form multiple lower level
entities. These newly formed lower level entities inherit some features of the higher level entities.