Database: A collection of related data stored in a structured format on a
computer.
Database Management System (DBMS): Software that allows for the
creation, management, querying, and updating of databases.
Data Model: A mathematical framework that describes data structure,
constraints, and operations; examples include relational, hierarchical, and
object-oriented models.
Schema: Defines the structure of the database, specifying tables, fields, and
relationships.
Instance: The actual data stored in the database at a given time.
Relational Model: A data model where data is organized into tables
(relations) with rows (tuples) and columns (attributes).
ACID Properties: Principles that ensure reliable transactions:
o Atomicity: All operations in a transaction are complete or none do.
o Consistency: The database remains in a valid state after a
transaction.
o Isolation: Concurrent transactions don’t interfere with each other.
o Durability: Changes from a transaction persist even after system
failures.
Entity: An object in the database that has attributes, e.g., Student or
Employee.
Entity Set: A collection of similar entities, comparable to a table in a
relational model.
Attribute: A property or characteristic of an entity, similar to a column in a
table.
Primary Key: A unique identifier for each entity in an entity set.
Weak Entity: An entity that cannot be uniquely identified by its attributes
alone and depends on another entity.
Relationship: A connection between entities, such as Employee works in
Department.
Multiplicity: Indicates the relationship type between entities:
o One-to-One (1:1): Each entity instance in one set is related to only
one instance in another.
o One-to-Many (1:N): One entity instance relates to multiple instances
in another set.
o Many-to-Many (M:N): Multiple instances in one set relate to multiple
in another.
ER Diagram (ERD): A visual representation of entities, attributes, and
relationships within a database.
Relation/Table: A set of tuples that share the same attributes.
Tuple: A row in a table representing a single data item.
Domain: A set of permissible values for an attribute (e.g., age values 0-120).
Schema of a Relation: Defines the structure of a table, including attributes
and types.
Super Key: A set of attributes that can uniquely identify a tuple.
Candidate Key: A minimal super key; a candidate to become the primary
key.
Foreign Key: An attribute that links one table to the primary key of another,
enforcing referential integrity.
Entity Integrity: Ensures primary key fields cannot contain NULL values.
Referential Integrity: Ensures that foreign keys match primary keys in
related tables or are NULL.
ER to Relational Mapping: The process of converting an ERD into a
relational schema.
Regular Entity Mapping: For each strong entity, create a corresponding
table with all simple attributes.
Weak Entity Mapping: For each weak entity, create a table that includes
attributes of the entity and the foreign key of its owning entity.
Binary 1-to-1 Mapping: Map by adding a foreign key to one table; if total
participation, merged entities into one table.
Binary 1-to-N Mapping: Place the foreign key of the "1" side entity in the
"N" side table.
Binary M-to-N Mapping: Create a new table that includes foreign keys of
both related entities.
Multivalued Attributes: Create a separate table with a foreign key linking
to the original entity and the multivalued attribute.
Database Designer: Designs the structure of the database, including tables,
relationships, and constraints to meet organizational data needs.
Database Administrator (DBA): Manages and maintains the DBMS, ensuring
data availability, security, and performance optimization.
System Analyst: Analyzes organizational needs to develop data requirements
and design systems that use databases efficiently.
Application Programmer: Writes code that interacts with the database to
retrieve, update, and manipulate data for applications.
Total Participation: Every instance of an entity must be involved in the
relationship (e.g., every employee belongs to a department).
Partial Participation: Some instances of an entity may not be involved in the
relationship (e.g., not all employees may manage a project).
Business rules describe an organization’s policies and constraints on data,
helping define how data is stored, processed, and related.
ER Diagram Building Blocks:
Entities: Represent objects or things in the database (e.g., Student, Course).
Relationships: Describe connections between entities (e.g., Student "enrolls
in" Course).
Attributes: Properties of entities (e.g., Name, Age, Address for Student).
Types of Attributes:
Simple: Cannot be subdivided (e.g., Age).
Composite: Can be broken down (e.g., Address has Street, City).
Multivalued: Can hold multiple values (e.g., Phone Numbers).
Derived: Can be calculated from other attributes (e.g., Age from DOB).
Weak Entities: Depend on another entity for identification and typically
have a partial key.
Specialization/Generalization:
o Single Table with Type Attributes: Suitable for disjoint subclasses
with a type of column.
o Multiple Tables for Subclass and Superclass: Useful when there
are distinct attributes for each subclass.
Advantages of a Database System:
Answers queries quickly, e.g., finding posts by a specific author.
Groups modifications into transactions, ensuring all-or-nothing changes, e.g.,
for money transfers.
Recovers from crashes with modifications logged to prevent data corruption
after recovery.
Disadvantages of a Flat File System:
Managing data directly in application code can be tedious and error prone.
Difficult to ensure data integrity, such as avoiding duplicate or invalid entries.
Lacks durability: data may be lost if the machine crashes during an update.
Limited scalability, making it hard to adapt when multiple applications or
users need to access data.
ERD Advantages:
Provides exceptional conceptual simplicity for understanding database
structures.
Visual representation of data, making it easier to communicate ideas and
designs.
Effective communication tool between designers, developers, and
stakeholders.
Integrated with relational data model concepts, making ERDs easier to
translate into relational schemas.
ERD Disadvantages:
Limited in representing constraints (rules for data integrity).
Limited in representing complex relationships and business rules.
Lack of data manipulation language, requiring a separate query language
like SQL.
Some loss of detailed information content when moving from ERD to the
relational model.
Relational Model Advantages:
Allows set-based operations for efficient querying and data retrieval.
Enforces uniqueness through keys, avoiding duplicate tuples.
Typed and static attributes ensure data consistency within each column.
Flat structure simplifies data retrieval as all tables have a fixed, non-nested
structure.