Sei sulla pagina 1di 10

DBMS

Prepared By : Ms. Snehal Patil

Chapter 1 : Basic concepts

Data: Collection of facts & figures. Derives from Latin “to give”
Data is unprocessed facts and figures without any added interpretation
or analysis.
 Any Fact-That can be recorded
E.g: Text ,Number,Images,Video etc
Information: Result of processing raw data to reveal its meaning.
Information is data that has been interpreted so that it has meaning for
the user.
Database: Organized collection of data, storing the idea & retrieving
the information
Storing the idea :
Text and numbers : Traditional Database
Audio Video: Multimedia Database
Production ,Stores, Place order :Real time database
 a large store of data accumulated from a wide range of sources
within a company and used to guide management decisions.
:data warehouse

A database is an organized collection of data. It is the collection


of schemas, tables, queries, reports, views, and other objects. The data
are typically organized to model aspects of reality in a way that
supports processes requiring information, such as modeling the
availability of rooms in hotels in a way that supports finding a hotel with
vacancies.

Database System: Computerized record keeping system i.e. it is a


computerized system whose overall purpose is to store information & to
allow user to retrieve & update information on demand.
Major Components:

Data

Hardware

Software

Users

A database system is an integrated collection of related files, along


with details of the interpretation of the data contained therein.

Database Management System: It is software system that allows


access to data contained in a database.
The objective of the DBMS is to provide a convenient & effective
method of defining , storing & retrieving the information contained in
the database.
DBMS is a computer software application that interacts with the user,
other applications, and the database itself to capture and analyze data.
A general-purpose DBMS is designed to allow the definition, creation,
querying, update, and administration of databases. Well-known
DBMSsinclude MySQL, PostgreSQL, MongoDB, Microsoft SQL
Server, Oracle, Sybase, SAP HANA, and IBM DB2. A database is not
generally portable across different DBMSs, but different DBMS can
interoperate by using standards such as SQL and ODBC or JDBC to
allow a single application to work with more than one DBMS
DBMS Applications:

Banking: all transactions

Airlines: reservations, schedules

Universities: registration, grades

Sales: customers, products, purchases

Manufacturing: production, inventory, orders, supply chain

Human resources: employee records, salaries, tax deductions

Database System: database and DBMS software together.

Users/Programmers

Application Programs/Queries

Software to Process
Queries/Programs

Software to Access
Stored Data

Stored Database Stored


Definition
(MetaData) Database

Example: University Database


Used to maintain information concerning students, courses and
grades in a university environment.

The database has five files, each which stores data records of the same
type.

The Student file stores data of each student

The Course file stores data on each course,

The Section file stores data on each section of a course,

The Grade_Report stores information on the grades students receive


in the various sections they have completed,

The Prerequisite file stores the prerequisite of each course.

DEFINE: To define the database, we must specify the structure of the


records in the file by specifying the different types of data elements
to be stored in each record (elements of each file)

Purpose of DBMS / Drawbacks of File System:


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
 Multiple file formats, duplication of information in different
files
 Difficulty in accessing data : not retrieved data in a convenient
& efficient
 Data isolation— multiple files and formats
 Integrity problems
 Integrity constraints
 Hard to add new constraints or change existing ones
 Security Problem

Need of the DBMS


Compactness: There is no need for possibly voluminous paper files.
Speed : Retrieve & update data far faster than a human can.
Currency : Accurate, up-to-date information is available on demand
at any time.
Less Drudgery : maintaining files by hand is eliminated.

Advantages of DBMS :

 Shared Data :
 Reduction of Redundancies : Centralized control by a DBA
avoids unnecessary duplication of data & reduces total amt of data
storage.
 Integrity : accurate & consistent. e.g. : age
 Security : Confidential data must not be accessed by unauthorized
user. Proper procedures are followed including proper
authentication.
 Conflict Resolution : Database is under the control of DBA. So
he /she resolve conflicting requirements of various users &
applications
Database
 db.
 Uses simple structure .
 Many users of the database system they do not all this
information, they need to access only a part of the db.
 The db system provide many views for the same db.
Instances & Schema :
 The collection of information stored in the db at a particular
moment is called “Instance of the db”.
 The overall design of the database is called “Schema”
 Physical Schema : Describes the db design at physical level.
 Logical Schema : Describes the db design at the logical level.
 Sub Schema :
 The db have several schema at the view level.
 Describes different view of db.

Data Independence :
 Data Independence is the ability to change the schema at one
level of the database system without having to change the
schema at the other levels.
 Logical Data Independence :
 It is the ability to change the conceptual schema without
affecting the external schemas or application programs.
 The conceptual schema may be changed due to reason
 Change in constraints
 Addition of new data item
 Removal of existing data item from the database.
 Physical Data Independence
 It is the ability to change the internal schema without changing the
external schema.
 An internal schema may be changed due to several reasons
 Using New Storage devices
 Using different Data Structures.
 Switching from one access method to another.
 Using different file organization or storage structure .
 Modifying Indexes.
 Logical data independence is more difficult to achieve than the
physical data independence, because the application programs
are always dependent on the logical structure of the database.

 Insertion :
r r∪E
Where r is a relation

E is a relation algebra expression


Insert into emp values (1,’xyz’,200);
emp emp ∪ {(1,’xyz’,200)}
 Deletion :
Delete from emp where empid=1;
emp emp – σ empid=1 (emp)
 Updating :
update loan set amt=amt*2;
loan Π amt=amt*2 (loan)
update loan set loan_no=111 where branch_name=‘pune’;
loan Π loan_no=111 (σ branch_name=‘pune’ (loan))
Chapter 4: Relational Database design

Functional Dependencies
 Functional dependency describes the relationship between
attributes in a relation.
 Let R be the relation, and let x and y be the arbitrary subset of
the set of attributes of R. Then we say that Y is functionally
dependent on x – in symbol.
XY
(Read x functionally determines y) –
 If and only if each x value in R has associated with it precisely
one y value in R
In other words
 Whenever two tuples of R agree on their x value, they also agree
on their Y value.

 EX: if A and B are attributes of relation R, and B is functionally


dependent on A,if each value of A is associated with exactly one
value of B. ( A and B may each consist of one or more attributes.)
 Example on Student (sid, name, supervisor_id, specialization):
{supervisor_id}  {specialization} means

 If two student records have the same supervisor, then their


specialization (e.g., Databases) must be the same
 On the other hand, if the supervisors of 2 students are different,
we do not care about their specializations (they may be the same
or different)

Product table
One FD : - ( { S#}  {City})
 Because every tuple of that relation with a given S# value also
has the same city value.
TRIVIAL DEPENDENCIES
 One-way to reduce the size of the set of FD we need to deal with
is to eliminate the trivial dependencies.
 Trival functional dependency means that the right-hand side
is a subset ( not necessarily a proper subset) of the left-hand side.
 A functional dependency X  Y is trivial if Y is a subset of X
e.g. <S#, P#>  <S#>. (Trivial)
{name, supervisor_id}  {name}
staffNo, sName  sName
staffNo, sName  staffNo
 They do not provide any additional information about possible
integrity constraints on the values held by these attributes.

Potrebbero piacerti anche