Module-3 Database Management System (1)
Module-3 Database Management System (1)
Module No-3
Database Management System
Introduction
Database management system is software that is used to manage the database.
Data is the key and basic element necessary for information dissemination and
decision making functions for any organization.
For an organization this information aids the top level management to make strategic
decisions. (are the decisions that are concerned with whole environment in which the
firm operates)
The middle level management will be able to make tactical decisions (describe action
or plan which is intended to help someone achieve what they want in particular
situation) and lower level management will be able to take operational decisions.
Therefore it is necessary to acquire, handle and interpret data in an efficient manner so
that decision making process becomes easy.
The systematic organization of data for easy retrieval and manipulation needs a
management system called Database Management System.
What is Data?
Data is a collection of raw, unorganized facts and details like text, observations,
figures, symbols and description of things etc.
What is Information?
Information is the processed, organized and structured data. It provides context for
data and enables decision making.
What is Database?
• A database is an organized collection of structured information, or data typically
stored electronically in a computer system.
• Example: A company database may include tables for products, employees, and
financial records.
Why Database
• A database is a collection of data, usually stored in electronic form.
• A database is typically designed so that it is easy to store and access information.
• The database stores all the pertinent details about the company such as employee
records, transactional records, salary details etc.
• A database stores and manages a large amount of data on a daily basis. This would not
be possible using any other tool such as a spread sheet as they would simply not work.
Data Models
Data Model gives us an idea that how the final system will look like after its complete
implementation.
It defines the data elements and the relationships between the data elements.
Data Models are used to show how data is stored, connected, accessed and updated in
the database management system.
They are designed to store and retrieve data.
Schema (design of database) is basic plan for building database.
“The overall structure designed before implementation, which provides an approach to
the database” is called as DATA MODEL.
Data models are also called as structure of database.
A data model is an abstract model that organizes elements of data and standardizes
how they relate to one another and to the properties of real-world entities. ... The
term data model can refer to two distinct but closely related concepts.
1. Hierarchical Model
2. Network Model
3. Relational Model
4. Object-oriented Model
1. Hierarchical Model
The hierarchical database model organizes data into a tree-like structure, with
a single root, to which all the other data is linked.
The hierarchy starts from the Root data, and expands like a tree,
adding child nodes to the parent nodes.
In this model, a child node will only have a single parent node.
This model efficiently describes many real-world relationships like the index of a
book, etc.
IBM's Information Management System (IMS) is based on this model.
Data is organized into a tree-like structure with a one-to-many
relationship between two different types of data, for example,
one department can have many courses, many teachers, and of course
many students(like shown in the diagram below).
2. Network Model
The Network Model is an extension of the Hierarchical model.
In this model, data is organized more like a graph, and allowed to have more than
one parent node.
The network database model, data is more related as more relationships are
established in this database model.
Also, as the data is more related, hence accessing the data is also easier and fast.
This database model uses many-to-many data relationships.
Integrated Data Store (IDS) is based on this database model.
This was the most widely used database model before Relational Model was
introduced.
The implementation of the Network model is complex, and it's very difficult to
maintain it.
The Network model is difficult to modify also.
You may want to explore this if you are developing some social networking
applications, although the Graph Database model is new and is far better than the
Network Database model.
3. Relational Model
In this model, data is organized in two-dimensional tables and the relationship is
maintained by storing a common field.
This model was introduced by E.F Codd in 1970, and since then it has been the
most widely used database model.
The basic structure of data in the relational model is tables. All the information
related to a particular type is stored in rows of that table.
Hence, tables are also known as relations in the relational model.
You can design tables, normalize them to reduce data redundancy,
and use Structured Query language or SQL to access data from the tables.
Some of the most popular databases are based on this database model. For
example, Oracle, MySQL, etc.
Object-oriented Model
In this model, data is stored in the form of objects.
The behavior of the object-oriented database model is just like object-oriented
programming.
A very popular example of an Object Database management system
or ODBMS is MongoDB which is also a NoSQL database.
This database model is not mature enough as compared to the relational database
model.
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.
DDL is short name of Data Definition Language, which deals with database schemas
and descriptions, of how the data should reside in the database.
CREATE: To create a database and its objects like (table, index, views, store
procedure, function)
ALTER: Alters the structure of the existing database
DROP:Delete objects from the database
TRUNCATE:Remove all records from a table, including all spaces allocated for the
records are removed
COMMENT: Add comments to the data dictionary
RENAME:Rename an object
DML is short name of Data Manipulation Language which deals with data manipulation
and includes most common SQL statements such SELECT, INSERT, UPDATE,
DELETE, etc., and it is used to store, modify, retrieve, delete and update data in a
database.
SELECT-retrieve data from a database
INSERT-insert data into a table
UPDATE-updates existing data within a table
DELETE-Delete all records from a database table
MERGE-UPSERT operation (insert or update)
CALL-call a PL/SQL or Java sub program
EXPLAIN PLAN-interpretation of the data access path
LOCKTABLE-concurrency Control
DCL is short name of Data Control Language which includes commands such as
GRANT and mostly concerned with rights, permissions and other controls of the database
system.
GRANT-allow users access privileges to the database
REVOKE-with draw users access privileges given by using the GRANT command
TCL is short name of Transaction Control Language which deals with a transaction
within a database.
COMMIT-commits a Transaction
ROLLBACK-rollback a transaction in case of any error occurs
SAVEPOINT-to roll back the transaction making points within groups
SET TRANSACTION-specify characteristics of the transaction
Database Users
• The person who works on or uses database is called as user.
2) Database Designers:
• He is the person who designs (analyse and write) the database application software.
• The application programs are used by both the end user and DBA.
3) End user:
• The person who uses the DBMS for performing day-to-day activities.
• End user can only access the database.
Responsibilities of DBA
1) Software installation and Maintenance: DBA installs the database software and
configures it for use.
2) Database Backup and Recovery: In the case of a server failure or other form of data
loss, the DBA will use existing backups to restore lost information to the system
3) Design of schema definition: Design how and what data is stored in DBMS.
4) Defining storage structure: He has to create appropriate storage structure.
5) Schema and physical organization modification: He has to write the set of
definition that generate modifications to internal system tables.
7) Authentication: DBA Controls who has access and what type of access they are
allowed.
9) Data availability and recovery failure: DBA must take step to ensure that if system
fails, user can continue to access the uncorrupted data as much as possible.
• DBMS allows the user to create their databases as per their requirement.
• It provides security to the database.
• Examples: My-SQL, Microsoft Access, Oracle etc.
Tasks of DBMS
• Adding (storing): entering new data.
• Accessing data: stored is used to access.
• Deleting: removing unwanted details.
• Changing: updating the details.
TABLES:
It is a two-dimensional array containing rows and columns.
RECORDS:
Each row is called as records. It contains data related to an entity (student).
FIELDS:
Each column is called as fields. It contains the data related to a single attribute of
entity.
Difference between the File Management System and Database Management System
(DBMS)
Advantages of DBMS
The purpose of DBMS is to facilitate huge storage and quick retrieval of data from the
database. It provides the following advantages:
1) Controlling Redundancy: In traditional file processing, every user will maintenance its
own file for data processing applications
2) Restricting Unauthorized Access: When multiple users share a large database, it is
likely that most users will not be authorized to access all information in the database.
3) Providing backup & recovery: A DBMS must provide facilities for recovering from
hardware or software failure the backup & recovery subsystem of the DBMS is
responsible for recovery.
Disadvantages of DBMS:
Application of DBMS
2. Airlines:
For reservations and schedule information, Airlines were among the first to use
databases in a geographically distributed manner terminated situated around the world
accessed the central database system through phone lines and other data networks.
3. Universities:
For student information,course registration, course registrations, and grades.
5. Telecommunication:
For keeping records of calls made, generating monthly bills, maintaining balances
prepaid calling cards, and storing information about the communication networks.
6. Finance:
For storing information about holdings, sales and purchases of financial instruments
such as stock and bonds.
7. Sales:
For customer, product and purchases information.
8. Manufacturing:
For management of supply chain and for tracking production of items in factories,
inventories of items in warehouses/stores, and orders for items.
9. Human resources:
For information about employees, salaries, payroll taxes and benefits, and for
generation of paychecks.
Data Warehouse
1) Subject-Oriented
A data warehouse is subject-oriented since it provides topic-wise information rather
than the overall processes of a business. Such subjects may be sales, promotion,
inventory, etc. For example, if you want to analyze your company’s sales data, you
need to build a data warehouse that concentrates on sales. Such a warehouse would
provide valuable information like ‘who was your best customer last year?’ or ‘who is
likely to be your best customer in the coming year?’
2) Integrated
A data warehouse is developed by integrating data from varied sources into a
consistent format. The data must be stored in the warehouse in a consistent and
universally acceptable manner in terms of naming, format, and coding. This facilitates
effective data analysis.
3) Non-Volatile
Data once entered into a data warehouse must remain unchanged. All data is read-only.
Previous data is not erased when current data is entered. This helps you to analyze
what has happened and when.
4) Time-Variant
The data stored in a data warehouse is documented with an element of time, either
explicitly or implicitly. An example of time variance in Data Warehouse is exhibited in
the Primary Key, which must have an element of time like the day, week, or month.
5) Workload
Data warehouses are designed to accommodate ad hoc queries. You might not know the
workload of your data warehouse in advance, so a data warehouse should be optimized to
perform well for a wide variety of possible query operations.
D.M.S. Mandal’s College of Business Administration, Belgaum. Page 17
INFORMATION TECHNOLOGY FOR BUSINESS
Semester: Vth (B.B.A.) Prof. Miss. Poonam M. Patil
6) Data modifications
A data warehouse is update on a regular basis by the ETL (Extra, transform and load)
process (run nightly or weekly) using bulk data modification techniques. The end users of
data warehouse do not directly update the data warehouse.
7) Typical operations
A typical data warehouse query scans thousands or millions of rows.
For example: “Find the total sales for all customers last month”.
8) Historical data
Data warehouses usually store many months or years of data. This is to support historical
analysis.
Data Mining
Example:
Companies use data mining software to learn more about their customers. It can help
them to develop more effective marketing strategies, increase sales, and decrease costs.
MS ACCESS
Introduction:
MS Access is a Database Management system which was launched by Microsoft.
It is a part of the Microsoft Office suite and stores data in its own format.
D.M.S. Mandal’s College of Business Administration, Belgaum. Page 18
INFORMATION TECHNOLOGY FOR BUSINESS
Semester: Vth (B.B.A.) Prof. Miss. Poonam M. Patil
Microsoft Access enables business and enterprise users to manage data and analyze
vast amounts of information efficiently.
The program provides a blend of database functionality and programming capabilities
for creating easy-to-navigate forms.
MS Access Features
Some of the key features of MS Access are:
1) User-Friendly Interface
MS Access provides a user-friendly interface that allows you to create and manage
databases using a drag-and-drop interface. This makes it easy to create tables, forms,
queries, and reports without requiring extensive technical knowledge.
2) Customizable Templates
MS Access includes a range of customizable templates that you can use as a starting
point for your database. This includes templates for inventory management, customer
management, project tracking, and more.
5) Customizable Forms
MS Access allows you to create custom forms that provide a user-friendly interface
for entering and viewing data in your tables. This includes the ability to add controls,
such as text boxes, drop-down lists, and buttons.
7) Customizable Code
MS Access allows you to write custom code using the Visual Basic for Applications
(VBA) programming language. This allows you to create custom functions and
automate complex tasks.
8) Collaboration Features
MS Access allows you to share your database with other users and control their access
to the data. This includes the ability to assign specific permissions to individual users
or groups.
Title Bar:
This tells you which application package is currently running and which slide is currently
open.
Menu Bar:
It consists of different types of menus Home, Create, External Data& so on……
Standard Toolbar:
Toolbar contain buttons, drop-down menus and other controls that help you quickly
alter the appearance and arrangement of documents by executing a variety of Access
commands.
Toolbar are very helpful and convenient in quickly executing commands without
having to go through menus.
The standard toolbar contains icons for basic functions like opening new files, printing
files, sending and receiving e-mails, address book etc.
Main Switchboard:
When you open an Access database, you often see a screen labelled main Switchboard
that provides buttons to enable you to use the database easily.
Tables:
A table is a collection of data about a specific topic, such as
(Registration No, First Name, Last Name, DOB, Address, City, State, Pin code No, E-
Mail Address)
Create Database
Generate Table
Generate Queries using (Select, Update, Delete & Append)
Form Creation Using Wizard
Report Creation using Wizard
Student Database:
Student List
Registration First Last Pin
DOB Address City State E-Mail
No Name Name code No
amit@gmail.
B2014001 Amit Desai 03-12-2021 Vadgaon Kolhapur Maharastra 590005 com
vivek@gmail
B2014002 Vivek Patil 28-06-2014 Sulga Belgaum Karnataka 590005
.com
[email protected]
B2014003 Raju Pawale 12-04-2018 Andheri Mumbai Maharastra 100025 om
[email protected]
B2014004 Ram Kale 14-03-2019 SitaBardi Nagpur Maharastra 456821 om
roopa@gmail
B2014005 Roopa Jadhav 08-12-2021 Vakad Pune Maharastra 457896 .com
deepa@gmail
B2014006 Deepa Patel 21-01-2021 Angol Belgaum Karnataka 590003 .com
[email protected]
B2014007 Rani Dalvi 05-11-1992 Kapoli Khanapur Karnataka 896479 om
parvati@gma
B2014008 Parvati Sawant 10-09-1988 Hadpsar Pune Maharastra 123456 il.com
laxmi@gmail
B2014009 Laxmi Rane 08-04-1994 Thane Mumbai Maharastra 987456 .com
saraswati@g
Sarasw
B2014010 Bhosale 06-02-1991 Rajarampuri Kolhapur Maharastra 123546 mail.com
ati
Steps:
Database Creation:
1) Open MS Access.
2) Click on Blank Database
3) Give File Name>Choose path where you want to save Access File>click on Create.
4) Click on view button from ribbon
5) Select Design view option >click on Save >Save As popup box will open >give table
name > click on OK button.
6) Field Name, Data type & Description table will open.
7) Insert Field Names and Data Types as given below.
8) Click on Save.
D.M.S. Mandal’s College of Business Administration, Belgaum. Page 24
INFORMATION TECHNOLOGY FOR BUSINESS
Semester: Vth (B.B.A.) Prof. Miss. Poonam M. Patil
Generate Table:
9) Click on View button from ribbon > Select Datasheet View option from list >Field
Names displayed in table format.
10) Insert data into the Table.
Student List
Pin
Registration First Last E-
DOB Address City State code
No Name Name Mail
No
amit@
03-12-
B2014001 Amit Desai Vadgaon Kolhapur Maharastra 590005 gmail.c
2021
om
vivek
28-06-
B2014002 Vivek Patil Sulga Belgaum Karnataka 590005 @gmai
2014
l.com
Primary Key:A primary key, also called a primary keyword, is a key in a relational
database that is unique for each record. It is a unique identifier.
For Example: A driver license number, telephone number (including area code), or
vehicle identification number (VIN). A relational database must always have one and
only one primary key.
11) Here choose Registration No field as a Primary key because each student has a
different Registration Number. It is a unique number for each student.
12) Click on save button.
SELECT:
SELECT query is used to retrieve data from a table. It is the most used SQL query. We
can retrieve complete table data, or partial by specifying conditions using the WHERE
clause.
Query:
SELECT *
FROM StudentList
WHERE RegistrationNo=B2014002;
UPDATE:
You use update queries in Access databases to add, change, or delete the information
in an existing record. You can think of update queries as a powerful form of the Find
and Replace dialog box. You cannot use an update query to add new records to a
database, or to delete records from a database.
Query:
UPDATE StudentList SET PincodeNo = 590004
WHERE RegistrationNo=B2014001;
DELETE:
The SQL DELETE Query is used to delete the existing records from a table. You can use
the WHERE clause with a DELETE query to delete the selected rows, otherwise all the
records would be deleted.
Query:
DELETE *
FROM StudentList
WHERE RegistrationNo=B2014016;
APPEND:
You use an append query when you need to add new records to an existing table by
using data from other sources.
OR
You can use an Append Query to retrieve data from one or more tables and add that data
to another table.
Query:
FROM Table2;
Steps:
Will display type query (code)> then click on Run button from ribbon.
26) Enter Parameter Value Dialogue box will open type value as it is given in box.
Then click on OK button.
27) Whatever Data / Record you want to see it will display on the screen.