02-Database Environment
02-Database Environment
02-Database Environment
1 www.pktutorials.com
Evolution of Database Systems
2 www.pktutorials.com
Components of Database Environment
▪ Repository
▪ Database
▪ DBMS
▪ CASE Tools
▪ User Interface
▪ Application Programs
▪ DBA
▪ System Developers
▪ End Users
3 www.pktutorials.com
Components of Database Environment
CASE Tool
• Computer Aided Software Engineering Tool
• Automatic tools used to design databases and application
programs.
Repository
• Centralized storehouse of metadata
• Centralized knowledge base for all data definitions,
relationships, formats, and other system component.
4 www.pktutorials.com
Components of Database Environment
DBMS
• Database Management System
• A database management is a software that is used to create,
maintain, and provide controlled access to user databases.
Database
• A collection of similar records with relationships between the
records.
5 www.pktutorials.com
Components of Database Environment
Application Programs
• Computer programs that are used to create and maintain the
database.
• Computer program provide information to the users.
User Interface
• Language and menus by which user interact with the various
system components.
6 www.pktutorials.com
Components of Database Environment
System developers
• Person who develops the database or new application programs.
7 www.pktutorials.com
Components of Database Environment
End Users
• The person who use the database for their need in an
organization.
• The person who add, delete, modify data in database.
8 www.pktutorials.com
Database Development Process:
9 www.pktutorials.com
Database Development Process:
Top-Down Development
10 www.pktutorials.com
Database Development Process:
Bottom-Up Development
11 www.pktutorials.com
Database Development Life Cycle (DDLC)
▪ Planning
▪ Analysis
▪ Conceptual Design
▪ Logical Design
▪ Physical Design
▪ Implementation and Data Loading
▪ Testing
▪ Deployment and Maintenance.
12 www.pktutorials.com
Database Development Life Cycle (DDLC)
Planning:
▪ Organization decision whether there is a need for a database,
▪ Determines the goals of the database,
▪ Estimates the cost,
▪ Objectives should be clearly defined for the database.
13 www.pktutorials.com
Database Development Life Cycle (DDLC)
Analysis:
▪ Requirement gathering and specification
▪ Identify the tasks & the use cases
▪ Objectives should be clearly defined for the database.
▪ Coordination with stakeholders (end-users, product owners etc.)
▪ Preparation of Software Requirement Specification (SRS).
14 www.pktutorials.com
Database Development Life Cycle (DDLC)
Conceptual Design:
▪ The goal is to visualize the entities, fields and connections
▪ Requirement specification to conceptual model
▪ Data is categorized into graphical representation of the entities
▪ Relationship and dependencies are specified
15 www.pktutorials.com
Database Development Life Cycle (DDLC)
Logical Design:
▪ Defining entities with detail of all attributes
▪ Specifying primary/foreign keys
▪ Normalization of the database
▪ Applying Integrity constraints
16 www.pktutorials.com
Database Development Life Cycle (DDLC)
Physical Design:
▪ Last step of the design
▪ Converting entities into tables
▪ Naming assigning data types etc.
▪ Validation and optimization of the design
▪ Denormalization if needed
17 www.pktutorials.com
Database Development Life Cycle (DDLC)
18 www.pktutorials.com
Database Development Life Cycle (DDLC)
Testing:
▪ Make sure that everything is working as expected
▪ Fixing anomalies in the system
▪ Testing can be done automatically or manually
▪ Test in multiple environments for better quality assurance
19 www.pktutorials.com
Database Development Life Cycle (DDLC)
20 www.pktutorials.com
Database Languages:
Read, Update, Manipulate, and Store data in a database using
Database Languages.
The following are the database languages:
➢ Data Definition Language (DDL)
➢ Data Manipulation Language (DML)
➢ Data Control Language (DCL)
➢ Transaction Control Language (TCL)
➢ Data Query Language (DQL)
21 www.pktutorials.com
SQL (Structural Query Language)
22 www.pktutorials.com
Database Languages:
Data Definition Language (DDL)
Used to specify the database schema.
It allows the user to describe and name the entities, attributes, and
relationships required for the application, together with any associated
integrity and security constraints.
The main purpose of DDL is to store the information of metadata like the
number of schemas and tables, their names, indexes, constraints, columns in
each table, etc.
23 www.pktutorials.com
Data Definition Language (DDL):
The result of the compilation of the DDL statements is a set of tables stored in
special files collectively called the system catalog.
The system catalog integrates the metadata, that is data that describes objects
in the database and makes it easier for those objects to be accessed or
manipulated.
This language is used by the conceptual schema to access and retrieve the
records from/to the database respectively, where these records describe entities,
relationship, and attributes.
24 www.pktutorials.com
Data Definition Language (DDL):
There are following Data Definition Languages (DDL) Commands:
➢ CREATE : used to create objects in the database
➢ ALTER : used to alters the structure of the database
➢ DROP : used to delete objects from the database
➢ TRUNCATE : used to remove all records from a table, including all spaces
allocated for the records are removed
➢ COMMENT : used to add comments to the data dictionary
➢ RENAME : used to rename an object
25 www.pktutorials.com
Data Manipulation Language (DML):
A language that provides a set of operations to support the basic data manipulation
operations on the data held in the database.
DML statements are used to manage data within schema objects.
DML is mainly of two types:
Procedural DML: It allows the user to tell the system what data is
needed and exactly how to retrieve the data. Its function-oriented.
Declarative DML or Non-procedural DML: It allows the user to state what data is
needed rather than how it is to be retrieved. Its Command based.
26 www.pktutorials.com
Data Manipulation Language (DML):
27 www.pktutorials.com
Data Control Language (DCL):
Data Control Language
DCL statements control access to data and the database using statements such
as GRANT and REVOKE.
A privilege can be granted to a User with the help of GRANT statement.
The privileges assigned can be SELECT, ALTER, DELETE, EXECUTE, INSERT, INDEX
etc.
In addition to granting of privileges, you can also revoke (taken back) it by using
REVOKE command.
28 www.pktutorials.com
Data Control Language (DCL):
29 www.pktutorials.com
Transaction Control Language (TCL):
Transaction Control Languages
TCL is a language which manages transactions within the database. It is used to
execute the changes made by the DML statements.
There are following Transaction Control Language (TCL) Commands:
➢Commit : This command is used to save the transactions in the database.
➢Rollback : This command is used to restore the database to that state which was last
committed.
30 www.pktutorials.com
Data Models:
▪ A model is a representation of ‘real world’ objects and events, and their associations.
▪ Data Model
▪ Integrated collection of concepts for describing data, relationships between data,
and constraints on the data in an organization.
▪ Graphical systems used to capture the nature and relationships among data.
▪ Data model is a set of tools that are used to develop a database design.
31 www.pktutorials.com
Data Models:
32 www.pktutorials.com
Components / Parts of Data Models:
▪ Structural Part: It consists of set of rules. These rules specify how database
can be developed.
▪ Manipulative Part: It defines the types of operations that can be performed
on data. [updating or retrieving data from database and changing structure of database]
▪ Set of Integrity Rules: It ensures the accuracy of data in the database.
33 www.pktutorials.com
Importance of Data Models:
▪ It is used as a communication tool for database designer, application programmer
and end user to interact with one another.
▪ Good data model enables the users to understand the organization for which
database design is developed.
▪ Good data model is necessary for designing a good database.
▪ Any DBMS is based on a specific data model.
▪ No DBMS can exist without any data model.
▪ It is very important to know the structures, manipulation languages, and integrity
facilities implemented by DBMS. It enables the users to understand the facilities
and functionalities provided by the DBMS.
34 www.pktutorials.com
Types / Categories of Data Models:
35 www.pktutorials.com
Object-Based Data Models:
36 www.pktutorials.com
Object-Based Data Models:
▪ Entity–Relationship Model
Forms the basis for the database design methodology
▪ Semantic Model
▪ Functional Model
▪ Object-Oriented Model
37 www.pktutorials.com
Record-Based Data Models:
▪ In this model, database consists of a number of fixed format records and each
record has a fixed number of fields.
▪ They are used to develop and specify the logical structure and provide some
options for implementation of the design.
▪ There are three types of recode-based data models:
▪ Relational model
▪ Network Model
▪ Hierarchical model
38 www.pktutorials.com
Record-Based Data Models:
Relational Model
• This model is based on mathematical relations.
• Data and Relationships are represented by tables.
• Each table has a number of columns with unique names.
Note: Relation is another term used for Table.
39 www.pktutorials.com
Record-Based Data Models:
Network Model
▪ The network model is the extension of the hierarchical structure because it allows
multiple parent-child relationships.
▪ Data is represented as collection of records and relationships are represented as sets.
▪ These sets become pointers in the implementations.
▪ Records are organized as graph structures
▪ Nodes are records
▪ Sets as edges
40 www.pktutorials.com
41 www.pktutorials.com
Network Model:
42 www.pktutorials.com
Example:
The following diagram depicts a network model.
43 www.pktutorials.com
Record-Based Data Models:
Hierarchical Model
▪ Restricted type of Network Model
▪ Data is represented as collection of records and relationships are
represented as sets.
▪ It allows a node to have only one parent
▪ It is represented by a tree graph
▪ Records as nodes also called Segments
▪ Sets as Edges
44 www.pktutorials.com
Record-Based Data Models:
Hierarchical Model
▪ for example, one department can have many courses, many professors and
of-course many students.
45 www.pktutorials.com
Record-Based Data Models:
Hierarchical Model
Advantages Disadvantages
• Flexible for changing the structure • Structure should must be defined
• Insertion, deletion and is easy in advanced which is difficult
• Little skill is required to developed and task.
understand • Adding new records to database
• Accessing and updating is very fast need to redefined the whole
database
• No relationship between child
records
46 www.pktutorials.com
Physical Data Models:
47 www.pktutorials.com
THANKS
57 3/3/2024 www.pktutorials.com