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

Database Management With MS Access: School of Management Studies

This document discusses a report submitted by Japjeet Singh Bajwa for their Masters of Business Administration degree from 2014-2016 at Punjab University in Patiala, India. The report covers topics related to database management using Microsoft Access, including introductions to databases and relational database management systems, concepts of normalization, and how to create tables, queries, forms and reports in Access.
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
66 views

Database Management With MS Access: School of Management Studies

This document discusses a report submitted by Japjeet Singh Bajwa for their Masters of Business Administration degree from 2014-2016 at Punjab University in Patiala, India. The report covers topics related to database management using Microsoft Access, including introductions to databases and relational database management systems, concepts of normalization, and how to create tables, queries, forms and reports in Access.
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 30

Database Management with MS Access

A report submitted in partial fulfillment of the requirement for the degree of

MASTERS OF BUSINESS ADMINISTRATION


(2014-2016)

Submitted to:

Submitted by:

Ms. Sonam

Japjeet singh Bajwa


MBA 1st year SEC B
Roll No.: 140423353

SCHOOL OF MANAGEMENT STUDIES


P U N J A B I U N I V E R S I T Y P ATI A L A

Table of Contents

Database An Introduction

Database Hierarchy

Relational Database Management System

Normalization

First Normal Form (1NF)

Second Normal Form (2NF)

Third Normal Form (3NF)

Creating a Database

Creating a Table

Creating a Table in Datasheet View

Creating a Table in Design View

10

Creating a Lookup Wizard

11

Specifying the Currency Datatype


Specifying the OLE Object (Object Linking and Embedding) Datatype
Specifying the Attachment Datatype

.
14
.

Sorting Table Data

15

Filtering Table Data

16

Importing Data into Access

17

Freeze Pane
Creating Relationships
One to Many Relation
One to One Relationship
Queries

.
20
20
.
21

Simple Queries

21

Advanced Queries

23

The SQL View


Forms

.
24

Creating a Form in Form Wizard

24

Creating a Form in Design Wizard

26

Reports
Creating a Report Using Forms
Creating a Report Using Report Wizard

28
.
28

Database An Introduction
Database is basically a collection of information organized in such a way that the user can
quickly retrieve desired pieces of data. From the managerial point of view, organizations have
to store voluminous data and systematically process the stored data. As the organizations are

working in highly competitive and dynamic environment, the needs of the managers also
keep on changing. The managers need to dynamically store the process data, that is, they
have to analyse the stored data from different perspective before taking any decisions. Hence,
the storage and processing of data are very crucial aspects, which need special attention. It
must be clear from the discussion that organisations need special storage and retrieval facility
for information. To accomplish these objectives, they use the concept of database.
For managing this huge amount of data, organisations are now using various softwares
known as Database Management System (DBMS) which is a collection of programs that
enables the user to store, modify, and extract information from a database. There are many
different types of database management systems, ranging from small systems that run on
personal computers to huge systems that run on mainframes. Various DBMS tools such as
MS Access, Oracle and DB/2 are available in the market.

Database Hierarchy
Data hierarchy refers to the systematic organization of data, often in a hierarchical form. Data
organization involves fields, records, files and so on. A data field holds a single fact or
attribute of an entity. Consider a date field, e.g. "September 19, 2004". This can be treated as
a single date field (e.g. birthdate), or 3 fields, namely, month, day of month and year. The
hierarchy helps in storing the data in orderly manner, which helps in timely and accurate
retrieval of the information. The 5 level hierarchy model is the most widely used model.
Various components of the hierarchy model are discussed below.
Database: At the top of the hierarchy is the database, which stores data regarding various
specific entities, for example, the database of the organisation will store all important
information regarding the organisation.
File: A file is a collection of related records. If there are 100 employees, then each employee
would have a record (e.g. called Employee Personal Details record) and the collection of 100
such records would constitute a file (in this case, called Employee Personal Details file).
Record: A record is a collection of related fields. An Employee record may contain a name
field(s), address fields, birthdate field and so on.
Data item: it stores the specific values for specific records. For example, the file of the
employee has records of name and age. If we store name as John and age as 32, these are the
data items.

Bytes: At the lowest level of hierarchy is the byte, which is a collection of bits. Bits are the
binary digits, zero and one. A combination of bits is used to represent any character. The
databases are essentially computer based and the computer understands only the binary code.
Hence, it is important to store the data in the form of binary digits. The combination of bits
results in bytes and combination of bytes results in data items.
The figure shows a sample database hierarchy with various levels

Relational Database Management System


A relational database management system (RDBMS) is a database management
system (DBMS) that is based on the relational model as invented by E. F. Codd. Many
popular databases currently in use are based on the relational data model. Relational
databases have often replaced legacy hierarchical databases and network databases because
they are easier to understand and use. The data in RDBMS is stored in database objects
called tables which consist of row and columns. A few basic concepts of relational data model
are discussed below.

Table: The table is a collection of related data entries and it consists of columns (fields) and
rows (records). It is a database object in which data is stored. Below is an example of a table
containing data of employees in an organisation.
Emp_
ID

Emp_Na
me

2 Peter

Emp_Designation
Senior Sales
Manager
Deputy Sales
Manager

3 Xaveir
4 Smith

CEO
Senior Vice

1 John

Emp_S
al
$
200000
$
150000
$
300000
$

Emp_D
ept
Sales
Sales
Executiv
e
Executiv

President
5 Mitchell

COO

250000
$
300000

e
Executiv
e

Record (Row): A record, also called a row of data, is each individual entry that exists in a
table. For example there are 5 records in the above EMPLOYEE table. Following is a single
row of data or record in the EMPLOYEE table.
1

John

Senior Sales
Manager

$
200000

Sales

Field (Column): Every table is broken up into smaller entities called fields. The fields in the
EMPLOYEE table consist of EMP_ID, EMP_NAME, EMP_DESIGNATION, EMP_SAL,
EMP_DEPT.
Emp_Na
me
John
Peter
Xaveir
Smith
Mitchell

SQL Constraints are the rules enforced on data columns on table. These are used to limit the
type of data that can go into a table. This ensures the accuracy and reliability of the data in
the database. Constraints could be column level or table level. Column level constraints are
applied only to one column whereas table level constraints are applied to the whole table.
Following are commonly used constraints available in SQL:
NOT NULL Constraint: Ensures that a column cannot have NULL value.
DEFAULT Constraint: Provides a default value for a column when none is specified.
UNIQUE Constraint: Ensures that all values in a column are different.
PRIMARY Key: Uniquely identified each rows/records in a database table.
FOREIGN Key: Uniquely identified a rows/records in any another database table.
CHECK Constraint: The CHECK constraint ensures that all values in a column satisfy
certain conditions.
INDEX: Use to create and retrieve data from the database very quickly.
Data integrity refers to maintaining and assuring the accuracy and consistency of data over its
entire life-cycle, and is a critical aspect to the design, implementation and usage of any
system which stores, processes, or retrieves data. The following categories of the data
integrity exist with each RDBMS:
Entity Integrity: There are no duplicate rows in a table.
Domain Integrity: Enforces valid entries for a given column by restricting the type, the
format, or the range of values.
Referential integrity: Rows cannot be deleted, which are used by other records.

User-Defined Integrity: Enforces some specific business rules that do not fall into entity,
domain or referential integrity.

Normalization
Database normalization is the process of organizing the attributes and tables of a relational
database to minimize data redundancy. Normalization involves refactoring a table into
smaller (and less redundant) tables but without losing information; defining foreign keys in
the old table referencing the primary keys of the new ones. The objective is to isolate data so
that additions, deletions, and modifications of an attribute can be made in just one table and
then propagated through the rest of the database using the defined foreign keys. Three forms
of normalization help to check redundancy in the databases.

First Normal Form (1NF)


As per First Normal Form, no two Rows of data must contain repeating group of information
i.e. each set of column must have a unique value, such that multiple columns cannot be used
to fetch the same row. Each table should be organized into rows, and each row should have a
primary key that distinguishes it as unique. The Primary key is usually a single column, but
sometimes more than one column can be combined to create a single primary key. For
example consider the following STUDENT table having Name, Age and Subject as fields.
Student

Age

Subject

Adam

15

Biology, Maths

Alex

14

Maths

Stuart

17

Maths

In First Normal Form, any row must not have a column in which more than one value is
saved, like separated with commas. Rather than that, we must separate such data into multiple
rows. Student Table following 1NF will be as follows.
Student

Age

Subject

Adam

15

Biology

Adam

15

Maths

Alex

14

Maths

Stuart

17

Maths

The problem with using the First Normal Form is that the data redundancy increases, as there
will be many columns with same data in multiple rows but each row as a whole will be
unique.

Second Normal Form (2NF)


As per the Second Normal Form there must not be any partial dependency of any column on
primary key. It means that for a table that has concatenated primary key, each column in the
table that is not part of the primary key must depend upon the entire concatenated key for its
existence. If any column depends only on one part of the concatenated key, then the table
fails Second normal form.
In example of First Normal Form there are two rows for Adam, to include multiple subjects
that he has opted for. While this is searchable, and follows First normal form, it is an
inefficient use of space. Also in the above Table in First Normal Form, while the candidate
key is {Student, Subject}, Age of Student only depends on Student column, which is
incorrect as per Second Normal Form. To achieve second normal form, it would be helpful to
split out the subjects into an independent table, and match them up using the student names as
foreign keys.
In Student Table the candidate key will be Student column, because all other column
i.e. Age is dependent on it. New Student Table following 2NF will be:
Student

Age

Adam

15

Alex

14

Stuart

17

New Subject Table introduced for 2NF will be:


Student

Subject

Adam

Biology

Adam

Maths

Alex

Maths

Stuart

Maths

In Subject Table the candidate key will be {Student, Subject} column. Now, both the above
tables qualify for Second Normal Form and will never suffer from Update Anomalies.
Although there are a few complex cases in which table in Second Normal Form suffers
Update Anomalies, and to handle those scenarios Third Normal Form is there.

Third Normal Form (3NF)


Third Normal form applies that every non-prime attribute of table must be dependent on
primary key, or we can say that, there should not be the case that a non-prime attribute is
determined by another non-prime attribute. So this transitive functional dependency should
be removed from the table and also the table must be in Second Normal form. For example,
consider a table with following fields.
Student_Detail Table:

Student
_id

Student_n
ame

DO
B

Stre
et

Cit
y

Sta
te

Zi
p

In this table Student_id is Primary key, but street, city and state depends upon Zip. The
dependency between zip and other fields is called transitive dependency. Hence to
apply 3NF, we need to move the street, city and state to new table, with Zip as primary key.
New Student_Detail Table:
Student
_id

Student_na
me

DO
B

Zi
p

Address Table:
Zi
p

Stre
et

Ci
ty

Sta
te

Creating a Database
To create a blank database using MS Access, the following steps are to be performed:
1
2
3
4

Click on the blank Access database option button in the initial MS access dialog box.
Click the OK button, and a new database dialog box will be opened.
Specify the appropriate name in the file name text box and thenm click on create
button.
A created blank database will appear in the MS access window.

Creating a Table
Once a blank database has been created, the next step is to populate the database with objects
such as tables, forms and reports. Now we will see how to create a table. A table is useful in
storing huge amount of data with efficiency and convenience. The following steps need to be
performed in order to create a table
1
2

Click on the create option in the main menu bar in the database window.
The tables can be created in two different modes:
a Datasheet view
b Design view

Creating a Table in Datasheet View


User can create a table in the datasheet view. When a user creates a table in the datasheet
view, MS Access inserts the ID as an auto number field and sets the ID as the primary key.
The user can give a specific name and data type for the field. Following are the steps to create
a table in datasheet view.
1

Click on the table button in the main menu.

Creating a Table in Design View


Users can also create a table using the table design option. Using this option, the user can
enter specific field names and description according to his need. Moreover, the user can
declare any unique field as the primary key.
1

Select the create table design view from the database window menu. As a result, the
following screen will appear.

Specify the field names and data types. The data type of a field indicates the nature of
the field. Below can also be seen the list of data types offered by MS Access.

After saving the table, to enter data in the table, the user right clicks the mouse and
the following screen appears.

Creating a Lookup Wizard


The Lookup Wizard data type allows you to create a lookup field/column, which you can
choose a value from another table or from a list of values by using combo box or list box. The
following steps can be used to create a lookup wizard
1

In the design view, select the lookup wizard option from the data type field.

When the user selects the above option the below screen will appear. The first option
lets you lookup field to get values from another table or query.

4
5

By clicking on the next button the wizard will let the user enter different values as
seen below in the screenshot.

After selecting the table, the user can select the field from which the values can be
picked.
The user can finalize by clicking the finish button to create the lookup.

Specifying the OLE Object (Object Linking and Embedding) Datatype


The user can use the OLE (Attachment) feature in Access to add one or more files,
documents, presentations, images, and so on in the database. It can be used for attaching and
storing several files of various types in a single field.
1. In the design view, while selecting the datatype, select the OLE Object datatype.

2. For inserting the OLE data, right-click in the text box in the datasheet view and the
user can see the option of Insert Object.

Sorting Table Data


The user in MS access can sort both text and numeric data from the table itself without any
cumbersome queries.
1. Right-click on the column title and the below option will appear. We can either sort
the data from smallest to largest or vice-versa.
2. The below screenshot shows the Cust_ID field sorted from the smallest value to the
largest value.

3. The below screenshot shows the Cust_ID field sorted from the largest value to the
smallest value.

Filtering Table Data


While working with data in an Access database, the user may not want to view all of the data
at once. Instead, the user may want to view only those records that meet a certain criteria. To
do so, a filter must be applied.

1. By clicking on the extreme right on the column title, the filter menu will open. Here
we can see that the filter has been applied to select only those customer who belong to
the state of Banglore.

Importing Data into Access


Import option in the Access database is a very powerful tool. It is not necessary that there is
always a single source of data. Multiple sources of data can be in multiple formats and there
may be a need to load that data into a centralized repository. It can often be useful to import
these files into Access to you database. Here we take an example of importing MS Excel
workbook data into the MS Access database.
1. Open the Excel file that the user wants to import.

2. Select the Excel option in the External Data tab on the main menu.

3. The following window will open with three options. With the first option we can
import the data into a new table in the current database. If a table already exists in the
database with the same name it will be overwritten. After browsing the Excel file
press the OK button

4. On clicking the OK button the following screen will appear. If the spread sheet
contains first row as column headers then select the checkbox.

5. After clicking the NEXT button the following screen will appear. The user can specify
information about each field by selecting the fields in the area below.

6. In the final step specify the table name that the user wants to keep.

7. After the FINISH button has been clicked the data is imported in Excel as can be seen
from the below screenshot.

Creating Relationships
Relationship helps to join two or more tables and enables to make automatic changes in the
joined tables. The user need not make changes in the tables separately. Under referencing,
first create tables having one common unique field. In addition, assign a primary key to the
common unique field in both the tables. After assigning the primary key to the unique fields
in both the tables, when the user makes any changes in the entries of the primary field in the
first table, the second table gets automatically updated.

After creating the tables, select relationship option from the database tools in the main menu.

Select the show table command to display the stored tables in the particular database.

Add the tables on which the user wants and build relationships. Finally the relation
will be as seen in snapshot.

Queries
After creating the database, next important application of MS Access is the queries. The user
can ask specific questions in order to retrieve specific information according to the
requirements.

Simple Queries
Following are the steps for creating a new query with just a single table.
1. Click on the create option of the main menu and select query design.

2. The user then selects the particular table on which he wants to apply he query. To
create a query, select the relevant fields in the lower section of the application.

3. For example, the user wants to see the order places after a particular date. The user
can specify the same in the Criteria field

When the user runs the query, the result will be as follows.

Advanced Queries
User can also design advanced queries which can have more than one table. Following are the
steps for creating a new query with multiple tables.
1. Select the tables from which the data needs to be fetched. . To create a query, select
the relevant fields in the lower section of the application.

2. When the user runs the query, the result will be as follows.

Forms
Forms show the desired information stored in the data. They can also be used to directly enter
data and the entered data is saved in the selected tables. The user can create a form using the
Form Wizard option and Form Design option.

Creating a Form in Form Wizard


1

In the create tab of main menu, click on Form Wizard and then select the table/query for
which form has been created. After table, select the required fields as well.

Next, select the particular layout in which you want to view the final format of the form. In
the below example tabular layout has been selected.

In the next step, provide the name of the form. The form will be saved in this name.

Once the finish button is clicked, the final form will appear.

Creating a Form in Design Wizard


1. A form can also be created using form design. This option gives the user the facility to
design a form using the tools of his choice. To design using the form design, select the
form design option from the create menu.

2. Select the Add Existing Fields option from the design menu. All the names of the
saved tables/queries will appear on the right side of the window; select the required
table and drag the fields to the form screen.

3. Save the form in the name of your choice. The final form will on the screen

Reports
A manager has to report various activities on different parameters. MS access provides the
facility of creating reports. The reports can be generated in the two ways i.e. directly from the
form and secondly from the Report Wizard.

Creating a Report Using Report Wizard


1. Select the report wizard option from the create menu and then select the
table/query on which you want to create the report. After selecting the
above, select the fieldsthat you want to add in the final report.

2. Select the particular layout of the final report

3. Give a title to this report. The report will be saved in this title. After
clicking the finish button, the final report will be generated. The manager
can take the printout of this report and submit it to the parties he wants.

You might also like