DBMS Mod 3
DBMS Mod 3
Syllabus
Introduction to database Systems, advantages of database system over traditional
file system, Basic concepts & Definitions, Database users, Database Language,
Database System Architecture, Schemas, Sub Schemas, & Instances, database
constraints, 3-level database architecture, Data Abstraction, Data Independence,
Mappings, Structure, Components & functions of DBMS, Data models.
DDLC
Definition: DDLC stands for Database Development Life Cycle.
DBMS Module 3 1
Phases:
1. Planning
2. Requirements Analysis
3. Conceptual Design
4. Logical Design
5. Physical Design
6. Implementation
7. Testing
8. Deployment
9. Maintenance
1. Planning:
Objective: Establish the foundation for the database project.
Activities:
2. Requirements Analysis:
Objective: Gather detailed information on what the database needs to
accomplish.
DBMS Module 3 2
Activities:
3. Conceptual Design:
Objective: Create a high-level abstract representation of the database.
Activities:
4. Logical Design:
Objective: Transform the conceptual model into a logical structure for
implementation.
Activities:
5. Physical Design:
Objective: Specify how the logical design will be implemented on a chosen
Database Management System (DBMS).
Activities:
DBMS Module 3 3
Indexing: Define indexes to optimize data retrieval.
Activities:
Testing: Conduct unit and integration testing to ensure data accuracy and
system functionality.
2. Data Modeling: Support for creating logical data models, facilitating the
translation from conceptual to logical structures.
DBMS Module 3 4
7. Database Documentation: Generate documentation for the database schema,
enhancing communication and knowledge sharing.
9. Data Type Suggestions: Provide suggestions for appropriate data types based
on best practices.
12. Security Modeling: Model and visualize security aspects such as user roles and
access permissions.
Functional Dependency:
Decomposition:
Steps:
DBMS Module 3 5
1. Identify Functional Dependencies: Determine the functional dependencies
present in the relation.
Connection:
Definition: An equi join is a specific type of inner join where the condition for
matching rows is based on the equality of values in specified columns.
Syntax:
Example:
DBMS Module 3 6
2. Theta Join:
Definition: A theta join is a generalization of the equi join, where the condition
for matching rows involves any comparison operator (other than equality).
Syntax:
Example:
3. Cross Join:
Definition: A cross join, or Cartesian join, returns the Cartesian product of two
tables, resulting in all possible combinations of rows from both tables.
Syntax:
Example:
4. Natural Join:
Definition: A natural join returns rows from two tables with matching values in
columns with the same name. It automatically identifies and joins columns with
identical names.
Syntax:
Example:
DBMS Module 3 7
SELECT * FROM employees NATURAL JOIN departments;
5. Inner Join:
Definition: An inner join returns only the rows that have matching values in the
specified columns of both tables.
Syntax:
Example:
Definition: Outer joins return all rows from one table and the matching rows
from the other table. Types include:
Left Outer Join (or Left Join): Returns all rows from the left table and
matching rows from the right table.
Right Outer Join (or Right Join): Returns all rows from the right table and
matching rows from the left table.
Full Outer Join (or Full Join): Returns all rows when there is a match in
either the left or right table.
Syntax:
Example:
DBMS Module 3 8
-- Left Outer Join
SELECT * FROM employees LEFT OUTER JOIN departments ON employees.department_id = d
epartments.department_id;
Additional Notes:
Performance Considerations:
Cross joins can result in large result sets and are often used with caution.
Natural joins rely on column names and may lead to unexpected results if
schema changes occur.
Null Values:
Outer joins can introduce null values in columns where there is no match.
Select the appropriate join based on the desired outcome and the
relationship between tables.
Dependency Preservation:
*1. Functional Dependency (FD):
DBMS Module 3 9
Importance: Ensures that the information implied by functional dependencies is
not lost during the decomposition process.
Lossless Design:
*1. Lossless Join Decomposition:
Criteria: A decomposition is lossless if, for any instance of the original relation,
joining the decomposed relations produces the same result as joining the original
relation.
Example: If relation R(A, B, C) is decomposed into R1(A, B) and R2(B, C), the
chasing algorithm checks if attributes in R can be reconstructed from R1 and R2.
DBMS Module 3 10
Example: If functional dependencies are preserved during decomposition, it is
more likely that the decomposition is lossless because dependencies provide
constraints that help maintain the integrity of the data.
Importance: The combined goal is to create decomposed relations that not only
adhere to normalization principles but also retain the original information and
dependencies.
2. Objectives:
Normal Forms:
1. First Normal Form (1NF):
Definition: Requires 1NF and ensures that non-prime attributes are fully
functionally dependent on the primary key.
DBMS Module 3 11
Definition: Requires 2NF and ensures that no transitive dependencies exist, i.e.,
non-prime attributes are not dependent on other non-prime attributes.
Multi-valued Dependencies:
1. Definition:
Fifth Normal Form (5NF) addresses cases where a table contains join
dependencies between overlapping candidate keys.
2. Key Points:
It deals with situations where a table has multiple overlapping candidate keys.
Considerations:
1. Trade-offs:
2. Denormalization:
DBMS Module 3 12
In some cases, denormalization is applied to optimize query performance by
reintroducing redundancy carefully.
3. Application:
The level of normalization depends on the specific requirements and use cases
of the application.
DBMS Module 3 13