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

Accessing and Using Database Application

This document describes a module on accessing and using database applications. It covers topics like introduction to databases and database management systems, designing databases, creating database objects, adding and modifying records, and customizing basic settings.

Uploaded by

Dej Ayn
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
20 views

Accessing and Using Database Application

This document describes a module on accessing and using database applications. It covers topics like introduction to databases and database management systems, designing databases, creating database objects, adding and modifying records, and customizing basic settings.

Uploaded by

Dej Ayn
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 61

TVET-PROGRAMME TITLE: Web Development

and Database Administration Level I

• MODULE TITLE: Accessing and Using


Database Application
• MODULE CODE: EIS WDDB1 M08 0322
• NOMINAL DURATION: .70 Hours

By Dejenie A.
MODULE CONTENTS:
LO1. Create database objects
– Occupational Health & Safety (OH&S)
– Introduction to database and database management systems
– Designing a database incorporating basic Database design principles
– Opening Database application
– Creating Database objects
– Modifying Database object as required
– Creating Relationship with tables
LO2. Add record on table
– Adding data in a table according to information requirements
– Modifying and deleting records as required
– Saving and compiling database objects
LO3. Customize basic settings
– Adjusting page layout to meet user requirements
– Opening and viewing different toolbars
– Formatting fonts as appropriate for the purpose of the database entries
LO1. Create Database Objects
Introduction to database and database management
systems
• Data means known facts that can be recorded and that have
implicit meaning.
–For example, consider the names, telephone numbers, and
addresses of the people you know.
–You may have recorded this data in an indexed address book
or you may have stored it on a hard drive, using a personal
computer and software such as Microsoft Access or Excel.
• Information is meaningful data or processing output of
computer that is meaning and understandable by the user.
• Database is a collection of related data.
• A database is an integrated collection of
logically related records or files
consolidated into a common pool that
provides data for one or more multiple
uses.
• A database can best be described as a way
of storing large amounts of information.
• The data can be retrieved and we can even
ask questions of the data and get answers.
– For example: You may want to know how
many Students enrolled in every occupational
level.
• One way of classifying databases involves the
type of content, for example: bibliographic, full-
text, numeric, and image.
• Other classification methods start from
examining database models or database
architectures.
• The data in a database is organized according to
a database model.
• The relational model is the most common used
in database system.
• Database Management System (DBMS) consists
of software that organizes the storage of data.
• A DBMS controls the creation, maintenance, and
use of the database storage structures of
organizations and of their end users.
• It allows organizations to place control of
organization-wide database development in the
hands of Database Administrators (DBAs) and
other specialists.
• In large systems, a DBMS allows users and other
software to store and retrieve data in a structured
way.
• Database management systems are usually
categorized according to the database model
that they support, such as the network,
relational or object model.
• The model tends to determine the query
languages that are available to access the
database.
• Commonly used language for the relational
database are Ms- Access, SQL, Oracle, etc.
• In this level we will discuss the concepts of
database using Ms Access.
Introduction Ms- Access
• MS Access is a database management tool that
enables one to store relevant data.
• This also has the capabilities to retrieve, sort,
summarize and report results immediately and
effectively.
• It can combine data from various files (tables)
through creating relationships.
• Microsoft Access (MS Access) enables one to manage
all important information from a single database file.
• Within the file, one can use the different objects:
– Tables - A table is a collection of data about a specific topic,
such as products or suppliers. Using a separate table for each
topic means that you store that data only once. This results in
a more efficient database and fewer data-entry errors.
– Queries - You use queries to view, change, and analyze data
in different ways. You can also use them as a source of
records for forms, reports, and data access pages.
– Forms - A form is a type of a database object that is primarily
used to enter or display data in a database. You can also use a
form as a switchboard that opens other forms and reports in
the database, or as a custom dialog box that accepts user
input and carries out an action based on the input.
– Reports - A report is an effective way to present your
data in a printed format. Because you have control over
the size and appearance of everything on a report, you
can display the information the way you want to see it
– Modules - A module is essentially a collection of
declarations, statements, and procedures stored
together as one named unit to organize your Microsoft
Visual Basic code.
– Data access pages - A data access page is a special type
of Web page designed for viewing and working with data
from the Internet or an intranet— data that is stored in a
Microsoft Access database or a Microsoft SQL Server
database.
Database design Principles
• In studying MS Access, it is necessary to understand
some basic elements of a database before
proceeding to it.
• Database Elements:
• Data :It tells the truth about something; a person, a
place, an object, etc.
• It is raw facts and figures about things.
Name “Girma” is a data. “Girma” is my name, so it tells
Girma something about a person. “Girma” is a Name.

Gender
Male” is Girma’s gender. So it tells something about “Girma”.

Male

•Information is a collection of data (raw facts) which is


contained in 1 file (table in Access)
Example:
IDNumber LName FName Mname Gender Bday Address
MOE-0001 Cuevas Noel Pancho Male 11-05-1978 Aratkilo
Naming Conventions
• It is manner of naming files and variables.
• Having a poor naming convention can only add confusion, so it's important
that you start with a good scheme, and think about what the scheme will
mean to you.
• Here are the three things to consider in establishing a naming convention:

– Does my convention make sense to me?  


• Must be simple and understandable to you.
– Will my convention make sense to other people? 
• Time will come that other people will look into your database program, so
they must able to understand it.
– Can I be consistent in implementing and enforcing my
convention? 
• All throughout my database work, your naming convention must not
change.
• Generally , here are some basic simple rules when it comes to
the name of any object in a database (including the name of
the database itself): 
• Do not use spaces in object names.
– It might seem tempting and cute to have a view named "Sales By
Quarter," but this is a nightmare to deal with programmatically.
Instead write it as “SalesByQuarter” or “SalesByQtr” or “QtrlySales”
• Avoid using reserved words.
– This is easier said than done, as there is a very large list of current
and future reserved words to check against.
– Example: do not name your file as “Date” because “Date” is a
reserve word in Ms Access.
• Do not use dashes in database names.
– Minus“-“ was often recognized by a computer as an operator
(subtraction), so instead of naming your object as “Quarterly-Sales”
better name it as QuarterlySales” or better use underscore instead of
a dash “Quarterly_Sales”.
• Start object names with a letter.
– I see table named "2005_Sales" and columns and
columns named "1", "2," "3," and so on (to represent
months. 
• Keep names short but meaningful.
– This is self-explanatory and fairly logical, "SlQ" is too
short. “SalesFiguresForCompanyByFiscalQuarter" is
just silly.   
• Use sensible case.
– There is little worse than going through a database
schema where all the table names are in ALL CAPS.
Database Design Principles
• Usability:
– Any information which we are storing in any organization should be
meaningful for that organization.
– If we are storing those factors which are actually not fit with
organization’s requirement then this is just waste of resources.
• Extensibility:
– As we know that everyday new business requirements come up and
every day there is a need to change or enhance information system to
capture new requirements.
– So information design should be extensible so that it can adopt new
requirements without much efforts or without major breaking
changes.
• Data Integrity:
– is the overall accuracy, completeness, and consistency of data.
– One small mistake in data can lead to major issues with any
organization’s key decision and hence a big risk for growth.
• Entity Integrity:
– Involves the structure (primary key and its attributes) of the entity. If the
primary key is unique and all attributes are scalar and fully dependent
on the primary key, then the integrity of the entity is good.
• Domain Integrity:
– We can define proper data types for different attributes based on
organization’s requirement so that correct format data should present in
system.
• Referential Integrity:
– This defines if any entity is dependent on another one then parent entity
should be there in the system and should be uniquely identifiable.
– We can do this by implementing foreign keys.
• User defined integrity:
– User-defined integrity involves the rules and constraints created by the
user to fit their particular needs. Sometimes entity, referential, and
domain integrity aren't enough to safeguard data.
• Performance:
– As data in increasing day by day so at some time there will
be impact on performance if database design is poor or
we’ll not take any actions to improve performance.
• Availability:
– The availability of information refers to the information’s
accessibility when required regarding time, locations, and
the availability of the data for future analysis.
• Security:
– For any organizational asset, the level of security must be
secured depending on its value and sensitivity.
– So security is one of the most important aspect of good
database design.
Design Process
– Determine the purpose of your database
– Find and organize the information required. Gather
all of the types of information you might want to
record in the database.
– Divide the information into tables: Divide your
information items into major entities or subjects.
– Each subject then becomes a table.
– Turn information items into columns:
• Decide what information you want to store in each table.
Each item becomes a field, and is displayed as a column in
the table.
• For example, an Employees table might include fields such
as Last Name and Hire Date.
– Specify primary keys: Choose each table’s primary key.
The primary key is a column that is used to uniquely
identify each row. An example might be Product ID.
– Set up the table relationships. Look at each table and
decide how the data in one table is related to the data
in other tables.
– Refine your design: Analyze your design for errors.
– Apply the normalization rules: Apply the data
normalization rules to see if your tables are structured
correctly.
Database Objects
• A database object in a relational database is a data
structure used to either store or reference data.
• The most common object that people interact with is the
table.
• The different type of Database objects
• Tables: - it is defined as a container or a worksheet-like
container where the collection of data has been stored.
• Tables - is a collection of data about a specific topic, such
as products or suppliers
• Basic Component of a Table:
– Meta Data – Database Structure
– Field – Column – Data
– Fieldname
– Record - Row - Information
• Metadata – is a “data about data” or synonymously called
table structure that defines what type of data your data is?
• Queries –Queries used to view, change, and
analyze data in different ways.
– You can also use them as a source of records for
forms, reports.
• Forms - A form is a type of a database object that
is primarily used to enter or display data in a
database.
• Reports - A report is an effective way to present
your data in a printed format.
– Because you have control over the size and
appearance of everything on a report.
Data types in Microsoft Access
• 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.
Type of Data Description Size
Short Text Text or combinations of text and numbers, Up to 255 characters.
including numbers that do not require
calculating (e.g. phone numbers).
Long Text Lengthy text or combinations of text and Up to 63, 999 characters.
numbers.
Number Numeric data used in mathematical 1, 2, 4, or 8 bytes (16 bytes if
calculations. set to Replication ID).
Date/Time Date and time values for the years 100 8 bytes
through 9999.
Currency Currency values and numeric data used in 8 bytes
mathematical calculations involving data
with one to four decimal places.
AutoNumber A unique sequential (incremented by 1) 4 bytes (16 bytes if set to
number or random number assigned by Replication ID).
Microsoft Access whenever a new record is
added to a table.
Yes/No Yes and No values and fields that contain 1 bit.
only one of two values (Yes/No, True/False,
or On/Off).
Type of Description Size
Data
Attachment Files, such as digital photos. Multiple files can be Up to about 2 GB.
attached per record. This data type is not available in
earlier versions of Access.
OLE objects OLE objects can store pictures, audio, video, or Up to about 2 GB.
other BLOBs (Binary Large Objects)
Hyperlink Text or combinations of text and numbers stored as Up to 8,192 (each part of a
text and used as a hyperlink address. Hyperlink data type can contain
up to 2048 characters).

Lookup The Lookup Wizard entry in the Data Type column Dependent on the data type of
Wizard in the Design view is not actually a data type. When the lookup field.
you choose this entry, a wizard starts to help you
define either a simple or complex lookup field.
Calculated You can create an expression that uses data from one You can create an expression
or more fields. You can designate different result that uses data from one or more
data types from the expression. fields. You can designate
different result data types from
the expression.
• Create Database Relationship
• Table Relationship
• Newcomers to the world of databases often have a
hard time seeing the differences between a
database and a spreadsheet.
• They see tables of data and recognize that databases
allow you to organize and query data in new ways,
but fail to grasp the significance of
the relationship that gives relational database
technology & its name.
• Relationships allow you to describe the connections
between different database tables in powerful ways.
• A relationship is a logical connection between two
tables.
• Keys are fields that are part of a table relationship.
• There are two kinds of keys
• Primary key
– A table can have only one primary key. A primary key
is used to identify each record that you store in the
table. It will not allow a duplication of the Primary
Key thus make it unique. Primary Key is the unique
identification of one record. There is a uniquely
identification number, such as
• ID number
• A serial number
• A code that serves as a primary key
• Foreign key
– A table can also have one or more foreign key. A
foreign key contains values that correspondent to
values in the primary key of another table. You use
table relationship to combine data from related table
Types of Database Relationships
• There are three types of relationships
1. One to One Relationship
– In a one-to-one relationship, each row in one
database table is linked to 1 and only 1 other row in
another table. In a one-to-one relationship between
Table A and Table B, each row in Table A is linked to
another row in Table B. The number of rows in Table
A must equal the number of rows in Table B.
– To illustrate the one-to-one relationship consider
the sample table design and data below:
Customer name table

cust_id (primary key - link to cust_id of customer


details table)
first name
last name

Customer details table


cust_id (primary key - link to cust_id of customer
name table)
height
weight
date of birth
cust_id firstname last cust_i height weight dateofbirth
name
d  
0001     Abebe Tekalign
0001     181     75      03/05/1960
0002     Sintayehu Balcha
0002     179     82      06/08/1974
0003     Kebede  Daba 

0004 Simehar     Belay 0003 171     65      04/01/1955

0005  Makida  Teka  


0004     185     93      05/05/1980

0005     168     71   09/09/1975


• Notice that each row in the customer name
table is related to 1 and only 1 other row in the
customer details table.
• Similarly, each row in the customer details
table is related to 1 and only 1 other row in the
customer name table.
2. One to Many Relationships
– In a one-to-many relationship, each row in the
related to table can be related to many rows in the
relating table.
– This allows frequently used information to be saved
only once in a table and referenced many times in all
other tables.
– In a one-to-many relationship between Table A and
Table B, each row in Table A is linked to 0, 1 or many
rows in Table B.
– The number of rows in Table A is almost always less
than the number of rows in Table B.
– To illustrate the one-to-many relationship consider
the sample table design and data below
Authors table Books table
author_id (primary book_id (primary key)
key)
title
first name
author_id  (foreign key - link
last name
to author_id of author table)
Books Table
Author Table
book_id  title author_id 
author_id first last name
  name  b1     a database primer 0001
0001     Abebe Tekalign b2     building data warehouse 0001
b3 teach yourself sql            0001
0002     Sintayehu Balcha
b4     101 exotic recipes 0002
0003     Kebede  Daba  b5     visiting ethiopia             0003

0004 Simehar     Belay


• Notice that each row in the authors table is
related to 0, 1 or many rows in the books table.
This makes intuitive sense because an author
can write 0, 1 or more than 1 books.
• In our example above, Abebe Tekalign has
written 3 books, Sintayehu balacha has written
1 book, Kebede daba has written 1 book and
Simhar belay has not written any books.
• If you notice carefully, the above relationship
between the authors table and the books table
is a one-to-many relationship.
• Turning around, the relationship between the
books table and the authors table is a many-to-
one relationship.
3. Many to Many Relationships
– In a many-to-many relationship, one or more rows
in a table can be related to 0, 1 or many rows in
another table.
– In a many-to-many relationship between Table A
and Table B, each row in Table A is linked to 0, 1 or
many rows in Table B and vice versa. 
– A 3rd table called a mapping table is required in
order to implement such a relationship.
To illustrate the many-to-many relationship consider
the sample table design for a bank below:
To illustrate the many-to-many relationship consider the sample
table design for a bank below:
Customers table
cust_id (primary
key)
last name
first name

Products table
product_id (primary
key)
name

Mapping table
cust_id
product_id
Assume that the bank has only 2 customers and
2 products:
Customer Table
cust_id firstname last name
0001     Abebe Tekalign

0002     Sintayehu Balcha

Mapping Table

Products Table cust_id product_id


product_id  name
0001     P0001
P0001 savings
0001     P0002
P0002  credit card
0002     P0002
• Notice from the mapping table, Abebe Tekalign
has 2 facilities with the bank - a Savings account
and a Credit Card.
• Also, notice that both the customers own Credit
Cards issued by the bank. This means that with
the way the database tables are designed:
• One customer can have 0, 1 or many products
• One product can be owned by 0, 1 or many
customers
Lo2: Add record on table
• Add, Modify & Delete records
• There are several ways to update data in an Access database.
• You add a record to your database when you have a new item to
track, such as a new contact to the Contacts table.
• When you add a new record, Access appends the record to the
end of the table.
• You also change fields to stay up-to-date, such as a new address
or last name.
• To maintain data integrity, the fields in an Access database are set
to accept a specific type of data, such as text or numbers.
• If you don't enter the correct data type, Access displays an error
message.
• Finally, you can delete a record when it is no longer relevant and
to save space.
• You use a form to manually update data.
• Data entry forms can provide an easier, faster,
and more accurate way to enter data.
• Forms can contain any number of controls
such as lists, text boxes, and buttons.
• In turn, each of the controls on the form either
reads data from or writes data to an
underlying table field.
• Datasheets are grids of data that look like Excel
worksheets.
• You can change data by working directly in Datasheet
view.
• If you are familiar with Excel, datasheets should be
relatively easy to understand.
• You can change data in tables, query result sets, and
forms that display datasheets.
• Typically, you use datasheets when you need to see
many records at once.
Understanding data entry symbols
The following table shows some of the record
selector symbols you might see when updating data
and what they mean.
Lookup data-entry list in MS Access
• Perhaps the best way to make sure that data is entered
correctly is to create a data-entry drop-down list.
• That way, anyone entering the data in your database table
can do so by choosing an item from the list, not by typing
it in.
• This method saves time and prevents invalid data from
being entered.
• Access offers two ways to create the drop-down list:
– Create the list by entering the items yourself: Go this route
when you’re dealing with a finite list of items that never change.
– Get the items from another database table: Go this route to
get items from a column in another database table.
– This way, you can choose from an ever-expanding list of items.
Filed Properties Settings
• The Field Properties settings safeguard data
from being entered incorrectly.
• Following is a description of the different
properties.
Field Size
– In the Field Size box for Text fields, enter the
maximum number of characters that can be
entered in the field.
• Format
– Click the drop-down list and choose the format in
which text, numbers, and dates and times are
displayed.
• Decimal Places
– For a field that holds numbers, open the Decimal
Places drop-down list and choose how many
numbers can appear to the right of the decimal
point.
• Input Mask
– For Text and Date field types, this feature provides
a template with punctuation marks to make
entering the data easier. Telephone numbers, social
security numbers, and other numbers that typically
are entered along with dashes and parentheses are
ideal candidates for an input mask (another
ridiculous database term!).
– On the datasheet, blank spaces appear where the
numbers go, and the punctuation marks stand at
the ready to receive numbers
• In the Input Mask text box, enter a 0 where
numbers go and enter the punctuation marks
where they go.
• For example, enter (000) 000-0000 or 000/000-
0000 to enter an input mask for a telephone
number.
• You can also create input masks by clicking the
three dots beside the Input Mask text box.
• Doing so opens the Input Mask Wizard dialog
box, where you can fashion a very sophisticated
input mask.
• Caption
– If the field you're working on has a cryptic or hard-
to-understand name, enter a more descriptive
name in the Caption text box.
– The value in the Caption property appears as the
column heading in Datasheet view, as a label on
forms, and on reports in place of the field name.
– People entering data understand what to enter
after reading the descriptive caption.
• Default Value
• When you know that the majority of records require a
certain value, number, or abbreviation, enter it in the
Default Value text box.
• That way, you save yourself the trouble of entering the
value, number, or abbreviation most of the time
because the default value appears already in each
record when you enter it.
• You can always override the default value by entering
something different.
• Validation Rule
– As long as you know your way around operators and
Boolean expressions, you can establish a rule for entering
data in a field. For example, you can enter an expression
that requires dates to be entered in a certain time frame.
Or you can require currency figures to be above or below a
certain value.
– To establish a validation rule, enter an expression in the
Validation Rule text box. To use dates in an expression, the
dates must be enclosed by number signs (#). 
– To get help forming expressions, click the three dots beside
the Validation Rule text box to open the Expression Builder
and build an expression there.
– Try clicking the Help button in the Expression Builder dialog
box. Doing so opens the Access Help program, where you
can get advice about building expressions.
• Validation Text
• If someone enters data that violates a validation rule that
you enter in the Validation Rule text box, Access displays a
standard error message.
• The message reads, “One or more values are prohibited by
the validation rule set for [this field].
• Enter a value that the expression for this field can accept.”
If this message is too cold and impersonal for you, you can
create a message of your own for the error message dialog
box. Enter your friendly message in the Validation Text text
box.
• Required
• By default, no entry has to be made in a field,
but if you choose Yes instead of No in the
Required box and you fail to make an entry in
the field, a message box tells you to be sure to
make an entry.
Lo3- Customize basic settings
Adjusting Page Layout and Settings
• Layout view is the most intuitive view to use for report
modification, and can be used for nearly all the
changes you would want to make to a report in Access.
• In Layout view, the report is actually running, so you
can see your data much as it will appear when printed.
• However, you can also make changes to the report
design in this view. Because you can see the data while
you are modifying the report, it's a very useful view for
setting column widths, add grouping levels, or
performing almost any other task that affects the
appearance and readability of the report.
Understanding Views

• There are multiple ways to view a database object.


• The two views for tables are Design View and Datasheet
View.
• Design View is used to set the data types, insert or
delete fields, and set the Primary Key
• Datasheet View is used to enter and view the data for
the records
• Switching Between Design View and Datasheet View:
• Click the View arrow on the Home tab and click on
either Datasheet View or Design View
Open and viewing different tools
• Access 2016 uses the Ribbon to organize
commands, just like in Access 2013 and 2010.
• If you've used these versions before, Access 2016
will feel familiar.
• But if you are new to Access or have more
experience with older versions, you should first
take some time to become familiar with the Access
2016 interface.
Course End!

You might also like