COMP3 Database Access COMP 3
COMP3 Database Access COMP 3
COMP3 Database Access COMP 3
IGNATIUS
TECHNICAL INSTITUTE OF BUSINESS AND ARTS
Prepared by:
GLENN F. MADRID JR
1 GFMJR
Lesson 1
Database Management System
MS-Access Overview
Database Creation - Create your Microsoft Access database and specify what
kind of data you will be storing.
Data Input - After your database is created, the data of every business day
can be entered into the Access database.
Query - This is a fancy term to basically describe the process of retrieving
information from database.
Report (optional) - Information from the database is organized in a nice
presentation that can be printed in an Access Report.
2 GFMJR
Architecture
Access calls anything that can have a name an object. Within an Access
desktop database, the main objects are tables, queries, forms, reports,
macros, data macros, and modules.
If you have worked with other database systems on desktop computers, you
might have seen the term database used to refer to only those files in which
you store data.
But, in Access, a desktop database (.accdb) also includes all the major
objects related to the stored data, including objects you define to automate
the use of your data.
3 GFMJR
Assessment No. (10 pts)
___________2. After your database is created, the data of every business day can
be entered into the Access database.
___________4. Create your Microsoft Access database and specify what kind of
data you will be storing.
Software Orientation
When you create a blank database in Access, the opening screen provides you
with a workspace in which to build a database. Being familiar with the screen
elements helps you understand important tools and information. The elements
and features of your screen may vary if default settings have been changed or if
other preferences have been set.
5 GFMJR
GETTING STARTED
Before you begin these steps, make sure that your computer is on. Sign on, if
necessary. 1. Press the Windows key on the keyboard to display the Start
menu. 2. Click All apps, point to Access 2016 (see Figure 1-2), and then click
Access 2016 to start Access and display its Start screen (see Figure 1-3).
6 GFMJR
7 GFMJR
If you open a file in a multi-user environment such as a SharePoint drive, other users
can read and write to the database as well; therefore, you may want to open the
database with other options. Click the down arrow next to the Open button to view
these options:
• Open Read-Only: Opens with only viewing ability and not editing ability. Others can
still read and write.
• Open Exclusive: Opens so that the database is only available to you. Others will
receive a message that the file is already in use.
• Open Exclusive Read-Only: Opens with only viewing ability and not editing
ability. Others can only view and not edit the database.
8 GFMJR
Assessment No. 2 (15 pts)
9 GFMJR
Lesson 3
Database Management System
MS-Access RDBMS
Microsoft Access has the look and feel of other Microsoft Office products as far
as its layout and navigational aspects are concerned, but MS Access is a
database and, more specifically, a relational database.
Before MS Access 2007, the file extension was *.mdb, but in MS Access
2007 the extension has been changed to *.accdb extension.
Early versions of Access cannot read accdb extensions, but MS Access
2007 and later versions can read and change earlier versions of Access.
An Access desktop database (.accdb or .mdb) is a fully functional
RDBMS.
It provides all the data definition, data manipulation, and data control
features that you need to manage large volumes of data.
You can use an Access desktop database (.accdb or .mdb) either as a
standalone RDBMS on a single workstation or in a shared client/server
mode across a network.
A desktop database can also act as the data source for data displayed on
webpages on your company intranet.
When you build an application with an Access desktop database, Access
is the RDBMS.
Data Definitions
10 GFMJR
Data Manipulation
Working with data in RDBMS is very different from working with data in a word
processing or spreadsheet program.
In a word processing document, you can include tabular data and perform
a limited set of functions on the data in the document.
You can also search for text strings in the original document and, with
ActiveX controls, include tables, charts, or pictures from other
applications.
In a spreadsheet, some cells contain functions that determine the result
you want, and in other cells, you enter the data that provides the source
information for the functions.
An RDBMS provides you many ways to work with your data. For example,
11 GFMJR
Assessment No. 3
____________3. A desktop database can also act as the data source for data
displayed on webpages on your company intranet.
____________5. Before MS Access 2010, the file extension was *.mdb, but in MS
Access 2010 the extension has been changed to *.accdb extension.ive
1.
2.
3.
4.
5.
12 GFMJR
Lesson 4
Database Management System
MS-Access – Objects
MS Access uses “objects" to help the user list and organize information, as well
as prepare specially designed reports. When you create a database, Access offers
you Tables, Queries, Forms, Reports, Macros, and Modules. Databases in
Access are composed of many objects but the following are the major objects:
Tables
Queries
Forms
Reports
Together, these objects allow you to enter, store, analyze, and compile your
data. Here is a summary of the major objects in an Access database;
Table
Table is an object that is used to define and store data. When you create a new
table, Access asks you to define fields which is also known as column headings
Query
An object that provides a custom view of data from one or more tables. Queries
are a way of searching for and compiling data from one or more tables.
13 GFMJR
Form
Form is an object in a desktop database designed primarily for data input or display or for
control of application execution. You use forms to customize the presentation of data that
your application extracts from queries or tables.
Report
Macro
This object is a structured definition of one or more actions that you want
Access to perform in response to a defined event. An Access Macro is a script
for doing some job. For example, to create a button which opens a report, you
could use a macro which will fire Open Report action.
You can include simple conditions in macros to specify when one or more
actions in the macro should be performed or skipped.
You can also run other macros or Visual Basic procedures from within a
macro.
Data macros can be attached directly to table events such as inserting new
records, editing existing records, or deleting records.
14 GFMJR
Data macros in web apps can also be stand-alone objects that can be
called from other data macros or macro objects.
Module
Everything that can be done in a macro can also be done in a module, but
you don't get the macro interface that prompts you what is needed for
each action.
Modules are far more powerful and are essential if you plan to write code
for a multi-user environment, because macros cannot include error
handling.
Modules can be standalone objects containing functions that can be
called from anywhere in your application, or they can be directly
associated with a form or a report to respond to events on the associated
form or report.
15 GFMJR
Assessment No. 4 (20 pts.)
1.)
2.)
3.)
4.)
16 GFMJR
Lesson 5
Database Management System
MS-Access – Working in the Access Interface
(Navigation Pane)
The Access 2016 user interface was designed to help you find the commands you need
quickly so that you can successfully perform your tasks. In this lesson, you will begin
using the Navigation Pane, exploring the Ribbon and Backstage view
The Navigation Pane enables you to open, copy, and delete tables and other
database objects. It also lists all the objects in your database, including: tables
(the most basic database object that stores data in categories), queries (allow
you to search and retrieve the data you have stored), forms (control data entry
and data views and provide visual cues that make data easier to work with),
and reports (present your information in ways that are most useful to you).
You learn more about managing database objects (such as forms, queries, and
reports) in later lessons of this book.
17 GFMJR
18 GFMJR
19 GFMJR
Assessment No. 5 (20 pts)
20 GFMJR
Lesson 6
Database Management System
MS-Access – Using Object Tab / Changing view
When you create a database in Access, all the objects in that database—
including forms, tables, reports, queries—are displayed in a single window
separated by tabs. Tabs help keep open objects visible and accessible. To move
among the open objects, click a tab. To close a tab, click its Close button. You
can also right-click a tab to display the shortcut menu, which you can use to
save, close, close all, or change views. In this exercise, you practice opening
and displaying object tabs.
Changing Views
Each database object can be viewed several different ways. The main views for
a table are Datasheet View and Design View. Datasheet View can be used to
perform most table design tasks, so you will probably use it most often. A
21 GFMJR
datasheet is the visual representation of the data contained in a table or of the
results returned by a query. A query is simply a question you can ask a table
or another query. To change the view, on the Home tab, click the down arrow
on the View button and then choose a view from the menu. When you change
views, the commands available on the Ribbon change context to match the
tasks you will be performing in that view.
22 GFMJR
Assessment No. 6 (10 pts.)
23 GFMJR
Lesson 7
Database Management System
MS-Access – Selecting Tools and Command
addition to the Ribbon, Access also offers tools and commands on the File
menu (also known as Backstage view), a Quick Access toolbar, and a status
bar (refer to Figure 1-1). In this section, you explore the Ribbon, which displays
groups of common commands arranged by tabs.
Using the Ribbon The Ribbon is located across the top of the screen and
contains tabs and groups of commands. It is divided into several tabs, which
organize tasks according to similar commands you’d like to perform on a
database. The Ribbon is contextual, which means it offers you commands
related to the object that you are working on or the task that you are
performing.
Some groups have a dialog box launcher, which is a small arrow in the lower-
right corner of the group that you click to launch a dialog box or task pane that
displays additional options or information. Some commands on the Ribbon
have small arrows pointing down. These arrows indicate that a menu is
available that lists more options from which you can choose.
24 GFMJR
Using the Backstage View
25 GFMJR
The following is an overview of the options in the Backstage view:
• Info: Default view. Use this option to view the current database file path and
view and edit database properties. Compact and repair the database and
encrypt the database with a password to restrict access.
• New: Use this option to create a new database from scratch or from available
templates.
• Open: Use this option to open an existing database and view a list of recently
accessed databases.
• Save: Use this option to return to the open database window where objects
can be saved.
• Save As: Use this option to save the current database object (such as a table,
query, form, or report) as a new object or save the database in another format
that is compatible with earlier versions of Access. You can save the database to
a document management server for sharing or you can package the database
and apply a digital signature.
• Print: Use this option to quick-print to a printer, open a dialog box from
which to choose print options, or preview your document before printing.
• Close: Use this option to close the open database but keep the Access
application open.
• Account: Use this option to view and modify user account settings, change
application background and theme, add a service, manage your Office 365
account, update office, and learn more about Access.
26 GFMJR
• Options: Use this option to customize language, display, proofing, and other
settings.
• Feedback: Opens the Windows Feedback dialog box, which allows you to
provide feedback to Microsoft and explore other users’ feedback.
27 GFMJR
Assessment No. 7 (25 pts)
_____________1. This is to use this option to create a new database from scratch
or from available templates.
_____________4. Use this option to close the open database but keep the Access
application open.
_____________5. Use this option to view and modify user account settings,
change application background and theme, add a service, manage your Office
365 account, update office, and learn more about Access.
28 GFMJR
Lesson 8
Database Management System
MS-Access – Data Types
Every field in a table has properties and these properties define the field's
characteristics and behavior. The most important property for a field is its data
type. A field's data type determines what kind of data it can store. MS Access
supports different types of data, each with a specific purpose.
The data type determines the kind of the values that users
can store in any given field.
Each field can store data consisting of only a single data type.
Here are some of the most common data types you will find used in a typical
Microsoft Access database.
29 GFMJR
If you use previous versions of Access, you will notice a difference for two of
those data types.
In Access 2013, we now have two data types — short text and long text. In
previous versions of Access these data types were called text and memo.
The text field is referred to as short text and your memo field is now
called long text.
Here are some of the other more specialized data types, you can choose from in
Access.
These are all the different data types that you can choose from when creating
fields in a Microsoft Access table.
30 GFMJR
31 GFMJR
32 GFMJR
Assessment No. 8 (10 pts)
_____________3. You can create an expression that uses data from one or more
fields.
____________4. This data types files such as digital photos. Multiple files can be
attached per record.
_____________5. Numeric data used in mathematical calculations.
33 GFMJR
Lesson 9
Database Management System
MS-Access – Create Tables
When you create a database, you store your data in tables. Because other
database objects depend so heavily on tables, you should always start your
design of a database by creating all of its tables and then creating any other
object. Before you create tables, carefully consider your requirements and
determine all the tables that you need.
Let us try and create the first table that will store the basic contact information
concerning the employees as shown in the following table:
Let us now have short text as the data type for all these fields and open a blank
database in Access.
34 GFMJR
This is where we left things off. We created the database and then Access
automatically opened up this table-one-datasheet view for a table.
Let us now go to the Field tab and you will see that it is also automatically
created. The ID which is an AutoNumber field acts as our unique identifier and
is the primary key for this table.
35 GFMJR
The ID field has already been created and we now want to rename it to suit our
conditions. This is an Employee table and this will be the unique identifier for
our employees.
Click on the Name & Caption option in the Ribbon and you will see the
following dialog box.
Change the name of this field to EmployeeID to make it more specific to this
table. Enter the other optional information if you want and click Ok.
36 GFMJR
We now have our employee ID field with the caption Employee ID. This is
automatically set to auto number so we don't really need to change the data
type.
Let us now add some more fields by clicking on click to add.
37 GFMJR
Choose Short Text as the field. When you choose short text, Access will then
highlight that field name automatically and all you have to do is type the field
name.
38 GFMJR
Type FirstName as the field name. Similarly, add all the required fields as
shown in the following screenshot
Once all the fields are added, click the Save icon.
You will now see the Save As dialog box, where you can enter a table name for the table.
Enter the name of your table in the Table Name field. Here the tbl prefix stands
for table. Let us click Ok and you will see your table in the navigation pane.
39 GFMJR
Table Design View
As we have already created one table using Datasheet View. We will now create
another table using the Table Design View. We will be creating the following
fields in this table. These tables will store some of the information for various
book projects.
40 GFMJR
Let us now go to the Create tab.
In the tables group, click on Table and you can see this looks completely
different from the Datasheet View. In this view, you can see the field name and
data type side by side.
41 GFMJR
We now need to make ProjectID a primary key for this table, so let us select
ProjectID and click on Primary Key option in the ribbon.
42 GFMJR
You can now see a little key icon that will show up next to that field. This
shows that the field is part of the table’s primary key.
Let us save this table and give this table a name.
Click Ok and you can now see what this table looks like in the Datasheet
View.
43 GFMJR
Let us click the datasheet view button on the top left corner of the ribbon.
44 GFMJR
If you ever want to make changes to this table or any specific field, you don't
always have to go back to the Design View to change it. You can also change it
from the Datasheet View. Let us update the PStatus field as shown in the
following screenshot.
45 GFMJR
Assessment No. 9 (20 pts)
Create the table that will store the basic contact information of the students.
46 GFMJR
Lesson 10
Database Management System
MS-Access – Defining Database Tables
Tables are the most basic organizational element of a database. Not only is it
important to plan the tables so they will hold the type of data you need, it’s
important to plan how the tables and information will be connected. In this
exercise, you view a visual representation of the relationship between two
tables.
In a simple database, you might have only one table. Most databases, however,
will have more than just one table. The tables you include in a database will be
based on the data available. For example, a database of students might have a
table for contact information, a table for grades, and a table for tuition and
fees.
In database applications like Access, you can create a relational database. A
relational database stores information in separate tables and these tables are
connected or linked by a defined relationship that ties the data together.
47 GFMJR
STOP. CLOSE the database and Access.
As you create each table, keep in mind how the data in the tables are related to each
other. Enter test data and then add fields to tables or create new tables as necessary
to refine the database. The last step is to apply data normalization rules to see if your
tables are structured correctly and make adjustments as needed. Normalization is
the process of applying rules to your database design to ensure that you have divided
your information items into the appropriate tables.
Database design principles include standards and guidelines that can be used
to determine if your database is structured correctly. These are referred to as
normal forms. There are five normal forms, but typically only the first three are
applied, because that is usually all that is required. The following is a summary
of the first three normal forms:
• First Normal Form (1NF): This form divides each field according to its
smallest meaningful value, removes repeating groups of data, and creates a
separate table for each set of related data.
• Second Normal Form (2NF): With this form, each non-key column should be
fully dependent on the entire primary key. Create new tables for data that
applies to more than one record in a table and add a related field to the table.
• Third Normal Form (3NF): Use this form to remove fields that do not relate
to, nor provide a fact about, the primary key.
Before normalizing a database and defining fields for the efficient storage of
data in tables, it’s important to know where your data will come from. Data can
be brought into an Access database in a number of ways, including linking and
importing. When defining tables, you have to decide whether data should be
linked to or imported from external sources. When you import data, Access
creates a copy of the data or objects in the destination database without
altering the source. Linking lets you connect to data from another source
without importing it, so that you can view and modify the latest data in both
the source and destination databases without creating and maintaining two
copies of the same data thereby reducing redundant data. Any changes you
make to the data in the source are reflected in the linked table in the
destination database, and vice versa.
48 GFMJR
Assessment No. 10
T F 2. By default, the Navigation Pane appears on the right side of the Access
screen each time you create or open a database
Matching Type
Column 1 Column 2
49 GFMJR
MS Access
Lesson 11
Database Management System
MS-Access – Creating a Database
In this lesson, we will be covering the basic process of starting Access and
creating a database. This chapter will also explain how to create a desktop
database by using a template and how to build a database from scratch.
To create a database from a template, we first need to open MS Access and you
will see the following screen in which different Access database templates are
displayed.
To view the all the possible databases, you can scroll down or you can also use
the search box.
50 GFMJR
Let us enter project in the search box and press Enter. You will see the database
templates related to project management.
Select the first template. You will see more information related to this template.
51 GFMJR
After selecting a template related to your requirements, enter a name in the
File name field and you can also specify another location for your file if you
want.
Now, press the Create option. Access will download that database template and
open a new blank database as shown in the following screenshot.
52 GFMJR
Now, click the Navigation pane on the left side and you will see all the other
objects that come with this database.
Click the Projects Navigation and select the Object Type in the menu.
53 GFMJR
You will now see all the objects types — tables, queries, etc.
54 GFMJR
Step 2: Select Blank desktop database. Enter the name and click the Create button.
Step 3: Access will create a new blank database and will open up the table
which is also completely blank.
55 GFMJR
56 GFMJR
Assessment No. 11 (30 pts.)
2. Create a blank database and set a filename of your Last name and
Section. (e.g. Madrid.accdb_IT2-A).
After creating the databases, you may attached the file in google classroom or
screenshot of the two blank database.
57 GFMJR
Lesson 12
Database Management System
MS-Access – Creating a Table
It is easy to create a new table by using the Application Parts gallery and Quick
Start. Application Parts were introduced in Access 2010 and consist of
predefined templates that you can add to an existing database to help extend
its functionality. Another way to create a table is to copy the structure of an
existing table and then paste it into the database. You can copy a database
object and paste it into the same database or into a different database that is
open in another instance of Access.
The Templates group on the Create tab contains the Application Parts gallery
that you can use to insert predefined templates. Application parts vary from a
single table to a collection of database objects like tables, forms, and reports.
The Application Parts gallery consists of two categories:
Blank Forms and Quick Start. The Blank Forms category contains a collection
of form parts that allows you to add predefined forms to a database. The Quick
Start category of these templates contains a collection of predefined objects
arranged by parts for tracking things such as comments, contacts, and issues.
In this exercise, you will quickly create a table using the Application Parts
gallery and Quick Start.
58 GFMJR
59 GFMJR
Creating a Table from Another Table
Another way to create a table is to copy the structure of an existing table using the
Copy and Paste commands. In this exercise, you copy the structure of an existing
table to create a new table.
60 GFMJR
When you create a copy of a table by copying and pasting, you can re-create just the
table’s structure or both its structure and data. Access also provides you with a third
option that appends data to an existing table. If this option is chosen, Access will
attempt to append the table’s records to another table you specify.
61 GFMJR
Assessment No. 12 (20 pts)
Write the steps on how to create a Table using the Applications Parts and Gallery and
Quick start.
62 GFMJR
Lesson 13
Database Management System
MS-Access – Saving a Database Object
Saving a Table
When you save a new table for the first time, give it a name that describes the
information it contains. You can use up to 64 characters (letters or numbers),
including spaces. In this exercise, you save a database table, and then use the
Save Object As command to create a duplicate of the same table.
63 GFMJR
64 GFMJR
Assessment No. 13 (15 pts)
Fill in the Blank: Complete the following sentences by writing the correct word or
words in the blanks provided.
2. When you create a new blank desktop database, Access opens a database that
contains which of the following?
a. One of each type of database object
b. A table
c. Sample data
d. A template
3. The Templates group commands are located on which of the following tabs?
a. Home
b. Create
c. Database Tools
d. Datasheet
5. When you paste a table, which of the following dialog boxes is displayed?
a. Table Structure
b. Copy Table
c. Paste Data
d. Paste Table As
65 GFMJR
Lesson 14
Database Management System
MS-Access – Working with Tables and Database records
Table 3-1 lists keys and key combinations for moving among records.
66 GFMJR
Using Navigation Buttons
Access users who prefer to use the mouse can use the navigation buttons at
the bottom of Datasheet view to move among records. In this exercise, you use
these buttons to navigate among records.
67 GFMJR
68 GFMJR
Assessment No. 14 (20 pts.)
Commands Result
69 GFMJR
Lesson 15
Database Management System
MS-Access – Entering, Editing and Deleting Records
You can delete an entire record or several records at once from a database.
Just select the row or rows using the Record Selector box, and then press the
Delete key or click the Delete button on the Home tab in the Records group.
You can also right-click and select Delete Record from the shortcut menu. After
you delete a record, you cannot undo it.
70 GFMJR
71 GFMJR
References:
https://www.dit.ie/media/ittraining/msoffice/MOAC_Access_2016.
pdf
https://www.tutorialspoint.com/ms_access/index.htm
72 GFMJR