Dbms Imp All Units

Download as pdf or txt
Download as pdf or txt
You are on page 1of 15

DBMS UNIT_1 IMPS

1.What is impact of insert ,update, delete, anomaly on overall


design of database? How normalisation used to remove these
anomalies?

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:

• First Normal Form (1NF) removes repeating groups


• Third Normal Form (3NF) removes transitive dependencies

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.

Solution through Normalization: Normalization reduces redundancy by ensuring that data is


stored in only one place. By normalizing the database:

• In 2NF, partial dependencies are removed


• In 3NF, reducing redundancy.

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

Join Community by clicking below links

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

◦ SELECT Name FROM Employees WHERE EmployeeID = 102;

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).

Expressiveness: It must be capable of de ning, querying, modifying, and controlling data


effectively.

Transaction Management: The language should support transaction management, allowing


operations to be executed reliably and ensuring data integrity.

Integration with Programming: It should be usable in application programming languages as well


as in interactive query sessions, facilitating diverse data interactions.

Systematic Treatment of Null Values


The Systematic Treatment of Null Values is one of Codd's rules ensuring consistent handling of
NULL (representing missing or unknown data) in relational databases. Here's a brief summary:

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:

Functional dependencies are crucial for:

• Normalization: Reducing redundancy and preventing anomalies.


• Database Design: Ensuring proper relationships between attributes.
fi
fi
fi
Unit 5_IMPS
1.Comapare SQL and NOSQL

2.Explain NOSQL data types

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

• Structure: Data is represented as nodes, edges (relationships), and properties (attributes).


• Storage: Focuses on relationships between data points.
• Schema: Flexible, designed to model complex networks and relationships.
• Use Cases: Best suited for social networks, recommendation engines, fraud detection, and
complex relationship mapping.
• Examples: Neo4j, ArangoDB, Amazon Neptune.
• Example Data:
◦ Nodes: Users (John, Jane)

3.Base properties of NOSQL


Schema Flexibility: No prede ned schema, supports exible data structures.

Horizontal Scalability: Scales by adding more servers (nodes).

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.

High Performance: Ef cient read/write operations, especially in distributed environments.

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?

• Hybrid Approach: Combines features of relational databases and object-oriented databases.



• Complex Data Types: Supports user-de ned types, arrays, and complex structures.

• Object-Oriented Features: Incorporates concepts like classes, inheritance, and encapsulation.

• Table Inheritance: Allows tables to inherit attributes from other tables, reducing redundancy.

• Polymorphism: Enables exible queries by treating child tables as instances of parent tables.

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:

1. Parent Table: Contains common columns shared across multiple tables.


2. Child Table: Inherits the columns from the parent table but can also have its own unique
columns.
3. Querying: You can query both the child table (for all columns) or the parent table (to
retrieve rows from all children).
4. Reduces Redundancy: Avoids duplicating shared columns in multiple tables.
5. Hierarchical Structure: Models real-world relationships,
fl
fi
An example of an XML database is BaseX, which is a native XML database.

• 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.

Features of deductive data base

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

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy