0% found this document useful (0 votes)
10 views20 pages

11zon DBMS1 PDF

Uploaded by

kcanzu5
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views20 pages

11zon DBMS1 PDF

Uploaded by

kcanzu5
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 20

DBMS

Designed by: Shyam Gopal Timsina

[DATE]
[COMPANY NAME]
[Company address]
DATA
Data is the collection of raw facts and figures. Actually, data is unprocessed,
that is why data is called collection of raw facts and figures. We collect data
from different resources. After collection, data is entered into computer for
processing. Data may be collection of words, numbers, pictures, or sounds etc.
Examples of Data
Student Data on Admission Forms
Data of Citizens
Survey Data
Students Examination data
.
INFORMATION
Processed data is called information. When raw facts and figures are
processed and arranged in some proper order then they become information.
Information has proper meanings. Information is useful in decision-making.
Actually we process data to convert it into information. Here are some clear
easy to understand differences between data and information.
Examples of Information:
Student Address Labels
Census Report (Total population, Literacy Rate, Male / Female ratio
etc.)
Survey Reports and Results
Result Cards of Individual Students, Result sheets of a particular
Class
Merit List
What is a Database?

A database is a collection of related data which represents some aspect of the


real world. A database system is designed to be built and populated with data
for a certain task.

What is DBMS?
Database Management System is software for storing, editing, processing,
managing and retrieving users' data by considering appropriate security
measures. It allows users to create their own databases as per their requirement.

It consists of a group of programs which manipulate the database and provide


an interface between the databases. It includes the user of the database and
other application programs.

The DBMS accepts the request for data from an application and instructs the
operating system to provide the specific data. In large systems, a DBMS helps
users and other third-party software to store and retrieve data.

Characteristics of Database Management System

Provides security and removes redundancy

Self-describing nature of a database system

Insulation between programs and data abstraction

Support of multiple views of the data

Sharing of data and multiuser transaction processing

DBMS allows entities and relations among them to form tables.

It follows the ACID concept (Atomicity, Consistency, Isolation, and


Durability).

DBMS supports multi-user environment that allows users to access


and manipulate data in parallel.

DBMS vs. Flat File


DBMS Flat File Management
System
Multi-user access It does not support
multi-user access
Design to fulfill the need It is only limited to
for small and large smaller DBMS system.
businesses
Remove redundancy and Redundancy and
Integrity Integrity issues
Expensive. But in the It's cheaper
long term Total Cost of
Ownership is cheap
Easy to implement No support for
complicated transactions complicated transactions

Popular DBMS Software

MySQL

Microsoft Access

Oracle

dBASE

FoxPro

Microsoft SQL Server etc.

Types of DBMS

Four Types of DBMS systems are:

Hierarchical

Network
Relational

Object-Oriented DBMS

Hierarchical DBMS

In a Hierarchical database model data is organized in a tree-like structure. Data


is Stored Hierarchically (top down or bottom up) format. Data is represented
using a parent-child relationship. In Hierarchical DBMS parent may have many
children, but children have only one parent.

Network Model

The network database model allows each child to have multiple parents. It
helps you to address the need to model more complex relationships like as the
orders/parts many-to-many relationship. In this model, entities are organized in
a graph which can be accessed through several paths.
Relational model

Relational DBMS is the most widely used DBMS model because it is one of
the easiest. This model is based on normalizing data in the rows and columns
of the tables. Relational model stored in fixed structures and manipulated using
SQL.
Object-Oriented Model

In Object-oriented Model data stored in the form of objects. The structure


which is called classes which display data within it. It defines a database as a
collection of objects which stores both data member’s values and operations.

Advantages of DBMS

DBMS offers a variety of techniques to store & retrieve data

DBMS serves as an efficient handler to balance the needs of multiple


applications using the same data

Uniform administration procedures for data

Application programmers never exposed to details of data


representation and storage.

A DBMS uses various powerful functions to store and retrieve data


efficiently.

Offers Data Integrity and Security

The DBMS implies integrity constraints to get a high level of


protection against prohibited access to data.
A DBMS schedules concurrent access to the data in such a manner
that only one user can access the same data at a time

Reduced Application Development Time

Objects of MS-ACCESS

1. Tables
Tables are responsible for storing information within the database. Tables are
the building block of database. They contain columns and rows. Each column
has a name at the top, and each row has a number.
2. Queries
Queries are requests for information. Queries can sort, calculate, filter, update
data and more based on the results you are looking for.
3. Forms
Forms are the objects of DBMS which are used to enter the records in DBMS.
4. Reports
The final output of MS-Access is Report. It is the formatted output.
Data Types in DBMS
Data Types
The data type must be consistent with the data to be stored in the field. The
“text” type is the most commonly used data type, including numbers that will
not be added like social security or street address numbers. Here is a partial list
of Access data types:

Data Type Description

Short text Alphanumeric characters


Long text Alphanumeric characters

Number Numeric values

Large Number Numeric values

Date/Time Date and time data

Currency Monetary data

AutoNumber Automatic number increments

Yes/No Logical values: Yes/No, True/False,


etc.

OLE Objects Pictures, graphs, sound, video

Hyperlink Line to an Internet resource

Attachment External files

Calculated Stores calculations based on other


fields

Lookup Wizard Displays data from another table

Normalization

Database normalization is a process used to organize a relational database


efficiently.
Its goal is to reduce data redundancy and dependency by organizing the data
into separate, related tables.
There are different levels of normalization, usually referred to as normal forms,
each with its own set of rules.
Types of Normal Forms:

Normalization works through a series of stages called Normal forms. The


normal forms apply to individual relations. The relation is said to be in
particular normal form if it satisfies constraints.

First Normal Form (1NF)

A relation will be 1NF if it contains an atomic value.


It states that an attribute of a table cannot hold multiple values. It must hold
only single-valued attribute.
First normal form disallows the multi-valued attribute, composite attribute, and
their combinations.
Second Normal Form (2NF)

In the 2NF, relational must be in 1NF.


In the second normal form, all non-key attributes are fully functional dependent
on the primary key
Example: Let's assume, a school can store the data of teachers and the subjects
they teach. In a school, a teacher can teach more than one subject.

TEACHER_ID SUBJECT TEACHER_AGE

25 Chemistry 30

25 Biology 30

47 English 35

83 Math 38

83 Computer 38

TEACHER_ID TEACHER_AGE
25 30

47 35

83 38

TEACHER_ID SUBJECT

25 Chemistry

25 Biology

47 English

83 Math

83 Computer

Third Normal Form (3NF)

A relation will be in 3NF if it is in 2NF and not contain any transitive partial
dependency.
3NF is used to reduce the data duplication. It is also used to achieve the data
integrity.
If there is no transitive dependency for non-prime attributes, then the relation
must be in third normal form.
A relation is in third normal form if it holds atleast one of the following
conditions for every non-trivial function dependency X → Y.
X is a super key.
Y is a prime attribute, i.e., each element of Y is part of some candidate key.
EMP_ID EMP_NAME EMP_ZIP EMP_STATE EMP_CITY

222 Harry 201010 UP Noida

333 Stephan 02228 US Boston

444 Lan 60007 US Chicago

555 Katharine 06389 UK Norwich

666 John 462007 MP Bhopal

EMP_ID EMP_NAME EMP_ZIP

222 Harry 201010

333 Stephan 02228

444 Lan 60007

555 Katharine 06389

666 John 462007

EMP_ZIP EMP_STATE EMP_CITY

201010 UP Noida

02228 US Boston

60007 US Chicago

06389 UK Norwich
462007 MP Bhopal

Boyce Codd normal form (BCNF)

BCNF is the advance version of 3NF. It is stricter than 3NF.


A table is in BCNF if every functional dependency X → Y, X is the super key
of the table.
For BCNF, the table should be in 3NF, and for every FD, LHS is super key.
Example: Let's assume there is a company where employees work in more than
one department.
EMP_ID EMP_COUNTRYEMP_DEPT DEPT_TYPE EMP_DEPT_NO

264 India Designing D394 283

264 India Testing D394 300

364 UK Stores D283 232

364 UK Developing D283 549

EMP_ID EMP_COUNTRY

264 India

264 India

EMP_DEPT DEPT_TYPE EMP_DEPT_NO


Designing D394 283

Testing D394 300

Stores D283 232

Developing D283 549

EMP_ID EMP_DEPT

D394 283

D394 300

D283 232

D283 549

Fourth normal form (4NF)

A relation will be in 4NF if it is in Boyce Codd normal form and has no


multi-valued dependency.
For a dependency A → B, if for a single value of A, multiple values of B
exists, then the relation will be a multi-valued dependency.

STU_ID COURSE HOBBY


21 Computer Dancing

21 Math Singing

34 Chemistry Dancing

74 Biology Cricket

59 Physics Hockey

STU_ID COURSE

21 Computer

21 Math

34 Chemistry

74 Biology

59 Physics

STU_ID HOBBY

21 Dancing

21 Singing

34 Dancing

74 Cricket

59 Hockey
Fifth normal form (5NF)

A relation is in 5NF if it is in 4NF and not contains any join dependency and
joining should be lossless.
5NF is satisfied when all the tables are broken into as many tables as possible
in order to avoid redundancy.
5NF is also known as Project-join normal form (PJ/NF).
SUBJECT LECTURER SEMESTER

Computer Anshika Semester 1

Computer John Semester 1

Math John Semester 1

Math Akash Semester 2

Chemistry Praveen Semester 1

SEMESTER SUBJECT

Semester 1 Computer

Semester 1 Math

Semester 1 Chemistry

Semester 2 Math
SUBJECT LECTURER

Computer Anshika

Computer John

Math John

Math Akash

Chemistry Praveen

SEMSTER LECTURER

Semester 1 Anshika

Semester 1 John

Semester 1 John

Semester 2 Akash

Semester 1 Praveen

Structured Query Language (SQL)

Familiarity with Structured Query Language (SQL) statements is essential for


manipulating database objects and retrieving information from a database. SQL
is a standard language used to interact with relational database management
systems (RDBMS) like MySQL, PostgreSQL, SQL Server, Oracle, and SQLite.
Here's an overview of common SQL statements for manipulating database
objects and retrieving data:

Data Definition Language (DDL) Statements:


CREATE: Used to create database objects like tables, indexes, views, or stored
procedures.

CREATE TABLE TableName (


Column1 DataType,
Column2 DataType,
...
);

ALTER: Modifies the structure of existing database objects.


ALTER TABLE TableName
ADD ColumnName DataType;

DROP: Deletes existing database objects.


DROP TABLE TableName;

Data Manipulation Language (DML) Statements:


SELECT: Retrieves data from one or more tables.
SELECT Column1, Column2
FROM TableName
WHERE Condition;

INSERT: Adds new records to a table.


INSERT INTO TableName (Column1, Column2)
VALUES (Value1, Value2);

UPDATE: Modifies existing records in a table.


UPDATE TableName
SET Column1 = Value1
WHERE Condition;
DELETE: Removes records from a table.
DELETE FROM TableName
WHERE Condition;

Data Control Language (DCL) Statements:


GRANT: Provides specific privileges to users or roles.
GRANT SELECT ON TableName TO UserName;

REVOKE: Removes previously granted privileges from users or roles.


REVOKE SELECT ON TableName FROM UserName;

Data Transaction Control (DTC) Statements:


COMMIT: Saves all changes made during the current transaction.
COMMIT;
ROLLBACK: Reverts all changes made during the current transaction.
ROLLBACK;

You might also like