0% found this document useful (0 votes)
4 views

Dbms Notes

A Database Management System (DBMS) is software that efficiently manages data storage, retrieval, and organization, offering advantages such as reduced data redundancy and improved data integrity. The document discusses the three-schema architecture, which includes internal, conceptual, and external schemas, and the necessity of mapping between these levels to maintain data integrity. It also covers various types of keys and constraints in DBMS, emphasizing their importance in ensuring data accuracy and consistency.

Uploaded by

mynewnum01
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views

Dbms Notes

A Database Management System (DBMS) is software that efficiently manages data storage, retrieval, and organization, offering advantages such as reduced data redundancy and improved data integrity. The document discusses the three-schema architecture, which includes internal, conceptual, and external schemas, and the necessity of mapping between these levels to maintain data integrity. It also covers various types of keys and constraints in DBMS, emphasizing their importance in ensuring data accuracy and consistency.

Uploaded by

mynewnum01
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

1. Define the term DBMS.

What are the advantages of DBMS Three-Schema Architecture:Internal Schema: This level organized way to model the database structure, helping in the Tuple is a single row in a table, representing a specific record or
over the file-based approach? describes how data is physically stored in the database, design and planning phase of a database system.E-R Modeling data item. Each tuple contains a set of values corresponding to
including the data structures and storage methods used at the Styles:Chen’s Notation: This traditional style uses rectangles for the attributes defined in the table's schema.
Definition of DBMS:A Database Management System (DBMS) is
lowest level.Conceptual Schema: This level represents the entities, diamonds for relationships, and ovals for attributes. It
software that provides an efficient and systematic way to store, Check ConstraintEnsures that all values in a column satisfy a
entire database structure, describing the relationships and is useful for detailed, descriptive database designs.Crow’s Foot
manage, and retrieve data from databases. It allows users to specified condition.Syntax:CREATE TABLE table_name (
organization of data. It provides a unified view of the data for Notation: A more compact and widely-used style in database
interact with databases, ensuring the data is well-organized and column_name data_type CHECK (condition));
the organization.External Schema: This level defines how design tools, this notation represents relationships using lines
easily accessible.Advantages of DBMS over File-Based
individual users or user groups interact with the database. It and symbols that resemble a crow's foot, making it easier to Null ConstraintSpecifies whether a column can accept NULL
Approach:Control of Data Redundancy and Inconsistency: In a
provides different user-specific views of the data to cater to understand and implement large database designs.Symbols values.
file-based system, data duplication can occur, leading to
specific application needs.Need for Mapping Between Schema Used in E-R Diagrams:Entity: Represented by rectangles, Syntax:CREATE TABLE table_name ( column_name data_type
redundancy and possible inconsistencies. DBMS helps to
Levels:Mapping is required to maintain the integrity and entities denote real-world objects like "Customer" or NULL); -- Allows NULL values
minimize data duplication and ensures consistent data
consistency of data as it moves between different "Product."Relationship: Represented by diamonds,
throughout the system.Improved Data Integrity and Security: A CREATE TABLE table_name (column_name data_type NOT
levels:External-Conceptual Mapping: This ensures that changes relationships show how entities are related, such as "buys" or
DBMS can enforce data integrity constraints and security NULL); -- Disallows NULL values
in user views (external schema) do not affect the overall "owns."Attribute: Represented by ovals, attributes define
mechanisms, ensuring that only authorized users have access
database design (conceptual schema).Conceptual-Internal properties of entities, such as "Customer Name" or "Order Unique Constraint Ensures that all values in a column are
to the data and that it remains accurate and reliable.Data
Mapping: This ensures that changes in the physical storage of Date."Primary Key: Underlined attributes indicate the primary unique across the table.Syntax:CREATE TABLE table_name
Independence: The DBMS separates data structure from data
data (internal schema) do not affect the overall logical structure key, which uniquely identifies an entity in the database. (column_name data_type UNIQUE);
access, allowing changes in data storage or formats without
of the database (conceptual schema).
affecting application programs that use the data. This is difficult 1. What do you mean by constraints in DBMS? Default Constraint Specifies a default value for a column when
to achieve in file-based systems.Efficient Data Access and 3. What is the purpose of an E-R diagram? Explain the no value is provided during insertion.Syntax:CREATE TABLE
Constraints in DBMS:Constraints are rules applied to the
Querying: DBMS supports powerful query languages like SQL, different E-R modeling styles and the symbols used in each table_name (column_name data_type DEFAULT default_value);
database schema to ensure the accuracy, consistency, and
making data retrieval faster and more flexible compared to style.
integrity of data. They enforce certain conditions on data to Is it necessary to apply constraints while designing the
manual methods in a file system.
Purpose of E-R Diagram:An Entity-Relationship (E-R) Diagram is prevent invalid or incorrect entries. Examples include Primary database schema? Justify:Yes, applying constraints is essential
2. Describe the three-schema architecture and explain the a visual representation of the data and the relationships Key constraints, Foreign Key constraints, Unique constraints, when designing a database schema because:Data Integrity:
need for mapping between schema levels. between entities in a database. It provides a clear and Not Null constraints, and Check constraints. Constraints ensure that only valid data is entered, preventing
errors like duplicate or null values where not

allowed.Consistency: They help maintain consistency between two or more columns used to create a unique identifier for 2. What are the three levels of data abstraction? Explain with applications that interact with the database. For instance,
related tables (e.g., Foreign Key constraints).Reliability: rows in a table.Example: CREATE TABLE Orders (OrderID INT, the help of a diagram. Also, explain the concept of data adding a new column to a table or renaming an attribute should
Constraints enforce the business rules, making the data more ProductID INT, PRIMARY KEY (OrderID, ProductID)); independence. not require changes in the application layer or the way data is
reliable for decision-making.Security: Certain constraints (like presented to users. However, logical data independence is
1. DomainA domain is the set of permissible values that an Three Levels of Data Abstraction:Physical Level: This is the
CHECK) can restrict data inputs to only allowable values, harder to achieve because changes to the logical structure
attribute can take in a database. It defines the data type (e.g., lowest level, which describes how the data is actually stored in
preventing potential misuse or data corruption. often affect the data’s view.Physical data independence refers
integer, string, date) and any constraints (e.g., range of values) the database (e.g., indexes, file structures).Conceptual Level:
to the ability to change the physical storage of data (such as file
4. Explain various types of keys. Explain each of them with that apply to that attribute.2. Composite Attribute is an This level describes what data is stored in the database and the
structures or indexing methods) without altering the logical
suitable examples and their syntax. attribute that can be subdivided into smaller sub-parts, each relationships among them. It provides a unified view of the
schema or affecting how applications access the data. For
representing more basic attributes with independent meanings. data, independent of how it is stored.External Level: This is the
Types of Keys:Primary Key: A column or set of columns that example, reorganizing storage techniques or changing indexing
For example, a "Full Name" attribute can be broken down into highest level, which presents data to end users in different
uniquely identifies each record in a table. It cannot have NULL methods can be done without impacting the way data is
"First Name" and "Last Name."3. Degree of a Table(or relation) ways (i.e., different views for different users).Data
values.Example: CREATE TABLE Student (ID INT PRIMARY KEY, structured logically or how it is accessed. Physical data
refers to the number of attributes (columns) in that table. For Independence:Logical Data Independence: Changes to the
Name VARCHAR(50));Foreign Key: A column or set of columns independence is easier to achieve and allows for performance
instance, if a table has 5 attributes, its degree is 5.4. Schemais conceptual schema should not affect external schemas or
that establish a relationship between two tables. It references optimizations without needing to modify the logical view of the
the logical structure that defines how data is organized in a applications.Physical Data Independence: Changes to the
the primary key of another table.Example: CREATE TABLE data.
database. It includes the tables, the relationships between internal schema should not affect the conceptual schema or the
Enrollment (StudentID INT, CourseID INT, FOREIGN KEY
them, and the constraints that govern the data. It acts as a external views. 3. (i) What are weak and strong entity sets?
(StudentID) REFERENCES Student(ID));Unique Key: Ensures all
blueprint for how data is stored.5. Data Dictionary is a
values in a column are unique but allows one NULL value. Data Independence refers to the capability of modifying the Strong Entity Set:A strong entity set can exist independently
centralized repository that contains metadata about the
Similar to the primary key, but multiple unique keys can exist in database schema at one level without affecting the schema at without relying on other entities. It has a primary key that
database. It includes information about the structure of the
a table.Example: CREATE TABLE Employee (EmpID INT UNIQUE, the next higher level, allowing changes in data structure uniquely identifies each entity in the set. In an ER diagram, a
database, such as tables, fields, data types, constraints, and
EmpName VARCHAR(50));Candidate Key: Any column or set of without impacting application programs. It is classified into two strong entity set is represented by a rectangle.Weak Entity
relationships, allowing users to understand and manage the
columns that could be a primary key. The primary key is types: Logical and Physical data independence.Logical data Set:A weak entity set cannot exist independently and depends
data effectively.
selected from the candidate keys.Example: Both "Email" and independence refers to the ability to change the logical schema on a strong entity for its existence. It does not have a primary
"ID" in a "User" table could be candidate keys, but only one is (such as altering tables or attributes) without modifying the key of its own but is identified by a combination of its own
chosen as the primary key.Composite Key: A combination of external schema (the way users view the data) or the attributes and a foreign key from a related strong entity. In an

ER diagram, a weak entity set is represented by a double requires manual coding or basic operating system commands. Information Management System (IMS).Network DBMS: Similar for efficient data storage, access, and retrieval.Minimizes
rectangle, and its relationship with the strong entity is Searching can be slow as there is no optimized querying to the hierarchical model but allows many-to-many Redundancy: Through normalization and relationship mapping,
represented by a double diamond. mechanism.Concurrency Control: Most file systems lack proper relationships through a graph-like structure. Example: data modeling reduces duplication of data.
concurrency control. Simultaneous access by multiple users can Integrated Data Store (IDS).Object-Oriented DBMS (OODBMS):
(ii) What is total and partial participation? What is their role in Types of Data Modelling:Conceptual Data Model: A high-level
lead to issues such as data corruption. Stores data in the form of objects, as used in object-oriented
a relationship? model that captures the overall structure of the system without
programming. Example: db4o, ObjectDB.
Database Systems:Data Storage: Data is stored in structured focusing on implementation details. Typically represented using
Total Participation:In a relationship, total participation means
formats (tables) using schemas. DBMS manages the data and Components of DBMS:Database Engine: Manages data storage, ER diagrams.Logical Data Model: A more detailed model that
that every entity in the entity set must participate in the
allows for complex relationships between data entities.Data access, and modification.Database Schema: The blueprint of includes specific details about the structure and relationships,
relationship. For example, if every student must enroll in at
Redundancy and Consistency: DBMS systems minimize the database that defines the tables, fields, and but still independent of physical storage.Physical Data Model:
least one course, then there is total participation of the
redundancy by allowing relationships (like foreign keys), relationships.Query Processor: Interprets and executes SQL Focuses on how data will be stored physically on hardware. It
"Student" entity in the "Enrolls" relationship. In an ER diagram,
ensuring data consistency.Data Access: DBMS uses query queries.Transaction Management: Ensures that all database includes information on indexes, partitions, and storage
total participation is represented by a double line connecting
languages like SQL, which allow efficient and complex data operations are completed successfully or rolled back in case of structures.
the entity to the relationship.Partial Participation:In contrast,
retrieval with less effort.Concurrency Control: DBMS provides failure.Storage Manager: Manages how data is stored on
partial participation means that not all entities are required to Why Use E-R Model for Data Modelling?The Entity-
better concurrency control through mechanisms such as physical devices.Authorization Manager: Ensures that only
participate in the relationship. For example, not every teacher Relationship (E-R) model is widely used in conceptual data
locking, ensuring consistent access to data even when multiple authorized users can access certain parts of the
needs to supervise a research project. In an ER diagram, partial modeling because it provides a clear and visual representation
users are accessing the system simultaneously. database.Popular DBMS:MySQL,Oracle DB
participation is represented by a single line connecting the of the relationships between different entities. It simplifies
entity to the relationship. 2. Analyze the distinct classifications of Database 4. What is Data Modelling? Data modeling is the process of understanding for database designers and developers.Example:
Management Systems (DBMS). creating a data structure to represent real-world information in In a library system, entities like "Books," "Members," and
1. Compare and contrast file systems with database systems
a database. It serves as a blueprint for building the actual "Loans" can be modeled in an ER diagram to define how books
in detail. Classifications of DBMS:Relational DBMS (RDBMS): Stores data
database, ensuring that all data elements are represented and are issued to members and when they need to be returned.
in tables with rows and columns. Relationships are established
File Systems:Data Storage: In file systems, data is stored in files correctly related to each other.
using foreign keys. Examples include MySQL, PostgreSQL, and Hierarchical DataBase Models:Data is organized in a tree-like
within directories. These files are often unstructured or semi-
Oracle.Hierarchical DBMS: Organizes data in a tree-like Role in Database Design:Structure Definition: Data modeling structure where each record has a single parent and possibly
structured.Data Redundancy and Inconsistency: Data is often
structure where each child node has only one parent. It is used defines how the data will be organized and how different data many children (like a parent-child relationship).Parent-child
duplicated across multiple files, which can lead to
in specialized applications like banking systems. Example: IBM entities will be related.Efficiency: A well-designed model allows relationship.Each child record has only one parent.Data is
inconsistencies.Data Access: Accessing data in a file system

accessed through a predefined path, making traversal customers, products, and orders are stored in separate tables enclosing the relationship in a box and connecting it to another This query calculates the average salary of all employees in the
fast.Commonly used in early database management systems but linked by relationships entity. employees table.
and applications like XML data storage and file
Specialization, Generalization, and Aggregation SQL (Structured Query Language) is a standardized MAX():Returns the maximum value from a column.SELECT
systems.Example: A company's organizational chart or a file
programming language specifically designed for managing and MAX(salary) AS highest_salary FROM employees;
system directory.Network An extension of the hierarchical Specialization is a top-down approach where a general entity is
manipulating relational databases. It is used to perform various
model where records can have multiple parent-child divided into sub-entities based on distinguishing This query returns the highest salary in the employees table.
operations on the data stored within these databases, such as
relationships (many-to-many).Records are linked in a graph characteristics.Example:Vehicle can be specialized into Car and
querying data, updating records, inserting new data, and MIN():Returns the minimum value from a column.SELECT
structure, allowing more complex relationships.Supports many- Truck.Car: Attributes like "number of doors."Truck: Attributes
deleting existing information. SQL serves as the foundational MIN(salary) AS lowest_salary FROM employees;
to-many relationships.More flexible than the hierarchical like "load capacity."In ER diagrams, it’s shown with a triangle
language for interacting with relational database management This query returns the lowest salary in the employees table.
model, but navigation through the data is still done by labeled "ISA," linking the general entity to specialized sub-
systems (RDBMS), enabling users to efficiently retrieve and
following predefined paths.Use Case: Often used in applications entities.Types:Disjoint: An instance can belong to only one COUNT(DISTINCT):Returns the count of distinct (unique) values
manage data.
where complex relationships need to be modeled, like subclass (e.g., either a car or a truck).Overlapping: An instance in a column.SELECT COUNT(DISTINCT department) AS
telecommunications and network routing.Example: A database can belong to multiple subclasses (e.g., both employee and Aggregate functions are used to perform calculations on unique_departments FROM employees;
of flight connections between different cities, where one city student).Generalization is a bottom-up approach where multiple values and return a single value. These are commonly
This query counts the number of unique departments in the
can have flights to multiple other cities.Relational Data is multiple entities are combined into a general entity based on used with the GROUP BY clause to group rows with the same
employees table.
organized into tables (called relations) where each table shared attributes.Example:Teacher and Student can be values into summary rows.
consists of rows and columns.Each table (relation) represents generalized into Person, sharing common attributes like GROUP_CONCAT() :Concatenates values from multiple rows
COUNT():Returns the number of rows that match a specified
an entity, and rows in the table represent instances of that "Name" and "Address."Generalization is the reverse of into a single string.SELECT GROUP_CONCAT(department) AS
condition.SELECT COUNT(*) AS total_orders FROM orders;
entity.Relationships between tables are established using keys specialization and is also depicted with an "ISA" triangle in ER all_departments FROM employees;
diagrams.Aggregation treats a relationship as an entity, useful This query counts the total number of rows in the orders table.
(primary and foreign keys).Data can be queried using SQL This query concatenates the names of all departments into a
(Structured Query Language).Most widely used model today when a relationship itself has attributes or participates in SUM():Returns the total sum of a numeric column.SELECT single string.
due to its flexibility and ease of use.Use Case: Used in almost all another relationship.Example:Employee works on a Project SUM(salary) AS total_salary FROM employees;
modern database systems like MySQL, PostgreSQL, Oracle, (relationship: Works_On), and a Department oversees that
This query calculates the total salary from the employees table.
etc.Example: A database for an e-commerce site where project. Aggregation allows treating the relationship Works_On
as a higher-level entity.In ER diagrams, aggregation is shown by AVG():Returns the average value of a numeric column.SELECT
AVG(salary) AS avg_salary FROM employees;

You might also like