CP25C02 – Advanced Database Technologies
2 MARKS:
UNIT I – Entity Relationship Model
1. Define specialization and generalization with examples.
Specialization is the process of defining a set of subclasses from an existing entity
based on some distinguishing characteristics.
o Example: From entity Employee, we can create subclasses Manager and
Engineer based on job role.
Generalization is the process of combining two or more entities into a single, more
general entity.
o Example: Entities Car and Bike can be generalized into Vehicle because both
share common attributes like Vehicle_ID and Model.
2. Differentiate between aggregation and composition.
Basis Aggregation Composition
Represents a has-a relationship where A stronger form of aggregation
Definition the part can exist independently of the where the part cannot exist without
whole. the whole.
Dependency Independent existence. Dependent existence.
A Department has Professors
A Room is part of a Building (Room
Example (Professors can exist without
cannot exist without Building).
Department).
3. What is an enhanced ER model?
The Enhanced Entity-Relationship (EER) model extends the basic ER model by
including additional concepts such as specialization, generalization, inheritance, and
categories (union types).
It helps in representing more complex relationships and real-world constraints.
o Example: The EER model includes subclasses like FullTimeEmployee and
PartTimeEmployee derived from the Employee entity.
4. Write short notes on subclasses and superclasses.
A Superclass is a higher-level entity set that can be divided into one or more
subclasses.
A Subclass inherits attributes and relationships from its superclass, and may have
additional attributes of its own.
o Example:
Superclass: Employee
Subclasses: Manager (extra attribute: Department), Clerk (extra
attribute: TypingSpeed).
5. Explain union types in ER modeling.
A Union Type (also called Category) represents a single superclass that is derived
from two or more subclasses.
It shows an “OR” relationship among the entities.
o Example:
Entity Owner can be a Person or a Company.
Here, Owner is a union type combining Person and Company entities.
UNIT II – Object Relational Databases
1. What is an object-relational database?
An Object-Relational Database (ORDB) combines features of relational databases
with those of object-oriented programming.
It supports tables, rows, and columns like relational databases, but also allows
objects, classes, inheritance, and user-defined types (UDTs).
o Example: A table can store an attribute of type Address, where Address is a
user-defined object containing Street, City, and Pincode.
2. Define ODL and ODMG.
ODL (Object Definition Language):
A language used to define object types, their attributes, methods, and relationships
in an object-oriented database.
ODMG (Object Database Management Group):
A standardization group that defined specifications for object databases, including
ODL and OQL.
o The ODMG model ensures interoperability among different object-oriented
database systems.
3. What is the purpose of OQL?
OQL (Object Query Language) is used to query and manipulate objects stored in an
object-oriented or object-relational database.
It is similar to SQL but supports object-oriented concepts like methods, inheritance,
and object identity.
o Example:
o SELECT p.name FROM Person p WHERE p.address.city = 'Chennai';
→ Retrieves names of people living in Chennai.
4. Differentiate between ODL and OQL.
Basis ODL (Object Definition Language) OQL (Object Query Language)
Used to query and manipulate
Purpose Defines structure of objects (schema).
objects.
Function Schema definition language. Query language.
Equivalent in
Similar to CREATE TABLE. Similar to SELECT.
SQL
interface Person { attribute string
Example SELECT p.name FROM Person p;
name; };
5. List advantages of object-relational models.
1. Supports complex data types (images, videos, addresses, etc.).
2. Enhances reusability through inheritance and object classes.
3. Improves performance by reducing need for joins in complex structures.
4. Seamless integration with object-oriented programming languages.
5. Backward compatibility with traditional relational databases.
UNIT III – Query Processing and Optimization
1. What is query processing?
Query Processing is the sequence of steps used by a Database Management System
(DBMS) to convert a high-level query (like SQL) into an efficient execution strategy.
It involves parsing, optimization, and execution.
o Example:
o SELECT name FROM Employee WHERE salary > 50000;
The DBMS parses the query, selects an optimal way to retrieve the data (e.g.,
using an index), and executes it.
2. Define heuristic optimization.
Heuristic Optimization uses rules of thumb (heuristics) to rearrange query
operations and produce an efficient execution plan without exhaustive search.
It applies transformation rules like pushing selections and projections early to reduce
intermediate results.
Transform σ_salary>50000 (Employee ⋈ Department)
o Example:
into
(σ_salary>50000 (Employee)) ⋈ Department
→ Selection is pushed before join to reduce data size.
3. What is a query execution plan?
A Query Execution Plan (QEP) is a step-by-step representation of how a DBMS will
execute a query.
It specifies access paths, join orders, and algorithms (like nested-loop join or hash
join).
o Example:
For query SELECT * FROM A, B WHERE A.id = B.id;
the plan might include:
1. Scan table A
2. Scan table B
3. Perform hash join on A.id = B.id
4. What is cost-based optimization?
Cost-Based Optimization (CBO) selects the best query execution plan by estimating
the cost (CPU, I/O, memory) of different alternatives and choosing the lowest-cost
one.
o Example:
The optimizer may choose between a nested loop join or a hash join, based
on which has the lower estimated cost for given data sizes.
5. Define query tree with example.
A Query Tree is a tree representation of a relational algebra expression, where
o Leaves → represent relations (tables)
o Internal nodes → represent relational operations (like selection, projection,
join).
o Example:
Query:
o SELECT name FROM Employee WHERE dept = 'HR';
Query Tree:
π_name
|
σ_dept='HR'
|
Employee
→ The tree shows selection done before projection to optimize performance.