MS21C Computer Applications: Productivity Tools Overview Part 2: Databases
MS21C Computer Applications: Productivity Tools Overview Part 2: Databases
Overview
What is a Database?
Purpose of a Database
Foundation of a Database
Data and Information
How Data is Organized
Database Design - ER Diagram, Normalization,
Data Structure
Database Management System
Operations and Capabilities of a DBMS
Key Database Activities
Create a DB Table, DB Window, Design and
Data Sheet Views
Additional Resources
Database Skills
1. What is a Database?
A database is collection of related
tables/files. For example Event and Ticket
tables are in a EVENT_SALES database
whereas Order, Supplier, and Part are in an
ORDER_PROCESSING database.
A database is an organized collection of
related data that is shared by groups of
users.
2. Purpose of a Database
The purpose of a database is to help people
keep track of things a.k.a. entities and
provide information for decision-making.
What are entities?
Entities may be people, places and things e.g.
customers, schools, and books, respectively.
Entities may also be concepts or events that are
intangible but are stored nevertheless e.g. an
account or a transaction.
3. Foundation of a Database
Data is the foundation of a database.
The effectiveness of a database depends
on how data are stored.
Data and information are sometimes used
interchangeably.
This is erroneous!
Byte
Field
0 or 1
TicketNum TicketDesc
Record
19
Day Pass
TicketNum
File
TicketDesc
SeatNum
EventNum
A12
10
SeatNum
EventNum
19
Day Pass
A12
10
45
Season Pass
B14
20
17
Day Pass
A10
25
Database
Ticket Table
Sale Table
6. Database Design
The best database in the world is no better
than the data it holds!
Conversely, all the data in the world will do
you no good if they are not organized in a
manner in which there are few
redundancies and in which you can retrieve,
analyze and understand them.
Therefore, both the data in- and the
structure of- the database are key
elements in database design.
Has
Participates
Games
Players
Has
Has
Game
Statistics
Table
(Relation)
TICKET
TicketNum
TicketDesc
SeatNum
EventNum
19
Day Pass
A12
10
45
Season Pass
B14
20
17
Day Pass
A10
25
23
Day Pass
C22
10
13
Day Pass
B67
25
EventNum
EVENT
EventType
EventDate
10
17/08/07
20
17/08/07
25
Three-day Test
28/08/07
???
???
Rows
(Records,
Tuples)
8. Operations of a DBMS
Suppose we wanted to find out which event
did ticket holders 23 or 45 attend?
We would need information from two tables:
TICKET and EVENT.
To develop useful sets of data, such as the
information required to answer the question
above, the DBMS uses three basic
operations: select, join and project.
8. Operations of a DBMS
Select:
The select operation creates a subset consisting of all
records (rows) in the table that meet stated criteria.
In our example we want to select records from the
TICKET table where the TicketNum equals 23 or 45.
Join:
The join operation combines tables to provide you with
more information than is available in individual tables.
In our example we want to join the now-shortened
TICKET table (only tickets 23 or 45 will be presented)
and the EVENT table into a single new table.
8. Operations of a DBMS
Join Types:
Inner Join (default) on the basis of the data in the joined
Left Outer Join left outer joins include all of the records from
the first (left) of two tables, even if there are no matching values
for records in the second (right) table.
For example, you could use LEFT JOIN with the Departments (left)
and Employees (right) tables to select all departments, including those
that have no employees assigned to them.
Right Outer Join right outer joins include all of the records
from the second (right) of two tables, even if there are no
matching values for records in the first (left) table.
For example, you could use RIGHT JOIN with the Departments (left)
and Employees (right) tables to select all employees, including those
that are not assigned to a department.
8. Operations of a DBMS
Project
The project operation creates a subset consisting
of columns in a table, permitting you to create
new tables that contain only information required.
In our example we want to extract from the new
table only the following columns: TicketNum,
TicketDesc, EventType and EventDate.
8. Operations of a DBMS
TICKET
TicketNum
TicketDesc
SeatNum
EventNum
19
Day Pass
A12
10
45
Season Pass
B14
20
17
Day Pass
A10
25
23
Day Pass
C22
13
Day Pass
B67
EVENT
EventType
EventDate
10
One Day
International
17/08/07
10
20
17/08/07
25
25
Three-day Test
28/08/07
Select TicketNum = 23 or 45
EventNum
Join by EventNum
TicketNum
TicketDesc
EventType
EventDate
45
Season Pass
17/08/07
23
Day Pass
17/08/07
9. Capabilities of a DBMS
A DBMS have a data definition capability
that enables you to specify the structure of
the content of the database.
The data definition capability is used to
create database tables and to define the
characteristics of the fields in each table.
This information about the database would be
documented in a data dictionary.
Data in the data dictionary is referred to as
Metadata.
9. Capabilities of a DBMS
Metadata:
Often described as data about data
Provides a description of the characteristics of the data
and how it is used in a database.
Includes data type as well as other descriptors or
characteristics.
For example the field, TicketDesc is text (data type)
and is 15 characters in length (size).
Other metadata can include format (e.g. for a date field,
is it mm/dd/yy or yyyy/mm/dd), and default value (e.g.
your Pipeline default password is your DOB).
Metadata makes databases more useful and
understandable.
9. Capabilities of a DBMS
Data Dictionary:
MS Access has a
built-in rudimentary
data dictionary
capability that
displays information
about the name,
description, size, type
and format of each
field in a table when it
is in Design View.
This is an example of
the QBE grid in MS
Access.
The query in the
example retrieve tickets
assigned seat numbers
starting with A.
Note: the * is a
wildcard and can be
used to represent any
character.
Note: As you do in
Excel you can use
comparison operators
in MS Access queries.
You can use the Like
operator to find values
in a field that match the
pattern you specify.
Database
Name
Location
Create Button
Ribbon
Group
s
Object
s
Well
focus on
these
objects
in the
course
Table
Name
Click
Datasheet
View
first record
previous record
next
record
new
last
record record