rapid application development - cmu personal...

30
Rapid Application Development Chapter 6: Development Database Application Tools: Microsoft Access Dr.Orawit Thinnukool College of Arts, Media and Technology, Chiang Mai University Cr: fisher.osu.edu

Upload: dangnhi

Post on 27-Jul-2018

216 views

Category:

Documents


0 download

TRANSCRIPT

Rapid Application Development

Chapter 6: Development Database Application

Tools: Microsoft Access

Dr.Orawit Thinnukool

College of Arts, Media and Technology, Chiang Mai University

Cr: fisher.osu.edu

Contents

• Introduction to Database

• Database Component

• Purpose of Database System

• Database Management Systems

• Database System Hardware

• Database System Software

• Planning the design of database

• Database Application

• Introduction: What is Access?

• What are these objects in ACCESS

• Data Type :Access

• Relational Database

• The database design process

• Logically structuring data

Introduction to Database

• A database is a place to store information. That information

could be sales figures, an inventory of computers you own, a

list of key customers, timesheet information; the possibilities

are endless. By having the database on your site, you can

easily share the information with people who need access to

it.

• The best way to think of a database is as a table. The

columns in the table are called fields. There are many types

of fields you can create: text, numeric, currency, names,

dates, to name a few. The rows in the table are

called records. The records contain all the database

information.

Introduction to Database

A database is much more powerful than a simple table.

With a table, you can only look at the information in the one way that the

table is designed. A database allows you to create many views of your

information. Each view allows you to:

Select the fields displayed in the view.

Pick the order in which the fields appear.

Set up a filter to control which records appear in the view.

Sort the order in which the records appear.

Total up fields in the view.

View fields from more than one database.

Introduction to Database When you create your own

database, you determine how

the information appears, what

the names of the fields are,

what the views look like, and

who has access to the

database.

If you already have information

that you would like in your

database, you can import that

information into the database.

You can also export information

from your database for use in

another program, such as

Microsoft Excel

Database Component

1. Data : In DBMS, databases are defined, constructed and then

data is stored,

2. Database Application: program contains statements that

request the DBMS to perform operation on database. The

operations may include updating, deleting data etc .

3. Database Management System: It is the set of

programs used to handle the database and to control and

manage the overall computerized database

4. Database Server: database server is a computer program that

provides database services to other computer programs

or computers, as defined by the client–server model. The term may

also refer to a computer dedicated to running such a program.

5. Database Administrator : A person who is responsible for

managing the overall database management system is called

database administrator or simply DBA.

Database Management Systems

• A database management system (DBMS) is an

aggregate of data, hardware, software, and users that

helps an enterprise manage its operational data

• The main function of a DBMS is to provide efficient and

reliable methods of data retrieval to many users

• Most DBMSs deal with several users who try

simultaneously to access several data items and,

frequently, the same data item

(Oracle)

Microsoft SQL Server

MySQL

Microsoft Access

IBM DB/2

Sybase

SAP DB

Database System Hardware

• A categorize computer memory into two classes:

internal memory and external memory ; internal

memory is permanent, such as ROM

• We are interested here only in memory that can

be changed by programs. This memory is often

known as RAM.

Database System Software

• Users interact with database systems through query

languages. The query language of a DBMS has two

broad tasks: to define the data structures that serve as

receptacles for the data of the database, and to allow the

speedy retrieval and modification of data.

DBMS software usually contains application development tools

in addition to query languages. The role of these tools is to

facilitate user interface development. They include forms

systems, procedural and nonprocedural programming

languages that integrate database querying with various user

interfaces, etc.

Purpose of Database System

• Nowadays, database applications were built on top of file

systems

- Data redundancy and inconsistency

Multiple file formats, duplication of information in different files

- Difficulty in accessing data

Need to write a new program to carry out each new task

- Data isolation

multiple files and formats

- Integrity problems

Integrity constraints

Hard to add new constraints or change existing ones

Purpose of Database System

- Atomicity of updates

Failures may leave database in an inconsistent state with partial

updates carried out

E.g. transfer of funds from one account to another should either

complete or not happen at all

- Concurrent access by multiple users

Concurrent accessed needed for performance

Uncontrolled concurrent accesses can lead to inconsistencies

- Security problems

Database Models

A database model is a type of data model that determines

the logical structure of a database and fundamentally

determines in which manner data can be stored, organized,

and manipulated. The most popular example of a database

model is the relational model, which uses a table-based

format.

1. Hierarchical database model

2. Network model

3. Relational mode l** we also uses this model

4. Object model

Database Models

Planning the design of database

• When designing your database, you need to consider:

• What fields should be in the database? This determines

what type of information can be stored in the database.

• What views of the information are needed? This

determines how users can see the information and what

appears in printed reports or screen.

• What are the permission levels for the database? Who

should have access to this information? Who can add

information? Who can edit it?

Database Application

A database application is a computer

program whose primary purpose is

entering and retrieving information from

a computerized database.

Database application comes from the

practice of dividing computer software

into systems programs, such as the

operating system, compilers, the file

system, and tools such as the database

management system, and application

programs, such as a payroll check

processor. On a standard PC running

Microsoft Windows, ATM, Registration

app et al.

Database Application

-Banking: all transactions

-Airlines: reservations, schedules

-Universities: registration, grades

-Sales: customers, products, purchases

-Manufacturing: production, inventory,

orders, supply chain

-Human resources: employee records,

salaries, tax deductions

Introduction: What is Access?

• Microsoft Access is a relational database management system

(DBMS). At the most basic level, a DBMS is a program that

facilitates the storage and retrieval of structured information on

a computer’s hard drive. Examples of well-know industrial-

strength relational DBMSes include

• Oracle

• Microsoft SQL Server

• IBM DB2

• • Informix

Well-know PC-based (“desktop”) relational DBMSes include

• • Microsoft Access

• • Microsoft FoxPro

• • Borland dBase

Introduction: What is Access?

Microsoft generally likes to incorporate as many features as

possible into its products. For example, the Access

package contains the following elements:

• A relational database system that supports two industry

standard query languages: Structured Query Language

(SQL) and Query By Example (QBE);

• A full-featured procedural programming language—

essentially a subset of Visual Basic,

• A simplified procedural macro language unique to

Access;

• A rapid application development environment complete

with visual form and report development tools;

Introduction: What is Access?

• A sprinkling of objected-oriented extensions;

• Various wizards and builders to make development

easier

What are these objects in ACCESS

When you create a database, Access offers you Tables,

Queries, Forms, Reports, Macros, and Modules. Here's a

quick overview of what these are and when to use them.

1. Tables.

2. Queries

3. Forms

4. Reports

5. Macros

6. Modules

What are these objects in Access

• 1.Table : All data is stored in tables. When you create a new table,

Access asks you define fields (column headings), giving each a

unique name, and telling Access the data type. Use the "Text" type

for most data, including numbers that don't need to be added e.g.

phone numbers or postal codes

• 2. Forms: The basic form has an appearance similar to an index

card: it shows only one record at a time, with a different field on each

line. If you want to control how the records are sorted, define a query

first, and then create a form based on the query. If you have defined

a one-to-many relationship between two tables, use the "Subform"

Wizard to create a form which contains another form. The subform

will then display only the records matching the one on the main form.

1 2

What are these objects in Access

3. Reports: If forms are for input, then reports are for output. Anything

you plan to print deserves a report, whether it is a list of names

and addresses, a financial summary for a period, or a set of mailing

labels.

4. Wizards : Again the Access Wizards walk you through the process

of defining reports table form and queries, which are also automatic

created.

5. Macros. An Access Macro is a script for doing some job. Macros

can also be used to set one field based on the value of another (the

"SetValue" action), to validate that certain conditions are met before

a record saved (the "CancelEvent" action) etc.

3 4 5

Data Type :Access

Think of a field's data type as a set of qualities that applies to all the

values contained in the field and that determines what kind of data

those values can be. There are ten different data types in Access:

• Attachment Files, such as digital photos. Multiple files can be

attached per record. This data type is not available in earlier versions

of Access.

• AutoNumber Numbers that are automatically generated for each

record.

• Currency Monetary values.

• Date/Time Dates and times.

• Hyperlink Hyperlinks, such as e-mail addresses.

• Memo Long blocks of text and text that use text formatting. A

typical use of a Memo field would be a detailed product description.

Data Type :Access

• Number Numeric values, such as distances. Note that there

is a separate data type for currency.

• OLE Object OLE objects, such as Word documents.

• Text Short, alphanumeric values, such as a last name or a

street address.

• Yes/No Boolean values.

NOTE THAT : Sometimes, the data in a field may appear to be one data

type, but is actually another. For example, a field may seem to contain

numeric values but may actually contain text values, such as room

numbers. You can often use an expression to compare or convert values

of different data types.

Relational Database

A database is a means of storing information in such a way

that information can be retrieved from it. In simplest terms, a

relational database is one that presents information in tables

with rows and columns. A table is referred to as a relation in

the sense that it is a collection of objects of the same type

(rows).Data in a table can be

related according to

common keys or

concepts, and the

ability to retrieve

related data from a

table is the basis for

the term relational

database.

Relational Database

• Data in a table can be related according to common

keys (Primary Key (PK) or Florien Key (FK) )

The database design process

1. Determine the purpose of your database

This helps prepare you for the remaining steps.

2. Find and organize the information required

Gather all of the types of information you might want to record in the

database, such as product name and order number.

3. Divide the information into tables

Divide your information items into major entities or subjects, such as

Products or Orders. Each subject then becomes a table.

4. 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.

The database design process

5. 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 or Order ID.

6. 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. Add fields to tables or create new tables to clarify the

relationships, as necessary.

7. Refine your design

Analyze your design for errors. Create the tables and add a few records of

sample data. See if you can get the results you want from your tables. Make

adjustments to the design, as needed.

8. Apply the normalization rules

Apply the data normalization rules to see if your tables are structured

correctly. Make adjustments to the tables, as needed.

Logically structuring data

Once the relationships and dependencies

amongst the various pieces of information have

been determined, it is possible to arrange the data

into a logical structure which can then be mapped

into the storage objects supported by the database

management system. In the case of relational

databases the storage objects are tables which

store data in rows and columns.

Reference

https://support.office.microsoft.com/en-us/article/Database-design-basics-1eade2bf-

e3a0-41b5-aee6-d2331f158280?CorrelationId=224322a9-d5f8-4ac7-bef2-

2fdbfc28a3d5&ui=en-US&rs=en-US&ad=US

Gehani, N. (2006). The Database Book: Principles and practice using MySQL. 1st

ed., Summit, NJ.: Silicon Press

Database design basics. (n.d.). Database design basics. Retrieved May 1, 2010,

from http://office.microsoft.com/en-us/access/HA012242471033.aspx

Teorey, T.; Lightstone, S. and Nadeau, T.(2005) Database Modeling & Design:

Logical Design, 4th edition, Morgan Kaufmann Press. ISBN 0-12-685352-5

http://www.comnetsite.com/access-tech.php