02-Database Environment

Download as pdf or txt
Download as pdf or txt
You are on page 1of 48

Database System

Data Base Environment

Dr. Maqbool Khan

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.

What is difference between Repository and database?

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

Data and Database Administrator


• DBA is a person who is responsible for the overall management
of data resources in an organization, including maintaining data
definitions and standards.
• Database Administrator is a person who is responsible for
physical database design and technical issue.

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:

▪ Development of complete database application is lengthy and


complicated process.

▪ Different strategies can be used to develop database applications


which are as follows:
▪ Top-Down Strategies
▪ Bottom-Up Strategies

9 www.pktutorials.com
Database Development Process:

Top-Down Development

▪ Starts with general issues and moves to specific issues.

▪ First of all, it is important to find out general goals of organization


and the means by which these goals can be achieved.

▪ User moves to detailed and specific issues using this models.

10 www.pktutorials.com
Database Development Process:

Bottom-Up Development

▪ Starts with specific issues and moves to general issues.

▪ User begins by identifying specific system to be developed.

▪ Requirements are found by studying the existing system and by


interviewing different users.

11 www.pktutorials.com
Database Development Life Cycle (DDLC)

It is a process used in development to assist the creation of a database.

▪ 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)

Implementation and Data Loading:


▪ Installation of DBMS
▪ Create the data base
▪ Load the existing data if any
▪ Integrate the database with other applications

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)

Deployment and Maintenance:


▪ Deploying the to the production environment
▪ Fixing bugs raised during usage of th product
▪ Make changes / update the system
▪ Need to revisit the steps again and again

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):

DML Commands are:


➢Select: This command is used to retrieve or access the data from the database table.
➢Insert: This command is used to insert the records into the table.
➢Update: This command is used to change/update the existing data in a table.
➢Delete: This command is used to delete one or all the existing records from the table.

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):

DCL Privileges are of two types:


➢ System : creating a session, table, etc. are all types of system privilege.
➢ Object : any command or query to work on tables comes under object
privilege.

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:

▪ Data model is used to develop a database design.


▪ Data models define how data is connected to each other and how they are
processed and stored inside the system.
▪ Data models define how the logical structure of a database is modeled.
▪ Data Models are fundamental entities to introduce abstraction in a DBMS.
▪ The purpose of a data model is to represent data and to make the data
understandable. If it does this, then it can be easily used to design a database.

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:

Different types of data models are as follows:

▪ Object-Based Data Models They are used to describe data at


conceptual and external levels.

▪ Record-Based Data Models

▪ Physical Data Models It is used to describe data at internal level.

35 www.pktutorials.com
Object-Based Data Models:

Object based models use concepts like entities, attributes and


relationships.

▪ Entity is a person, place, thing or event for which data is


collected and maintained in the database.

▪ Attribute is the property / characteristics of an entity.

▪ Relationship is an association between two or more entities.

36 www.pktutorials.com
Object-Based Data Models:

Some of the more common types of object-based data model are:

▪ 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:

▪ Parent Record is called Owner


▪ Child Record is called Member
▪ Support 1-1, 1-M & M-M relationship
▪ Support recursive relationship
Disadvantages
▪ Structure should must be defined in advanced which is difficult task.
▪ It is complex to understand and develop.

42 www.pktutorials.com
Example:
The following diagram depicts a network model.

▪ An agent represents several clients and manages several entertainers.


▪ Each client schedules any number of engagements and makes payments to the agent for his or her services.
▪ Each entertainer performs several engagements and may play a variety of musical styles.

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:

▪ Describe how data is stored in the computer, representing information such as


record structures, record orderings, and access paths.
▪ There are limited physical data models as compared to logical data models.
▪ The most common physical data models are unifying model and frame memory.

47 www.pktutorials.com
THANKS

57 3/3/2024 www.pktutorials.com

You might also like