Unit 2

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 10

Unit 2: Manipulation of Data Using the

Database Management System (DBMS) Graphical User (GUI)

Unit 2
Manipulation of Data Using the
Database Management System (DBMS) Graphical User (GUI)

Topic 1: Terminologies, Data Names and definition


Classification of Attributes
Time Allotment: 2 Hours

Learning Objectives
 Define the different terminologies in Data Manipulation Using
Database Management System Graphical User
 Relate the different terms and basic concept in Unit 1 when it comes to
Graphical User Interface
 Identifying the rules in giving Data Names and definitions
 Differentiate the different classifications of attributes

Presentation of Contents

TERMINOLOGY

Database vs. Relational Databases

Database: A database can be one, stand-alone table that can contain many
fields of information. This is the simplest, yet least powerful type of
databasand is often referred to as a “flat” database.

Relational Databases: Many tables that are linked through common fields
and can ensure greater accuracy and less input of data. Relational
databases increase flexibility of data and allow ease of collecting and
maintaining historical data.

Relationships: Relational databases are databases in which common fields of


information join tables. The relationships are one-to-one and one-to-
many relationships. A one-to-one relationship ensures that one record
in one table has a (and only one) matching record in another table.
One-to-Many relationships allow one record in one table and many
records in another table.

Database Objects: Many Database management Systems (DBMS), such as


MS Access (which by the way we’ll be using as our DBMS for this
course), contain objects. These objects generally are: tables, queries,

1
Unit 2: Manipulation of Data Using the
Database Management System (DBMS) Graphical User (GUI)

forms, and reports. These objects provide functionality and power to


your database information. However, access is not appropriate for
large databases, but is terrific for small and medium size databases
with limited users.

Table (Entity Type) - A table contains or holds the data. Tables can limit the
types of data in fields and can assist in integrity and accuracy of data.
Generally, tables do not perform calculations and are simply data
collectors for input or other means of acquiring data. Fields comprise
the records, records comprise the tables, and tables comprise the
database.

RECORD - A record is a collection of fields for an item you are tracking. For
example, a record consists of all the fields for a person if you are
tracking associates in a company. In addition, a record is a single row
which consists of multiple fields.

Attribute (Fields) - are the different characteristics (attributes) within a Table.


Tables usually contain multiple fields. A field is the lowest level of
data in a database. Fields consist of information about the item you are
tracking. For example, if you are tracking people or human resource
data some of the fields you would want to include would be First
Name, Last Name, Social Security Number, and so on.

It is a defined property of an entity. In the school example an


attribute of student (which is an entity) might be name or student ID.
Attributes are the same thing as fields in a flat file database. It is (often
corresponds to a field in a table).

Data Names and Definitions


Data objects must be named and defined before they can be used
unmistakably in a model of organizational data.
 Data Names
◦ There are some general guidelines about naming any data
object
 Relate to business, not technical characteristics.
 Customer, Student is a good name but
File01, Bit07 are not good names.
 Be meaningful, must be to the point
 Be unique from the name used for every other
distinct data objects.
 HomeAddress versus CampusAddress
 Readable so that the name is structured as the
concept would most naturally be said
 GradePointAverage is a good name
compared to AverageGradeRelative to A.
 Composed of words taken from an approved list
 Each organization often chooses a
vocabulary from which significant words in

2
Unit 2: Manipulation of Data Using the
Database Management System (DBMS) Graphical User (GUI)

data names must be chosen. (maximum is


preferred, never upper limit, ceiling or
highest)
 Repeatable meaning that different people or the
same person at different times should develop
exactly or almost the same name.
 The birth date of a student would be
StudentBirthDate and the birth date of an
employee would be EmployeeBirthDate.
Classifications of attributes:
Entities are represented by means of their properties, called attributes.
Attributes are characteristics of an entity. An entity may have many attributes. For
each attribute, there is set permitted values called domain. Data Domain refers to all
the valid values which a data element (column) may contain.

Atomic vs. Composite Attribute


Atomic Attribute: An attribute that cannot be divided into smaller independent
attribute is known as atomic attribute. For example, assume Student is an
entity and its attributes are Student No, Name, Age, Address and Phone no.
Here the age (attribute) of student (entity) cannot further be divided. In this
example age is atomic attribute.

Composite Attribute: An attribute that can be divided into smaller independent


attribute is known as composite attribute. For example, the address
(attribute) of student (entity) can be further be divided into House no, city
and so on. In this example address is composite attribute.

Single-Valued vs. Multi-Valued Attribute


Single-Valued Attribute: An attribute that has only single value for an entity is
known as single-valued attribute. For example, the age (attribute) of student
(entity) can have only one value. Here, age is single valued attribute.

Multi-Valued Attribute: An attribute that can have multiple values for an entity is
known as multi-valued attribute. For example, the Phone no (attribute) of
student (entity) can have multiple value because a student may have many
phone numbers. Here, Phone no is multi valued attribute.

Stored vs. Derived Attribute


Stored Attribute: An attribute that cannot be derived from another attribute is
known as stored attribute. For example, birth date cannot derive from age of
student.

Derived Attribute: An attribute that can be derived from another attribute is known
as derived attribute. For example, age can be derived from birth date of
student.

3
Unit 2: Manipulation of Data Using the
Database Management System (DBMS) Graphical User (GUI)

Null Valued Attribute: An attribute which has not any value for an entity is known
as null valued attribute. For example, there may be chance when a student
has no phone no. In that case, phone no is called null valued attributes.

Key Attribute: An attribute that has unique value of each entity is known as key
attribute. For example, every student has unique student no. Here, student no.
is key attribute.

INTRODUCTION TO MS ACCESS

Microsoft Access - is a powerful database software package or


program that can be used to create and manage databases.

DATABASE FILE

TABLE

FIELD

DATA TYPE

VALUE/RECORD

1. Database File – is the main file that encompasses the entire


database.

Example: StudentDatabase.mdb (Access 2003) or


StudentDatabase.accdb (Access 2007).

2. Table -is a collection of related data about a specific topic (entity)


that are organized in fields (column) and records (rows) on a
datasheet. There can be multiple tables in a database.

Examples: Students table, Teachers table, Employees table

3. Fields - are the different characteristics (attributes) within a Table.


Tables usually contain multiple fields.

*Is a column on a datasheet and defines the data type for a set
of values in a table.

Examples: LastName, FirstName, Rank, Age, Gender, ID


Number

4
Unit 2: Manipulation of Data Using the
Database Management System (DBMS) Graphical User (GUI)

4. Data types - are the properties of each field. A field only has one
data type.

Examples:

Field: LastName
Data type: Text

5. RECORD (values) - is a row on a datasheet and is a set of values


defined by fields.

PARTS OF THE MS ACCESS SCREEN

The Navigation Pane

An Access database consists of the following objects: tables, queries,


forms, reports, macros, and modules. The Navigation pane displays
these objects in a database.
Click the double right-arrows to open it. The arrows change to
double left-arrows
Click the double left-arrows to close it. The arrows change to
double right-arrows .
The Microsoft Office Button – is used to create a new database, open
and save a database, and many other tasks.
The Quick Access Toolbar - provides access to commands you
frequently use. By default, Save, Undo, and Redo appear on the
Quick Access toolbar.
The Title Bar - displays the name of the database on which you are
currently working.
The Ribbon – used to issue commands. At the top of the Ribbon are
several tabs; Home, Create, External Data, Database Tools. Clicking a
tab displays related command group. Within each group are related
command buttons. You click buttons to issue commands or to access
menus and dialog boxes.
Access Objects
As stated earlier, the Navigation pane stores the objects in your
database: tables, queries, forms, reports, macros, and modules. Objects
always display with an icon to the right. The icon tells you the object
type: table, query, form, report, macro, and
module.

Tables - In Access, data is stored in tables. A table is a set of columns


and rows, with each column referred to as a field. Each value in a field
represents a single type of data. Each row of a table is referred to as a
record.

5
Unit 2: Manipulation of Data Using the
Database Management System (DBMS) Graphical User (GUI)

Queries - You use queries to retrieve specific data from your database
and to answer questions about your data. For example, you can use a
query to find the names of the employees in your database who live in
a particular state.

Forms - Forms give you the ability to choose the format and
arrangement of fields. You can use a form to enter, edit, and display
data.

Reports - Reports organize or summarize your data so you can print it


or view it onscreen. You often use reports when you want to analyze
your data or present your data to others.

Macros - Macros give you the ability to automate tasks. You can use a
macro to add functionality to a form, report, or control.

Modules - Like macros, modules give you the ability to automate tasks
and add functionality to a form, report, or control. Macros are created
by choosing from a list of macro actions, whereas modules are written
in Visual Basic for Applications.

In Access, tables are used to store data, queries to retrieve data, forms
to enter data, and reports to display data.

Notes:

 Double-click an object to open the object.


 Right click an object to view a menu of options that you can
use to open, rename or delete the object.
 Objects that are open appear on tabs. Right-click a tab to view a
menu of options that you can use to save the object, close the
object, or change the view.

3 Options in Creating a Database

 Use a blank database - you must save an Access database


before you start working with it.
 Use one of the templates provided - access automatically
creates forms, reports, and other objects that you can use. You
can modify these objects to suit your needs.
 Use an existing database – you may use recently opened or
created databases on your computer to work with.

What is a Datasheet?

A datasheet displays the information stored in a table in


columns and rows. The columns are called fields and the rows are
called records. You can use a datasheet to create a table, enter data,
retrieve data, and perform other tasks.

6
Unit 2: Manipulation of Data Using the
Database Management System (DBMS) Graphical User (GUI)

Understanding Tables

- A table is a set of columns and rows.


- Each column is called a field.
- Each field must be given a name and no two fields can have the
same name.
- Each value in a field represents a single category of data.
- Each row in a table is called a record.
- All of the data in a table should refer to the same subject.

Note: When you view a blank database for the first time in Datasheet
view, you see a column named ID. This column is by default the
primary key field.

Primary key is a field or combination of fields that uniquely identify


each record in a table. No two records in a table should have the same
values in every field. The ID field has a data type of AutoNumber; as a
result, Access automatically creates a unique number for each record in
the database.

What are views?

Views are different ways of looking at the same object. Tables have
four views:

- Datasheet view used to create a table, edit data, or view data.


- Pivot Table view used to create a pivot table.
- Pivot Chart view used to create a pivot chart.
- Design view used to create a table or modify an existing table.

To change the view:


- Activate the Home tab.
- Click the down-arrow under the View button. A menu appears.
- Click the view you want. Access changes to the view you
chose.

Data Types

o Text (MS access 2007)/ShortText (MS access higher version)


- Alphanumeric data. Use for text and for numbers that are not
used in mathematical calculations. Use for names, addresses,
and other relatively short pieces of text. It can store up to 255
characters.

7
Unit 2: Manipulation of Data Using the
Database Management System (DBMS) Graphical User (GUI)

o Memo (MS access 2007)/Long text (MS access for higher


version). Use for long pieces of text, such as notes and long
descriptions. It can store up to 64,000 characters.

o Number - Numeric data. Use for numbers you want to use in


mathematical calculations. If you are working with currency,
use the currency type.

o Date/Time - is use for dates and times.

o Currency - is use for currency. It prevents rounding during


calculation.

o AutoNumber - unique sequential numbers or random numbers


automatically inserted when you create a record. Use to create a
primary key.

o Yes/No - logical data. It is use when only one of two values are
valid. Yes/No, True/False, etc.-

o Hyperlink - is used to store hyperlinks.

o Attachment - is used to store attachments.

o OLE Object - is used to attach an OLE object such as a Word


document, Excel spreadsheet, or PowerPoint presentation.

 Description - enter a brief description of what the


contents of the field are.
 Field Properties - select any pertinent properties for
the filed from the bottom pane.
 Field size – default field size for the text type is 255
characters.
Format -
Text and Memo format
Number format -
Currency format
Date Format
 Yes/No – fields are displayed as check boxes by
default on the datasheet
* Default value
* Indexes
 Validation rule- validates rule
 Input masks - controls the value of a record and sets it
in a specific format.

8
Unit 2: Manipulation of Data Using the
Database Management System (DBMS) Graphical User (GUI)

A Sample Table using the different data types and field properties in Microsoft Access 2007

Database Filename: DBPersonnel


Table Name: PersonnelTable

Field Name Data Type Field size Format Input MaskValidation Rule Validation Text
PersonnelID Autonumber
LastName Text 25 >
FirstName Text 20 >
Social Security # Text 15 000-00-0000
Street address Text 25
City Text 20
State Text 2 >
Zip Text 5
Gender Text 1
Favorite Number Number 0 and <1000 Favorite Number must be between 1 and 999.

Date hired Date/Time Short Date 99/99/0000;0;


Salary Currency (Decimal places =0, Default value =0)
Application Received Yes/No

The following topics will be taught in the LABORATORY ACTIVITIES:


1. Creating of Database Objects
2. Inserting of Records
3. Modifying of Records
4. Deleting of Records
5. Retrieving of Records
6. Creating of Forms
7. Creating of Reports

9
Unit 2: Manipulation of Data Using the
Database Management System (DBMS) Graphical User (GUI)

10

You might also like