DBMS Reviewer
DBMS Reviewer
MODULE 1
Data management is a discipline that focuses on the proper generation, storage, and retrieval
of data.
- Query is used on retrieving data.
- GIGO ( garbage in, garbage out).
A database is a shared, integrated computer structure that stores a collection of the following:
COMPONENTS OF DATABASE
TYPES OF DATABASES
Primary functions:
1. Define, create and organize a database
2. Input data
3. Process dat
4. Maintain data integrity and security
5. Query database
COMPONENTS OF DBMS
1. Data Definition Language (DDL). It allows the users to define the database, specify the data
types, data structures, and constraints on the data to be stored in the database.
2. Data Manipulation Language (DML) and Query Language. allows users to insert, update,
delete and retrieve data from the database.
3. Software for Controlled Access of Database.
Data modeling is the first step in the database design journey, serving as a bridge between
real-world objects and the computer database.
- is an iterative, progressive process. <pwedeng maulit>
1. ENTITY - entity represents a particular type of object in the real world, which means an
entity is “distinguishable” in the real world.
- Implemented as TABLE in database
- Examples are PHYSICAL OBJECTS <customer> & ABSTRACTIONS <routes>
1. RECORD BASED DATA MODELS to represent the data using Record Structure
(conceptual view).
Hierarchical Data Model organizes records in a tree structure, i.e., a hierarchy of parent
and child records relationships.
Network Data Model - records and sets. directed graphs are used instead of a tree
structure in which a node can have more than one parent.
Relational model presents data in the form of tables which is used interchangeably with
the word Relation.
2. OBJECT-BASED DATA MODELS are also known as conceptual models used to define
concepts, including entries, attributes, and relationships between them.
3. PHYSICAL DATA MODELS provide the concepts that describe the details of how the
data is stored.
- a. Unifying Model <to analyze data from multiple resources>
- b. Frame Memory Model <virtual view of secondary storage>
TYPES OF ATTRIBUTES
1. Simple Attributes are those which cannot be divided into subparts. <e.g. Age and
student no.>
2. Composite Attributes are those which can be divided into subparts. <name (FI, MI &
LN)>
3. Single Valued Attribute: An attribute having only a single value for a particular entity.
<e.g. age>
4. Multi-Valued Attributes: An attribute with more than one possible value for a particular
entity. <e.g. Contact #>
5. Derived Attributes: An attribute that can be derived from other known attributes. <e.g.
Age - System Date - DOB>
6. Stored Attributes: An attribute that cannot be derived by other known attributes. <DOB
of any employee. NULL Value: Null stands for nothing. An attribute has a null value if
either the value of that attribute is not known or the value is not applicable.>
RELATIONSHIP SETS
1. Binary Relationship Set: A relationship set in which only two entity sets are involved.
2. Ternary Relationship Set: A relationship set in which three entity sets are involved.
Role: The function of any entity in the relationship set is called that entity's role. <e.g., an
employee plays the worker's role in his department>
Recursive Relationship Set: When the same entity sets participate in the same relationship
set more than once with different roles each time. <e.g., A student who attends weekend
classes in college may also be a lecturer in that college.>
MAPPING CONSTRAINTS
MAPPING CARDINALITIES (CARDINALITY RATIOS)
1. One to One (1 : 1) :
2. One to Many (1 : N)
3. Many to One (N : 1)
4. Many to Many (M : N)
TYPES OF KEYS
1. Super Key: A super key is a set of collections of one or more than one attributes that
can identify data uniquely. (Example: a. (ID, Name, Salary, Reg. No.)vb. (ID, Name,
Reg. No.) c. (ID) etc.)
2. Candidate Key: The minimal super key. (Example: ID and Reg. No.)
3. Primary Key: An attribute that identifies data uniquely. (Example: An entity sets an
Employee, either Reg. No. is the primary key, or ID is the primary key.)
4. Alternate Keys: All the candidate keys other than the Primary Key. (Example: An entity
set Employee, either Reg. No. is the primary key, or ID is the primary key.)
5. Secondary Key: An attribute or set of attributes that don't identify data uniquely but
identifies a group of data. (Example: Name, Salary, and Department No.)
6. Foreign Key: A foreign key is an attribute in any entity set, which is also a Primary Key
in any other entity set. (Example: Dept_ID: This is an attribute in an entity set Employee
and a primary key in an entity set Department. Thus, it is a foreign key for employees.)
MODULE 4 - ENTITY RELATIONSHIP DIAGRAM
- represent the logical structure of a database. An ERD (SmartDraw, 2021) shows the
relationships of entity sets stored in a database.
Advantages of E-R Model
The major advantages of the E-R model are as follows:
1. Strong Entity Sets - Entity sets having any key attributes are known as Strong Entity
sets.
2. Weak Entity Sets - Entity sets having no key attributes are known as Weak Entity sets.
Superclass Entity Type (Supertype): is a generic entity type that includes one or more distinct
subclasses required to be represented in a data model.
Subclass Entity Type (Subtype): is a more specialized entity type that has a distinct role in the
organization.
Example: PERSON entity (superclass entity type) - EMPLOYEE and CUSTOMER (subclass
entity type)
a. Specialization is a process by which any existing entity set is divided into smaller entity
sets according to the distinct or different nature of entities.
b. Generalization is when two or more entity sets can be combined into a single entity set
by determining similarities between the entities. If an abstract view of information is
needed, then go towards generalization.
- Specialization and generalization lead to attribute inheritance,
c. Aggregation is an abstraction process in which a relationship set is considered a
higher-level entity set.