Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 53

DATABASE

DESIGN USING
SEMANTIC
OBJECT MODEL
GROUP MEMBERS
Roll Numbers Names
2023 – CS – 02 Malaika Khan
2023 – CS – 14 Zarwa Imran
2023 – CS – 18 Zahra Aslam
TO P I CS:
Converting 1:1 Mapping Hybrid
Introduction Compound Objects Objects

Mapping
Mapping Simple Converting 1:N
Association
Objects Compound Objects
Objects

Mapping
Converting M:N Mapping Super /
Composite Compound Objects Subtype Objects
Objects
INTRODUCTION
TO
database design using SOM
WHAT IS DATABASE
DESIGN?
• The process of creating a conceptual representation of a
database
• Involves identifying entities, attributes, and relationships

What is the Semantic Object Model (SOM)?


• A conceptual data modeling technique
• Based on the idea of representing real-world objects and
their relationships
BENEFITS OF
SOM:
Improved data organization and
structure
Enhanced data integrity and
consistency
Simplified data modeling and
database design
Better support for complex
relationships and constraints
KEY CONCEPTS IN SOM:
Objects
• Represent real-world entities (e.g., customers, orders, products)
• Have attributes and relationships
Attributes:
• Characteristics of objects (e.g., customer name, order date, product
price)
Relationships:
• Connections between objects (e.g., customer places order, order
contains products)
MAPPING
SIMPLE
OBJECTS
MAPPING SIMPLE
OBJECTS
• Identify Objects: Determine the key objects in the system, such as
customers, orders, products, etc.
• Define Attributes: Identify the attributes of each object, such as
customer name, address, phone number, etc.
• Establish Relationships: Define the relationships between objects,
such as one customer can have many orders, one order is associated with
one customer, etc.
• Create a Semantic Object Diagram: Visualize the objects,
attributes, and relationships using a diagram or graph.
EXAMPLE:
ONLINE SHOPPING SYSTEM
Objects: Customer, Order, Product, Payment
Attributes:
 Customer: name, address, phone number
 Order: order date, total, status
 Product: name, description, price
 Payment: payment date, amount
 Relationships:
 One customer can have many orders
 One order is associated with one customer
 One order can have many products
 One product can be part of many orders
CONCLUSION
• The Semantic Object Model provides a simple and
intuitive way to map real-world objects and their
relationships to a database design.

• By using SOM, developers and analysts can create a


robust and scalable database design that meets the needs
of complex systems.
MAPPING
COMPOSITE
OBJECTS
INTRODUCTION
 Composite objects are complex entities made up of
multiple simpler objects
 Example: An order is a composite object consisting of
customer, products, and payment
BENEFITS OF MAPPING
COMPOSITE OBJECTS IN
SOM
Improved data organization and structure
 Enhanced data integrity and consistency
 Better support for complex relationships and constraints
 Simplified data modeling and database design
 Improved communication and understanding between
developers, analysts, and stakeholders
KEY CONCEPTS
• Composite Objects: Made up of multiple simpler objects
(e.g., order = customer + products + payment)
• Component Objects: Simpler objects that make up a
composite object (e.g., customer, products, payment)
• Aggregation: Relationship between a composite object and its
component objects
• Composition: Relationship between a composite object and
its parent object (if applicable)
MAPPING COMPOSITE
OBJECTS
• Identify Composite Objects: Determine the complex entities in
the system (e.g., order, invoice, contract)
• Identify Component Objects: Determine the simpler objects that
make up the composite object (e.g., customer, products, payment)
• Establish Aggregation Relationships: Define the relationships
between the composite object and its component objects
• Establish Composition Relationships: Define the relationships
between the composite object and its parent object (if applicable)
• Create a Semantic Object Diagram: Visualize the composite
objects, component objects, and relationships using a diagram or graph
EXAMPLE
ONLINE SHOPPING SYSTEM
• Composite Object: Order
• Component Objects: Customer, Products, Payment
• Aggregation Relationships: One order consists of one
customer, multiple products, and one payment
• Composition Relationship: One order is part of one
customer's order history
CONCLUSION
• Mapping composite objects in SOM provides a powerful way
to model complex systems and relationships

• By using SOM, developers and analysts can create a robust


and scalable database design that meets the needs of complex
systems.
CONVERTING 1:1
COMPOUND
OBJECTS
INTRODUCTION
• 1:1 compound objects represent a one-to-one relationship
between two objects
• Example: A customer and their corresponding address
CONVERTING 1:1
COMPOUND OBJECTS
• Identify 1:1 Compound Objects: Determine the objects with a one-to-
one relationship (e.g., customer and address)
• Decompose into Simple Objects: Break down the compound object
into its component simple objects (e.g., customer and address)
• Create a Semantic Object Diagram: Visualize the simple objects and
their relationships using a diagram or graph
• Define Attributes and Relationships: Identify the attributes and
relationships for each simple object
• Map to Database Design: Convert the simple objects and relationships
into database tables and columns
BENEFITS OF CONVERTING
1:1 COMPOUND OBJECTS
• Improved data normalization and organization
• Reduced data redundancy and inconsistency
• Simplified data modeling and database design
• Enhanced data integrity and scalability
EXAMPLE
CUSTOMER AND ADDRESS
 Compound Object: CustomerAddress
 Simple Objects: Customer, Address
 Attributes:
-Customer: name, email, phone
-Address: street, city, state, zip
 Relationships: One customer has one address, one address
belongs to one customer
DATABASE DESIGN
• Customer Table: customer_id (PK), name, email, phone

• Address Table: address_id (PK), street, city, state, zip,


customer_id (FK)
CONVERTING 1:N
COMPOUND
OBJECTS
INTRODUCTION
• 1:N compound objects represent a one-to-many relationship between
two objects
• Example: A customer and their multiple orders
CONVERTING 1:N
COMPOUND OBJECTS
• Identify 1:N Compound Objects: Determine the objects with a one-to-many relationship
(e.g., customer and orders)
• Decompose into Simple Objects: Break down the compound object into its component
simple objects (e.g., customer and order)
• Create a Semantic Object Diagram: Visualize the simple objects and their relationships
using a diagram or graph
• Define Attributes and Relationships: Identify the attributes and relationships for each
simple object
• Map to Database Design: Convert the simple objects and relationships into database tables
and columns
BENEFITS OF CONVERTING
1:N COMPOUND OBJECTS
• Improved data normalization and organization
• Reduced data redundancy and inconsistency
• Simplified data modeling and database design
• Enhanced data integrity and scalability
EXAMPLE
CUSTOMER AND ORDERS
• Compound Object: CustomerOrders
• Simple Objects: Customer, Order- Attributes: - Customer: name, email, phone
• Order: order_date, total, status- Relationships: One customer has many orders, one order
belongs to one customer
Database Design
• Customer Table: customer_id (PK), name, email, phone
• Order Table: order_id (PK), order_date, total, status, customer_id (FK)
CONVERTING M:N
COMPOUND
OBJECTS
INTRODUCTION
• M:N compound objects represent a many-to-many relationship between two objects
• Example: Products and Categories (a product can belong to multiple categories, and
a category can have multiple products)
CONVERTING M:N
COMPOUND OBJECTS
• Identify M:N Compound Objects: Determine the objects with a many-to-many
relationship (e.g., products and categories)
• Decompose into Simple Objects: Break down the compound object into its
component simple objects (e.g., product and category)
• Create a Semantic Object Diagram: Visualize the simple objects and their
relationships using a diagram or graph
• Define Attributes and Relationships: Identify the attributes and relationships for
each simple object
• Map to Database Design: Convert the simple objects and relationships into
database tables and columns
BENEFITS OF CONVERTING
M:N COMPOUND OBJECTS
• Improved data normalization and organization
• Reduced data redundancy and inconsistency
• Simplified data modeling and database design
• Enhanced data integrity and scalability
EXAMPLE
PRODUCTS AND
Compound Object: ProductCategories
CATEGORIES
Simple Objects: Product, Category
Attributes:
-Product: name, description, price
-Category: name, description
-Relationships: A product can belong to multiple categories, and a category can have multiple
products
Database Design
⁃ Product Table: product_id (PK), name, description, price
⁃ Category Table: category_id (PK), name, description
⁃ Product_Category Table: product_id (FK), category_id (FK)
MAPPING HYBRID
OBJECTS
INTRODUCTION
• Hybrid objects combine characteristics of different object types (e.g.,
entity, relationship, and attribute)
• Example: A car with attributes (color, model) and relationships (owner,
manufacturer)
MAPPING HYBRID OBJECTS
• Identify Hybrid Objects: Determine objects with multiple characteristics (e.g.,
entity, relationship, attribute)
• Decompose into Simple Objects: Break down the hybrid object into its
component simple objects (e.g., car entity, owner relationship, color attribute)
• Create a Semantic Object Diagram: Visualize the simple objects and their
relationships using a diagram or graph
• Define Attributes and Relationships: Identify the attributes and
relationships for each simple object
• Map to Database Design: Convert the simple objects and relationships into
database tables and columns
BENEFITS OF MAPPING
HYBRID OBJECTS
• Improved data organization and structure
• Enhanced data integrity and consistency
• Simplified data modeling and database design
• Better support for complex relationships and constraints`
EXAMPLE: CAR OBJECT
• Hybrid Object: Car (entity) with attributes (color, model) and relationships (owner,
manufacturer)
• Simple Objects:
Car (entity) -
Owner (relationship)
Color (attribute)
Model (attribute)
Manufacturer (relationship)
DATABASE DESIGN
• Car Table: car_id (PK), color, model
• Owner Table: owner_id (PK), name
• Car_Owner Table: car_id (FK), owner_id (FK)
• Manufacturer Table: manufacturer_id (PK), name
• Car_Manufacturer Table: car_id (FK), manufacturer_id (FK)
MAPPING
ASSOCIATION
OBJECTS
INTRODUCTION
• A semantic object model is a conceptual representation of data as objects
and their relationships
• Association objects represent relationships between entities
BENEFITS OF MAPPING
ASSOCIATION OBJECTS
• Improves data integrity and consistency
• Reduces data redundancy and errors
• Enhances data navigation and querying capabilities
• Supports complex relationships and constraints
STEPS FOR MAPPING
ASSOCIATION OBJECTS
1. Identify associations between entities
2. Determine the type of relationship (one-to-one, one-to-many, many-to-
many)
3. Define the association object and its attributes
4. Map the association object to a relational database table
5. Define foreign key constraints to maintain referential integrity
EXAMPLE
ORDER-PRODUCT ASSOCIATION
• Entities: Order, Product
• Association object: OrderProduct
• Attributes: OrderID, ProductID, Quantity
• Relational table: OrderProduct (OrderID, ProductID, Quantity)
• Foreign key constraints: OrderID (references Orders table), ProductID (references
Products table)
CONCLUSION
• Mapping association objects in database design using a semantic object
model enhances data modeling and querying capabilities
• Follow best practices to ensure data integrity, consistency, and
performance
MAPPING SUPER /
SUBTYPE OBJECTS
INTRODUCTION
• Super/subtype objects represent a hierarchical relationship between
objects (e.g., vehicle and car)
• Example: A car is a subtype of a vehicle
MAPPING SUPER/SUBTYPE
OBJECTS IN SOM
• Identify Super/Subtype Objects: Determine objects with hierarchical relationships (e.g.,
vehicle and car)
• Create a Semantic Object Diagram: Visualize the super/subtype objects and their
relationships using a diagram or graph
• Define Attributes and Relationships: Identify the attributes and relationships for each
object
• Map to Database Design: Convert the objects and relationships into database tables and
columns
BENEFITS OF MAPPING
SUPER/SUBTYPE OBJECTS
• Improved data organization and structure
• Enhanced data integrity and consistency
• Simplified data modeling and database design
• Better support for complex relationships and constraints
EXAMPLE
VEHICLE AND CAR OBJECTS
 Super/Subtype Objects:
• Vehicle (super)
• Car (subtype)
 Attributes:
• Vehicle: vehicle_id (PK), type
• Car: car_id (PK), vehicle_id (FK), make, model
 Database Design:
• Vehicle Table: vehicle_id (PK), type
• Car Table: car_id (PK), vehicle_id (FK), make, model
CONCLUSION OF THE
CHAPTER
• Semantic object model is a graphical representation of a system. It is also used to
describe the elements of a system and their relationships with one another. Sematic
object model represents different things as objects. This model is used to design the
database using relational model

• In conclusion, semantic object modeling is a powerful approach to database design


that enables us to create robust, efficient, and scalable data models. By applying the
concepts and techniques covered in this presentation, we can effectively capture
complex business relationships and ensure data integrity and consistency. From
simple objects to complex compound and hybrid objects, and from association
objects to super/subtype objects, we now have the tools to tackle a wide range of
data modeling challenges. By leveraging semantic object modeling, we can unlock
the full potential of our data and drive business success.
THANK
YOU!

You might also like