Sunteți pe pagina 1din 13

Mahatma Gandhi Mission’s College of Engineering and Technology

Kamothe, Navi Mumbai

Assignment -2
Subject-DBMS Div-A & B Sem-V Class –TE

Q.No Question Module

Q1.Fill in the blanks


a) Entities are two types 1) Strong 2) Weak 2
b) Real world objects in ER diagram is called as Entity 2

c) Properties of entities are called as attributes 2

d) Teacher teaches to whole class is One to Many type of relation. 2

e) ER diagram is developed by Peter Chen 2

Q2. Choose Correct Options


a) Which of the following gives a logical structure of the database graphically? 2
a) Entity-relationship diagram
b) Entity diagram
c) Database diagram
d) Architectural representation
b) The entity relationship set is represented in E-R diagram as 2
a) Double diamonds
b) Undivided rectangles
c) Dashed lines
d) Diamond
c) An entity set that does not have sufficient attributes to form a primary key is termed a __________ 2
a) Strong entity set
b) Variant set
c) Weak entity set
d) Variable set
d) If you were collecting and storing information about your music collection, an album would be 2
considered a(n) _____
a) Relation
b) Entity
c) Instance
d) Attribute
e) Weak entity set is represented as 2
a) Underline
b) Double line
c) Double diamond
d) Double rectangle

Q3. state whether the following statements are true or false (Give Reasons)
a) ER was developed by Chen in 1980 2

A. True B. False
b) An ERs purpose is to support a user’s perception of the data and conceal the technical aspects 2

associated with database design.

A. True B. False
c) An Atribute is a property of an entity or a relationship type 2

A. True
B. False

Q4. Name the following or define or design the following


a) Define ER diagram. 2

An entity relationship model, also called an entity-relationship (ER) diagram, is a graphical


representation of entities and their relationships to each other, typically used in computing in regard
to the organization of data within databases or information systems. An entity is a piece of data-an
object or concept about which data is stored.
b) List types of attributes. 2

Attribute(s):
Attributes are the properties which define the entity type. For example, Roll_No, Name, DOB,
Age, Address, Mobile_No are the attributes which defines entity type Student. In ER diagram,
attribute is represented by an oval.

1. Key Attribute –
The attribute which uniquely identifies each entity in the entity set is called key
attribute.For example, Roll_No will be unique for each student. In ER diagram, key attribute
is represented by an oval with underlying lines.

2. Composite Attribute –
An attribute composed of many other attribute is called as composite attribute. For
example, Address attribute of student Entity type consists of Street, City, State, and Country.
In ER diagram, composite attribute is represented by an oval comprising of ovals.
3. Multivalued Attribute –
An attribute consisting more than one value for a given entity. For example, Phone_No
(can be more than one for a given student). In ER diagram, multivalued attribute is
represented by double oval.

4. Derived Attribute –
An attribute which can be derived from other attributes of the entity type is known as
derived attribute. e.g.; Age (can be derived from DOB). In ER diagram, derived attribute is
represented by dashed oval.

c) List the types of Entities 2

These shapes are independent from other entities, and


are often called parent entities, since they will often
Strong
have weak entities that depend on them. They will
entity
also have a primary key, distinguishing each
occurrence of the entity.

Weak entities depend on some other entity type. They


Weak
don't have primary keys, and have no meaning in the
entity
diagram without their parent entity.

Q5. Answer the following questions in brief (20 to 30 words)


a) Explain the features of ER diagram? 2

Data integrity
This is one of the most important characteristics of database management system. Integrity ensures
the quality and reliability of database system. It protects the unauthorized access of database and
makes it more secure. It brings only the consistence and accurate data into the database.
Security
Features like multiple views offer security to some extent where users are unable to access data of
other users and departments. DBMS offers methods to impose constraints while entering data into
the database and retrieving the same at a later stage. DBMS offers many different levels of security
features, which enables multiple users to have different views with different features. Since a DBMS
is not saved on the disk as traditional file systems, it is very hard for miscreants to break the code.
Data Independence
Data Independence is defined as a property of DBMS that helps you to change the Database schema
at one level of a database system without requiring to change the schema at the next higher level.
Data independence helps you to keep data separated from all programs that make use of it.
You can use this stored data for computing and presentation. In many systems, data independence is
an essential function for components of the system.
Transaction control and rollback
SQL statement forms a single transaction on its own. A COMMIT or ROLLBACK statement ends
the current transaction and a new one starts. If a session that has autocommit disabled ends without
explicitly committing the final transaction, MySQL rolls back that transaction.
Concurrency Control
There are many chances that many users will be accessing the data at the same time. They may
require altering the database system concurrently. At that time, DBMS supports them to
concurrently use the database without any problem.
Backup and recovery
There are many chances of failure of whole database. At that time no one will be able to get the
database back and for sure company will be in a big loss. The only solution is to take backup of
database and whenever it is needed, it can be stored back. All the databases must have this
characteristic.

b) What are the types of relationships? 2

1. One to one – When each entity in each entity set can take part only once in the relationship, the
cardinality is one to one. Let us assume that a male can marry to one female and a female can marry
to one male. So the relationship will be one to one.
2.Many to one – When entities in one entity set can take part only once in the relationship set
and entities in other entity set can take part more than once in the relationship set, cardinality
is many to one. Let us assume that a student can take only one course but one course can be taken by
many students. So the cardinality will be n to 1. It means that for one course there can be n students
but for one student, there will be only one course.

In this case, each student is taking only 1 course but 1 course has been taken by many students.
3. Many to many – When entities in all entity sets can take part more than once in the
relationship cardinality is many to many. Let us assume that a student can take more than
one course and one course can be taken by many students. So the relationship will be
many to many.

4.One to Many
a one-to-many relationship is a type of cardinality that refers to the relationship between two entities
(see also entity–relationship model) A and B in which an element of A may be linked to many
elements of B, but a member of B is linked to only one element of A. For example one college can
have many students. n m
College Admit Students
s
c) Difference between specialization and Generalization. 2

BASIS FOR
GENERALIZATION SPECIALIZATION
COMPARISON

Basic It proceeds in a bottom-up It proceeds in a top-down

manner. manner.

Function Generalization extracts the Specialization splits an entity

common features of multiple to form multiple new entities


entities to form a new entity. that inherit some feature of

the splitting entity.

Entities The higher level entity must The higher level entity may

have lower level entities. not have lower level entities.

Size Generalization reduces the Specialization increases the

size of a schema. size of a schema.

Application Generalization entities on Specialization is applied on a

group of entities. single entity.

Result Generalization results in Specialization results in

forming a single entity from forming the multiple entity

multiple entities. from a single entity.

. Q6. Answer the following questions in brief (50 to 70 words)


a) Explain EER diagram with properties 2

EER Model-
The enhanced entity–relationship (EER) model (or extended entity–relationship model).
EER is a high-level data model that incorporates the extensions to the original ER model.
It is a diagrammatic technique for displaying the following concepts
 Sub Class and Super Class
 Specialization and Generalization
 Union or Category
 Aggregation
These concepts are used when the comes in EER schema and the resulting schema diagrams called
as EER Diagrams.
It is a diagrammatic technique for displaying the following concepts
 Sub Class and Super Class
 Specialization and Generalization
 Union or Category
 Aggregation
These concepts are used when the comes in EER schema and the resulting schema diagrams called
as EER Diagrams.
1. Generalization
 Generalization is the process of generalizing the entities which contain the properties of all the
generalized entities.
 It is a bottom approach, in which two lower level entities combine to form a higher level entity.
 Generalization is the reverse process of Specialization.
 It defines a general entity type from a set of specialized entity type.
 It minimizes the difference between the entities by identifying the common features.
For example:

In the above example, Tiger, Lion, Elephant can all be generalized as Animals.

2. Specialization
 Specialization is a process that defines a group entities which is divided into sub groups based on
their characteristic.
 It is a top down approach, in which one higher entity can be broken down into two lower level
entity.
 It maximizes the difference between the members of an entity by identifying the unique
characteristic or attributes of each member.
 It defines one or more sub class for the super class and also forms the superclass/subclass
relationship.

For example
In the above example, Employee can be specialized as Developer or Tester, based
on what role they play in an Organization.
3. Aggregation
 Aggregation is a process that represent a relationship between a whole object and its
component parts.
 It abstracts a relationship between objects and viewing the relationship as an object.
 It is a process when two entity is treated as a single entity.

In the above example, the relation between College and Course is acting as an Entity in Relation
with Student.
b) Draw and explain Database Architecture. 2

The architecture of a database system is greatly influenced by the underlying computer system on
which the database is running:
i. Centralized.
ii. Client-server.
iii. Parallel (multi-processor).
iv. Distributed
Database Users:
Users are differentiated by the way they expect to interact with the system:
 Application programmers:
o Application programmers are computer professionals who write application
programs. Application programmers can choose from many tools to develop user
interfaces.
o Rapid application development (RAD) tools are tools that enable an application
programmer to construct forms and reports without writing a program.
 Sophisticated users:
o Sophisticated users interact with the system without writing programs. Instead, they
form their requests in a database query language.
o They submit each such query to a query processor, whose function is to break down
DML statements into instructions that the storage manager understands.
 Specialized users :
o Specialized users are sophisticated users who write specialized database applications
that do not fit into the traditional data-processing framework.
o Among these applications are computer-aided design systems, knowledge base and
expert systems, systems that store data with complex data types (for example,
graphics data and audio data), and environment-modeling systems.
 Naïve users :
o Naive users are unsophisticated users who interact with the system by invoking one
of the application programs that have been written previously.
o For example, a bank teller who needs to transfer $50 from account A to account B
invokes a program called transfer. This program asks the teller for the amount of
money to be transferred, the account from which the money is to be transferred, and
the account to which the money is to be transferred.
Database Administrator:
 Coordinates all the activities of the database system. The database administrator has a good
understanding of the enterprise’s information resources and needs.
 Database administrator's duties include:
o Schema definition: The DBA creates the original database schema by executing a set
of data definition statements in the DDL.
o Storage structure and access method definition.
o Schema and physical organization modification: The DBA carries out changes to the
schema and physical organization to reflect the changing needs of the organization,
or to alter the physical organization to improve performance.
o Granting user authority to access the database: By granting different types of
authorization, the database administrator can regulate which parts of the database
various users can access.
o Specifying integrity constraints.
o Monitoring performance and responding to changes in requirements.
Query Processor:
The query processor will accept query from user and solves it by accessing the database.
Parts of Query processor:
 DDL interpreter
This will interpret DDL statements and fetch the definitions in the data dictionary.
 DML compiler
a. This will translates DML statements in a query language into low level instructions that the query
evaluation engine understands.
b. A query can usually be translated into any of a number of alternative evaluation plans for same
query result DML compiler will select best plan for query optimization.
 Query evaluation engine
This engine will execute low-level instructions generated by the DML compiler on DBMS.
Storage Manager/Storage Management:
 A storage manager is a program module which acts like interface between the data stored in
a database and the application programs and queries submitted to the system.
 Thus, the storage manager is responsible for storing, retrieving and updating data in the
database.
 The storage manager components include:
o Authorization and integrity manager: Checks for integrity constraints and authority of
users to access data.
o Transaction manager: Ensures that the database remains in a consistent state although
there are system failures.
o File manager: Manages the allocation of space on disk storage and the data structures
used to represent information stored on disk.
o Buffer manager: It is responsible for retrieving data from disk storage into main
memory. It enables the database to handle data sizes that are much larger than the
size of main memory.
o Data structures implemented by storage manager.
o Data files: Stored in the database itself.
o Data dictionary: Stores metadata about the structure of the database.
o Indices: Provide fast access to data items.

c) Explain Aggregation in details. 2

 One limitation of the E-R model is that it cannot express relationships among relationships.
To illustrate the need for such a construct, quaternary relationships are used which lead to
redundancy in data storage.
 The best way to mode such situations is to use aggregation.
 Aggregation is an abstraction through which relationships are treated as higher-level entities.
 Below is the example of aggregation relation between offer (which is binary relation
between center and course) and visitor.

Q7. Think and Answer


a) What is type of cardinality of relations? 2

The degree of relationship (also known as cardinality) is the number of occurrences in one entity which are
associated (or linked) to the number of occurrences in another.

There are three degrees of relationship, known as:

1. one-to-one (1:1)

2. one-to-many (1:M)

3. many-to-many (M:M)

b) Give the example of Generalization and Aggregation 2

Generalization

 It is a bottom-up approach in which two lower level entities combine to form higher entity. In
generalization, the higher level entity can also combine with other lower level entity to make
further higher level entity.

 Generalization proceeds from the recognition that a number of entity sets share some common
features. On the basis of the commonalities, generalization synthesizes these entity sets into a
single, higher-level entity set.

 Generalization is used to emphasize the similarities among lower-level entity sets and to hide the
differences in the schema.
Aggregation

 One limitation of the E-R model is that it cannot express relationships among relationships. To
illustrate the need for such a construct, quaternary relationships are used which lead to redundancy
in data storage.

 The best way to mode such situations is to use aggregation.

 Aggregation is an abstraction through which relationships are treated as higher-level entities.

 Below is the example of aggregation relation between offer (which is binary relation between
center and course) and visitor.

Q8. My Ideas

a) Draw college management system ER diagram which includes aggregation generalization and 2
specialization
b) Draw Payroll system ER diagram which includes aggregation generalization and specialization 2

~TuFeL

S-ar putea să vă placă și