Вы находитесь на странице: 1из 35

Amity School of Business

Amity School of Business


BBA, Semester 2
DataBase Management Systems , Module - I
Ms Bhawana Gupta

1
Amity School of Business

Data & Information


Data
Data is the name given to basic facts and entities such as names and
numbers. Good examples of data are date, weights, price, costs
employee names , tax codes, addresses etc.

Data consists of a series of facts or statements that may have been


collected, stored , processed and or manipulated but have not been
organised or placed into context.

When data is organised, its becomes Information.


Information can be processed and used to draw generalized
conclusions or knowledge. 2
Amity School of Business

What is Knowledge
Knowledge is defined variously as Expertise, and skills acquired by
a person through experience or education; the theoretical or practical
understanding of a subject.

Knowledge is of two types:


a) Facts based or information based: Knowledge gained from
fundamentals and through experiments. The knowledge like the
information contained in fundamental sciences which has been
derived from experiments, rules, regulations that are commonly
agreed by experts.
b) Heuristic Knowledge : It is knowledge of good practice
experience and good judgment like hypothesis. 3
Amity School of Business

Other Concepts
•Entity
•Entity Set
•Attribute
•Record / Tuple
•File
• Schema
• Instance
•Data Dictionary

4
Amity School of Business

5
Amity School of Business

Database
• It is defines as the collection of logically interrelated data and a
description of this data, designed to meet the information needs
of an organization.

• For example, a dictionary, a telephone directory, student record


register etc . They all store data in some particular arranged
form i.e in some order

6
Amity School of Business

Features of Database
• Shared
• Security
• Consistency
• Non-Redundancy
• Independence

7
Amity School of Business

The Traditional File Approach to Data


Management
Application Reports
Data Files Program

• The Traditional File Approach


– Separate files are created and stored for each application
program.
– Very common from the 50’s through the 80’s.

8
Amity School of Business

The Traditional File Approach


Example: Student Data in a University.

• Student address may be needed for registering, library management,


financial office, grade reporting, etc.
•Each application separately maintains its data files and programs to
manipulate those files.
• Possibly different formats for the same data (Eg: Length of name)
•Redundant updates (E.g.: to change an address).

9
Amity School of Business

Purpose of Database Systems


• In the early days, database applications were built directly on top of file systems
• Drawbacks of using file systems to store data:
– Data redundancy and inconsistency
– Poor Data manipulation capabilities
– Data Isolation
– Integrity problem
– Security problems
– Concurrent Access to data
– Program-Data dependence

Database systems offer solutions to all the above problems

10
Amity School of Business

The Database Approach


• The Database Management System Approach
– A pool of related data is shared by multiple application programs. Rather than having
separate data files, each application uses a collection of data that is either joined or related
in the database.

Reports Checking
Programs
Database
Management
Reports Savings
System
Programs All Data
DBMS
Loan
Reports
Programs 11
Amity School of Business

Database Management System


• DBMS is a collection of programs that enables you to store ,
modify and extract information from a database. There are many
different types of DBMS , ranging from small systems that run on
personal computers to huge systems that run on mainframes.

• The following are examples of database applications:


- Computerised Library Systems
- Flight Reservation Systems

A DBMS is a software package for defining and managing a database

12
Amity School of Business

Features & Abilities of DBMS


• Query Ability
• Backup & Replication
• Security
• Computation
• Change & Access Logging
• Rule Enforcement

13
Amity School of Business

Advantages of DBMS
• Reduced data redundancy
• Improved data integrity
• Conflicting requirements can be balance
• Inconsistency can be avoided.
• Monitoring database performance.
• Centralisation for multi-users
• Security

14
Amity School of Business

Disadvantages to the DBMS


• Greater impact of failure
• More difficult recovery
• Increased cost of specialized staff.
• Substantial hardware and software start-up costs .
• Extensive conversion costs in moving form a file-based
system to a database system

15
Amity School of Business

Components of DBMS
Structure Facilities Users
• Storage Manager •Data Definition • End Users
- File Manager - Naïve Users
- Buffer Manager Language - Stand Alone
• Disk Manager (DDL)
- Sophisticated
• Query Processor •Data
Manipulation - Casual
• Data Dictionary Language • Database
• Access Aids (DML) Administrators
- Indexes •Data Control • Database Designers
Language 16
Amity School of Business

Structure of a DBMS
• The “cylindrical” component contains not
only data, but also metadata, i.e. info
about the structure of data.
• If DBMS is relational, metadata includes:
– names of relations,
– names of attributes of those
relations, and
– data types for those attributes (e.g.,
integer or character string).
• A database also maintains indexes for the
data.
– Indexes are part of the stored data.
– Description of which attributes have
indexes is part of the metadata. 17
Amity School of Business

Storage Manager
• The job of the Storage Manager is to
– obtain data from the data storage, and
– modify the data to the data storage when
requested.
• Storage Manager has two components:
– File Manager handles files.
 Keeps track of the location of files
 Obtains block(s) of a file on request
from the buffer manager.
– Buffer Manager handles main memory.
 Obtains and returns blocks of data
from/to the file manager
 Stores blocks temporarily in main
memory pages.
18
Amity School of Business

Query Processor
• Query Processor handles: queries and
modifications to the data.
– Finds the best way to carry out a
requested operation and
– Issues commands to the storage
manager which will carry them out.
• E.g. A bank has a DB with two relat.:  
Customers (name, SIN, address),
Accounts (accountNo, balance, SIN)

Query: “Find the balances of all accounts


of which Sally is the owner.”
SELECT Accounts.balance
FROM Customers, Accounts
WHERE Customers.SIN = Accounts.SIN
19
AND Customers.name = 'Shelly';
Amity School of Business

Transaction Manager
• Transaction Manager is responsible for
the integrity of the system. It must assure
that:
– several queries running
simultaneously do not interfere with
each other and that,
– the system will not lose data even if
there is a power failure.
• Transaction Manager interacts with:
• Query Manager,
– Because it may need to delay
certain query operations to avoid
conflicts.
• Storage Manager
– Because schemes for protecting
data involve storing a log of 20
changes to the data.
Amity School of Business

Disk Manager
• Data files, which store the
database itself.
• Data Dictionary, which
stores metadata about the
structure of the database.
• Statistical data, which store
statistical information about
the data in the database.
This information is used by
the query processor to select
efficient ways to execute a Disk Manager
query.

21
Amity School of Business

Components of DBMS
DBMS Facilities
Data Definition Language (DDL)
Data Manipulation Language (DML)
Data Control Language (DCL)

22
Amity School of Business

Classification of DBMS Users


– Database administrators
– Database Designers
– End Users : Casual
Naïve or Parametric
Sophisticated
Stand-alone

23
Amity School of Business

DATA WAREHOUSE
Data Warehouse, defines the term as “an Integrated, subject oriented,
time-variant, nonvolatile collection of data that provides support for
decision making .

24
Amity School of Business

DATA MINING
It has been described as "the non-trivial extraction of implicit,
previously unknown or hidden, and potentially useful information
from data“.

Data Mining is the principle of sorting through large amounts of data


and picking out relevant information.

It is usually used by business intelligence organizations, and financial


analysts, but it is increasingly used in the sciences to extract
information from the enormous data sets generated by modern
experimental and observational methods.
25
Amity School of Business

SQL
• SQL stands for Structured Query Language. SQL is used to communicate
with a database.
• According to ANSI (American National Standards Institute), it is the
standard language for relational database management systems.
• SQL statements are used to perform tasks such as update data on a
database, or retrieve data from a database.
• Some common relational database management systems that use SQL are:
Oracle, Sybase, Microsoft SQL Server, Access, etc.
• However, the standard SQL commands such as "Select", "Insert",
"Update", "Delete", "Create", and "Drop" can be used to accomplish
almost everything that one needs to do with a database.

26
Amity School of Business

SQL
• SQL can be divided into two parts: The Data Manipulation Language (DML) and the Data
Definition Language (DDL).
• The query and update commands form the DML part of SQL:
• SELECT - extracts data from a database
• UPDATE - updates data in a database
• DELETE - deletes data from a database
• INSERT INTO - inserts new data into a database
• The DDL part of SQL permits database tables to be created or deleted. The most important
DDL statements in SQL are:
• CREATE DATABASE - creates a new database
• ALTER DATABASE - modifies a database
• CREATE TABLE - creates a new table
• ALTER TABLE - modifies a table
• DROP TABLE - deletes a table

27
Amity School of Business

Few Basic Operations of DBMS


• The create table statement is used to create a new table. Here is the format of a
simple create table statement:
Syntax: create table "tablename"
("column1" "data type",
"column2" "data type",
"column3" "data type");
Example: create table employee
(first char(15),
last char(20),
age number(3),
address char(30),
city char(20),
state char(20));

28
Amity School of Business

Inserting into a Table


• The insert statement is used to insert or add a row of data into
the table.
Syntax:
• insert into "tablename" (first_column,...last_column) values
(first_value,...last_value);

• Example: insert into employee (first, last, age, address, city,


state) values ('Luke', 'Duke', 45, '2130 Boars Nest', 'Hazard
Co', 'Georgia');

29
Amity School of Business

Updating Records
• The update statement is used to update or change records that
match a specified criteria.

Syntax : update "tablename"


set "columnname" = "newvalue"
[,"nextcolumn" = "newvalue2"...]
where "columnname" OPERATOR "value" [and|or
"column" OPERATOR "value"]; [] = optional

30
Amity School of Business

Updating Records
Examples: update phone_book
set area_code = 623
where prefix = 979;

update phone_book
set last_name = 'Smith',
prefix=555, suffix=9292
where last_name = 'Jones';

31
Amity School of Business

Deleting Records
• The delete statement is used to delete records or rows from the table.
Syntax: delete from "tablename"
where "columnname" OPERATOR "value"
[and|or "column" OPERATOR "value"]; [ ] = optional

Examples: delete from employee where lastname = 'May';

delete from employee where firstname = 'Mike'


or firstname = 'Eric';

32
Amity School of Business

Drop a Table
• The drop table command is used to delete a table and all rows
in the table.
Syntax: drop table "tablename"

Example:
• drop table myemployees_ts0211;

33
Amity School of Business

Alter Table
• The ALTER TABLE statement is used to add, delete, or modify
columns in an existing table.
Syntax: To add a column in a table
ALTER TABLE table_name
ADD column_name datatype

To delete a column in a table


ALTER TABLE table_name
DROP COLUMN column_name
To change the data type of a column in a table
ALTER TABLE table_name
ALTER COLUMN column_name datatype
34
Amity School of Business

Alter Table
Syntax: To change the data type of an existing column
ALTER TABLE table_name
CHANGE COLUMN LAST TO CHAR(20)

35

Вам также может понравиться