Overview, Database System vs File System, Database System Concept and
Architecture, Data Model Schema and Instances, Data Independence and Database Language and
Interfaces, Data Definitions Language, DML, Overall Database Structure. Data Modeling Using the
Entity Relationship Model: ER Model Concepts, Notation for ER Diagram, Mapping Constraints,
Keys, Concepts of Super Key, Candidate Key, Primary Key, Generalization, Aggregation,
Reduction of an ER Diagrams to Tables, Extended ER Model, Relationship of Higher Degree.
2. What is Database?
• The database is a collection of inter-related data
which is used to retrieve, insert and delete the
data efficiently. It is also used to organize the data
in the form of a table, schema, views, and
reports, etc.
• For example: The college Database organizes the
data about the admin, staff, students and faculty
etc.
• Using the database, you can easily retrieve,
insert, and delete the information.
3. Database Management System
• Database management system is a software which is used to manage the
database. For example: MySQL, Oracle, etc are a very popular commercial
database which is used in different applications.
• DBMS provides an interface to perform various operations like database creation,
storing data in it, updating data, creating a table in the database and a lot more.
• It provides protection and security to the database. In the case of multiple users, it
also maintains data consistency.
• DBMS allows users the following tasks:
• Data Definition: It is used for creation, modification, and removal of definition that
defines the organization of data in the database.
• Data Updation: It is used for the insertion, modification, and deletion of the actual
data in the database.
• Data Retrieval: It is used to retrieve the data from the database which can be used
by applications for various purposes.
• User Administration: It is used for registering and monitoring users, maintain data
integrity, enforcing data security, dealing with concurrency control, monitoring
performance and recovering information corrupted by unexpected failure.
4. Characteristics of DBMS
• It uses a digital repository established on a server to store
and manage the information.
• It can provide a clear and logical view of the process that
manipulates data.
• DBMS contains automatic backup and recovery procedures.
• It contains ACID properties which maintain data in a
healthy state in case of failure.
• It can reduce the complex relationship between data.
• It is used to support manipulation and processing of data.
• It is used to provide security of data.
• It can view the database from different viewpoints
according to the requirements of the user.
5. Advantages of DBMS
• Controls database redundancy: It can control data redundancy
because it stores all the data in one single database file and that
recorded data is placed in the database.
• Data sharing: In DBMS, the authorized users of an organization can
share the data among multiple users.
• Easily Maintenance: It can be easily maintainable due to the
centralized nature of the database system.
• Reduce time: It reduces development time and maintenance need.
• Backup: It provides backup and recovery subsystems which create
automatic backup of data from hardware and software failures and
restores the data if required.
• Multiple user interface: It provides different types of user
interfaces like graphical user interfaces, application program
interfaces
6. Disadvantages of DBMS
• Cost of Hardware and Software: It requires a high
speed of data processor and large memory size to run
DBMS software.
• Size: It occupies a large space of disks and large
memory to run them efficiently.
• Complexity: Database system creates additional
complexity and requirements.
• Higher impact of failure: Failure is highly impacted the
database because in most of the organization, all the
data stored in a single database and if the database is
damaged due to electric failure or database corruption
then the data may be lost forever.
7. DBMS Architecture
• The DBMS design depends upon its architecture.
The basic client/server architecture is used to
deal with a large number of PCs, web servers,
database servers and other components that are
connected with networks.
• The client/server architecture consists of many
PCs and a workstation which are connected via
the network.
• DBMS architecture depends upon how users are
connected to the database to get their request
done.
9. Types of DBMS Architecture
1-Tier Architecture
• In this architecture, the database is directly available to the user. It means the user
can directly sit on the DBMS and uses it.
• Any changes done here will directly be done on the database itself. It doesn't
provide a handy tool for end users.
• The 1-Tier architecture is used for development of the local application, where
programmers can directly communicate with the database for the quick response.
2-Tier Architecture
• The 2-Tier architecture is same as basic client-server. In the two-tier architecture,
applications on the client end can directly communicate with the database at the
server side. For this interaction, API's like: ODBC, JDBC are used.
• The user interfaces and application programs are run on the client-side.
• The server side is responsible to provide the functionalities like: query processing
and transaction management.
• To communicate with the DBMS, client-side application establishes a connection
with the server side.
11. 3-Tier Architecture
• The 3-Tier architecture contains another layer between
the client and server. In this architecture, client can't
directly communicate with the server.
• The application on the client-end interacts with an
application server which further communicates with
the database system.
• End user has no idea about the existence of the
database beyond the application server. The database
also has no idea about any other user beyond the
application.
• The 3-Tier architecture is used in case of large web
application.
13. Three schema Architecture
• The three schema architecture is also called
ANSI/SPARC architecture or three-level
architecture.
• This framework is used to describe the structure
of a specific database system.
• 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.
15. Data Models
• Data Model is the modeling of the data description, data semantics, and
consistency constraints of the data.
• It provides the conceptual tools for describing the design of a database at
each level of data abstraction
16. Data Models
• 1) Relational Data Model: This type of model designs
the data in the form of rows and columns within a
table. Thus, a relational model uses tables for
representing data and in-between relationships. Tables
are also called relations. This model was initially
described by Edgar F. Codd, in 1969.
• 2) Entity-Relationship Data Model: An ER model is the
logical representation of data as objects and
relationships among them. These objects are known as
entities, and relationship is an association among these
entities. This model was designed by Peter Chen and
published in 1976 papers. It was widely used in
database designing.
17. • 3) Object-based Data Model: An extension of the ER model
with notions of functions, encapsulation, and object
identity, as well. This model supports a rich type system
that includes structured and collection types. Thus, in
1980s, various database systems following the object-
oriented approach were developed. Here, the objects are
nothing but the data carrying its properties.
• 4) Semistructured Data Model: This type of data model is
different from the other three data models (explained
above). The semistructured data model allows the data
specifications at places where the individual data items of
the same type may have different attributes sets.
18. Data model Schema and Instance
• The data which is stored in the database at a particular moment of
time is called an instance of the database.
• The overall design of a database is called schema.
• A database schema is the skeleton structure of the database. It
represents the logical view of the entire database.
• A schema contains schema objects like table, foreign key, primary
key, views, columns, data types, stored procedure, etc.
• A database schema can be represented by using the visual diagram.
That diagram shows the database objects and relationship with
each other.
• A database schema is designed by the database designers to help
programmers whose software will interact with the database. The
process of database creation is called data modeling.
19. Data Independence
• Data independence can be explained using the three-schema architecture.
• Data independence refers characteristic of being able to modify the schema at one level of
the database system without altering the schema at the next higher level.
• There are two types of data independence:
1. Logical Data Independence
• Logical data independence refers characteristic of being able to change the conceptual
schema without having to change the external schema.
• Logical data independence is used to separate the external level from the conceptual view.
• If we do any changes in the conceptual view of the data, then the user view of the data
would not be affected.
• Logical data independence occurs at the user interface level.
2. Physical Data Independence
• Physical data independence can be defined as the capacity to change the internal schema
without having to change the conceptual schema.
• If we do any changes in the storage size of the database system server, then the Conceptual
structure of the database will not be affected.
• Physical data independence is used to separate conceptual levels from the internal levels.
• Physical data independence occurs at the logical interface level.
21. Database Language
• A DBMS has appropriate languages and interfaces to express
database queries and updates.
• Database languages can be used to read, store and update the
data in the database.
• Types of Database Language
22. Keys
• Keys play an important role in the relational database.
• It is used to uniquely identify any record or row of data from the table. It is
also used to establish and identify relationships between tables.
• For example: In Student table, ID is used as a key because it is unique for
each student. In PERSON table, passport_number, license_number, SSN
are keys since they are unique for each person.
•
23. Types of key:
1. Primary key
•It is the first key which is used to identify one and only one instance of an entity
uniquely. An entity can contain multiple keys as we saw in PERSON table. The key
which is most suitable from those lists become a primary key.
•In the EMPLOYEE table, ID can be primary key since it is unique for each employee.
In the EMPLOYEE table, we can even select License_Number and Passport_Number as
primary key since they are also unique.
•For each entity, selection of the primary key is based on requirement and
developers.
24. 2. Candidate key
• A candidate key is an attribute or set of an attribute which can uniquely
identify a tuple.
• The remaining attributes except for primary key are considered as a
candidate key. The candidate keys are as strong as the primary key.
• For example: In the EMPLOYEE table, id is best suited for the primary key.
Rest of the attributes like SSN, Passport_Number, and License_Number,
etc. are considered as a candidate key.
25. 3. Super Key
• Super key is a set of an attribute which can uniquely
identify a tuple. Super key is a superset of a
candidate key.
• For example: In the above EMPLOYEE table,
for(EMPLOEE_ID, EMPLOYEE_NAME) the name of
two employees can be the same, but their
EMPLYEE_ID can't be the same. Hence, this
combination can also be a key.
• The super key would be EMPLOYEE-ID,
(EMPLOYEE_ID, EMPLOYEE-NAME), etc.
26. 4. Foreign key
• Foreign keys are the column of the table which is used to point to the primary key of another table.
• In a company, every employee works in a specific department, and employee and department are two
different entities. So we can't store the information of the department in the employee table. That's why
we link these two tables through the primary key of one table.
• We add the primary key of the DEPARTMENT table, Department_Id as a new attribute in the EMPLOYEE
table.
• Now in the EMPLOYEE table, Department_Id is the foreign key, and both the tables are related.
27. Generalization
• Generalization is like a bottom-up approach in which two or more entities
of lower level combine to form a higher level entity if they have some
attributes in common.
• In generalization, an entity of a higher level can also combine with the
entities of the lower level to form a further higher level entity.
• Generalization is more like subclass and superclass system, but the only
difference is the approach. Generalization uses the bottom-up approach.
28. Specialization
• Specialization is a top-down approach, and it is opposite to Generalization. In
specialization, one higher level entity can be broken down into two lower level
entities.
• Specialization is used to identify the subset of an entity set that shares some
distinguishing characteristics.
• Normally, the superclass is defined first, the subclass and its related attributes are
defined next, and relationship set are then added.
• For example: In an Employee management system, EMPLOYEE entity can be
specialized as TESTER or DEVELOPER based on what role they play in the company.
•
29. Aggregation
• In aggregation, the relation between two entities is treated as a single entity. In
aggregation, relationship with its corresponding entities is aggregated into a higher
level entity.
• For example: Center entity offers the Course entity act as a single entity in the
relationship which is in a relationship with another entity visitor. In the real world,
if a visitor visits a coaching center then he will never enquiry about the Course
only or just about the Center instead he will ask the enquiry about both.
30. Reduction of ER diagram to Table
• The database can be represented using the notations, and these notations can be
reduced to a collection of tables.
• In the database, every entity set or relationship set can be represented in tabular
form.The ER diagram is given below:
32. • Defining the information.
• Storing the information.
• Manipulating the information.
• Protecting the information from system crashes or data
theft.
• Differentiating access permissions for different users.
The database system is divided into three components:
Query Processor, Storage Manager, and Disk Storage.
These are explained as following below.
33. 1. Query Processor :
•
It interprets the requests (queries) received from end user via an application program into
instructions. It also executes the user request which is received from the DML compiler.
Query Processor contains the following components –
• DML Compiler –
It processes the DML statements into low level instruction (machine language), so that they
can be executed.
• DDL Interpreter –
It processes the DDL statements into a set of table containing meta data (data about data).
• Embedded DML Pre-compiler –
It processes DML statements embedded in an application program into procedural calls.
• Query Optimizer –
It executes the instruction generated by DML Compiler.
34. 2. Storage Manager :
• Storage Manager is a program that provides an interface between the data
stored in the database and the queries received.
• It is also known as Database Control System.
• It maintains the consistency and integrity of the database by applying the
constraints and executes the DCL statements.
• It is responsible for updating, storing, deleting, and retrieving data in the
database.
It contains the following components –
• Authorization Manager –
It ensures role-based access control, i.e,. checks whether the particular person is
privileged to perform the requested operation or not.
• Integrity Manager –
It checks the integrity constraints when the database is modified.
35. 2. Storage Manager :
• Transaction Manager –
It controls concurrent access by performing the operations
in a scheduled way that it receives the transaction. Thus, it
ensures that the database remains in the consistent state
before and after the execution of a transaction.
• File Manager –
It manages the file space and the data structure used to
represent information in the database.
• Buffer Manager –
It is responsible for cache memory and the transfer of data
between the secondary storage and main memory.
36. 3. Disk Storage :
•
It contains the following components –
• Data Files –
It stores the data.
• Data Dictionary –
It contains the information about the structure of any database object. It
is the repository of information that governs the metadata.
• Indices –
It provides faster retrieval of data item.
•
37. Extended Entity-Relationship (EE-R) Model
• EER is a high-level data model that incorporates the extensions to
the original ER model. Enhanced ERD are high level models that
represent the requirements and complexities of complex database.
• In addition to ER model concepts EE-R includes −
• Subclasses and Super classes.
• Specialization and Generalization.
• Category or union type.
• Aggregation.
• These concepts are used to create EE-R diagrams.
• Subclasses and Super class
• Super class is an entity that can be divided into further subtype.
38. Extended Entity-Relationship (EE-R) Model
Super class shape has sub groups: Triangle, Square and Circle.
Sub classes are the group of entities with some unique attributes.Sub class
inherits the properties and attributes from super class.