Database Management System 2
Database Management System 2
Each and every individual, company and organization have their own aim and target. Without
maintaining or without any data or information they cannot achieve their goal. They formulate plans
polices and to achieve the goal they should have data and information. Any logical decision should be
made on the basics of facts. Therefore it is duty of manager to manage each and every data and
information in safe and secure method. One of the secure methods of maintaining the data is used of
database management system.
Data
Collection of raw-facts is called data
Information
Processed data is called information which gives clear meaning to the user.
Importance of data.
1. To get information about something.
2. To make plan and policies.
3. To make decision
4. To give current result.
Database:
A database is a repository (place where things/data are stored) for collection of related a data or
facts. Simply we can say that database is a collection of related data stored in a particular place.
A database contains a collection of related items or facts arranged in a specific structure.
The most common example of non-computerized database is telephone directory.
Database program can also sort lists of, arranging them in alphabetical, numeric, or chronological
order.
A database is an organized collection of data in easily accessible form which are shared and used
for multiple purposes as desired.
Importance Of Database
1. Data can be stored in small area
2. Save time while searching specific data
3. Database can store data for long time.
4. Database reduces risk of data being lost
c) referential integrity :set of rules that helps to show relationship between object in a
database is called ……..
1
Database Management System (DBMS)
Database Management System is a software tool that allows multiple users to store, access, and
process data or facts into useful information.
DBMS is an equally vital tool for people and organizations that use networks and stand-alone
personal computers.
DMBS can be used at home and for commercial use.
DBMS helps to maintain address list of friends and business contacts, manage household purchases
and budget, organize music CD and video libraries and store for home
Application of DBMS
Databases are widely used in
Bankingemployee information, client information, account, loan, banking transaction
Airlines employee information, ticket Reservation, Flight Schedule information, air traffic
information,
Universities employee information, Student information, registration No., Result.
Credit and Transaction Purchase on credit cards and monthly statement
Telecommunication Record of call made, generating monthly bills
Finance Sales and purchase of financial instrument
Human Resource Information about employee, salary, payroll taxes, benefits, and generation of
paychecks
Function of Databases
A database is a organization or collection of related information. Any database need ti have the
following features to be a functional database
1. To store, manipulate and manage the information.
2. To reduce data redundancy.
3. To keep the latest and correct information. (Data consistency).
4. To automate the data managing and processing system
5. To improve the data security system.
6. To provide data validation facilities.
Student Class
RN Stuent Address DOB Sex
Name Class Class Sec
1 Soni Ktm 12-20-2008 F id name
2 Tisa Pok 10-22-2007 F 10 Ten A
3 soni But 10-22-2006 F 9 Nine B
4 Rachana Dhading 10-22-2004 F
Student Class
Rn Classid
1 10
9 Nine
Disadvantage of DBMS
DBMS s/w are complex and expensive. so small organization cannot effort to implement database
properly
Databases are usually increasing the cost of data processing.
If database gets corrupted, it becomes difficult to get data/recover lost daata
DBMS expert is needed to install,manage and repair database software.
Element of database
Data: Value entered under a field
Table
Any object or entity or thing which has some property is called table. Table has field and each
field holds data called record.
Field/ attribute
Column heading of a table is called field. The property of an entity is known as field. An
entity can have unique property or common property. So we can say that an entity have many
property/field.
Record
The collection of data stored horizontally for each field is known as record. A record is
complete set of information about an entity.
Tupple:
A record row in database is called tupple.
Index
The index is a numeric value organized internally by database system in order to keep data in
organized form and helps in fast retrieval of data. It speed up search operation. An index field may
accept duplicate or only unique values.
Cell
A cell is a intersection of row and column.
End users: are person who has need to use the computer according to their will
Structure Query Language: A database language used to create, insert, update, select and delete,
manipulate data in a database. tables
Macro: Macro consist of lists of actions that execute in response to an event such as button click.
Visual Basic Code : This is highly flexible and comprehensive language you can use to develop
complete user interactive applications.
File keeping has number of disadvantage such as which are the advantages of database as well as
feature of database.
Data redundancy Keeping or placing one original data into different place or location. Having
various copy of original data/file is called duplicate data/file
3
Data inconsistency various copy of data may no longer agree or mismatch of data is called
inconsistency because other copy of original data/file may not contain actual data that is in the original
data/file.
Difficulty in accessing data It is difficult, time consuming and tedious to search a piece of
data/information in file system
Data Isolation Data are scattered in various file and file may be in different format. Writing new
application program to retrieve the appropriate data is difficult.
Integrity problems Data stored in the database must satisfy certain types of consistency constraints.
Constraints are the limitation that should be match while entering the data or information.
Data Atomicity problem Like mechanical and electrical system computer system is subject to
failure. Data values stored must be in consistent state prior it goes to failure.
e.g.
Consider a program to transfer $5.0 from Account A to Account B. if a system failure occurs
during the execution of the program, it is possible that $5.0 was removed from account A but was not
credited to Account B. Resulting in an inconsistent database state. Clearly, it is essential to database
consistency that either both debit or ccredit occurs or both should not occur.
No Concurrent access anamolies many systems allows many user to update the data without
inconsistency at the same time is called Concurrent access anomalies
Security problem DBMS system provides strict security so no data leakage occurs.
Component of database
A database management system (DBMS) provides a secure medium for the storage and
retrieval of data. It helps to integrate and manage a large volume of related data in a convenient way. It
allows sharing data in the files that make up the database, delete existing, data, make changes in the
existing data, and selectively access portions of the data. The major database components are:
Transaction Processing:
It is the method in which data or information are processed or manipulated. It is the series of
action in which different event such as update, delete or modify a set of record may occurs.
Concurrency Management:
It is the database activity that maintains the consistency of shared data.
Security: It refers to the protection of data against unauthorized access.
Storage Management:
It is the way that defines how the data to be stored and how the storage manager (user)
interfaces the operating system to access the physical storage.
Attribute are the descriptive properties of an entity that describe an entity. For each attribute, there
is set of permitted values
Types of attributes: Property of an object is called attribute. An object can have unique property or
common property.
4
Student
FN MN LN
Simple attribute Attributes that cannot be divided in subpart. Simple attribute accept single and
simple value
Composite attributes attributes that can be divided into subpart. If an attribute of an entity cannot
identify a record uniquely then we have to make other attribute as primary key along with the first
attribute.
E.g. name can be divided into f_name, m_name and l_name and
address can be divide into country, state, city,street,zipcode
single-valued attribute attribute that takes only one value is a single valued attributes
e.g. loan_no,sid,eid, etc
Multivalued attributes If an attribute that takes multiple values then it is said to be multi-valued
attribute.
e.g. phone_no can take multiple value such as phone1,phone2, phone3 etc.
Derived attributes attribute that are derived from other attribute are called derived attribute
e.g. age attribute can be calculate from Date_of_birth attribute
An attribute that take null values when an entity does not have a value for it.
Relational Database
A database made up of a set of tables or database which consists of collection of object called
entities and relationship among those object/entities is called relational database.
Relational database management system
A database management system which reflects the relationships among the object of databse is
called Relational database management system.
Relationship is a an association (link ) among several entities.
Set of entities and the set of all relationship of the same type s termed as entity set and relationship set
we create form, query and report in which we pull information from more than one table. this
work can be done by creating suitable relationship among tables.
Relationship set is a set of relationships of same type
Constraints are rules to be followed, when database is designed.
One to one (1:1) If an entity in entity set A is associated with at most one entity in entity set B
A B
a d
b e
c f
one to many (1:M) if an entity in entity set A is associated with any entity in entity set B
A B
a d
b e 5
c f
many to one (M:1) if any entity of A is associated with at most one entity of entity set B .
A B
a d
b e
c f
many to many (M:M) if any entity of entity set A is associated with any entity of entity set B
A B
a d
b e
c f
Participation constraints
Participation of an entity E in a relationship set R is said o be TOTAL if every entity in E
participate at least one in R.
If entity in B participate in R is said to be PARTIAL if some entityin E participate in R
Student(rn,name,address,dob,gender,phone)
Student(rn,name,address,dob,gender,phone)
File is a collection of information of various items. A file has a name called filename. The filename
of dBASE can have 8 characters and DBF as an extension, thus a total of 11 characters.
Data processing
The process by which the raw data or facts collected from the field are inputted to the computer to
process and computer gives the required result is called data processing.
Some of the terms used in data processing are:
Data collection collecting data from different source of filed by means of field survey,
questionnaire, interview.
Raw data or facts any piece of information that is collected in the field and not entered into the
computer.
Filing the process of keeping or storing collected data from the field in the registered is called
filing
Data entry putting the collected data to the computer in for further processing is called Data entry
6
Coding is the process by which programmer writes queries to manipulate data that are the database
is called coding
Encoding The method of hiding the original message by using some technique while sending
message.
Decoding The method of retaining the original message which was encoded by using some
technique while receiving message.
Edit/ing the method in which may change to the text but we do not save the changed text or
document is called edit/ing
Update/ting the method in which may change to the text and save the changed text or document is
called edit/ing
Insert/ing to enter data by using SQL is called insert and the method to entering the data to the
computer is called Insert/ing to enter data by using SQL is called insert and the method to entering
the data to the computer is called.
Select/ing manipulating data or taking data from database is selecting.
Delete/ting removing data from database is called deleting.
Modify/ing changing data in the database is called modifying.
Create/ing making any objects on the database is called creating.
Verify/ing proving or checking the data or information in the database is called verifying.
Filtering Removing unnecessary data from data base is called filtering.
Sorting ordering data in chronological (ascending order or descending order) is
Form : Form is an interface that retrieves data from database and displays to the user
Data models underlying the structure of database is the data model/or database model is collection
of conceptual tools for describing data, data relationship, data semantic and consisting constraints
e.g. entity-relationship model ,Hierarchical model, Relational model and Network model.
Database Model
Relational Model
Hierarchical Model
Network Model
Method of Database
Centralized
Decentralized Database.
Distributed
Data Entry
Classify
Process
Store
Retrieve
Duplicate
Disseminate
Action
Goald
SQL (Structure Query Language): is a database language which helps create database user and table. It
also helps insert , update, delete, select data in a database
Ms Access
Ms Access is a desktop database management system where we can create and maintain related data. It
is is a relational database management system (RDBMS). It uses file sharing mechanism. It collects
data and information in the form of tables.
Features of Ms Access
1. It provides useful database features such as database tables, forms, query,reports, data access pages
and macro.
2. It provide Backend as well as Front End database Development tool
3. It can easily add, edit, delete and display the data.
4. This provides end-user application development environment.
5. it incorporates three programming languages: Structure Query language (SQL), macro and Visual
Basic
Purpose of Ms Access
Ms Access provides the following facilities
1. Ms Access Database reduces data redundancy.
2. Ms Access Database can control data inconsistency.
3. Ms Access Database facilitates sharing of data.
4. Ms Access Database enforces database standards
8
5. It shows relationship among database object.
6. Ms Access Database ensures data security.
7. Ms Access Database maintains data integrity checks and validates data.
Importance of table
To store data about specific topic.
It holds the main information.
It facilitates grouping and sorting the relevant data.
9
summarize large amount of data and perform calculations on the data using various
types of calculation
create queries: queries used to create table and user in database.
Update queries: queries used to modify data in table of database.
Append queries: queries used to add more data in table of database.
Delete queries: queries used to remove data in table of database.
Find Duplicate query: this query is very useful for finding out redundant data in a table. By
using this query, we can search for particular fields that are prone to redundancy in a database.
Find mismatch/Unmatched query: this query enables us to find all the records in a table that
are related with other related table in the database.
Form
Form is a foreground object of DBMS, which is designed to enter new records, edit and delete the
existing records easily. Forms present the data from a table or a query in a way we want it to be
displayed.
Use of form
It is used to make modification, addition the data directly into the table
To view the table in user defined manner.
Database forms are interactive data entry forms.
They need to be attractive for the user and easy to use.
You can control and enhance the way your data looks on the screen.
You can perform extensive editing of data using macros and VB procedures.
You can link multiple form or reports by using macros or VB procedures that are run form
buttons.
A form can have one or more forms that show the related information of the data in the main
form.
Mainly there are two types of forms
master-detail forms: It is the main form of a DBMA which contain detail related
information of an object. This form can call the sub-form.
Sub-form: A form that can be embedded or called by master-detail form is called
sub-form
Different view/layout of form
columnar View
Design view
Datasheet view
Tabular view
Justified view
Advantages of Form over table
Form are easier to enter data than table.
It is easier to make modification than table.
It helps to make database application interactive and attractive
it is easier to focus on specific/particular data.
In form in your own way you can design on the screen.
You can perform editing of data using macros or visual basic procedures.
Way of creating form
Using wizard
Using design view
Controls object are the parts of a form or report that you use to enter, edit, or display
data. Controls let you view and work with data in your database application.
Different control objects used in form are:
there are two types of controls they are
1. Bound controls : helps to display data retrieved from database table.
text box
combo box
Text area
Radio buttons
Check box
1. Unbound controls : object which does not has control on data
Selecting control
Moving control
Grouping control
Resizing control
Aligning control
Label
10
button
Report
It is an object of MS-Access which helps to summarize, analyse, present and print data from
database
Reports are the printed result of data processing. It I s a very important object of database. A
report is an effective way of present your data in printed format or on a screen softcopy.
A report is a printed form of the database for the officers and users.
The data entry form and table are the place where the data are usually manipulated.
Report allows to view a complete set of record from one or more table
It is an important tool of Ms-Access.
Importance of Report
It is helpful to give complete required information related to an object after processing from
different table.
Report can compare, summarize and subtotal large set of data.
Report can be created to produce attractive invoices, purchase order, mailing and labels.
You can view reports on your screen before print it.
Way of creating report:
Auto Report
Report wizard
Form Report
Form is an interactive tool Report is a not an interactive tool
Form is used to enter and view data in database Report is used only to view the data from database.
Form should be attractive Report should attractive
Table Form
Form is a background tool Form is a foreground object of Ms-Access
Form is used to enter and store data in database Form is used to enter, edit and view data in database
Table Query
Form is a background tool Report is a not an foreground tool
Table is used to enter and store data in database Query is used to retrieve data and helps to do
calculation in database
Table do not have types There are different types of query
Form Query
Form is a interactive object Report is a not interactive
Form is used to enter and edit data in database Query is used to retrieve data and helps to do
calculation in database
Form has control objects Query do not has control object
Macro
11
Pages : the Data Access page is the user interface for the database . They are used in viewing and
entering data form in a website or internet.
Datasheet view: - is an object of Ms-Access which helps to enter data or you can create a data entry
form or topic
Wizard
A wizard is a small program that interviews us, asking questions about what we want to
accomplish, then it takes over answers and creates the table , query or whatever according to our
specification.
Desing View Wizard
1 It takes more time. 1 It saves our time.
2 We can make our own design. 2 We can choose formats from pre-mod
one.
3 We can create any field according to 3 We copy fields from any of the simple
own requirement. table.
Sorting:
Sorting is the process of arranging the records in a particular order of a field is known as
sorting. the order of sorting may be entered in ascending order(A-Z) or descending order (Z-A)
Filtering
Filtering is an activity by which specified records only can be seen on the basic of criteria.
Field size
field size is the property that set maximum or minimum size for data stored in a fixed set to
the text, number or auto number data type.
Macro
A macro is a set of one or more actions that each perform a particular operation, such as
opening a form or printing a report. Macros can help you to automate common tasks. For example, you
can run a macro that prints a report when a user clicks a command button.
or
A macro is a set of keystrokes and instruction recorded and saved under a short key code or
short name. When key code is typed or the macro name is used, the program carries out the instruction
of the macro.
Validation Rule
A rule that verify whether the data is entered data correctly or not.
Validation Text
A text that used to specify the message to be displayed to the user.
Format
Format property to specify the data display format for a field. Format property to display data
in a consistent format. For example, if you set the Format property for a Date/Time field to Medium
Date format, all dates entered will display in this form: 12-Jan-1999. If a user of your database enters a
date as 01/12/99 (or any other valid date format), Microsoft Access will convert the display to the
Medium Date format when the record is saved
Input Mask
If you define both a display format and an input mask for a field, Microsoft Access uses the
input mask when you are adding or editing data, and the Format setting determines how the data is
displayed when the record is saved. When using both Format and InputMask properties, be careful
that their results don't conflict
12
Caption
is the field property that
a. Rename a field name in a table or datasheet
b. Change the field name that appears in the datasheet
13