Database Design and Development
Database Design and Development
Development
Objective
• This Unit aims to provide learners an understanding of the
concept of databases, its objects, principles, application.
• The unit furthermore will provide the necessary skills and
knowledge in designing a logical database and implementing a
physical database using the industry accepted technologies.
Learning Outcomes
• On successful completion of this module, students should be
able to:
• Explain the database concepts and components
• Develop logical database design.
• Construct a physical database for a given requirement
• Test and Manage databases
Data Vs Information
1.Data:
• Data refers to raw facts, figures, or symbols that do not carry
any specific meaning by themselves.
• It consists of individual pieces of information.
• Data can be in various forms, such as numbers, text, dates,
images, or any other format.
• Example data elements:
• 12345
• John Smith
• 2023-10-21
• 12.5cm
2. Information:
• Information is data that has been processed, organized, or
interpreted to give it meaning and context.
• It provides knowledge, insights, or answers to specific
questions.
• Information is the result of analyzing and deriving meaning
from data.
• Example information:
• "Customer John Smith with ID 12345 made a purchase of
$12.50 on 2023-10-21.“
• Databases are designed to store and manage data.
• The process of transforming data into information often involves
querying the database and using various operations like filtering,
sorting, and aggregation to extract meaningful insights and
answers.
• A database is an organized collection of structured information,
or data, typically stored electronically in a computer system.
• A database is usually controlled by a database management
system (DBMS)
Database
• A database is a structured
collection of data.
that data.
• Key characteristics and components of a database
include:
1. Data:
• Databases store a wide range of data, including numbers,
text, dates, images, and more.
• This data is organized into tables with rows and columns.
2. Tables:
• In a database, data is typically organized into tables, which
consist of rows (records) and columns (fields).
• Each row represents a specific record or entry, while each
column represents a specific attribute or field of data.
3. Schemas:
• Databases use a schema to define the structure of the
database, including the tables, fields, relationships
between tables, and constraints on the data.
4. Queries:
• Users can retrieve and manipulate data in a database using
queries.
• SQL (Structured Query Language) is a common language
used to interact with relational databases.
5. Relationships:
• Databases can establish relationships between tables to
link related data.
• For example, in a customer database, there might be a
relationship between customers and their orders.
6. Indexes:
• Databases often use indexes to improve the speed of data
retrieval.
• An index is a data structure that provides quick access to
data rows.
7. Security:
• Databases have security features to control who can
access, modify, and delete data.
• Access control and authentication mechanisms are used to
safeguard the data.
8. ACID Properties:
• Databases adhere to ACID properties (Atomicity,
Consistency, Isolation, Durability) to ensure data integrity
and reliability, especially in multi-user environments.
9. Scalability:
• Databases can be designed to scale to handle large
volumes of data and concurrent users.
Why we need Database?
• Allows a business to make informed business decisions.
• Efficiently store and retrieve related information.
• Helps analyze and aggravate business data.
• Collect and store crucial customer data from different applications.
• Delivers data-driven timely, personalized applications and detailed
analytics.
• Ensures immediate access to crucial business data that different
departments can use to comprehend data patterns, generate reports,
and predict future trends.
Database Models
• A Database model defines the logical design and structure of a database.
• It defines how data will be stored, accessed, and updated in a database
management system.
• There are several types of database models, each with its own characteristics
and purposes. For example
• Hierarchical model
• Network Model
• Relational Model
• Entity-Relationship Model
Hierarchical Model
Hierarchical Model
• In a hierarchical model, data is organized in a tree-like structure, with parent-
child relationships.
• Each record can have multiple child records but only one parent record.
• This model is commonly used in older database systems, such as IBM's
Information Management System (IMS).
Network Model
Network Model
• The network model is an extension of the hierarchical model that allows records
to have multiple parent and child records.
• In the network database model, data is more related as more relationships are
established in this database model.
• It's more flexible than the hierarchical model but can be complex to implement
and use.
• This was the most widely used database model before Relational Model was
introduced.
Entity-Relationship Model
Entity-Relationship Model
• The ER model is a conceptual model used for database design.
• It represents entities (objects or concepts) and the relationships between them.
Attributes of entities are also defined.
• The ER model helps in the visualization and design of a database schema.
• ER Models are defined to represent the relationships in pictorial form to make it
easier for different stakeholders to understand.
• This model is good to design a database, which can then be turned into tables in
a relational model.
Relational Model
Relational Model / Record-based Model
• The relational model is the most widely used database model.
• It represents data as tables (relations) with rows (tuples) and columns
(attributes).
• Relationships between tables are established through keys.
• You can design tables, normalize them to reduce data redundancy, and use
Structured Query language or SQL to access data from the tables
• SQL (Structured Query Language) is commonly used to manage and query
relational databases.
Relational Model
Characteristics of Relational Model
• Each relation in a database must have a distinct or unique name which would
separate it from the other relations in a database.
• A relation must not have two attributes with the same name. Each attribute
must have a distinct name.
• Duplicate tuples must not be present in a relation.
• Each tuple must have exactly one data value for an attribute.
• Tuples in a relation do not have to follow a significant order as the relation is
not order-sensitive.
• Similarly, the attributes of a relation also do not have to follow certain
ordering, it’s up to the developer to decide the ordering of attributes.
Types of Database
Types Of Database
• There are several major types of databases, each designed to serve different
needs and applications. Here are the most common types of databases:
• In this model, data is organized into tables with rows and columns, and
relationships between tables are defined by keys.
• Relational databases are one of the most widely used database systems and have
been a cornerstone of data storage and management for several decades.
2.Augmentation:
• If X → Y holds, then adding attributes to both sides preserves the functional
dependency.
• If X → Y, then XZ → YZ.
3.Transitivity:
• If X → Y and Y → Z hold, then it implies that X → Z.
• The dependency can be transitive through a common set of attributes.
4. Splitting:
• If X → YZ holds, then it implies both X → Y and X → Z.
• The dependency can be split into multiple dependencies.
5. Combining:
• If X → Y and X → Z hold, then it implies X → YZ.
• The dependencies can be combined into a single dependency.
Inference Rule
1.Reflexivity (Reflexive Rule):
• If Y is a subset of X, then X → Y.
2.Augmentation (Augmentative Rule):
• If X → Y, then XZ → YZ for any set of attributes Z.
3.Transitivity (Transitive Rule):
• If X → Y and Y → Z, then X → Z.
4.Union (Union Rule):
• If X → Y and X → Z, then X → YZ.
5. Decomposition (Decomposition Rule):
• If X → YZ, then X → Y and X → Z.
6. Pseudo transitivity:
• If X → Y and WY → Z, then WX → Z.
7. Combining (Combining Rule):
• If X → Y and X → Z, then X → YZ.
8. Remove Redundant Attributes (Irreducible Rule):
• If X → YZ and Y → W, then X → WZ.
Closure of an attribute
• The closure of a set of attributes refers to the complete set of
attributes that can be functionally determined by that original set,
based on a given set of functional dependencies.