You are on page 1of 11

INTERNAL ASSESSMENT 1

Q.1. Write answers for any two questions from below. (5 marks each – Word limit –
500)
A.Discuss the mechanism of attribute relationship inheritance. How is it useful?
B.Find the sids of suppliers who supply some red or green part
C.Find the names of the parts supplied by "RamRaj"

Q.2. Write short notes on all of the following topics (1 mark each - Word limit - 100)
A.Updatable view
B.What is a surrogate key? How can it be used for schema refinement?
C.What is Functional Dependency?
D.What is the need of data model in DBMS and give its classification?
E.Aggregation
ANSWER 1 A)

Attribute relationship inheritance is a mechanism used in data modeling and database


design to establish hierarchical relationships between attributes within an
entity-relationship model. In this mechanism, attributes inherit characteristics or
properties from other attributes in the same hierarchy, facilitating data organization,
consistency, and efficiency.

Mechanism of Attribute Relationship Inheritance:

1. Hierarchical Structure: Attribute relationship inheritance is typically applied in


hierarchical data structures where attributes are organized in parent-child
relationships. Each attribute inherits properties from its parent attribute,
forming a hierarchical chain.
2. Inheritance Rules: In attribute relationship inheritance, certain rules govern the
inheritance of properties:
a. Child attributes inherit properties such as data types, constraints, and
default values from their parent attributes.
b. Modifications to parent attributes propagate to child attributes unless
overridden at the child level.
c. Child attributes can add additional properties or constraints specific to
their context.
3. Parent-Child Mapping: Attributes are mapped in a parent-child relationship
within the data model. Each child attribute is linked to its parent attribute,
indicating the inheritance of properties.
4. Propagation of Changes: When changes are made to a parent attribute, such as
modifying its data type or adding constraints, these changes are automatically
propagated to all child attributes in the inheritance hierarchy. This ensures
consistency and avoids redundancy in attribute definitions.

Usefulness of Attribute Relationship Inheritance:

● Consistency and Standardization: Attribute relationship inheritance promotes


consistency and standardization in data modeling by ensuring that attributes
with similar characteristics inherit properties from a common parent. This
reduces the risk of inconsistencies and errors in attribute definitions.
● Efficiency in Maintenance: By propagating changes from parent attributes to
child attributes, attribute relationship inheritance simplifies maintenance tasks.
Modifications made at the parent level are automatically reflected in all child
attributes, eliminating the need for manual updates and reducing the risk of
errors.
● Scalability and Flexibility: Attribute relationship inheritance supports
scalability and flexibility in data models by enabling the creation of
hierarchical structures that can accommodate varying levels of complexity.
New attributes can be added as child attributes within existing hierarchies,
facilitating data expansion and evolution.
● Simplified Modeling: Attribute relationship inheritance simplifies the modeling
process by reducing the number of attributes that need to be defined explicitly.
Instead of defining properties for each attribute individually, common
properties can be specified at the parent level and inherited by all child
attributes.
● Enhanced Data Integrity: By enforcing consistent data definitions and
constraints across related attributes, attribute relationship inheritance enhances
data integrity and ensures that data adheres to predefined standards and rules.

ANSWER 1 C)

ANSWER 2

A. Updatable View:
An updatable view is a database view that allows users to perform data modification
operations such as INSERT, UPDATE, and DELETE directly on the view. In other
words, changes made to the view are propagated to the underlying base tables, and
vice versa. Updatable views provide a convenient way to interact with data by
presenting a logical subset of data from one or more tables while maintaining
consistency and integrity.

B. Surrogate Key:

A surrogate key is a unique identifier or attribute added to a database table to uniquely


identify each record, primarily for the purpose of data management and integrity.
Unlike natural keys, which are based on existing data attributes (e.g., Social Security
Number), surrogate keys are artificially generated and have no inherent meaning.
Surrogate keys can be used for schema refinement by simplifying the identification of
records, improving performance in join operations, and ensuring data integrity when
natural keys are unavailable or unsuitable.

C. Functional Dependency:
Functional dependency is a concept in database management that describes the
relationship between attributes in a relation or table. It states that the value of one
attribute (dependent attribute) is determined by the value of another attribute or a
combination of attributes (independent attributes). In other words, if two or more
attributes have a functional dependency relationship, the value of one attribute
uniquely determines the value of another attribute.

D. Need of Data Model in DBMS and its Classification:

The need for a data model in a Database Management System (DBMS) arises from the
requirement to organize, structure, and represent data in a logical and consistent
manner. Data models serve as blueprints for designing databases, defining data
relationships, and facilitating communication between stakeholders involved in
database development.

Data models are classified into three main types:



1. Conceptual Data Model: A high-level, abstract representation of the entities,
relationships, and attributes in a database, independent of implementation
details. It provides a conceptual framework for understanding the structure and
semantics of data.
2. Logical Data Model: A detailed representation of data elements, their
relationships, and constraints within a specific database management system. It
defines the logical structure of the database, including tables, columns, keys,
and relationships.
3. Physical Data Model: A representation of how data is stored, accessed, and
organized at the physical level in a database system. It describes the storage
structures, indexing mechanisms, and optimization techniques used to
implement the logical data model in a specific DBMS.

E. Aggregation:
Aggregation in the context of databases refers to the process of combining multiple
rows of data into a single result set based on a specified grouping criterion.
Aggregation functions such as SUM, AVG, COUNT, MAX, and MIN are used to
perform calculations on grouped data. Aggregation is commonly used in SQL queries
to generate summary reports, calculate totals, averages, or other aggregate statistics
from raw data stored in database tables
INTERNAL ASSESSMENT 2

Q.1. Write answers for any two questions from below. (5 marks each – Word
limit – 500)
A.Find the sname, bid, and day for each reservation.
B.Explain about various constraints used in ER-model.
C.Find the sids of suppliers who supply every red or green part

Q.2. Write short notes on all of the following topics (1 mark each - Word limit -
100)
A.What is its importance?
B.Different types of database users.
C.The properties of a relation
D.Wait/Die & Wound/Wait protocols
E.Weak entity set
ANSWER 1 A)

ANSWER 1 B)

In an Entity-Relationship (ER) model, constraints are rules or conditions applied to


the entities, relationships, and attributes to maintain data integrity and ensure that the
database remains consistent and accurate.

Various types of constraints are used in an ER model:

​ Entity Integrity Constraint:


● Ensures that each entity within an entity set must have a unique and
non-null identifier.
● Typically enforced using primary key constraints, ensuring that no two
entities have the same primary key value.
● Example: Each employee in an Employee entity set must have a unique
Employee ID.

​ Referential Integrity Constraint:


● Ensures the consistency and validity of relationships between entities by
enforcing referential integrity.
● Typically enforced using foreign key constraints, ensuring that values in
a foreign key column match values in the corresponding primary key
column of the referenced entity.
● Example: In a relationship between Employees and Departments, each
employee's Department ID (foreign key) must correspond to an existing
Department ID in the Departments entity set.

​ Attribute Constraints:
● Constraints applied to individual attributes within an entity to enforce
specific rules or conditions.
● Types of attribute constraints include:
● Unique Constraint: Ensures that each value in an attribute is
unique across all instances of the entity.
● Check Constraint: Enforces specific conditions or rules on the
allowable values for an attribute.
● Default Constraint: Specifies a default value for an attribute if no
value is provided during insertion.
● Example: In an Employee entity, the Social Security Number (SSN)
attribute may have a unique constraint to ensure each employee has a
unique SSN.

​ Multiplicity Constraints:
● Specifies the minimum and maximum number of instances of an entity
that can participate in a relationship.
● Types of multiplicity constraints include:
● One-to-One (1:1): Each entity instance in one entity set is
associated with exactly one entity instance in another entity set.
● One-to-Many (1:N): Each entity instance in one entity set is
associated with zero or more entity instances in another entity set.
● Many-to-One (N:1): Multiple entity instances in one entity set are
associated with a single entity instance in another entity set.
● Many-to-Many (M:N): Multiple entity instances in one entity set
are associated with multiple entity instances in another entity set.
● Example: A one-to-many relationship between Employees and Projects,
where each employee can be assigned to multiple projects but each
project is assigned to only one employee.

ANSWER 2

A. Importance of Constraints in ER Modeling:

Constraints play a crucial role in ER modeling for several reasons:



● Data Integrity: Constraints ensure that data stored in the database remains
accurate, consistent, and valid. By enforcing rules and conditions on entities,
relationships, and attributes, constraints prevent the insertion of incorrect or
incomplete data.
● Business Rules Enforcement: Constraints enforce business rules and logic
within the database schema, ensuring that the database reflects the real-world
constraints and requirements of the organization or application domain.
● Data Quality Assurance: Constraints help maintain data quality by preventing
data anomalies, such as duplicate records, inconsistent relationships, or
orphaned records, which could compromise the reliability and usefulness of the
data.
● Database Consistency: Constraints maintain the consistency of the database
schema by defining the structure and relationships among entities and ensuring
that all data operations adhere to the defined constraints.
● Ease of Maintenance: By defining constraints at the schema level, ER models
become self-documenting and self-enforcing. This simplifies database
maintenance and administration tasks, as developers and administrators can
rely on constraints to enforce data integrity without manual intervention.

B. Different Types of Database Users:

1. End Users: End users are the individuals or entities who interact directly with
the database system to retrieve, enter, or manipulate data. They may include
employees, customers, or other stakeholders who use database applications or
interfaces to perform specific tasks.
2. Application Developers: Application developers are responsible for designing,
developing, and maintaining database applications. They create software
applications that interact with the database system to perform data processing,
transactions, and business logic.
3. Database Administrators (DBAs): Database administrators are responsible for
managing and maintaining the database system. They perform tasks such as
database installation, configuration, security management, backup and
recovery, performance tuning, and monitoring.
4. Database Designers: Database designers are involved in the conceptual and
logical design of the database schema. They analyze requirements, model data
structures, define tables, relationships, and constraints, and optimize the
database design for efficiency and scalability.
5. Data Analysts: Data analysts analyze and interpret data stored in the database
to extract insights, trends, and patterns. They use querying, reporting, and data
visualization tools to analyze data and generate reports for decision-making
purposes.
6. Executives and Managers: Executives and managers rely on database systems
to access business intelligence, monitor performance metrics, and make
strategic decisions based on data-driven insights. They may use dashboards,
analytics tools, and custom reports to track key performance indicators and
evaluate organizational performance.
C. Properties of a Relation:

The properties of a relation in a relational database model include:


● Uniqueness: Each tuple (row) in a relation is unique, and there are no duplicate
rows.
● Atomicity: Each attribute (column) in a relation contains atomic values,
meaning it cannot be further divided into smaller components.
● Homogeneity: Each attribute in a relation has the same data type, ensuring
consistency and uniformity of data representation.
● Ordering: The order of tuples in a relation is not significant. Tuples can be
retrieved in any order unless explicitly specified using sorting operations.
● Cardinality: The cardinality of a relation refers to the number of tuples it
contains. It can vary dynamically as data is inserted, updated, or deleted from
the relation.

D. Wait/Die & Wound/Wait Protocols:

● Wait/Die Protocol: In the Wait/Die protocol for deadlock prevention, when a


transaction requests a resource held by another transaction, it is either allowed
to wait (if its timestamp is older than that of the holding transaction) or aborted
(if its timestamp is newer). Older transactions wait, while younger transactions
are aborted.
● Wound/Wait Protocol: In the Wound/Wait protocol for deadlock prevention,
when a transaction requests a resource held by another transaction, it is allowed
to preempt (wound) the holding transaction if its timestamp is older. The
preempted transaction then waits until the preempting transaction completes.

These protocols are used in concurrency control mechanisms to resolve deadlocks by


ensuring that transactions are either allowed to wait or preempted based on their
timestamps.

E. Weak Entity Set:

A weak entity set is an entity set in a database schema that does not have sufficient
attributes to uniquely identify its entities on its own. Instead, it depends on the
existence of a related entity set, called the identifying or owner entity set, and a
relationship between them.

A weak entity set must be associated with a strong entity set via a one-to-many
identifying relationship. It typically has a partial key, which is a set of attributes that,
in combination with the primary key of the owner entity set, uniquely identifies each
entity in the weak entity set. Weak entity sets are represented by double rectangles in
ER diagrams and are connected to their identifying entity sets by a double diamond
relationship.

You might also like