0% found this document useful (0 votes)
53 views24 pages

Advance Database 1-5

This document provides an introduction and overview of databases. It defines what a database is, explains that databases store data in tables organized into records and fields, and discusses the key database objects of forms, queries, and reports. Forms are used for entering and viewing data, queries search for and compile data from tables, and reports output information. Relational databases like Access can link related data across multiple tables through relationships between fields.

Uploaded by

Arjay Balberan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
53 views24 pages

Advance Database 1-5

This document provides an introduction and overview of databases. It defines what a database is, explains that databases store data in tables organized into records and fields, and discusses the key database objects of forms, queries, and reports. Forms are used for entering and viewing data, queries search for and compile data from tables, and reports output information. Relational databases like Access can link related data across multiple tables through relationships between fields.

Uploaded by

Arjay Balberan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 24

Lesson 1 - Introduction to

Databases
What is a database?
A database is a collection of data that is
stored in a computer system. Databases
allow their users to enter, access, and However, if you were a professional baker,
analyze their data quickly and easily. you would have many more lists to keep
They're such a useful tool that you see them track of: a list of customers, products sold,
all the time. Ever waited while a doctor's prices, orders, and so on. The more lists you
receptionist entered your personal add, the more complex the database will
information into a computer, or watched a be.
store employee use a computer to see
whether an item was in stock? If so, then
you’ve seen a database in action.

The easiest way to understand a database is


to think of it as a collection of lists. Think
about one of the databases we mentioned
above: the database of patient information
at a doctor's office. What lists are contained In Access, lists are a little more complex
in a database like this? To start with, there's than the ones you write on paper. Access
a list of patients' names. Then there's a list stores its lists of data in tables, which allow
of past appointments, a list with medical you to store even more detailed
history for each patient, a list of contact information. In the table below, the People
information, and so on. list in the amateur baker’s database has
been expanded to include other relevant
information on the baker’s friends.
This is true of all databases, from the
simplest to the most complex. If you like to
bake, for example, you might decide to
keep a database containing the types of
cookies you know how to make and the If you are familiar with other programs in
friends you give these cookies to. This is the Microsoft Office suite, this might
one of the simplest databases imaginable. It remind you of Excel, which allows you to
contains two lists: a list of your friends, and organize data in a similar way. In fact, you
a list of cookies. could build a similar table in Excel.
Why use a database? See how the third list uses words that
appeared in the first two lists? A database is
If a database is essentially a collection of capable of understanding that the Dad and
lists stored in tables and you can build Oatmeal cookies in the Batches list are the
tables in Excel, why do you need a real same things as the Dad and Oatmeal
database in the first place? While Excel is cookies in the first two lists. This
great at storing and organizing numbers, relationship seems obvious, and a person
Access is far stronger at handling non- would understand it right away; however,
numerical data, like names and an Excel workbook wouldn’t.
descriptions. Non-numerical data plays a
significant role in almost any database, and
it's important to be able to sort and analyze Excel would treat all of these things as
it. distinct and unrelated pieces of
information. In Excel, you'd have to enter
every single piece of information about a
What really sets databases apart from any person or type of cookie each time you
other way of storing data is connectivity. mentioned it because that database
We call a database like the ones you’ll work wouldn't be relational like an Access
with in Access a relational database. A database. Simply put, relational databases
relational database is able to understand can recognize what a human can: If the
how lists and the objects within them relate same words appear in multiple lists, they
to one another. To explore this idea, let's go refer to the same thing.
back to the simple database with two lists:
names of your friends, and the types of
cookies you know how to make. You decide The fact that relational databases can
to create a third list to keep track of the handle information this way allows you to
batches of cookies you make and who enter, search for, and analyze data in more
they’re for. Because you're only making than one table at a time. All of these things
cookies you know the recipe for and you're would be difficult to accomplish in Excel,
only going to give them to your friends, this but in Access even complicated tasks can be
new list will get all of its information from simplified and made fairly user friendly.
the lists you made earlier.
Lesson 2 - Introduction to Likewise, a record is more than just a row;
Objects it's a unit of information. Every cell in a
given row is part of that row’s record.
Tables
At this point, you should already
understand that a database is a collection of
data organized into several connected lists.
In Access, all data is stored in tables, which
means tables are the heart of any database.
Notice how each record spans several
fields. Even though the information in each
You also might already know that tables are record is organized into fields, it belongs
organized into vertical columns and with the other information in that record.
horizontal rows. See the number at the left of each row? It’s
the ID number that identifies each record.
The ID number for a record refers to every
piece of information contained on that row.

In Access, rows and columns are referred to


as records and fields. A field is more than
just a column; it’s a way of organizing
information by the type of data it is. Every
piece of information within a field is of the
same type. For example, every entry in a
field called First Name would be a name,
and every entry in field called Street Tables are good for storing closely related
Address would be an address. information. Let's say you own a bakery and
have a database that includes a table with
your customers' names and information,
like their phone numbers, home addresses,
and email addresses. Because these pieces
of information are all details on your
customers, you’d include them all in the
same table. Each customer would be
represented by a unique record, and each
type of information about these customers
would be stored in its own field. If you tables at once, all in one place. Database
decided to add any more information—say, designers can even set restrictions on
a customer's birthday—you would simply individual form components to ensure all of
create a new field within the same table. the needed data is entered in the correct
format. All in all, forms help keep data
Forms, queries, and reports consistent and organized, which is essential
Although tables store all of your data, the for an accurate and powerful database.
other three objects—forms, queries, and
Queries
reports—give you ways to work with it.
Each of these objects interacts with the Queries are a way of searching for and
records stored in your database's tables. compiling data from one or more tables.
Running a query is like asking a detailed
Forms question of your database. When you build
Forms are used for entering, modifying, and a query in Access, you are defining specific
viewing records. You likely have had to fill search conditions to find exactly the data
out forms on many occasions, like when you want.
visiting a doctor's office, applying for a job,
or registering for school. The reason forms
are used so often is that they're an easy Queries are far more powerful than the
way to guide people toward entering data simple searches you might carry out within
correctly. When you enter information into a table. While a search would be able to
a form in Access, the data goes exactly help you find the name of one customer at
where the database designer wants it to go: your business, you could run a query to find
into one or more related tables. the name and phone number of every
customer who has made a purchase within
the past week. A well-designed query can
give information you might not be able to
find just by looking through the data in your
tables.

Forms make entering data easier. Working


with extensive tables can be confusing, and
when you have connected tables you might
need to work with more than one at a time
to enter a set of data. However, with forms
it's possible to enter data into multiple
Reports Forms allow you to both add data to tables
and view data that already exists. Reports
Reports offer you the ability to present your present data from tables and also from
data in print. If you've ever received a queries, which then search for and analyze
computer printout of a class schedule or a data within these same tables.
printed invoice of a purchase, you've seen a
database report. Reports are useful because
they allow you to present components of These relationships sound complicated, but
your database in an easy-to-read format. in fact they work together so well and
You can even customize a report's naturally that we often don't even notice
appearance to make it visually appealing. when we're using connected database
Access offers you the ability to create a objects. Have you ever used an electronic
report from any table or query. card catalog to search for a book at the
library? Chances are, you entered your
search into something that looks like this:

Putting it all together


Even if you have a good idea of how each When you performed your search, you
object can be used, it can initially be were entering your search terms into a
difficult to understand how they all work form that then created and ran a query
together. It helps to remember that they all based on your request. When the query
work with the same data. Every piece of finished searching the database's tables for
data a query, form, or report uses is stored records that matched your search, you
in one of your database tables. were shown a report that drew information
from the query and the related tables—in
this case, a list of books matching your
search terms. You could represent the
connections between the objects like this:
Let's say instead of using these tools you
had to search within a giant table
containing every book in the library system.
The relevant records would likely be spread
out across many tables: a table for book
titles and descriptions, a table containing
information on which books are checked in
or out, and a table with each branch of the
library, just to name a few.

You'd have to search at least three tables


just to find a book, learn its location, and
see whether it's checked in! It's easy to
imagine how difficult it could be to find the
right book. If you weren't careful, you might
even mess something up by accidentally
deleting or editing a record. It's easy to see
how the database objects make this search
much more manageable.

In our Introduction to Databases lesson, we


discussed the concept of a relational
database, which is a database that is able to
understand how different sets of data relate
to one another. Situations like the example
above are exactly why people find relational
databases so useful. Without a relational
database, what should be a simple task—
searching for a book and seeing if it's Lesson 3 – Getting Started in
checked in and where—becomes incredibly
Access
complicated and time consuming. Knowing
how to use the four Access objects can Getting to know Access
make even complicated tasks fairly user
friendly. Access uses the Ribbon to organize
commands. If you're new to Access or have
more experience with older versions, you
should first take some time to become
familiar with the Access interface.
Click the buttons in the interactive below to
become familiar with the Access interface.

To minimize and maximize the


Ribbon:
The Ribbon is designed to respond to your
current task; however, you can choose to
minimize the Ribbon if you find that it takes
Working in your Access environment
up too much screen space.
Access uses features like the Ribbon and
the Quick Access Toolbar—where you will
find commands to perform common tasks Click the arrow in the lower-right corner of
in Access—as well as Backstage view. the Ribbon to minimize it.

The Ribbon
Access uses a tabbed Ribbon system instead
of traditional menus. The Ribbon contains
multiple tabs, each with several groups of
commands. For example, the Clipboard
group on the Home tab contains the Cut,
Copy, and Paste commands.

The Ribbon will be minimized. Click a tab to


Some groups also have a small arrow in the make the Ribbon reappear. It will disappear
bottom-right corner that you can click for again when not in use.
even more options.
commands no matter which tab you are on.
By default, it shows the Save, Undo, and
Redo commands. If you want, you can
customize it by adding additional
commands.

To maximize the Ribbon, click a tab, then


click the pin icon in the lower-right corner.
The Ribbon will appear at all times.

Note that the Save command only saves the


current open object. In addition, the Undo
command will not undo certain actions, like
adding a record. Pay close attention to your
information when using the Undo
command to make sure it has the desired
effect.

Backstage view
Using the Tell me feature
Backstage view gives you various options
If you're having trouble finding a command
for saving, opening, and printing your
you want, the Tell me feature can help. It
database.
works just like a regular search bar: Type
what you're looking for, and a list of options To access Backstage view:
will appear. You can then use the command
Click the File tab on the Ribbon.
directly from the menu without having to
find it on the Ribbon.

The Quick Access Toolbar Backstage view will appear.


The Quick Access Toolbar, located above Click the buttons in the interactive below to
the Ribbon, lets you access common learn more about using Backstage view.
feel that it takes up too much of your
screen space, you can minimize it.
To minimize the Navigation pane, click the
double arrow in the upper-right corner.

The Navigation pane


The Navigation pane is a list containing
every object in your database. For easier
viewing, the objects are organized into
groups by type. You can open, rename, and
The Navigation pane will be minimized.
delete objects using the Navigation pane.
Click the double arrow again to maximize it.
If you want to make the Navigation pane
smaller without fully minimizing it, you can
resize it. Simply click and drag the right
border of the Navigation pane. When it is
the desired size, release your mouse.

To minimize and maximize the Sorting objects in the Navigation


Navigation pane: pane

The Navigation pane is designed to help you By default, objects are sorted by type, with
manage all of your objects; however, if you tables in one group, forms in another, and
so on. However, if you want you can sort
the objects in the Navigation pane into
groups of your choosing. There are four sort
options:

Custom allows you to create a custom


group for sorting objects. After applying the
sort, simply drag the desired objects to the
new group.
Object Type groups objects by type. This is
the default setting. To further customize the appearance of the
Navigation pane, you can minimize groups
Tables and Related Views groups forms,
of objects you don't want to see. Simply
queries, and reports with the tables they
click the upward
refer to.
double arrow next
Created Date or Modified Date sorts objects to the group
based on when they were created or last name. To show a
edited. group, click the
downward double
To sort objects in the Navigation arrow.
pane:
Click the drop-down arrow to the right of All
Access Objects, then select the desired sort
from the drop-down menu.

Databases with navigation forms


Some databases include a navigation form
that opens automatically when the
The objects in the database is opened. Navigation forms are
Navigation pane designed to be a user-friendly replacement
will now be sorted of the Navigation pane. They contain tabs
to reflect your that allow you to view and work with
choice. common forms, queries, and reports.
Having your frequently used objects approval, you can simply maximize the
available to you in one place lets you access Navigation pane and open the objects from
them quickly and easily. there.

To open an object from a navigation form,


click its tab. The object will be displayed
within the navigation form. Once an object
is open, you can work with it as you
normally would. In the example below, the
navigation form has tabs near the top-left
for orders, customers, and menu items, and
each one will open a corresponding object.

Generally, navigation forms the objects a


typical user will need to work with fairly
regularly, which is why your navigation form
may not include every single form, query, or
report. This makes it easier to navigate the
database. By hiding tables and rarely used
forms, queries, and reports, it also reduces
the chance of the database being damaged
by users accidentally editing or deleting
necessary data.

For this reason, it's important to ask your


database designer or administrator before
working with objects that are not available
in your navigation form. Once you have
Lesson 4 – Managing Databases box will appear. Locate and select the
database, then click Open.
and Objects
To open an existing database:
Before entering data or modifying objects,
you will need to open your database.

Select the File tab to go to Backstage view.

One or more warning messages may appear


when you open your database. If the
database contains customized functions, a
yellow bar with a security warning may
appear below the Ribbon. If you trust the
source of your database, click Enable
Content for your database to display
Click Open.
correctly.

After enabling all content in the database,


you may see a message asking if you want
Click Browse. to make the database a Trusted Document.
Click Yes if you would like all content to be
automatically enabled each time you open
the database.

The You may also be prompted to sign in to the


Open database. Select your name from the login
dialog
list. If your name does not appear, click Add database. This is because you cannot save
User to enter your information. an entire database at once. Instead, you
must individually save the objects contained
To close a database: within the database.
Select the File tab to go to Backstage view.
To open an object:
Select Close.
In the Navigation pane, locate and double-
click the desired object.

If you have any unsaved objects, a dialog


box will appear for each one asking if you
The object will appear as a tab in the
want to save it. Select Yes to save the
Document Tabs bar.
object, No to close it without saving, or
Cancel to leave your database open.

Working with objects


It's helpful to think of your database as a
large binder or folder in which your data is
stored. The data itself is contained in By default, the most recently opened object
database objects. Access treats each of will appear in the main window as the
these objects as separate documents, which current object. To view another open
means you will have to open and save them object, click its tab in the Document Tabs
individually in order to work with them. bar.

You may have noticed that this lesson


contains no instructions for saving a
The object will be saved. Click the Save
command again to save any changes to the
object.

To close an object:
Select the object you want to close, then
click the X to the right of the Document
Saving objects
Tabs bar.
You'll need to save any changes you make
to each object before closing your
database. Remember, saving early and
often can prevent your work from being
lost. However, you will also be prompted to If there are any unsaved changes to the
save any unsaved work when you attempt object, you will be prompted to save it.
to close your database. Select Yes to save, No to close it without
saving your changes, and Cancel to leave
To save a new object: the object open.
Select the object you want to save by You can also close an object by right-clicking
clicking its tab in the Document Tabs bar. its tab on the Document Tabs bar and
Click the Save command on the Quick selecting Close. Select Close All to close all
Access Toolbar, or press Ctrl+S on your open objects.
keyboard.

To rename an object:
If the object you want to rename is open,
close it.
The first time you save an object, you will
be prompted to name it. Enter the desired In the Navigation pane, right-click the
object name, then click OK. desired object, then select Rename.
Type the new object name, then press Enter
on your keyboard.
All tables are composed of horizontal rows
and vertical columns, with small rectangles
called cells in the places where rows and
columns intersect. In Access, rows and
columns are referred to as records and
fields.
A field is a way of organizing information by
Lesson 5 – Working with Tables type. Think of the field name as a question
and every cell within that field as a
Table basics response to that question. In our example,
the Last Name field is selected, which
To open an existing table:
contains all of the last names in the table.
Open your database and locate the
Navigation pane.
In the Navigation pane, locate the table you
want to open.
Double-click the desired table.

A record is one unit of information. Every


cell on a given row is part of that row's
record. In our example, Quinton Boyd's
record is selected, which contains all of the
information related to him in the table.

The table will open and appear as a tab in


the Document Tabs bar.

Each record has its own ID number. Within


a table, each ID number is unique to its
record and refers to all of the information
within that record. The ID number for a
record cannot be changed.
Understanding tables
Each cell of data in your table is part of both
a field and a record. For instance, if you had
a table of names and contact information,
each person would be represented by a
record, and each piece of information about
each person—name, phone number,
address, and so on—would be contained
within a distinct field on that record's row.
Click the buttons in the interactive below to
learn how to navigate a table.
You can create a new record with the new
(blank) record command on the Record
Navigation bar.

Navigating within tables


The bar at the bottom of the table contains
several commands to help you search or You can find any record in the currently
scroll through records: open table by searching for it using the
record search box. Place your cursor in the
search box, type any word that appears in
To navigate through records in a table, you the record you want to find, and press the
can use the up and down arrow keys, scroll Enter key.
up and down, or use the arrows in the
Record Navigation bar located at the
bottom of your table.
To navigate between fields, you can use the
left and right arrow keys or scroll left and
right.

Adding records and entering data


Entering data into tables in Access is similar
to entering data in Excel. To work with Sometimes when you enter information
records, you'll have to enter data into cells. into a record, a window will pop up to tell
If you need help entering data into records, you that the information you've entered is
you might want to review our Cell Basics invalid. This means the field you're working
lesson from our Excel tutorial. with has a validation rule, which is a rule
about the type of data that can appear in
To add a new record: that field. Click OK, then follow the
There are three ways to add a new record
to a table:

In the Records group on the Home tab, click


the New command.
instructions in the pop-up window to re-
enter your data.

On the Record Navigation bar at the bottom


of the window, click the New record button.
To save a record:
Access is designed to save records
automatically. After entering a record, you
can either select a different record or close
the object, and Access will save the record.
However, in certain situations you many
want to save a record manually. For
example, if you need to edit an existing
Begin typing in the row below your last record, you could save the record to ensure
added record. your changes are saved.

Select the Home tab and locate the Records


group.
Click the Save command. The record will be
saved.

Editing records
Click the Look In: drop-down arrow to select
To quickly edit any record within a table, the area you want to search. Select Current
you can click it and type your changes. field to limit your search to the currently
Access also lets you find and replace a word selected field. Select Current document to
within multiple records and delete records search within the entire table.
entirely.

To replace a word within a record:


You can edit multiple occurrences of the
same word by using Find and Replace,
which searches for a term and replaces it
with another term.
Click the Match: drop-down arrow to select
how closely you'd like results to match your
Select the Home tab and locate the Find search. Select Any Part of Field to search for
group. your search term in any part of a cell. Select
Whole Field to search only for cells that
Select the Replace command. The Find and
match your search term exactly. Select Start
Replace dialog box will appear.
of Field to search only for cells that start
with your search term.

In the Find What: field, type the word you


want to find, then in the Replace With: field
type the word you want to replace the
original word with. In our example, we'll Click Find Next. If the text is found, it will be
find instances of the word Fall and replace it selected.
with Autumn.
To delete a record:
Select the entire record by clicking the gray
Review the text to make sure you want to
border on the left side of the record.
replace it. Click Replace to replace the
original word with the new one.

Select the Home tab and locate the Records


group.
Click the Delete command.

Access will move to the next instance of the


A dialog box will appear. Click Yes.
text in the object. When you are finished
replacing text, click Cancel to close the
dialog box.
The Replace All option is powerful, but it
may actually change some things you don't
want to change. In the example below, the
The record will be permanently deleted.
word fall did not refer to the season, so
replacing it with Autumn would be The ID numbers assigned to records stay
incorrect. Using the normal Replace option the same even after you delete a record.
allows you check each instance before For example, if you delete the 205th record
replacing the text. You can click Find Next to in a table, the sequence of record ID
skip to the next instance without replacing numbers will read ... 204, 206, 207 ... rather
the text. than ... 204, 205, 206, 207 ...
Modifying table appearance
Access offers various ways to modify the
appearance of tables, including resizing
fields and rows and temporarily hiding To resize a row:
information you don't need to see. These
Place your cursor over the bottom gridline
changes aren't just about making your table
in the gray area to the left of the row. Your
look good; they can also make the table
mouse will become a double arrow.
easier to read.

Resizing fields and rows


If your fields and rows are too small or large
for the data contained with them, you can
always resize them so all of the text is
displayed.

To resize a field:
Place your cursor over the right gridline in Click and drag the gridline downward to
the field title. Your mouse will become a increase the row height or upward to
double arrow. decrease the row height, then release the
mouse. The row height will be changed.

Click and drag the gridline to the right to


increase the field width or to the left to
decrease the field width, then release the
mouse. The field width will be changed. Hiding fields
If you have a field you don't plan on editing
or don't want other people to edit, you can
hide it. A hidden field is invisible but is still
part of your database. Data within a hidden darker than the background of the rest of
field can still be accessed from forms, the table. This darker alternate row color
queries, reports, and any related tables. makes your table easier to read by offering
a visual distinction between each record
To hide a field: and the records directly above and below it.
Right-click the field title, then select Hide
Fields.

To change the alternate row color:


Select the Home tab, locate the Text
Formatting group, and click the Alternate
Row Color drop-down arrow.

The field will be hidden.


If you decide you want the field to be visible Select a color from the drop-down menu, or
again, you can unhide it. Simply right-click select No Color to remove the alternate row
any field title, then select Unhide Fields. A color.
dialog box will appear. Click the checkboxes
of any fields you want to be visible again,
then click Close.

Table formatting options The alternate row color will be updated.


Alternate row color
By default, the background of every other
row in an Access table is a few shades
Modifying gridlines
Additional formatting options
Another way Access makes your tables easier to
read is by adding gridlines that mark the To view additional formatting options, click the
borders of each cell. Gridlines are the thin lines Datasheet Formatting arrow in the bottom-right
that appear between each cell, row, and corner of the Text Formatting group.
column of your table. By default, gridlines are
dark gray and appear on every side of a cell, but
you can change their color and hide undesired
gridlines.
The Datasheet Formatting dialog box offers
several advanced formatting options, including
the ability to modify background color, gridline
color, and border and line style. It even includes
the ability to view a sample table with your
formatting choices, so play around with the
various formatting options until you get your
To customize which gridlines appear: table looking the way you want it.

Select the Home tab, locate the Text Formatting


group, and click the Gridlines drop-down arrow.

Select the gridlines you want to appear. You can


choose to have horizontal gridlines between the
rows, vertical gridlines between the columns,
both types of gridlines, or none at all.

The gridlines on your table will be updated.

You might also like