0% found this document useful (0 votes)
44 views16 pages

KKW Unit 1 Database System Concepts

Uploaded by

thakkarparth793
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)
44 views16 pages

KKW Unit 1 Database System Concepts

Uploaded by

thakkarparth793
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/ 16

Data Base Management System 2021

Unit 01- Database System Concepts


Course Outcomes (COs) / Unit Outcomes (UOs):
Course Outcome (CO 304.1):Design Normalized database on given data
Unit Outcomes:
1. State the importance of DBMS over file processing in the given situation
2. Describe the overall structure of the given DBMS
3. Identify the relevant database model in the given situation
4. Draw the E-R diagram of the given database & identify relationship between the entities

1.1 Introduction to Database Management System


 Data
 Data is the collection of facts stored in database. The term data is defined as a set of isolated and
unrelated raw facts with an implicit meaning.
 DBMS
 A database-management system (DBMS) is a collection of interrelated data and a set of programs
to access those data.

 The collection of data, usually referred to as the database , contains information relevant to an
enterprise.

 The primary goal of a DBMS is to provide a way to store and retrieve database information that is both
convenient and efficient.

 Database systems are designed to manage large bodies of information.

 Management of data involves both defining structures for storage of information and providing
mechanisms for the manipulation of information.

 In addition, the database system must ensure the safety of the information stored, despite system crashes
or attempts at unauthorized access.

 If data are to be shared among several users, the system must avoid possible anomalous results.

 Database System Applications


Databases are widely used. Here are some representative applications:
 Banking: For customer information, accounts, loans, and banking transactions.
 Airlines: For reservations and schedule information. Airlines were among the first to use databases in a
geographically distributed manner.
 Universities: For student information/ course registrations, and grades.
 Credit card transactions: For purchases on credit cards and generation of monthly statements.
 Telecommunication: For keeping records of calls made, generating monthly bills, maintaining balances
on prepaid calling cards, and storing information about the communication networks.
 Finance: for storing information about holdings, sales and purchases of financial instruments such as
stocks and bonds; also for storing real-time market data to enable on-line trading by customers and
automated trading by the firm.
 Sales: For customer, product, and purchase information.

Prepared By: Ms. Y. U. Kadam, Lecturer, KKWP, Nashik Page 1


Data Base Management System 2021
 On-line retailers: For sales data noted above plus on-line order tracking/ generation of
recommendation lists, and maintenance of on-line product evaluations.
 Manufacturing: For management of the supply chain and for tracking production of items in factories,
inventories of items in warehouses and stores, and orders for items.
 Human Resource : For information about employees ,salaries ,payroll taxes, benefits, and for generation
of pay checks

 Disadvantages of File Processing System


 Data Redundancy and Inconsistency:
Data Redundancy occurs due to duplicate copies of files which leads to inconsistency & waste in storage space.
Ex. If an organization wants to communicate with employees by email, then it will mailed messages to old as well
as new address. Combining all these the database involves redundancy as well as inconsistency.

 Difficulty in Accessing data:


It doesn’t allow to access data in convenient & efficient way as it was placed in different location so, different
applications programs required to access those data. Ex. If dept. wanted to access information of student from city
Nashik, then a program will be written for such a application. Later if dept. required it from another forms such as
city, year then another program will be written.

 Data Isolation:
As data is scattered in different files & locations & formats, then writing new applications programs for retrieving
is tedious task.

 Data Integrity:
The database must satisfy some consistency constructions i.e. accuracy. E.g. In patient’s database there should be
limit for storing the x-ray results for minimum of five year before it can be deleted for easy access & accuracy.

 Atomicity Problems:
If any transaction is in process, & some failure occurs, then it should be fully executed or not, so that it can be in
consistency state. Eg. If transaction is in process from sending money from A account. to B account & if failure
occurs, then A to B should get transferred or not is major problem.

 Concurrent Accessing problems:


Concurrency means simultaneously multiple operations are performed so, multiple transactions may updating
same data concurrently. Eg. If a person depositing x amount to his acct. & another person is withdrawing y
amount same account simultaneously, then consistency updated result must be printed for concurrent updating.

 Security problems:
Data should be secured against unauthorised access & prevented from some malicious attacks which is not
possible in file processing.

 Advantages of RDBMS over File processing system:


 Independence of data & programs.
 Centralized control
 Security
 Performance & Efficiency

Prepared By: Ms. Y. U. Kadam, Lecturer, KKWP, Nashik Page 2


Data Base Management System 2021
 Improved strategic use of corporate data
 Reduced data redundancy
 Improved data integrity
 Easier modification and updating
 Data and program independence
 Better access to data and information
 Standardization of data access
 A framework for program development
 Better overall protection of the data
 Shared data and information resources
1.2 Three Level Architecture for Database System
 Most users of a database system today are not present at the site of the database system but connect to it
through the network.
 We can therefore differentiate between client machines on which remote database users work and server
machine on which the database system runs.
 Client: The client is the users machine which contains the user interface which request for the service to
the server
 Server: Server is the machine which serves to the client. This communication can be via local area
network or WAN.
1] 2-tier Architecture

 In this architecture the application is partition into a component that resides on server machine.
Application program interface standards like ODBC & JDBC are used for interaction between the client
and the server

Prepared By: Ms. Y. U. Kadam, Lecturer, KKWP, Nashik Page 3


Data Base Management System 2021

2] 3-tier Architecture

 In this architecture client machine acts as a frontend and does not contain any direct database calls.
Instead a client communicates with application server. The application server in turn communicates with
database system to access data.
 The main logic for all application program is embedded within application server.
 3-tier architecture is more appropriate for large application i. e. www or business logic

1.3 Data Abstraction


 For the system to be usable, it must retrieve data efficiently. The need for efficiency has led designers to
use complex data structures to represent data in the database.
 Since many database-system users are not computer trained, developers hide the complexity from users
through several levels of abstraction, to simplify users' interactions with the system

 Physical level.
 The lowest level of abstraction describes how the data are actually stored. The physical level describes
complex low-level data structures in Detail.
 Logical level.

Prepared By: Ms. Y. U. Kadam, Lecturer, KKWP, Nashik Page 4


Data Base Management System 2021
 The next-higher level of abstraction describes what data are stored in the database, and what
relationships exist among those data.
 The logical level thus describes the entire database in terms of a small number of relatively simple
structures.
 Although implementation of the simple structures at the logical level may involve complex physical-level
structures, the user of the logical level does not need to be aware of this complexity.
 Database administrators, who must decide what information to keep in the database, use the logical level
of abstraction.
 View level

 The highest level of abstraction describes only part of the entire database.
 Even though the logical level uses simpler structures, complexity Remains because if the variety of
information stored in a large database.
 Many users of the database system do not need all this information; instead, they need to access only a
part of the database.
 The view level of abstraction exists to simplify their interaction with the system. The system may provide
many views for the same database.
 Data Independence

 It is the ability of an application to change the storage structure & access strategy.
 This is a prime advantage of a database. In conventional systems applications are data-dependent.
 For example, if a file is stored in indexed sequential form then an application must know that the index
exists the file sequence (as defined by the index), and the internal structure of the application will be built
around this knowledge.
 If, for example, the file was to be replaced by a hash-addressed file major modifications would have to be
made to the application.
 Such an application is data-dependent it is undesirable to allow applications to be data-dependent the DBA
must have the freedom to change storage structure or access strategy in response to changing requirements
without having to modify existing applications.
 It is divided into 2 types:
 Logical Data Independence: The ability to change the conceptual schema without having to change the
external schemas and their application programs. It is easy to achieve this.
 Ex. New fields can be added to database without disturbing old records.
 Physical Data Independence: The ability to change the internal schema without having to change the
conceptual schema. It is difficult to achieve this.
Ex. To achieve this, attributes of different tables are considered & changes are done. Then those changes are
reflected to old one.
 Instances and Schema
 Instances –
The collection of information stored in the database at a particular moment is called an instance of the database.
 Schema –
The overall design of the database is called the database schema.

Prepared By: Ms. Y. U. Kadam, Lecturer, KKWP, Nashik Page 5


Data Base Management System 2021

1.4 Components of DBMS and overall Structure of DBMS.


The functional components of a database system can be broadly divided into the Storage Manager, Query
Processor and the Database Users Components.

1) Storage Manager
 The storage manager is important because databases typically require a large amount of storage space.

 A storage manager is a program module that provides the interface between the low level data stored in the
database and the application programs and queries submitted to the system

 Thus, the storage manager is responsible for storing, retrieving, and updating data in the database.

The storage manager components include:

 Authorization and Integrity Manager - which tests for the satisfaction of integrity Constraints and checks
the authority of users to access data.

 Transaction Manager - which ensures that the database remains in a consistent (correct) state despite
system failures, and that concurrent transaction executions proceed without conflicting.

 File Manager- which manages the allocation of space on disk storage and the data structures used to
represent information stored on disk.

 Buffer Manager- which is responsible for fetching data from disk storage into main memory, and deciding
what data to cache in main memory.

 The buffer manager is a critical part of the database system, since it enables the database to handle data sizes
that are much larger than the size of main memory

2) Query Processor

 The query processor is important because it helps the database system simplify and facilitate access to data.

 It is the job of the database system to translate updates and queries written in a nonprocedural language, at
the logical level, into an efficient sequence of operations at the physical level.

 The query processor components include :

 DDL interpreter - which interprets DDL statements and records the definitions in the data dictionary

 DML compile r - which translates DML statements in a query language into an evaluation plan consisting of
low- level instructions that the query evaluation engine understands. A query can usually be translated into
any of a number of alternative evaluations plans that all give the same result. The DML compiler also
performs query optimization - that is, it picks the lowest cost evaluation plan from among the alternatives.

 Query evaluation engine - which executes low-level instructions generated by the DML compiler.

Prepared By: Ms. Y. U. Kadam, Lecturer, KKWP, Nashik Page 6


Data Base Management System 2021

Fig: Overall Structure of DBMS.

3) Database Users

There are four different types of database-system users.

i) Naive users

They are unsophisticated users who interact with the system by invoking one of the application programs that have
been written previously. Consider a user who wishes to find her account balance over the World Wide Web. Such a
user may access a form, where she enters her account number. An application program at the Web server then
retrieves the account balance, using the given account number, and passes this information back to the user.

ii) Application Programmers

They are computer professionals who write application programs. Application programmers can choose from many
tools to develop user interfaces. Rapid application development (RAD) tools are tools that enable an application
programmer to construct forms and reports with minimal programming effort.

iii) Sophisticated Users

They interact with the system without writing programs. Instead, they form their requests in a database query
language. They submit each such query to a query processor, whose function is to break down DML statements into
instructions that the storage manager understands. Analysts who submit queries to explore data in the database fa ll in
this category.

iv)Database Administrator

Prepared By: Ms. Y. U. Kadam, Lecturer, KKWP, Nashik Page 7


Data Base Management System 2021
One of the main reasons for using DBMSs is to have central control of both the data and the programs that access
those data. A person who has such central control over the system is called a database administrator (DBA). The
functions of a DBA include:

1) Schema Definition -The DBA creates the original database schema by executing a set of data definition
statements in the DDL.

2) Storage structure and access-method definition.

3) Schema and physical-organization modification- The DBA carries out changes to the schema and physical
organization to reflect the changing needs of the organization, or to alter the physical organization to improve
performance.
4) Granting of authorization for data access.-By granting different types of authorization, the database
administrator can regulate which parts of the database various users can access. The authorization information is
kept in a special system structure that the database system consults whenever someone attempts to access the data in
the system
5) Routine Maintenance
Examples of the database administrator's routine maintenance activities are:
 Periodically backing up the database, either onto tapes or onto remote servers, to prevent loss of data in case
of disasters such as flooding.

 Ensuring that enough free disk space is available for normal operations, and upgrading disk space as
required.

 Monitoring jobs running on the database and ensuring that performance is not degraded by very expensive
tasks submitted by some users.

1.5 Data Models


 Data Model:
It is a set of concepts to describe the structure of a database, and certain constraints that the database should obey.
Introduced by Dr. E. F. Codd in 1970. It describes simple, defined concepts of how user identifies the data. This data is
in form of table which represents real world’s person, place, things, or event.

Types of data Model-


A) Network Data Model
B) Hierarchical Model
C) Relational Model

A) Network Data Model


• An expansion of the hierarchical database model with an owner-member relationship in which a member may have
many owners
• It allows many to many relationships in data. Although 1:N or M:N relationship also permitted.
• It organizes data in in form of arbitrary graph.
• It consists of network diagram.

Prepared By: Ms. Y. U. Kadam, Lecturer, KKWP, Nashik Page 8


Data Base Management System 2021

Advantages:
• Network Model is able to model complex relationships and represents semantics of add/delete on the
relationships.
• Can handle most situations for modelling using record types and relationship types.
• Language is navigational; uses constructs like FIND, FIND member, FIND owner, FIND NEXT within set,
GET etc. Programmers can do optimal navigation through the database.
Disadvantages:
• Navigational and procedural nature of processing
• Database contains a complex array of pointers that thread through a set of records.
Little scope for automated "query optimization‖

B) Hierarchical Model
 A data model in which data are organized in a top-down, or inverted tree structure. It represents Parent-Child
relationship structure.
 It organizes data in a tree structure.
 It allows 1:N mapping between record types.

Advantages:
• Hierarchical Model is simple to construct and operate on
• Corresponds to a number of natural hierarchically organized domains - e.g., assemblies in manufacturing,
personnel organization in companies
• Language is simple; uses constructs like GET, GET UNIQUE, GET NEXT, GET NEXT WITHIN PARENT
etc.

Disadvantages:
• Navigational and procedural nature of processing
• Database is visualized as a linear arrangement of records
• Little scope for "query optimization"

C) Relational Model
– It was introduced by Dr. E. F. Codd in 1970.
– Data is represented with the help of tables (Person, Place, Things, and Events etc.)
– All data elements are placed in two-dimensional tables, called relations that are equal to files.

Prepared By: Ms. Y. U. Kadam, Lecturer, KKWP, Nashik Page 9


Data Base Management System 2021

It performs-
 Selecting: Data manipulation that eliminates rows according to certain criteria
 Projecting: Data manipulation that eliminates columns in a table
 Joining: Data manipulation that combines two or more tables
 Linking: Relating tables in a relational database together

► Relational Key’s concept


1. Primary Key
– PRIMARY KEY constraint uniquely identifies each record in a database table.
– Primary keys must contain unique values.
– A primary key column cannot contain NULL values.
– To ensure that each record is unique in each table, we can set one field to be a Primary Key field. For e. g. rno is a
primary key attribute for student table.

2. Foreign Key
– A foreign key is a combination of column with a value based on the primary key values from another table.
– A foreign key constraint also known as referential constraint corresponds to a actual values of the primary key in the
another table. Foreign Keys link to data in other tables

3. Super key
--It is a set of one or more attributes that, taken collectively, to identify uniquely an item in the entity set. For example,
SSN is a superkey.

4. Candidate key
Sometimes in relation, there are more than one attributes are having the unique identification property. Those attributes are
known as candidate key. E.g. Consider Student (RNO, NAME, PER, BRANCH), if RNO and NAME are unique then both are
known as Candidate keys.
► Attribute:
– It is Name of a column. It is also called as Arity, Degree or Order of a Table.
– Ex. For Emp table, E-Name, E-City etc. are the attributes of table.
– Number of Attributes in a relation or table is called as Degree of a relation.
► Tuple:
– It is row in a table. Ex. Particular record in a table represents a tuple.
– Number of tuples in a relation or table is called as Cardinality of a relation.

Prepared By: Ms. Y. U. Kadam, Lecturer, KKWP, Nashik Page 10


Data Base Management System 2021
► Domain:
– It is set of allowable values for attribute.
– It indicates area or field.
– It also indicates set of values of same data type.
► Null Value:
– It indicates that value for corresponding attribute is either not available or not applicable or absent.
– It is not equal to Zero.

1.6 Data Modelling using E-R Model


 An E-R Diagram is a pictorial representation of the entities and the relationship between them.
 From this user can use the information structure of the application at a glance.
 Afterwards these ER Diagrams are used to design tables and databases.
 Relationships are just as important as entities—they are data that need to be stored in the DB
 Most relationships are binary, but they may be ternary or more as well
 In the E/R model, the structure of data is represented graphically, as an ―entity-relationship diagram‖

Fig. Sample E-R Diagram

 E-R Model is based on a perception of a real world that consist of a set of basic objects called entities and
relationships among this objects

 Entity:
o Individual Object in a real world is called as Entity.
o An Entity is a thing in the real world with an independent existence.
o Eg. In a Relation Stud_Info ―Stud‖ is an Entity.
 Entity Set:
o Group of Objects in a system is called as Entity Set.
o Entity set ia a set of entities of the same type that share the same properties or Attributes.
o Ex. In a Relation Stud_Info ―Stud‖, ―Dept‖ is called as Entity Set.
 Attributes:
o The properties of an Entity(ies) in the called as attribute.
o Ex. In a Relation Stud_Info ―Stud‖ having ―Attribute‖ Stud-Name
 Relationship:
o The meaningful association among two or more entity Sets is called as Relationship
o Ex. For showing relation between ―Stud_Info ― & ―Dept‖ Works keyword is used.
 Keys:
o A column or set of columns used to uniquely identify the record in a Relation

Prepared By: Ms. Y. U. Kadam, Lecturer, KKWP, Nashik Page 11


Data Base Management System 2021

 Components of E-R Model:

 Types of Attributes
 Each attribute may have any value from its Domain.
 It is shown by Ellipse
 It is divided into following types
1. Simple or Composite Attributes
Simple attributes cannot be divided into subparts. On other hand composite attributes can be divided into sub parts
Simple attribute having simple structure for its use. Ex. DOB
Composite attributes formed by different attributes Ex. Name
2. Single Valued or Multivalued Attributes
Single-valued attributes are attributes that only have a single value for a particular entity. Ex. StudId
Multi-valued attributes are attributes that only have a multiple values for a particular entity. Ex. Ph. No
3. Derived Attribute
The value for this type of attribute can be derived from the values of other related attributes or entities.
Ex. Age is calculated from DOB

 Weak Entity Sets


 The entity set that does not have sufficient attributes to define the primary key are called weak entity set.
 The weak entity set is denoted by double Rectangle.

Prepared By: Ms. Y. U. Kadam, Lecturer, KKWP, Nashik Page 12


Data Base Management System 2021

 Strong Entity Sets


 An Entity set having sufficient attributes to form a Primary key is called as Strong Entity Set.
 It is also called as Identifying or owner Entity set.
 Relationship among strong Entity Set & Weak Entity Set is called as Identifying Relationship.
 Ex.
For Relation Employees ssn is Primary Key & for Relation Departments did is Primary Key, Hence it is example of Strong
Entity set

Difference between Strong Entity set & Weak Entity Set


Strong Entity set Weak Entity Set
The Strong entity has a primary key. The weak entity has a partial discriminator key.
The Strong entity is independent of any other entity in aWeak entity depends on the strong entity for its
schema. existence.
Strong entity is denoted by a single rectangle. Weak entity is denoted with the double rectangle.
The relationship between a weak and a strong entity is
The relation between two strong entities is denoted by a
denoted by Identifying Relationship denoted with double
single diamond simply called relationship.
diamond.
Strong entity may or may not have total participation in Weak entity always has total participation in the
the relationship. identifying relationship shown by double line.

 Steps To Draw E-R Diagram :


1) Identify entities from given problem definition.
2) Identify relationships.
3) Identity attributes of entities
4) Draw the E-R diagram using above information with conventions of E-R dig.

Prepared By: Ms. Y. U. Kadam, Lecturer, KKWP, Nashik Page 13


Data Base Management System 2021

1) E-R Diagram for Library Management System

Prepared By: Ms. Y. U. Kadam, Lecturer, KKWP, Nashik Page 14


Data Base Management System 2021

2) E-R Diagram for Hospital Management System

 Difference between DBMS & RDBMS


DBMS RDBMS
1. DBMS stands for Data Base Management System. 1. RDBMS stands for Relational Data Base Management
System.
2. It is old version of software to handle the database. 2. It is latest version of software to handle the database.

3. It can only relate one table to another table. 3. It can relate one database to another database.

4. Its data security is low as compared to RDBMS. 4. Its level of data security is very high as compared to
DBMS.

Prepared By: Ms. Y. U. Kadam, Lecturer, KKWP, Nashik Page 15


Data Base Management System 2021
5. It supports single user only. 5. It supports multiple users
6. Its data storage capacity is low. 6. Its data storage capacity is very high.
7. It treats Data as files internally. 7. It treats Data as tables internally.
8. It supports 3 rules of E.F. Codd . 8. It supports minimum 6 rules of E.F. Codd.
9. It needs low software and hardware requirements. 9. It needs high software and hardware requirements
10. DBMS is used for simpler business applications. 10. RDBMS is used for more complex applications.

 Difference between Network Model & Hierarchical Model & Relational Model
Summer-2014 Summer-2016 Winte-2016
Network Model Hierarchical Model Relational Model
Allowed the network model to One to many or one to one One to One, One to many, Many to
support many to many relationships relationships many relationships
A record can have many parents as
Based on parent child relationship Based on relational data structures
well as many children.
Relational databases are what brings
CODASYL (Conference on Data Does not provide an independent
many sources into a common query
Systems Languages) standalone query interface
(such as SQL)
Retrieve algorithms are complex and retrieve algorithms are complex and Retrieve algorithms are simple and
symmetric asymmetric symmetric
Does not suffer from any insertion Cannot insert the information of a Does not suffer from any insert
anomaly. child who does not have any parent. anomaly.
Multiple occurrences of child
records which lead to problems of
Free from update anomalies. Free form update anomalies
inconsistency during the update
operation
Deletion of parent results in deletion
Free from delete anomalies Free from delete anomalies
of child records

Prepared By: Ms. Y. U. Kadam, Lecturer, KKWP, Nashik Page 16

You might also like