DBMS_Module-1_Notes
DBMS_Module-1_Notes
• Data Security & Privacy – Ensures restricted access through authentication and
encryption.
• Data Integrity & Accuracy – Maintains consistency and prevents duplication or corruption.
SCOPE
• IT & Software Development – Used in applications, websites, and cloud storage.
• Education & Research – Manages student records, results, and online learning platforms.
Representational Data Model: A Representational Data Model defines the logical structure of a
database. It primarily helps in designing the database. A common example is the Relational Model,
which represents data using tables and defines relationships between them using Relational
Algebra and Relational Calculus.
Physical Data Model: A Physical Data Model describes how data is stored and organized on
storage devices like disks and tapes. It focuses on files, records, and data structures to ensure
efficient data storage and retrieval.
• It helps us in finding the missing data and also in minimizing Data Redundancy.
• The information in the data model can be used for defining the relationship between tables,
primary and foreign keys, and stored procedures.
• Even smaller change made in structure require modification in the entire application.
• To develop Data model, one should know physical data stored characteristics.
Schema
• Schema is the overall description of the database.
• The basic structure of how the data will be stored in the database is called schema.
• In DBMS, the term schema refers to the architecture of the database which describes how it
will appear or will be constructed.
• A schema is a template that dictates how data items in a database will be stored, arranged,
and accessed.
Schema is of three types
• Logical Schema
• Physical Schema
• View Schema
Logical Schema – A logical database schema defines the logical structure of the data, including
tables, views, relationships, and integrity constraints.
Physical Schema – A physical schema defines how data is stored in the storage system,
including the arrangement of files, indices and other storage structures.
View Schema – A view schema is the highest level of abstraction in a database, focusing on how
users interact with the database.
Instance
In Database Management Systems (DBMS), an instance refers to the actual data stored in the
database at a specific moment in time. It represents the current state of the database, including all
the records and data entries in the tables.
Types of Instances
• Initial Instance – When the database is first loaded with data.
Advantages of Instance
• Real-Time Representation: It a return of the data in the database at a certain point in time
as may be required for analysis or for performing operations.
• Flexibility: While a schema remains fixed in time, instances can be quite volatile, as data is
written, updated, or deleted.
Disadvantages of Instance
• Volatility: Those are occurrences may be dynamic in a way they are different over time and
this may make it a challenge to keep track without the necessary intervention.
• Data Integrity Issues: If not well regulated, it is evident that the data in an instance could
become very inconsistent and at times even incorrect.
• The three schema architecture is also used to separate the user applications and physical
database.
• The three schema architecture contains three-levels. It breaks the database down into three
different categories.
• The approach in which a particular user needs to see the data may change over time.
• The users of the database should not worry about the physical implementation and internal
workings of the database such as data compression and encryption techniques, hashing,
optimization of the internal structures etc.
• All users should be able to access the same data according to their requirements.
• DBA should be able to change the conceptual structure of the database without affecting
the user's
• Internal structure of the database should be unaffected by changes to physical aspects of
the storage.
Internal Level
• The internal level has an internal schema which describes the physical storage structure of
the database.
• It uses the physical data model. It is used to define that how the data will be stored in a
block.
• The physical level is used to describe complex low-level data structures in detail.
Conceptual Level
• The conceptual schema describes the design of a database at the conceptual level.
Conceptual level is also known as logical level.
• The conceptual level describes what data are to be stored in the database and also
describes what relationship exists among those data.
• In the conceptual level, internal details such as an implementation of the data structure are
hidden.
• Each view schema describes the database part that a particular user group is interested
and hides the remaining database from that user group.
• The view schema describes the end user interaction with database systems
Data Independence
Data Independence in Database Management Systems (DBMS) refers to the ability to change
the schema (structure) at one level without affecting the schema at a higher level. This ensures
flexibility, scalability, and easier maintenance of the database.
• The ability to change the internal schema (storage structures, indexing, data file
organization) without affecting the conceptual schema (tables and relationships).
• Example: Moving the database from HDD Hard Disk Drive to SSD Solid State Drive
or changing indexing techniques should not affect how applications access data.
Components of ER Diagram
Entity
An entity may be any object, class, person or place. In the ER diagram, an entity can be
represented as rectangles.
Types of Entities
❑ Strong Entity
❑ Weak Entity
❑ Strong Entity
A strong entity has a primary key and can exist independently in a database. It does not rely on
any other entity for its identification. The strong entity is represented by a rectangle.
❑ Weak Entity
An entity that depends on another entity called a weak entity. The weak entity doesn't contain any
key attribute of its own. The weak entity is represented by a double rectangle.
Attribute
The attribute is used to describe the property of an entity. Eclipse is used to represent an attribute.
Types of Attributes
❑ Simple Attribute
❑ Key Attribute
❑ Composite Attribute
❑ Multivalued Attribute
❑ Derived Attribute
❑ Simple Attribute
➢ A simple attribute is an attribute that has a single, indivisible value for an entity. It cannot be
broken down into smaller components.
➢ For example, Name(if stored as a single value)
➢ In ER diagram, the simple attribute is represented by an oval.
❑ Key Attribute
➢ The attribute which uniquely identifies each entity in the entity set is called the key
attribute.
➢ For example, Roll_No will be unique for each student.
❑ Composite Attribute
➢ For example, the Address attribute of the student Entity type consists of Street, City, State,
and Country.
❑ Multivalued Attribute
➢ For example, Phone_No (can be more than one for a given student).
❑ Derived Attribute
➢ An attribute that can be derived from other attributes of the entity type is known as a
derived attribute.
➢ For example, Age (can be derived from DOB).
Relationship in DBMS
It is association between two or more entities. Entities are the real-world objects which hold data,
participate in these relationships. Connection between different entities are represented by a
diamond shapes in ER (entity relationship) diagrams. Relationships enables the separation and
organization of data across multiple tables which facilitate the data management and data
retrieval.
Types of Relationships
❑ One-to-One relationship
❑ Many-to-Many relationship
❑ One-to-One Relationship
➢ In one-to-one relationship a single record in one table is related with a single record in other
table and vice versa. This type of relationships are relatively rare and commonly used for
security or organizational reasons.
➢ Example: Consider two entities "Person" and "Aadhar card". Each person can have only
one Aadhar card and each Aadhar card is assigned to only one person.
❑ Many-to-Many Relationship
➢ A many-to-many relationship is relationship in which one multiple records in one table are
associated with multiple records in another table. This relationship is mainly implemented
using junction table.
➢ Example: Consider two entities "Student" and "Course" where each student can enroll in
multiple courses and each course can have multiple students enrolled in it.