Dbms Imp All Units
Dbms Imp All Units
Dbms Imp All Units
The impact of insert, update, and delete anomalies on the overall design of a database affects its
data integrity, consistency, and ef ciency:
Insert Anomaly
An insert anomaly occurs when certain attributes cannot be inserted into the database without the
presence of other attributes.
Impact: This limits the ability to add data freely and can cause data redundancy and
inconsistencies.
Solution through Normalization: Normalization helps by separating the data into di erent related
tables, ensuring that you can insert a new record without requiring unrelated data. For example:
Update Anomaly
An update anomaly occurs when redundant data exists and a change to one instance of that data
doesn't automatically apply to all instances.
Impact: This results in data inconsistencies across the database and a high maintenance cost.
Delete Anomaly
A delete anomaly occurs when the deletion of data results in the unintended loss of additional data.
Impact: This leads to the accidental removal of important data and can compromise data integrity.
Solution through Normalization: Normalization splits the data into logically related tables. In this
case:
• In 2NF or 3NF,
fi
ff
Study material provided by: Vishwajeet Londhe
Telegram Channel
https://t.me/SPPU_TE_BE_COMP
(for all engineering Resources)
WhatsApp Channel
(for all tech updates)
https://whatsapp.com/channel/0029ValjFriICVfpcV9HFc3b
Insta Page
(for all engg & tech updates)
https://www.instagram.com/sppu_engineering_update
2. Explain 2NF,3NF,BNCF?
Guaranteed Access Rule
1. De nition:
◦ Every piece of data in a relational database should be accessible using a
combination of table name, primary key, and column name.
2. Access Method:
◦ Data access should rely on the logical structure of the database, not on physical
storage.
3. Primary Key Requirement:
◦ Each table must have a primary key that uniquely identi es each record.
4. Example:
◦ Consider a table named Employees:
1. Employee 1. Departm
1. Name
ID ent
1. Alice
1. 101 1. HR
Johnson
1. 102 1. Bob Smith 1. IT
1. Carol
1. 103 1. Finance
Williams
◦ To access the name of the employee with EmployeeID 102, you would use:sql
Copy code
Integrity independence
De nition: Integrity constraints (rules ensuring data accuracy) must be stored in the database
catalog, not in application programs.
Centralized Management: Allows easy modi cation of integrity rules without changing
application code.
Automatic Enforcement: The database management system (DBMS) automatically enforces
these constraints during data operations.
Application Independence: Changes to integrity constraints do not require updates to all
applications accessing the data, enhancing maintainability.
Examples: Common integrity constraints include primary keys (ensuring uniqueness) and foreign
keys (enforcing relationships between tables).
fi
fi
fi
fi
compretensive data sub language rule
Single Language Requirement: A relational database must support a single comprehensive data
sublanguage for all database operations.
Components Included: This language should encompass Data De nition Language (DDL), Data
Manipulation Language (DML), and Data Control Language (DCL).
1. Distinct Meaning: NULL represents missing or unknown data, not zero or an empty string.
2. Uniform Handling: The DBMS must treat NULL values consistently in all operations
(queries, updates, etc.).
3. Three-Valued Logic: Conditions involving NULL can result in TRUE, FALSE, or
UNKNOWN, affecting query results.
4. Ignored in Aggregation: Functions like SUM() and COUNT() ignore NULL values.
5. Special Handling: Queries use IS NULL or IS NOT NULL to explicitly check for
NULL values.
fi
fi
3.features of good relations database design?
1. Normalization: Organize data to minimize redundancy and ensure consistency.
2. Primary Key: Ensure every table has a unique primary key to identify records.
3. Foreign Keys: Use foreign keys to enforce relationships between tables.
4. Data Integrity: Maintain entity, referential, and domain integrity with constraints.
5. Ef cient Indexing: Apply appropriate indexes to speed up data retrieval.
6. Avoiding Over-Indexing: Use indexes wisely, as too many can slow down write operations.
7. Optimized Queries: Design ef cient SQL queries for better performance.
8. Scalability: Design for future growth with partitioning or sharding when necessary.
9. Consistency: Ensure consistency by following best practices like ACID (Atomicity,
Consistency, Isolation, Durability).
10. Security: Implement security measures like user roles, permissions, and encryption to
protect data.
4.What is decomposition?
Decomposition in relational databases is the process of breaking a large, complex table into
smaller, related tables to eliminate redundancy, prevent anomalies, and improve data structure. It
helps in organizing data ef ciently while preserving its integrity.
Key Points:
1. Lossless Decomposition: Ensures the original table can be fully reconstructed without
losing information.
2. Dependency Preservation: Maintains the functional dependencies of the original table.
3. Goals: Reduce redundancy, prevent insertion/update/deletion anomalies, and improve query
performance.
5. Functional dependency?
A functional dependency in a database occurs when one attribute (or set of attributes) uniquely
determines another. It's represented as X → Y, meaning that if two rows have the same value for X,
they must have the same value for Y.
Importance:
Document-Oriented Databases
• Structure: Store data as documents (usually in formats like JSON, BSON, or XML).
• Storage: Documents are grouped into collections.
• Schema: Flexible, allowing each document to have a different structure.
• Use Cases: Suitable for content management, user pro les, and catalogs where data can
vary in structure.
• Examples: MongoDB, CouchDB.
Key-Value Stores
• Structure: Simple key-value pairs, where a key is associated with a speci c data value.
• Storage: Data is retrieved by a unique key, similar to a dictionary/hashmap.
• Schema: No strict schema; the value can be any data type like string, JSON, or binary
objects.
• Use Cases: Ideal for caching, session management, and user preferences.
• Examples: Redis, DynamoDB, Riak.
fi
fi
Graph Databases
Distributed Architecture: Data distributed across multiple nodes for fault tolerance.
Eventual Consistency: Ensures data consistency over time but may allow temporary
inconsistencies.
BASE Model: Prioritizes availability and scalability over strong consistency (opposite of ACID).
High Availability: Designed for minimal downtime with automatic replication and failover.
Big Data Handling: Optimized for managing large volumes of both structured and unstructured
data.
Flexible Data Models: Supports documents, key-value pairs, columns, or graph structures.
Open-Source and Cost-Effective: Many NoSQL databases are open-source and lower in cost for
scaling large data systems.
fi
fi
fl
UNIT_6 IMPS
1.what is object relational database system . Explain table
inheritance?
Table inheritance
in a database allows one table (child) to inherit the structure (columns) from another table (parent).
It functions similarly to class inheritance in object-oriented programming.
Key Points:
• Use case: A company stores product catalogs as XML les. Each product
has varying attributes (e.g., size, color), which are nested in a hierarchical
structure.
• Bene t: BaseX allows ef cient querying of these product catalogs using
XQuery and XPath, enabling fast retrieval and exible management of
the data without needing a xed schema.
fi
fi
fi
fl
fi
3.what are spital data . Explain geographic and geometric
data?
Spatial data refers to any data that is related to or represents objects or
phenomena with a speci c location on the Earth's surface. It describes the
geometry, location, and sometimes the properties of objects. Spatial data is
often used in Geographic Information Systems (GIS), mapping, urban
planning, and location-based services.
Geographic data
fi
What is semi-structured data model
Flexible Structure: No strict, prede ned schema; data can vary between records.
Self-Describing: Data contains tags or labels (e.g., XML, JSON) to describe its structure.
Hierarchical: Often organized in a nested, tree-like format.
Partial Schema: Combines both structured elements ( elds) and unstructured data.
Used in Big Data: Common in web data, logs, emails, and social media where data formats evolve.
Rule-Based Inference: Uses logical rules (like Prolog) to derive new information from existing
data.
Declarative Queries: Supports queries in a declarative style, often with logic-based languages.
Recursive Queries: Can handle recursive relationships, enabling complex queries like hierarchical
data navigation.
Knowledge Representation: Combines facts and rules to model knowledge, making it suitable for
reasoning tasks.
Data and Logic Integration: Merges traditional database capabilities with logical reasoning for
advanced data analysis.
fi
fi