Slide show - Computer and Information Science

Download Report

Transcript Slide show - Computer and Information Science

Introduction to Databases
CISC 1050
Where would you find info about
yourself stored in a computer?
•
•
•
•
•
•
•
College
Physician’s office
Library
Grocery Store
Dentist’s office
Verizon
IRS
…
General Definition
• A DATABASE is a collection of
related data.
• Data = known facts that can be
recorded and have implicit meaning.
Example of a Database
STUDENT Table:
Name StudentNumber Class Major
Smith
Brown
17
8
1
2
CIS
MATH
COURSE Table:
CourseName
CourseNumber CreditHours Department
Intro to Computer Science
Data Structures
Discrete Mathematics
Databases
CIS1.1
CIS22
MAT240
CIS72
3
4
3
3
GRADE_REPORT Table:
StudentNumber
17
17
8
8
8
8
SectionIdentifier
112
119
85
92
102
135
PREREQUISITE Table:
CourseNumber
CIS22
MAT240
CIS72
PrerequisiteNumber
CIS15
MAT140
CIS71
Grade
B
C
A
A
B
A
CIS
CIS
MATH
CIS
Size of a database
• Small database example:
your personal phone directory
• Large database example:
database of the IRS
DBMS – Database
Management System
A collection of programs that
enables users to create and
maintain a database.
MS Access is a DBMS
In ACCESS, a DATABASE consists
of a collection of tables.
Table
• A table is defined by its columns,
called fields.
• Each row (or entry) in a table is
called a record. A record is the
information about a specific person,
product, or event.
Starting ACCESS
1. Begin ACCESS
2. Create a blank Database –
although a database consists of
many files, in Access, each
database is viewed as a single
file, hence a single icon.
Navigation Pane and Work Area
• Navigation Pane: On the left you
will see a list of the objects in the
database (including tables, forms,
reports, queries, etc.)
• Work Area: on the right you have
the object you are currently
working on.
Defining a TABLE
A TABLE is defined by its fields
(column headings).
1. Field Name – unique name
2. Data Type – type of info a field
can contain.
3. Description – comments about field.
PRIMARY KEY
• Each table must have a primary key
which is a unique identifier for each
record.
• Eg. ID number for a student,
course number for a course, driver
number for a driver, etc.
Two VIEWS of a Table
1. Design View – view the table’s
definition, I.e. the fields and
their properties.
2. Datasheet View – view the actual
records in the table.
Database Design
• Arranging data into tables and
fields.
• This process can be long and
difficult.
Remove Redundancy
WHY?
• Wastes space
• Updating is difficult
• Inconsistent data may result