This document provides information about database management systems (DBMS). It defines a DBMS as a software system that stores data, processes data, and provides information in an organized way. It discusses some popular DBMS software like MS Access, Oracle, SQL Server, and MySQL. The document also explains some key concepts in DBMS like tables, records, fields, and objects. It provides examples of how a database with tables can be used to store and organize information.
2. Database
• Database is an organized collection of related information or data, where we can store organized
information for multiple purposes.
• A telephone directory is one of the most common examples of database, where the names of
telephone subscribers are given in an alphabetical order. Likewise dictionary, school student’s
record, teacher’s salary record etc. are also given.
• Databases are structured to facilitate storage, retrieval, modification, and deletion of data in
conjunction with various data-processing operations.
• A database consists of a file or a set of files that can be broken down into records, each of which
consists of one or more fields.
• DBMSs can manage any form of data including text, images, sound and video. Database and file
structures are always determined by the software.
3. • Raw form of any facts, figures or entities are known as data. Data alone
does not give any meaning. Data are raw, unorganized facts that need
to be processed which have no meaning.
• When data are processed, organized, structured or presented in a given
context to make it useful that is called information.
• Here, we can say data are meaningless but information is meaningful.
Data are the source of information. Without data information cannot be
formed. For example: Aaradhya, 1000, account, balance etc. are raw
data individually does not give any meaning.
• The processed form of data is known as information. When the data
becomes information it gives meaningful result. For example, Aaradhya
has 1000 balance in his bank account. Here Aaradhya, 1000, account,
balance all have their significant meaning. Thus, we can say that
information is the organized collection of inter-related data.
Data and Information
Data
Processing
Information
4. ● It reduces the data redundancy on the file. Redundant data are
repeated and necessary data exist on the file. So, we have to
reduce it to save the memory of the computer.
● Data stored on the DBMS are highly consistent. They are constant in
nature.
● It is possible to share data using DBMS. Various users are allowed to
share data according to their needs using the same database file.
● It is possible to apply the centralized security system on DBMS.
● It has a very high data integrity. We can retrieve data on complete
form using DBMS.
Advantages of Database Systems
5. ● High initial investment in hardware, software, and training.
● Overhead for providing security, recovery, and integrity functions.
● Cost for the hardware-upgrade to allow for the extensive programs
and the workspaces required for their execution and storage.
● Cost for the maintenance of the software which remains forever.
● An additional cost is required to transfer from a traditionally
separate application environment to an interpreted one.
● High cost for backup and recovery.
Disadvantages of Database Systems
6. • Electronic database is an organized
collection of data stored on a computer in
such a way that its contents (data) can
easily be accessed, updated and queried
upon with the help of a software program.
• An Electronic Database is a computer-
based collection or listing of information. It
can include professional, peer-reviewed
journal articles that are organized in a
systematic way with searchable elements or
fields.
• The Advantages of electronic database are
:- limitless capacity to store data, Speed,
Accuracy, Efficiency.
Electronic database
7. Elements of database
S.N. Book Name Quantity Rate
1 Computer Science 10 100
2 Social Studies 15 150
3 Moral Science 25 125
4 Optional Mathematics 28 275
5 Nepali 20 185
Records
Fields
Book bill table
8. Tables
01
A database table is
composed of records and
fields that hold data.
Records
02
Data are stored in records.
Records appear as rows in
the database table.
Fields
03
A field or column contains
information about a certain
type for all records.
Elements of data base
9. Tables
01
A database table is composed of records and fields that hold data. Tables are also called datasheets. Each
table in a database holds data about a different, but related, subject. Table stores a large volume of data
into rows and column format as below. In the given table, SN, Book, Name , Quantity and Rate are the field
names and the information stored on each field is called record.
SN Book Name Quantity Rate
1 Computer Science 10 100
2 Social Studies 15 150
3 Moral Science 25 125
4 Optional Mathematics 28 275
5 Nepali 20 185
10. Records
02
Data are stored in records. A record is composed of fields and contains all the data about one particular
person, company, or item in a database. Records appear as rows in the database table. A record for S.N. 5
is given as below from the above table
SN Book Name Quantity Rate
5 Nepali 20 185
11. Fields
03
A field is part of a record and contains a single piece of data for the subject of the record. A field or column
contains information about a certain type for all records. In the given table SN, Book Name, Quantity and
Rate are the fields of table where Book Name contains the name of each book in the table
Book Name
Computer Science
Social Studies
Moral Science
Optional Mathematics
Nepali
12. • DBMS is a software that stores data, processes them and provides information in an organized way.
• A database management system (DBMS) is designed to manage a large volume of information.
• It is a computerized system that stores data, processes them and provides information in an organized
form.
• Some of the popular DBMS software's are MS-Access, Oracle, FoxPro, SQL Server, My SQL, DBASE etc.
Data management involves both defining structures for storing information and providing mechanisms
for manipulating the information.
• Examples of the use of database systems are airline reservation systems, company payroll, employee
information systems, banking systems, credit card processing systems, and sales and order.
• DBMS basically deals with the creation of database, its management and retrieval process. Creating,
modifying, updating, appending, organizing, sorting, removing, and retrieving are the major tasks
performed easily, efficiently and accurately using Database management system
Database Management System (DBMS)
13. • Every organization have to maintain data
concerning their activities, business,
transaction, employees etc. For example,
your school maintains data regarding a
student's general information, academic
performance, punctuality and discipline.
These data need to be kept in such a way
that it can be readily available and can be
presented easily in desired formats.
• Some of the database management
system software are: MS Access, Oracle
database, SQL server, etc.
Cont.
14. Relational database management system
A relational database is a special type
of database where data is stored in a
number of separate but linked tables.
The software used to create relational
databases are called relational
database management system or
RDBMS. In relational database, two
tables are linked together using
common field or column.
15. Edgar Frank "Ted" Codd (19 August 1923 – 18 April
2003) was an English computer scientist who,
while working for IBM, invented the relational
model for database management, the theoretical
basis for relational databases and relational
database management systems. He made other
valuable contributions to computer science, but
the relational model, a very influential general
theory of data management, remains his most
mentioned, analyzed and celebrated
achievement.
Father of DBMS
Frank "Ted" Codd
16. WORKING OF DATABASE
MANAGEMENT SYSTEM
• DBMS provides a centralized control over data. A database system maintains a
centralized database, i.e. all the data kept at one place and any application
that requires the data can access it from this central location. Any application
can share data from the central location. Though sometimes it may be
necessary to duplicate the data i.e.com intern multiple copies of the data, the
redundancy can be controlled as the DBMS is aware of the multiple copies and
updates them regularly.
17. Features of DBMS:-
Large volume of data can be stored and updated easily.
Provides data integrity and security.
Easy in data administration or data management.
Provides the data sharing facility.
Reduces the data redundancy (duplication of data).
Provides concurrent access, recovers the data from the crashes.
Supports centralized control
19. Examples of DBMS
MySQL is an open-source relational
database management system. MySQL
was created by a Swedish company,
MySQL AB
MySQL Microsoft SQL Server
Microsoft SQL Server is a relational database
management system developed by Microsoft. As
a database server, it is a software product with
the primary function of storing and retrieving
data as requested by other software applications
20. More Examples of DBMS
Oracle
Oracle Database is a multi-model
database management system produced
and marketed by Oracle Corporation. It is
a database commonly used for running
online transaction processing, data
warehousing and mixed database
workloads.
IBM DB2
Db2 is a family of data management products,
including database servers, developed by IBM.
They initially supported the relational model, but
were extended to support object–relational
features and non-relational structures like JSON
and XML.
21. FoxPro was a text-based procedurally
oriented programming language and database
management system, and it was also an
object-oriented programming language,
originally published by Fox Software
More Examples of DBMS
Microsoft Access is a database management system
from Microsoft that combines the relational Microsoft
Jet Database Engine with a graphical user interface
and software-development tools. It is a member of the
Microsoft 365 suite of applications, included in the
Professional and higher editions or sold separately.
FoxPro Microsoft Access
22. Microsoft Access
Microsoft Access is an information management tool,
or relational database, that helps you store information
for reference, reporting and analysis. Access can also
overcome the limitations found when trying to manage
large amounts of information in Excel or other
spreadsheet applications. Microsoft Access is a
database management system from Microsoft that
combines the relational Microsoft Jet Database Engine
with a graphical user interface and software-
development tools. It is a member of the Microsoft 365
suite of applications, included in the Professional and
higher editions or sold separately. Wikipedia
23. 01
Duplicate data is minimized.
02
Information can be shared among
several users.
03
Information is more
accurate, reliable and
consistent.
Advantages of Microsoft Access
04
Information retrieval is faster and
easier.
24. WORKING WITH YOUR ACCESS ENVIRONMENT.
• Ribbon :- Access 2013 uses a tabbed Ribbon system instead of traditional main menus. The
Ribbon contains multiple tabs, each with several groups of commands. You will use these
tabs to perform the most common tasks in Access.
• Quick access toolbar :- The Quick access toolbar, located above the Ribbon, lets you access
common commands no matter which you tab you are on. By default, it shows the save, undo
and repeat commands.
• Backstage view :- Backstage view gives you various options for saving, opening, and printing
your database.
• Navigation pane :- The navigation pane is a list containing every object in your database. It is
designed to help you manage all of your objects. For easier viewing, the objects are organized
into groups by type. You can open, rename and delete objects using the Navigation pane.
28. Objects of MS-Access
Table: Table is a collection of various records. A table is a feature, comprising of parallel
columns and rows, which is used to store, organize, and view data on a particular topic.
Form: A form is an object of database which shows only the information you want to see. A form
is used to view data in a database, enter new data into the database, or edit data. We can
create from in database by using Design View , Auto form tabular , Auto form Columnar, Form
Wizard, etc.
Report: A report is used to show and print selected information from a table in a customized
manner. A report differs from a form because it does not allow you to make any modifications
or edits to the actual records within the table or tables.
Query: A query is a question that you ask about the data in your table(s). Query is also used to
perform various mathematical calculation is the database records.
Macros:- Macros automate common Access database tasks, such as opening and printing
tables, forms and reports.
Modules :- Modules are programs written in the Visual Basic language. Pages Data Access
Pages(DAP) are Web pages that allow you to view and work with data that is stored in ana
access database on the internet.
29. CREATING A DESKTOP DATABASE
A desktop database table holds your data and is stored on your local computer or
network. The data is displayed in rows (horizontal layout), with each row including a
list of column of field names (vertical layout) like a worksheet. Each field in the table
can be of a different data type, depending on the data to be held. Strong data in
the correct field type is important because you can take advantage of special
feature in the database. A database normally consists of more than one table,
having the tables correctly related to another will save you a lot of subsequent
work. An individual tool in access is the lookup wizard, which can automatically
build the required relationship between the table..
30. Starting MS-Access
Method-1
Step 1: Press Windows Key and R at
the same time. Run window
appears.
Step 2: Type ‘msaccess’ as shown in
the figure alongside.
Step 3: Finally click on OK button
31. Starting MS-Access
Method-2
Step:1 - Click on Start.
Step:2 - Select All Programs.
Step:3 - Choose Microsoft Office folder.
Step:4 - Now choose Microsoft Access from the list.
Step:5 - We will get windows with various choices.
Step:6 - Select blank database & type the database file name on the file name
box.
Step:7 - Finally click on Create button.
32. Creating a new database file
When MS-Access is started, it gives user a choice of either creating a new database or opening
an existing database. Follow the below steps to create a new database file:
Step 1: Click on the Blank desktop database.
A Blank desktop database dialog box will appear.
Step 2: Type the File Name.
Step 3: Choose the required folder where you
want to save.
Step 4: Click on Create button
33. Follow the below steps to create a table:
Step 1: From Create tab, click on Table Design button of Tables group.
Step 2: Add the required Field Name and Data Type.
Step 3: Right click on the Table1 tab in the above figure.
Step 4: Type Table name. Click on OK.
Note: A field name can be up 40 characters long.
Creating Table in MS-Access
34. Adding Fields in a table
Follow the below steps to add a field in an existing table:
Step 1: Open the database and open the table.
Step 2: Right click on the field above which you want to add a new field
Step 3: Click on Insert Rows. A new blank field is inserted above the selected field.
Step 4: Type Field Name and Data Type.
35. Deleting Fields in a table
• Follow the below steps to add a field in an existing
table:
Step 1: Open the database and open the table.
Step 2: Right click on the field which you want to delete.
Step 3: Click on Delete Rows.
36. Defining Data types
• Data type determines the kind of values that you
can store in the field. After you enter the valid field
name, it allows a user to select the data type for
the field. You can use the Data Type property to
specify the type of data stored in a table field such
as text for name field, number for class field, Date
and time for DOB field etc. Each field can store
data consisting of only a single data type.
37. Table - MS-Access Data types
Data
Type
Description
Maximum
Data / Space
Default Field
Size
Short Text
Used for text or combinations of text and numbers, as well as
numbers those don't require calculations, such as phone
numbers. Up to 255
Characters
255
Long Text
Lengthy text or combinations of text and numbers. Up to 64,000
Characters
_
38. Table - MS-Access Data types
Data Type Description
Maximum
Data / Space
Default Field
Size
Number
- Byte
Used for data to be included in mathematical
calculations.
1,2,4 or 8 Bytes Long Integer
Stores numbers from 0 to 255 without decimals.
1 byte
-Integer
- Long Integer
- Single
- Double
Stores numbers from -32768 to +32768 without
decimals.
2 bytes
Stores numbers from -2147483648 to
+2147483647 without decimals.
4 bytes
Single precision floating point numbers from -3.4
x 10-38 to 3.4 x 1038.
4 bytes, 7 decimal
places
Double precision floating point numbers from -
1.797 x 10-308 to
1.797 x 10308.
8 bytes, 15 decimal
places
Date/Time Used for dates and time data. 8 Bytes
Currency Used for currency values. 8 Bytes -
Auto Number
Used for unique sequential
4 Bytes _
39. Data Type Description
Maximum
Data / Space
Default
Field
Size
Yes/No
Used for data that can be only one of two
possible values, such as Yes/No. 1 Bit _
OLE Object
Used for OLE objects (such as MSWord
documents, MS-Excel spread sheets,
pictures, sounds).
Up to about 2
GB
_
Hyperlink Used for hyperlinks.
Up to 2048
Characters _
Attachments To attach any supported type of file
Up to about 2
GB _
Lookup
Wizard
Used to create a field that allows you to
choose a value from another table
Dependent on the
data type of the
lookup field
_
Table - MS-Access Data types
40. Field Description
• You can enter the description of each field in the Description column. It helps you to remember the use
and purpose of a particular field. This is an optional part in a database. It is displayed in the status bar
when you select this field on a form.
Primary Key
41. Primary Key
• Primary key is a special field or group of fields in the table that uniquely identifies
each record from the database. To distinguish one record from another, table must
contain a unique field named as primary key. The primary key does not accept
duplicate value for a field and it does not allow a user to leave the field blank or null.
The primary key is an identifier such as a student ID, a Product code, Exam roll no.
etc. Hence, primary key is unique to each record.
• Importance of Primary Key
1. To identify each record of a table uniquely.
2. To reduce and control duplication of the record in a table.
3. To set the relationship between tables.
42. Setting the Primary Key
Step 1:Open the table in design view.
Step 2: Click on the field in which you want to apply primary key.
Step 3: A key icon will be displayed on the left side of the primary key field.
43. Field Properties Pane
• Field properties pane displays list of properties associated with each field data type. To control over the
contents of a field we can set the field size, format, validation rule etc.
• The general properties of fields are given below:-
Field Properties – Short Text
Field Properties – Number
44. Field Property Purpose
Format It determines the way that the field appears when it is displayed or printed in
datasheets or in forms or reports that are bound to the field. You can use any valid
number format. In most cases, you should set the format value to currency.
Decimal Places It specifies the number of decimal places to use when displaying numbers.
Input Mask It displays editing characters to guide data entry. For example, an input mask might
display a dollar sign ($) at the beginning of the field.
Caption It displays the label text that is displayed for this field by default in forms, reports, and
queries. If this property is empty, the name of the field is used.
Default Value It automatically assigns the specified value to this field when a new record is added.
Validation Rule It supplies an expression that must be true whenever you add or change the value in
this field. It is used in conjunction with the validation text property.
Validation Text It displays when a value that is entered violates the expression in the validation rule
property.
Required It requires that data are entered in the field.
Different types of field properties are listed below:
45. Caption
Caption field property is the
alternative name given for any
field. This helps to make field
name more explanatory. The
maximum size for this is 2048
characters. It is also a label for a
field when used on a form. If
caption is not entered, field name
is used for label for a field on a
form.
Default Value field property is one
that is displayed automatically for
the field when you add a new
record to the table. Default values
are preset values defined for a
column type. Default values are
used when many records hold
similar data.
Default Value
46. Field Size
• You can use the Field Size property to set the maximum size for data stored in the field that is set to the
Text or Number data type.
• For Text data, the amount of data that you can store can be determined by the number of characters
you wish to store on it. Maximum is 255 characters.
• For numeric data, the field size can be set depending upon the type and range of value you wish to
store. Below table explains about the numeric data range and storage.
Field Size Setting Range of Values
Decimal
Places
Storage Size
(in Bytes)
Byte 0 to 255 None 1
Integer -32768 to 32767 None 2
Long Integer 2147483648 to +2147483647 None 4
Single -3.4 x 10-38 to 3.4 x 1038. 7 4
Double -1.797 x 10-308 to 1.797 x 10308 15 8
47. • It is basically used to specify the layout for a field. Format field property allows you to display data in a
format different from the way it is actually stored in a table. It is also known as display layout for a field. The
format property uses different settings for different data types.
• Format field property allows you to display data in a format different from the way it is actually stored in a
table. It is also known as display layout for a field. Depending on the type of data, the option in the Format
menu will differ.
Format Symbol Meaning
$ Indicates text character is optional
@ Text character in the form of character or space or
number not meant for calculation is required.
& Text character is not required.
< It converts all characters to lowercase.
> It converts all characters to uppercase.
For Text and Memo Data Types
Format
48. • You can format the number and currency data with predefined formats. You can
choose the pre-defined formats and many other symbols for creating your own
customized numeric and currency data format given below.
For Numeric and Currency Data Types
Format Setting Meaning
General
Number
It displays number as entered without changes. It is default for number field.
Currency It displays the number with currency symbol with separator. It is default for
currency field.
Euro It displays number with Euro currency symbol and separator.
Fixed It displays at least one digit
Standard It displays thousand separator.
Percent It displays the value multiplied by 100 with added % sign.
Scientific It uses standard scientific notation with exponents.
49. For Date and Time Data Types
Setting Description
General Date Here, if the value is date only, no time is displayed and if the value is time
only, no date is displayed. This setting is the combination of the short date
and long time.
Long Date Long date setting,
Medium Date Medium date setting,
Short Date Short date setting,
Long Time Long time setting,
Medium Time Medium time setting,
Short Time Short time setting,
50. For Format String
Format String
$#,##0.00
$#,##0.00
##.00%
##.00%
For Logical (Yes/No) Data
Types
A logical format allows only two
possible values. The default setting
is Yes/No. You can use format as
Yes/No or ON/OFF or True/False
which displays with checkbox. A
checked checkbox represents Yes
or True or On. An unchecked
checkbox represents No or False or
Off.
51. Input Mask
• Input Mask is a field property that determines what kind of data can be entered in the field
how it looks and how can it be entered in a field. It is simply the control over the data entry.
• The task of input mask are:
1. It helps to enter field values in a specified pattern.
2. It can fill in constant characters like dash (-), parenthesis ( ) and slash (/) and optionally store These
characters as part of the field value as you do not have to enter these characters at the time of data entry.
52. Create your own (custom)
Input Mask
• Input mask wizard can be the easiest option for certain fields like, pin code, phone
numbers, date and time.
• You can create your own input masks if you need to format other kinds of values.
The rules for creating input masks are :
1. It contains three possible parts, separated by semicolons (;).
2. It uses special characters in a mask to impose limits on what can be entered in a
field.
53. Input Mask Characters
• The input mask characters are used to indicate how to limit the data that gets
entered in a field. The following input mask characters are allowed to use in the
input mask.
Character Description/Function
0 Number is entered and required (0-9), no plus or minus sign.
9 Number is entered and optional (0-9), no plus or minus sign.
# Optional number or space, plus and minus sign is allowed.
L Letter is entered and required (A-Z).
? Letter is entered and optional (A-Z).
A Letter or number entered and required.
A Letter or number entered and optional.
& Any character or space required.
C Any character or space optional.
54. Validation Rule
A validation rule limits or controls what users can enter in a table field or a control on a form. Access provides
several ways to validate data, and you often use several of those techniques to define a validation rule.
Types of Validation Rule
Field Validation Rules
Record (or table) Validation
Rules
55. Field Validation Rules
It uses a field validation rule to check the value that you enter in a field when you leave
the field. For example, suppose you have a date field, and you enter >=#01/01/2017# in
the validation rule property of that field. Your rule now requires users to enter dates on or
after January 1, 2017.
Record / table Validation Rules
It uses a record validation rule to control when you can save a record (a row in a table). Unlike field
validation rules, record validation rules refer to other fields in the same table. You create record
validation rules when you need to check the values in one field against the values in another.
56. Record / table Validation
Rules
Expression Example Description
Validation expression for numbers
< <100 Entered value must be less than 100.
> >50 Entered value must be less than 50.
<> <>0 Entered value must not be equal to 0.
<= <=100 Entered value must be less than or equal to 100.
>= >=50 Entered value must be less than or equal to 50.
= =10 Entered value must be equal to 10.
Between ... and .. Between 0 and
100
Entered value must be within the range of 0 to 100.
57. Validation Text
• Validation text is a field property which displays the error message when the user fails to use the
validation rule. If the data entered is invalid according to the specified validation rule it displays the
validation text.
Validation Text Message Box Field – “A” Or “B”
Validation Rule for Section
58. • Validation Text
Validation text is a field property which displays the error message when the user fails to use the
validation rule. If the data entered is invalid according to the specified validation rule it displays
the validation text.
• Required
Required property is used to specify whether a value is required in a field or not. So, Yes and No
are the options for required property. If this property is set to Yes for a field, the field must receive
a value during data entry. If this property is set to No for a field, the field can be left blank without
any value during data entry.
• Allow Zero Length
Allow zero length property is only for the text and memo data types. This property works with the
required property. If you set the required property to ‘Yes’ and allow zero length to ‘No’, data must
be entered during data entry.
• Indexed
This property speeds up searching and sorting of records based on a field. For example, if you
search for specific student name in the first name field, you can create an index for this field to
speed up search for the specific name.
59. Table - Indexed property
settings
Setting Description
No No indexing.
Yes (Duplicates OK) The index allows duplicates.
Yes (No Duplicates) The index does not allow duplicates.
60. Creating table using design view
• After creating a blank database, we need to create a
table. The steps are as follows:
1. Create a database file.
2. Click on Create tab.
3. Choose Table Design from the ribbon.
4. A blank table will display.
5. Type the required Field name and Data type.
6. Press CTRL+S to save the table under new name.
61. To enter records on table:
• Double click on the table name.
You will get a table that you have created with the name
of fields.
• Enter records on the table and press CTRL + S
again to save it.
62. To modify the fields on the table:
• Right click over the name of the table.
• Select the Design view option.
• Now you will get the previous design box, you can change the structure of the table as
required and press CTRL + S to save it.
63. Delete Records in a Datasheet
You can remove the unwanted records of the datasheet. Follow the below steps to delete records
in datasheet:
Step 1: Open the table in a Datasheet View.
Step 2: Right-click on the square box left to
the record which you want to delete. A pop-up menu will appear.
Step 3: Click on Delete Record option. A message box will appear.
Step 4: Click on Yes.
64. • You can temporarily hide a column(s) or field(s) so that you can view more columns in a larger
datasheet.
• Follow the below steps to hide fields:
Step 1: Right-click on the column heading (field name) which you want to hide. A pop-up menu
will appear.
Step 2: Click on Hide Fields option.
Hiding the columns or fields
65. Unhide the hidden fields
Step 1: Open the table in Datasheet View.
Step 2: Right-Click on any Column
heading. A pop-up menu will appear.
Step 3: Click on Unhide Fields option. An Unhide Columns dialog box will appear with the list of fields.
Step 4: Click on the check box of required field to unhide.
Step 5: Click on Close.
66. • You can freeze one or more columns on a datasheet so that they become the
leftmost columns and are visible at all times no matter wherever you scroll.
• Follow the below steps to freeze column(s):
Step 1: Open the table in Datasheet View.
Step 2: Right-Click on the column
heading which you want to freeze.
A pop-up menu will appear.
Step 3: Click on Freeze Fields option.
Freeze Columns
67. Unfreeze Columns
• You can unfreeze columns on a datasheet.
• Follow the below steps to unfreeze column(s):
Step 1: Right-Click on the column heading.
A pop-up menu will appear.
Step 2: Click on Unfreeze All Fields option.
68. Adjusting Column Width
● In datasheet we can adjust the column width as required to fit the data in the field. In some case field might
contain the longer data that might not be easily visible and in other case field might contain the short data
that taking unnecessary longer width. So, to improve from this inefficient view of datasheet we have to
adjust the column width.
● This can be done in the following ways:-
Method 1
By dragging the field sizing line from the right most corner of the field header.
Method 2
By double clicking on the field sizing line.
Method 3
By setting the fixed width in a column width dialog box.
Step 1: Right-Click on the header of column.
Step 2: Click on Field Width option. A Column Width dialog box will appear.
Step 3: Type the required width value.
Step 4: Click on OK.
69. Adjusting Row Height
• In datasheet we can also adjust the height of row as
required to fit the records in the row. This can be
done in below mentioned two ways.
Method 1
By dragging the row sizing line from the bottom most corner of
the row.
Method 2
By setting the row height in a Row Height dialog box.
Step 1: Right-Click on the square box left to the required row. A
pop-up menu will appear.
Step 2: Select Row Height option. A Row Height dialog box
will appear.
Step 3: Type the required row height.
Step 4: Click on OK.
70. Sorting Records
• The process of arranging all the records in a table either
ascending or descending order based on field or fields is
known as sorting.
Text types of data are sorted in alphabetical order (i.e. A to Z
or Z to A).
Date and Time data are sorted from oldest to newest or
newest to oldest.
Number/Currency types of data are sorted in smallest to
largest or largest to smallest
• Follow the below steps to sort data of Short Text field:
Step 1: Open the table in Datasheet View.
Step 2: Right-Click on the column heading of a field which you
want to sort.
A pop-up menu will appear.
Step 3: Click on Sort A to Z option.
The data will be sorted in alphabetical order.
Before Sorting
After Sorting
71. Filtering Records
• Filtering is the process of viewing required
record of a table that matches the
specified criteria. While filtering, you can
use criteria to search values in one or more
than one field.
• We can use the following options to filter
the record:-
1. Filter by selection
2. Filter by form
3. Advance Filter or sort
72. Creating a Relationship
Relationship:-
• A primary feature of relational databases is that
they contain multiple tables, each of which can
have a relationship with any of the other tables.
• Relationships are ties that are created between
tables in the database so that MS-Access can
combine data from more than one table to
create reports. It is how tables determine how
they correspond to each other.
73. Types of Relationship
One-to-one relationship:
For each record in one table, there is one and only one matching record in a different table. It is as if two tables
have the exact same primary key. Typically, data from different tables in a one-to-one relationship will be
combined into one table.
One-to-many relationship:
For each record in one table, there may be zero, one or many records matching in a separate table. For
example, you might have an invoice header table related to an invoice detail table. The invoice header table
has a primary key, Invoice Number. The invoice detail table will use the invoice number for every record
representing a detail of that particular invoice. This is certainly the most common type of relationship you will
encounter.
Many-to-many relationship:
This relationship cannot be defined in MS-Access without the use of a mapping table. This relationship states
that records in both tables can have any number of matching records in the other table.
74. To create a relationship, first we have to create the related tables as below.
• Be sure to set a format and default value for the date created fields on both tables (you shouldn’t need to
enter this field - the system can do that). Now, to create the relationship between all three tables we can do
as below.
• Click on Design, and select the Relationships options
• A Show Table dialog box will appear, displaying all three tables. Select all of them and click Add.
• Click Close to close the dialog box.
75. You will now see three boxes which represent your three tables. Click and drag the Customer ID
from the Customers table cross to the corresponding CustomerId field on the orders table
The Edit Relationships dialog will appear. Click Enforce Referential Integrity so that it is checked. Check that
the values are the same as the following screenshot and click OK.
76. • You will now see a line established between the CustomerId field on the Customers table and
the CustomerId on the Order stable.
• Now do the same for the Products table. That is, click and drag the ProductId from the
Products table across to the corresponding ProductId field on the Orders table.
77. Deleting the Relationships
• When we delete a relationship, we remove something from the
database, but if you delete a table from the diagram, you are changing
only the relationship picture. The table is not deleted from the
database, and it can be easily be added back to the diagram. When
you save the relationship diagram, you are saving only a picture. It is
when you delete or create a relationships that the database gets
changed.
78. Query
Query is the question asked for the database. Information
stored in any database becomes meaningful only when you
will be able to retrieve the desired information. So, query is
an object of database that is used to view, retrieve, change
and analyze records from a table or multiple linked tables
based on specified condition.
Using a query, you can answer very specific questions about your data
that would be difficult to answer by looking at table data directly. You can
use queries to filter your data, to perform calculations with your data, and
to summarize your data.
79. Select Query
• Select query is simply used to select and display the relevant data from the
database. You can select all or part of data from a single or multiple tables or
existing queries and display in datasheet. You can also use a select query to
group records and calculate sums, counts, averages, maximum and other types
of totals.
• Creating a Select Query
Follow the below steps to create a select query:
Step 1: Open the database file created in MS-Access.
Step 2: Click on Create tab.
Step 3: Click on Query Design button from Queries group. QBE (Query By Example)
grid will appear. Also, a Show Table dialog box will appear with the list of tables
and queries created in the database.
Step 4: Select the required table based on which you are creating query. Click on
Add.
Step 5: Click on Close button.
80. Cont.
• A select query can contain specifications for the fields (columns) to return, the
records (rows) to select, the order to put the records in, and the way to group
(summarize) information.
• Select query can be used to:
- view subset of records.
- retrieve data form one (or more) tables.
- display the results in a datasheet.
- update the records from within the datasheet.
81. Running the Query
• After making a query, you need to run.
Follow the below steps to run a query:
Step 1: Click on the Design tab under Query
Tools.
Step 2: Click on Run button from Results group.
A new datasheet will be displayed based on the
criteria and other settings we provided in the
query.
82. Functions
• SUM – It is the total of the values in a field.
• AVG – It is the average of the values in a field.
• COUNT – It counts number of values, excluding empty cells,in a field for all
records
• MIN – It is the lowest value in a field.
• MAX – It is the highest value in a field.
• STDEV – It measure of the dispersion of a frequency distribution.
• VAR – It is the square of the standard deviation
83. QBE Grid
• The QBE grid appears with two sections. The upper section shows the list of fields in the selected table and
the lower section shows the grid with rows and columns where we define the query.
• The first row in the grid shows the fields that we have selected from the table.
• The second row shows the table from which the field is selected.
• The third row is ‘Sort’. We can select ‘Ascending’, ‘Descending’ or ‘Not sorted’ for sort. If we set sorting
option (ascending or descending) for more than one field then the leftmost field for which sorting is enabled
becomes the primary sort key and other sorting enabled fields subsequently become the secondary sort
keys.
• Show row has check box for each field. The fields that are checked at this row are displayed and those not
checked are not displayed.
• The fifth row is ‘Criteria’. Here, we can provide criteria or condition to select the records from the table.
• The last row is ‘or’. Here, we provide the criteria which are tested with OR logical operator with the above
condition or criteria mentioned in the row ‘Criteria’.
84. Parameter Queries
• A parameter query is a query that displays a dialog box
prompting users for information, that information can be used for
retrieving records or a value you want to insert in a field.
• You can design the query to prompt you for more than one piece
of information.
for example, you can design a query to prompt a user for two
dates (beginning and end date). Access can then retrieve all
records that fall between those two dates.
• Parameter queries are also can be used as the basis for forms,
reports, and data access pages.
For example, you can create a monthly earnings report based on
a parameter query. When you print the report, Access displays a
dialog box asking for the month that you want the report to
cover. You enter a month and MS-Access prints the appropriate
report.
85. Crosstab Query
• Crosstab query is used when you want to calculate and restructure summary data to
make it easier to read and understand.
• Crosstab queries calculate a sum, average, count, or other type of aggregate
function to calculate data that is grouped by two types of information one down the
left side of the datasheet and another across the top. If you want to use values from a
Date/Time field for column headings, but want to group the dates into intervals that
the wizard does not provide, such as fiscal year or biennium, do not use the wizard to
create your query. Instead, create the crosstab query in design view, and use an
expression to create the intervals.
86. Action Query
• Action Query
• An action query is a query that makes changes to or removes many records in just one operation. Below are
the four different types of action queries.
1. Delete Query
2. Update Query
3. Append Query
4. Make Table Query
Delete Query Update Query Append Query Make Table Query
Action Query
87. Cont.
• Delete Query: A delete query deletes a record or group of records from one or more tables. For
example, you can delete the records of those students who have got marks less than 40 in
each subject in the marks database.
• Update Query: An update query makes entire changes to a record or group of records in one
or more tables. For example, you can change the class of students from 9 to 10 when students
are promoted to 10th grade in the student database. With an update query, you can change
data in existing tables.
• Append Query: An append query adds a group of records in one or more tables to the end of
records. For example, suppose that some new students have been admitted in school and you
need to keep the records of those students in the school’s database. To avoid typing all this
information into your database, you’d like to append it to your students table of school’s
database.
• Make-Table Query: Make-table query creates a new table from all or part of the data in one or
more tables.
88. Structured Query Language
(SQL)
• You can use SQL to query, update, and manage relational databases such as MS-Access. In MS-Access
you can write queries in SQL format. Queries written in SQL are also known as SQL statement. When you
create a query in design view, MS-Access automatically makes the equivalent SQL statement. You can
view it selecting the SQL view shortcut menu option. In below figures, you can see two queries created in
design view option and their equivalent SQL query. In MS-Access you can write queries in SQL format.
Queries written in SQL are also known as SQL statement. When you create a query in design view, MS-
Access automatically makes the equivalent SQL statement. You can view it selecting the SQL view
shortcut menu option. In below figures, you can see two queries created in design view option and their
equivalent SQL query.
89. Creating Queries Using Design View
• Select the queries object from the database window.
• Select and click on Query Design option from Create menu.
• You can see the Show Table dialog box.
• Select and add the source for designing query.
Source can be Tables or existing queries or
both. After you add table as a source it displays as below.
• Double click on the field(s) or simply drag the field(s) to the
bottom half of the window in the proper order that you want
to view in query datasheet.
• Click on Run option to view the result of the query created.
After you follow all the above mentioned steps, for all the queries except select query you have to select from
shortcut menu list or from the quick access toolbar as shown in the figure.
90. Tasks in QBE grid:
Step 1: First you need to bring the required field of table in the grid. We can drag
or double click each field to bring them in the grid. So, bring the required field of the selected table from the upper
section of QBE.
Step 2: Choose the fields and select either Ascending or Descending from the Sort row, if you want to display
the result in sorted order of any field.
Step 3: Remove the tick (√) mark from the checkbox of the Show row, if you don’t want to show field(s).
Step 4: Set the criteria in Criteria row. In this example, “10” is written in the Class field and “A” is written in the
Section field. It means only the records of Class 10A are selected in the query.
91. Wildcard characters and operators in query
Wildcards/
Operators
Example Description
? ?????UP
It represents a single character. ?????UP shows the records from the specified field that
has first any five character before UP.
*/ S* / Like S*
Represents the number of characters. S* retrieves the record from the field that starts
from the character S.
# Represents any single digit, 0-9.
> >100 Shows the record where the specified field is greater than 100.
> <200 Shows the record where the specified field is less than 200.
>= >=100 Shows the record where the specified field is greater than or equal to 100.
<= <=200 Shows the record where the specified field is less than or equal to 200.
<> <>50 Shows the record where the specified field is not equal to 50.
Between....
And
Between #02/04/10#
And #04/07/12#
Shows the record between 02/04/10 to 04/07/12 date.
In In("Ram", "Hari") Shows the record that has the field value as Ram or Hari.
AND >60 And <=80
Shows the record that has specific value from
61 to 80
OR "Bus" OR "Car" Shows the record that has specific value Bus or car.
Is Null Shows the record that has no value.
IS not Null Shows the record that has no null (blank) value.
92. Query Calculation Sample
• Prepare a query that displays those student’s record who have secured more than 90 in computer.
• Create a database and create a table in design view with the information such as Student Roll , Name ,
Class, Math , Computer, English and Social then save the table.
• Click on Create tab and select Query Design option.
• Add the table and add the table field by double clicking over it.
• Set the criteria as >90 under the computer field and save it.
• Now, just click on the query, then you can see those records who have secured more than 90 in
computer.
93. Forms
• Form is one of the MS-Access database objects that is primarily used to
create an interface for entering data in a table or multiple linked tables.
• Forms are basically GUI (Graphical Users Interface) using which users
interact with MS-Access database.
• Form also displays complete record one at a time, so you can view and
modify records using the form.
94. Creating form by using the wizard
• The wizard enables you to select the fields from a table or multiple linked tables, layout, and user interface
for the form. Follow the below steps to create forms using the wizard option:
Step 1: Open the Access database file.
Step 2: Click on Create tab.
Step 3: Click on Form Wizard button from Forms group.
Form Wizard dialog box will appear.
Step 4: Choose the required table from the Tables/Queries drop-down list.
95. Cont.
Step 5: A list of fields of the selected table will be displayed. Now, you have to select the fields that you want
to keep in the form from the Available Fields box. To select fields as per the requirement, click on single
arrow button to select a single field or you can also select all the available fields at once by clicking on
double arrow button. After selecting fields click on Next button.
Step 6: Select the desired layout. In this example, Columnar is chosen. Click Next.
Step 7: Type the title of the form. In this example, Marks Forms is typed.
Step 8: Click on Finish button.
96. Cont.
Now, the form for the Marks table is created as:- below:
Click here and type
to edit field values
New (blank) Record
Last Record
Next Record
Previous
Record
First
Record
97. Entering Data Using a Form
• After the form is created, you can enter the data simply typing in the text box. Whereas MS-Access form
also contains various control options while entering the data. These control options are, Text box, Combo
box, List box, Check box, Label, Command button, Tab control, Image, hyperlink etc.
• Steps to add records in form datasheet are as follows.
1. After you open form datasheet mouse cursor will be placed in the first field of first record. Type the required
data in the field.
2. Press Tab or enter to move to the next field. Or, simply place the mouse cursor in the desired field.
3. When you finish entering the all the data for the first record, MS-Access automatically prompts for entering
the second record and so on.
98. Report
• Report is a type of access database object
used to present information in an effective
and organized format that is ready for
printing.
• Using the report, you can display the
information the way you want to view it.
• A report's record source refers to the fields
in the underlying tables and queries. A
report need not contain all the fields from
each of the tables or queries that it is
based on. Creating a report is very similar
to creating a form.
99. Creating a report
• The wizard enables you to create a report in a desired format. The Report
Wizard provides you with more flexibility such as you can choose the
tables and fields, group the data, sort the data, summarize the data,
choose a layout and orientation, apply a style, and title your report.
• Follow the below steps to create a report using Wizard:
Step 1: Open the Access database file.
Step 2: Click on Create tab.
Step 3: Click on Report Wizard button from Reports
group.
Report Wizard dialog box will appear.
Step 4: Choose the required table from the Tables/
Queries drop-down list.
100. Step 5: A list of fields of the selected table will be displayed.
Now, you have to select the fields that you want to keep in
the form from the Available Fields box. To select fields as per
the requirement, click on single arrow button to select a
single field or you can also select all the available fields at
once by clicking on double arrow button. After selecting fields
click on Next button
Step 6: On the next wizard screen, you can further group
records in the report by a particular field. To group by a field,
click the field and then click the arrow button. You can select
several grouping levels in the order you want them.
Then click Next to move on.
Step 7: The wizard then asks whether you would like to sort the
records in the report as in the below figure If you want to sort the
records by a particular field or fields, open the top drop-down
list and select a field by which to sort. Click Next to move on.
Step 8: On the next wizard, select the required Layout and Page
Orientation. Click Next.
Step 9: Type the title of the report. In this example, Marks Report
is typed.
Step 10: Click on the Finish button.
102. Viewing and Printing Reports in Print Preview
• When you create a report with Report
Wizard option, the report appears in
Print Preview (as shown in above
figure). From there, you can print the
report if it is ok or go to Report Design
view to make changes. In the Print
Preview mode, you can zoom in and
out on the report using the Zoom tool
(click once to zoom in and click again
to zoom out). Using the appropriate
button on the Print Preview toolbar, you
can also display the report as one
page, two pages, or multiple pages.
103. Summary
A collection of systematically organized inter-related data is called a database.
Raw form of any facts, figures or entities are known as data.
The processed form of data is known as information.
Database management system (DBMS) is a computerized system that stores data process
them and provide information in an organized form.
Some of the popular DBMS software are MS-Access, Oracle, MS-SQL Server, MySQL, etc.
Tables are the building block of database.
A record or row contains information about single items in a database.
A field or column contains information about a certain type for all records. MS-Access is DBMS
software developed by Microsoft Corporation. It is distributed with MS-Office package.
Tables, Queries, Reports and Forms are the four main objects of MS-Access database.
Tables are the primary building block of database.
Data Type supported by MS-Access are Short Text, Long Text, Number, Date/ Time, Currency,
AutoNumber, Yes/No, OLE Object, Hyperlink, Attachment and Lookup Wizard.
Primary Key is a special field or group of fields in the table that uniquely identifies each record
from the database.
Caption is the alternative name given for any field.
Indexed property speeds up searching and sorting of records based on a field.
104. Summary
There are two views of Table: Design View and Datasheet View.
Using the datasheet view, you can add, modify, search or delete records.
You can hide/column and freeze/unfreeze required column(s) of a table.
The process of arranging all the records in a table either ascending or descending order based
on field or fields is known as sorting
Query is the question asked to database.
There are two main types of Query used in Access: Select Query and Action Query.
Select query is simply used to select and display the relevant data from the database.
An action query is a query that makes changes to or removes many records in just one
operation. Examples of action query are update query and delete query.
Form is one of the MS-Access database objects used to view, modify and add records.
The Form Wizard enables you to select the fields from a table or multiple linked tables, layout,
and user interface for the form.
Report is one of the MS-Access database objects used to present information in an effective
and organized format that is ready for printing.
The Report Wizard provides you with more flexibility such as you can choose the tables and
fields, group the data, sort the data, summarize the data, choose a layout and orientation,
apply a style, and title your report.