0% found this document useful (0 votes)
7 views

DBMS-UNIT-1 prepared

Dbms notes

Uploaded by

Arun
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views

DBMS-UNIT-1 prepared

Dbms notes

Uploaded by

Arun
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 22

BSC-DBMS

UNIT-1
DATABASEMANAGEMENTSYSTEM

1. Define the following: Data,Information,Database, DBMS

Ans:

DATA:AData is a raw fact.Data is the building blocks of Information.

Example of data are rollno, name, rama, 50000,age,Hyderabad, salary , address etc.,

INFORMATION:Meaning collection of data or processed data is known as information

For example:(rama , 50000, Hyderabad) gives information about a person.

DATABASE: A database is a collection of data about one particular organization. A database contains
one or more tables. A database is also known as “Schema”

SYMBOLof database:

DBMS:DBMS stands for Database Management System. It is a collection of programs used to create a
database structure, organize the database(add,modify ordeletedata) and provide security for data in a
database. We use SQL to work with DBMS.
Examples of DBMS Software’s are: Oracle, MYSQL,MS-SQL,MS-Access etc.,

2. Describe the differences between Data and Information

DATA INFORMATION
Data is raw fact and figures. Information is a processed form of data.For
For example:32 in data. example: Age 32
Data is not significant to a business. Information is signification to a business.
Data are atomic level pieces of information. Information is a collection of data. For example:
It can be in the form of numbers, characters, Age and 32 collected together to
Symbols ,or even pictures. form information(Age 32).
Data does not help in decision making. Information helps in decision making.
Observations and recordings are done to Analysis is done to obtain information
Obtain data.
Input to any system may be treated as data. Output afterprocessing the system is
information.
Difficult to understand properly. Easy to understand.
Data must be processed to understand. Information is already in understandable
form .It may be processed further to make it more
understandable.
Data may not be in the order. Information should be in the order.

1
BSC-DBMS

3Q.Write about Basic FileTerminologies or Define the following:Table,Record,Field.


Ans: Field: A field is defined as a character or a group of characters that has a specific meaning. A field
is also known as “Attribute”.
Examples of fields are stno, sname, addr, fname, dob etc.,

Record: A record is defined as collection of related fields. A record is also known as “Tuple”.

Examples of record are(1,rama,kkd,…..), (2,gita,rjy,….)

Table: A table is defined as collection of records. A table is also known as “Entity” or “sub-schema” or
“File”.

Ex:The records of STUDENT Table are given below

StudentNo. SName Addr Fname DOB

S01 Saritha KKD RamaRao 11-11-2000

S02 Kavitha KKD MohanRao 10-10-2000

S03 Krishna KKD RajaRao 8-8-2000

4Q. What is File Processing System.What are drawbacks or limitation of File Processing System.

File Processing System:

 A file processing system(FPS)is a method of storing and organizing data in computer files.
 In File processing system files are designed using programming languages like c, cobol , c++,
java etc.,
 Here ,Files are called “Flat Files”. It is best suited for small databases.

Representation of FILEPROCESSING SYSTEM is as follows:

2
BSC-DBMS

Drawbacks or limitations of File Processing System:


 Data Redundancy:
 Data redundancy means duplication of data values ,i.e. same information is duplicated
in several files.
 This makes data redundancy.
 Data redundancy results in memory wastage.
 EX: The same information of customer will be stored in two different locations.
 Data Inconsistency:
 Data inconsistency means a different copies of the same data are not matching.
 Due to data redundancy the data may not be inconsistent state.
 This occurs as the result of update operations that are not updating the same data
stored at different places.
 E.g.Addressinformationofacustomerisrecordeddifferentlyindifferentfiles.
 Difficulty in Accessing Data:
 Accessing data is not convenient and efficient in File Processing Systems.
 Integrity Problems:
 Data Integrity means that the data contained in the database is both correct and
consistent.
 The data values may need to satisfy some integrity constraints.
 It is difficult to add new constraints in FPS.
 No Data Sharing:
 In FPS, data sharing is not possible i.e., we cannot open a file at a time in more than
one computer.
 Atomicity Problems:
 Any operation on data base must be atomic.This means operation completes either
100% or 0% (either complete or not happen at all).
 It is difficult to ensure atomicity in file processing system.
 For example: Transferring $100from account A to Account B. If a failure occurs during
execution there could be situation like $100 is deducted from Account A and not
credited in Account B.
 Concurrent Access Variation:
 If multiple users are updating the same data simultaneously, it will result I inconsistent
data state.
 In file processing system it is very difficult to handle this using program code. This
results in concurrent access variation.
 Lack of Data Security:
 It is difficult to provide security for data in FPS.
 Security features like password protection, locking data in a file are difficult to
implement.

3
BSC-DBMS

5. Write about the characteristics of Database Approach.


Characteristics of Database Approach:

A database approach possesses the following characteristics:

 It is central repository of shared data. It allows several users to access the database
concurrently.
 A fundamental feature of the database approach is that the database system does not only
contain the data but also the complete definition and description of these data. These
description are basically details about the extent, the structure, the type and the formant of
all data and, additionally, the relationship between the data. This kind of stored data is called
metadata (“data about data”).
 A primary feature of the database approach is a standardized, uniform approach to database
access. This means that the same overall procedures are used by all applications programs to
retrieve data and information.
 Data should be correct with respect to the real world entity that they represent.
 Data should be protected from unauthorized access.
 Its organization is such that duplication of data is minimized.
 Data in a database exit permanently until it is not explicitly deleted.

6. What are the various components of Database?


COMPONENTS OF DATABASE SYSTEM:

A database system is composed of following four major components, which coordinate with each other
to form an effective database system.

(a)Data (b) Hardware

(c)Software (d)Users

(a)Data: It is a very important component of the database system. Most of the organizations
generate, store and process large amount of data. Data may be of different types:

1. User data: It consists of a table(s)of data called structure(s), where column(s)are called fields
or attributes and rows are called records or tuples for tables. A relation must be structured
properly.
2. Metadata: Metadata means “data about data”. It is a description about the structure of the
database. System tables store the metadata which includes basic information about the
design of each table, the data type of each field and various constraints set on them.

(b) Hardware: The hardware consists of the secondary storage devices such as magnetic disk (hard
disk, zip disk, floppy disk), optical disk (CD-ROM, DVD), magnetic tapes etc.

4
BSC-DBMS

(c) Software: The DBMS needs three types of softwares. They are

1. Operating system software: Manages all hardware components and acts as an interface between
user and the computer. Ex: Microsoft Windows, Linux, Unix.

2. DBMS software: Databases/w is used to create database structure and organize the database. Ex:
Oracle, MS SQL,MY SQL,MS Access etc.,

3. Application Software: Used to design an front-end application. Ex: Java, HTML, .NETetc.,

(d) Users: There are 5 types of users identified in database system.

The users of a database system can be classified in the following groups:

(i) Naïve Users: Naïve user has no knowledge of database system and about its any supporting
Software. These users uses the existing application to interact with the database.
Ex: ATMs, online library system, ticket booking systems etc.
(ii) Online Users: Online users are those who may communicate with the database directly via an
Online device or via a user interface and application program.
(iii) Application Programmer: Application Programmers are developers who are responsible for
Developing application programs.
(iv) DataBase Administrator(DBA): A person who Is responsible for managing the overall
database Management system is called Database Administrator.
(v) EndUser: These are the people who interact with dbms to perform different operation on
Database such as retrieving, updating, inserting ,deleting data etc.

7. What is DBMS? Explain about the advantages and disadvantages ofDBMS(orobjectivesof


DBMS)?
INTRODUCTION TO DBMS:
“Data base management system (DBMS) is a software used to manage the database and its
various operations like insertion, deletion, updation and retrieval. It enables users to store, modify
and extract information from a database as per the requirements. It acts as an intermediate or
between the user and the database”.
ADVANTAGESOF DBMS:
Ithasanumberofadvantagesascomparedtotraditionalfileprocessingapproach.The major
advantages of DBMS are:
1. Controlling Redundancy 6.Data Integration
2. Data Consistency 7.IntegrityRules
3. Improved Data Sharing 8.Data Independence
4. Improved Data Security 9.Data Atomicity
5. Improved Data Access 10.Backupandrecoveryprocedures

5
BSC-DBMS

 Controlling redundancy:
 In DBMS ,all the data of an organization is integrated into a single database.
 The data is recorded at only one place in the database and it is not duplicated.
 By controlling redundancy, we can save storage space.
 Data Consistency:
 In the file processing system, information is duplicate throughout the system .so
changes made in one file may be necessary be carried over to another file.
 Reduced data redundancy leads to better data consistency.
 Improved Data Sharing:
 In a paper-based record keeping ,data can not be shared among many users.
 Data stored in DBMS can be shared among multiple users at the same time if they
are connected through a network.
 The data can be shared by authorized users only.
 Improved Data security:
 Data security is the protection of database from unauthorized users.
 DBMS provides a framework for better enforcement of data privacy and security
policies.
 Improved DataAccess:
 Data in a database can be accessed and manipulated by means of a query.
 DBMS sends output of query to the application.
 Data Integration:
 Data integrity means that the data contained in the database is both accurate and
consistent.
 Therefore, data values being entered for storage could be checked to ensure that
they are of the correct format or not.
 Integrity Rules:
 Integrity constraints or consistency rules can be applied to database, so that the
correct data can be entered into the database.
Ex: primarykey ,foreignkey, uniqueetc.
 Data Independence:
 The separation of database from the application program that is used to access the
data is called data independence.
 In DBMS, the database and application programs are separated from each other.
 Data Atomicity:
 Anyoperationondatabasemustbeatomici.e.itshouldeithercompleteornot occur at
all.(all or none).
 Backup and Recovery:
 Most of the DBMSs provide the backup and recovery systems that automatically
create the backup and restoring the data if required.

6
BSC-DBMS

DISADVANTAGES OF DBMS:

 High cost
 Complexity of Backup and recovery
 Security Threats.

8. Write about the Evaluation of DBMS?


History of DBMS: FilebasedsystemwasthepredecessortotheDBMS.Thechronologicalorderof

the development of DBMS isas follows:

1. Flat file system(1960s-1980s)


2. Hierarchical DataModel(1970s-1990s)
3. Network DataModel(1970s-1990s)
4. Relational DataModel(1980s-present)
5. Object-Oriented DBMS(OODBMS)(1990s-present)
6. Object-Relational DBMS(ORDBMS)(1990s-present)
7. Data Warehousing(1980s-present)
 Early 1960s: Charles Bachman introduced the first general purpose DBMS called as Integrated
Database(IDS). It created the basis for the network model which was standardized by
CODASYL(Conference on Data System Language).
 Late 1960s: IBM developed IMS(Information Management System). The hierarchical database
model was the IBMs first DBMS called IMS.
 1970:EdgarFrankCodd(E.F.Codd) created RelationalModel
 1976: Peter Chen presented Entity-Relationship(ER) model, which is widely used in database
design.
 1980:SQL(structured Query Language)was develop by IBM. It became the Standard query
language for databases.
 1980sand1990s:IBM, Oracle, Informix and others developed powerful DBMS.

9. Explain the three level architecture of DBMS.


THREE LEVEL ARCHITECTURE OF DBMS:

In the early 1970s, the ANSI-SPARC (American National Standard Institute-Standard Planning
and requirements committee) defined a frame work for data modelling on degrees of abstraction.
The term abstraction means the amount of detail you want to hide.

7
BSC-DBMS

This framework is used for describing the structure of specific database system. In this, the database
schemas can be defined at 3 levels. So, this architecture is called as three level (or) ANSI-SPARC
Three-tier (or) Three schemes

 The external level(user view)


 The conceptual level(logical view)
 The internal level(physical or storage view)

DATA

THE EXTERNAL LEVEL:

 The external level or user view is at the highest of the three level DBMS architecture.
 This is the highest level of data abstraction.
 It includes a number of user views of the database.
 It is also known as view level.
 Different views may have different representation of same data.
 It describes only part of the entire database that is relevant to each user.

THE CONCEPTUAL LEVEL:

 The middle level is known as the conceptual level or logical view.


 It deals with the structure of the entire database.

8
BSC-DBMS

 It is also known as logical level.


 It defines “what data are stored in the database” and what relationships exist among those
data.
 It hides the details of physical storage.
 This view does not contain any storage level details.
 Database Administrator and designers work at this level to determine “what data to keep in
database”.

THE INTERNAL LEVEL:

 The lowest level of three level DBMS architecture is known as the internal level or internal
schema.
 This is the lowest level of data abstraction.
 It describes the physical structure of data in database.
 It describes how the data items are stored in the physical storage devices (hard disk,CD,DVD,
Tape drives etc).
 It deals with file structures, access methods, data compression and ecncryption techniques if
used.

Data Independence:

Schema: The overall design of the database is called schema or metadata.

The ability to modify the schema definition in one level without affecting another level is called
data independence. They are of two types.

Physical Data Independence: The ability to modify a physical schema without causing application
programs to be rewritten.

Logical Data Independence: The ability to modify a logical schema without causing application
programs to be rewritten.

10. Explain about classification of DBMS.

Classification of DBMS:
The DBMSs can be classified into different categories on the basis of several criteria’s. These
are classified according to: DBMS is categorized into types based on the following:

i. Based on the DataModel


ii. Based on no.of users
iii. Based on location/sites
iv. Based on Data usage.

9
BSC-DBMS

1. Based on the datamodel: Depending on the data model they use ,the DBMS can be classified as
1. Hierarchical Data Model

2. Network Data Model

3.Realational Data Model


 Hierarchical database–
→This model used the tree as its basic structure.
→In this, the records are present in parent or child relationships.
→They are used in industry on main frame platforms.
→Examples are IMS(IBM),Windows registry(Microsoft).
 Network database–
→Mainly used on a large digital computers.
→If there are more connections, then this database is efficient.
→They are similar to hierarchical database, they look like a cobweb orinter connected
network of records. Examples are CA-IDMS(COMPUTER associates), IMAGE(HP).
 Relational database–
→This is the most popular data model used in industries.
→It is based on the SQL.
→They are table oriented which means data is stored in the form of rows and columns
called tables or relations. Examples are MYSQL(Oracle, open source),Oracle database
(Oracle), Microsoft SQL server(Microsoft) and DB2(IBM).

2. Based on the number of users

Single user Database–It can support only one user at a time. It is mostly used with the personal
computer on which the data resides accessible to a single person. The user may design ,maintain and
write the database programs.

Multiple user Database– It supports multiple users concurrently. In this, data can be both integrated and
shared. It can be divided into two types.

→ Workgroup Database: When a multiuser database supports a small number of users (or) a
specific department in an organization, then it is called as workgroup database.
→ Enterprise Database: When the database is used by the entire organization, across many
departments, then it is known as enterprise database.

3. Based on the sites:

Centralized database – The DBMS and database are stored at the single site that is used by several other
systems is called centralized database. The data is maintained on the centralized server.

10
BSC-DBMS

Distributed database–In this data and the DBMS software are distributed over several sites but
connected to the single computer.

There are two types in distributed databases.

1. Homogeneous Database:If the same software(DBMS) is accessed to multiplesites then it


can be called as homogeneous distributed database.

2. Heterogeneous Database: If the different softwares are accessed to different systems then
it can be called as heterogeneous database.

4. Based on the DataUsage:

 Operational Database: A database that is designed to support a company’s day-to-day


operations is classified as an operational database.
Ex: Banking database
 Data Warehouse: It is a repository of an organization’s data which is used for reporting and
analysis. Most of the data in data warehouse are based on historical data obtained from
operational database.

11
BSC-DBMS

11. Explain about different Data Models?


Data Model: It defines the logical structure of the database including data types, relationships between
data and constraints that should apply on the data. It is a conceptual representation of data
structures which is required for database.

1. Object Based Logical Models: These models can be used in describing the data at the logical
and view levels. These models are having flexible structuring capabilities classified into
following types.
 The entity-relationship model.
 The object-oriented model.
 The semantic data model.
 The functional data model
2. Record Based Logical Models: These models can also be used in describing the data at the logical and
view levels. These models can be classified into:
 Relational model.
 Network model.
 Hierarchal model.
3. Physical Models: These models can be used in describing the data at the lowest level (physical level).
These models can be classified into
 Unifying model
 Frame memory model.

Object Based Logical Models:


1)The entity-relationship model:

Basic Building blocks: The basic building blocks of all data models are:

12
BSC-DBMS
1. Entity: An entity is anything which data are to be collected and stored.

Ex: student, teacher employee etc.

2. Attribute :It is a characteristic or property of an entity.

Ex: name ,no ,age ,salary etc

3. Relationships: It describes an association among entities. The different types of relationships


are: 1.One-to-One relationship(1:1)
2. One-to-Many relationship(1:M)
3. Many-to-One relationship(M:1)
4. Many-to-Many relationship(M:MorM:N)

Key Features of an Entity-Relationship Model


1. Graphical Representation for Enhanced Understanding – The ER Model offers a simple and user-
friendly graphical representation, making it an effective tool for developers to interact with
stakeholders.
2. Database Design – The ER Model is a popular tool in database design and assists database designers in
developing efficient databases.
3. ER Diagram – The ER Diagram is a graphical interpretation of the ER Model.

 Rectangles: Rectangles represent Entities in the ER Model.


 Ellipses: Ellipses represent Attributes in the ER Model.
 Diamond: Diamonds represent Relationships among Entities.
 Lines: Lines represent attributes to entities and entity sets with other relationship types.
 Double Ellipse: Double Ellipses represent Multi-Valued Attributes.
 Double Rectangle: Double Rectangle represents a Weak Entity.

Advantages of Entity-Relationship Model


1. Simplicity – The ER Model is conceptually easy to construct. If the relationship between the entities
and the attributes is known, the ER Diagram can be easily created.
2. Effective Communication Tool – The ER Model is frequently used by database designers to
communicate their ideas effectively.

13
BSC-DBMS
3. Easy Conversion to Any Model – The ER Model can be easily converted into the relational model and
other models like the network model, hierarchical model, etc.

2) Object oriented Model– The information here is in the form of the object as used in object oriented
programming. It adds the database functionality to object programming languages. It requires less

code, use more natural data and also code bases are easy to maintain. Examples are ObjectDB
(ObjectDB software).
3) The Semantic Data Model

A semantic Data Model is a more high-level data model that makes it easier for a user to give starting
description of data in an enterprise. These models contain a wide variety of relations that helps to
describe a real application scenario. A DBMS cannot support all these relations directly; so, it is built
only with few relations Known as relational model in DBMS.A widely used semantic data model is the
Entity-Relationship (ER) data model which allows us to graphically denote entities and relationship
between them.

4) The Functional Data Model

The functional Data Model makes it easier to define functions and call them wherever necessary to
process data.

Record Based Logical Models:


1) Hierarchical Model–

 In mid 1960S,IBM developed IMS(Information Management System).


 IMS is used as an alternate model of Hierarchical model.
 It was developed to manage large amount of data.
 In this model, data is organized in a tree-like structure.
 In this ,the records are present in parent or child relationships i.e. there is only one entity
which is called root at the top of hierarchy.
 The relationship exists in the Hierarchical model is one-to-one and one-to-many.
 They are used in industry on main frame platforms.
 Examples are IMS(IBM),Windows registry(Microsoft).

14
BSC-DBMS

Advantages:

 Simplicity
 Data security
 Data Integrity
 Efficiency

Disadvantages:

 Implementation complexity
 Database Management problem
 Lack of structural independence.

2) NetworkModel–

 In early 1960s CharlesBachman created first database called as IDS(IntegratedDataStore).


 It is standardized by CODASYL( Conference on Data Systems Language).
 It is also called as CODASYL model.
 Mainly used on a large digital computers.
 The main benefit of network model is, it provides many-to-many relationships.
 If there are more connections ,then this database is efficient.
 Examples are CA-IDMS(COMPUTER associates),IMAGE(HP).

Advantages:

 Conceptual simplicity
 Easy to access data.
 Data Integrity
15
BSC-DBMS
 Data Independence

Disadvantages:

 System complexity
 Absence of Structural independence

3) Relational Model–

 Edgar Frank Codd (E.F.Codd) introduced relational model in 1970


 In order to overcome all the drawbacks of the previous sytem, the relational database system
got introduced.
 It can be implemented through RDBMS(Relational Database Management System).
 This is the most popular data model used in industries.
 It is based on the SQL(Structured Query Language).
 They are table oriented which means data is stored in the form of rows and columns called
tables or relations.
 ExamplesareMYSQL(Oracle,opensource),Oracledatabase(Oracle),MicrosoftSQLserver(Microso
ft) and DB2(IBM).

Advantages:

 Conceptual simplicity
 Easy to access data.
 Structural Independence
 Design Implementation
 Data Integrity
 Data Security
 Data Independence

16
BSC-DBMS
Disadvantages:

 Hardware overheads
 Cost
Physical Models
Physical models describe how data is stored at the lowest (hardware) level. They focus on performance,
storage structures, and data access methods.

1) Unifying Model

Description:

 Combines features of different data models for a hybrid approach.

 Supports both structured and unstructured data.

Key Features:

Flexibility in combining data types.

Good for modern applications requiring multiple models.

Example: Hybrid database:

 Relational tables for structured data.

 Graphs for relationships.

2. Frame Memory Model

Description:

 Maps data directly to memory structures for fast access.

 Commonly used in real-time systems.

Key Features:

 Fast read/write operations.

 Suitable for high-performance applications.

Example:
Navigation systems store frequently accessed landmarks in memory.

9) Explain about COSTS AND RISKS OF DATABASE APPROACH?

Costs and Risk of database approach:

17
BSC-DBMS
In database approach in order to maintain or develop database we should take a risk and we should
invest money, time and environment. Database approach when we develop a new database or when
we maintain an existing database, we should consider the following costs and risks of the database
approach are categorized into 5 factors:

 New specialized Personnel

 Installation and management cost and complexity

 Conversion costs

 Need for explicit backup and recovery

 Organizational conflict

New specialized persons

Organizations that adopt the database approach need to hire or train individuals to design and
implement databases, provide database administration services and manage a staff of new people.
Further, because of the rapid changes in technology these new people will have to be retrained or
upgraded on a regular basis.

Installation and manage cost and complexity

A multi user database management system is a large and complex software that has a high initial cost,
requires a staff of trained personnel to install and operate, annual maintenance etc. Installing such a
system may also require upgrade to the hardware and data communication system in the
organization.

Conversion Costs

If the database is changed or modified in some manner, all the data needs to be converted to the new
form. This cost may even exceed the database creation and management costs sometimes. This is the
reason most organizations prefer to work on their old databases rather than upgrade to new ones.

Need for Explicit Backup and Recovery

A shared database must be accurate and available at all times. This requires that procedures should be
developed and used for providing backup copies of data and for restoring a database when damage
occurs.

Organizational conflict
Centralization also means that the data is accessible from a single source, namely the database. This
increases the severity of security breaches and disrupting the operation of the organization.

BUSINESS RULES
18
BSC-DBMS

A business rule is statement that imposes some form of constraint on a specific aspect of the database,
such as the elements within a field specification for a particular field or the characteristics of a given
relationship. You base a business rule on the way the organization perceives and uses its data which
you determine from the manner in which the organization functions or conducts its business.

An important aspect of any design process is making choices. In database design, for example, you must
choose which data to store in the database; you would not necessarily want or need to store every
last piece of data the organization might possibly use. The data you finally choose to store and how
you decide to store it will be determined by the way the organization uses its data. A hospital may
wish to store times of various events to the second, whereas a warehouse requires only the date for
any given event.

The following statement is an example of a typical business rule:

A SHIP DATE cannot be prior to an ORDER DATE for any given order.

Tables from the Bel Air High School and Lake City High School databases.

Types of Business Rules

There are two major types of business rules.....

Database oriented

Application oriented

Both types of business rules impose some form of constraint and help enforce and maintain overall data
integrity, but they differ with regard to where and how they are established.

Database oriented

In this method business rules impose constraints that you can establish within the logical design of the
database. You implement a given constraint by modifying various field specification elements,
relationship characteristics, or a combination of the two.

This business rule limits the values that you can enter into the VENDSTATE field to WA, OR, ID, and MT.
You can establish the business rule's constraint in a meaningful manner by modifying the Range of
Values element in the field specifications for the VENDSTATE field.
Application oriented

Business rules impose constraints that you cannot establish within the logical design of the database You
must instead establish them within the physical design of the database or within the design of a
database application, where they will be more applicable and meaningful.

An example of a typical application-oriented business rule:

19
BSC-DBMS
A customer with a "Preferred" status receives a 15% discount on all purchases. There are certain
constraints that designers apply to ensure that a database honors a company's business rules. These
constraints help preserve data integrity.

Business-rules constraints fall into two categories:

1. Field constraints within tables, and

2. Relationship constraints between tables.

For purposes of this lesson, we will resort to the language of general database discussions (for instance,
table, field, record).

1)Field constraints

There are various field constraints that can be imposed on a database to honor business rules Consider
the example below

Business rule: We ship our fertilizer to just four states: Texas, New Mexico, Oklahoma, and Louisiana.

Field constraint: These states are represented in a Customers table in a field called State as: TX NM, OK,
and LA. A constraint is placed on the State field so that only those four state abbreviations are
accepted into the database for that specific table.

Constraints are especially common on date fields, where dates would become meaningless in a database
if a product's ship date. Etc...

2)Relationship constraints

There are also various constraints that can be placed on the relationships (links) between tables.

Consider the example below:

Business rule: Every vendor must supply at least one product.

Relationship constraint: The relationship between the Vendors table and Products table must be
governed by a participation constraint wherein a single record in the Vendors table must be related
to at least one record in the Products table.

Q) Explain difference between File system and Database approach


There are the following differences between DBMS and File systems:

Basis DBMS Approach File System Approach

20
BSC-DBMS

The file system is a collection of


DBMS is a collection of data. In
data. In this system, the user
Meaning DBMS, the user is not required
has to write the procedures for
to write the procedures.
managing the database.

Data is distributed in many files,


Due to the centralized and it may be of different
Sharing of data
approach, data sharing is easy. formats, so it isn't easy to share
data.

The file system provides the


DBMS gives an abstract view of
Data Abstraction detail of the data representation
data that hides the details.
and storage of data.

DBMS provides a good It isn't easy to protect a file


Security and Protection
protection mechanism. under the file system.

The file system doesn't have a


DBMS provides a crash
crash mechanism, i.e., if the
recovery mechanism, i.e.,
Recovery Mechanism system crashes while entering
DBMS protects the user from
some data, then the content of
system failure.
the file will be lost.

DBMS contains a wide variety


The file system can't efficiently
Manipulation Techniques of sophisticated techniques to
store and retrieve the data.
store and retrieve the data.

In the File system, concurrent


DBMS takes care of Concurrent access has many problems like
Concurrency Problems access of data using some form redirecting the file while deleting
of locking. some information or updating
some information.

Database approach used in File system approach used in


Where to use large systems which interrelate large systems which interrelate
many files. many files.

The database system is The file system approach is


Cost
expensive to design. cheaper to design.

In this, the files and application


Due to the centralization of the programs are created by
Data Redundancy and database, the problems of data different programmers so that
Inconsistency redundancy and inconsistency there exists a lot of duplication
are controlled. of data which may lead to
inconsistency.

21
BSC-DBMS

The database structure is The file system approach has a


Structure
complex to design. simple structure.

In this system, Data


Independence exists, and it can
be of two types.
In the File system approach,
Data Independence
o Logical Data there exists no Data
Independence Independence.
o Physical Data
Independence

Integrity Constraints are easy to Integrity Constraints are difficult


Integrity Constraints
apply. to implement in file system.

In the database approach, 3


types of data models exist:
In the file system approach,
Data Models o Hierarchal data models there is no concept of data
o Network data models models exists.
o Relational data models

Changes are often a necessity


to the content of the data stored The flexibility of the system is
Flexibility in any system, and these less as compared to the DBMS
changes are more easily with a approach.
database approach.

Oracle, SQL Server, Sybase


Examples Cobol, C++ etc.
etc.

22

You might also like