You are on page 1of 21

Information

Technology

Introduction to
Database
Management
Specific Objectives
⚫ Explain the concept of a database
⚫ Definition of key database terms
⚫ Definition of database keys
Primary key
Secondary key or Alternate key
Composite key
Candidate key
Foreign key
What is a Database?
⦿ An organized collection of Information
⦿ Examples of common databases:
-Telephone book
-Mailing List
-Recipe book
-Book shelf
⦿ In Ms Access database is a set of an
organized collection of related information
to a specific purpose or topic.
⦿ It includes tools needed to work with data:
-Sorting
-Extracting
-Summarizing
Database Hierarchy
Database

Table

Record

Fields

Byte

Bit
Database Terminology - Table
⚫ Table - is a collection of related records,
made of a set of rows and columns. Also
called a relation.
Database Terminology -
Record
⚫ Record – is a row of data , or a collection
of related fields in a database. For example:

First name Lastname Address City Cust_ID


Kevin Nevers 2 Rose St Kingston 220

⚫ Tuple – is a row of data in relational


databases. It gives details about a particular
entity. For example:
(Kevin, Nevers, 2 Rose St,Kingston,220)
Database Terminology - Field
⦿ Field – is a single column in a database
table that stores data. Also referred to as an
attribute in a database For example :
Field 1 Field 2 Field 3 Field 4 Field 5

Firstname Lastname Address City Cust_ID


Kevin Nevers 2 Rose St Kingston 220

This record consists of Five(5) fields or


columns.
One item of data such as the actual address
is called a Data value
Database Terminology
⚫ Byte – is a group of eight bits, usually

representing a single character.

⚫ An example of a byte is: 11000001 which

represents the letter “A”

⚫ Bit – is an acronym for binary digit. It can

be a value of 1 or 0.
Primary Keys
⚫ Primary Key – A unique field that is used to
identify each record in a database table.
⚫ The Cust_ID OR the TRN are both unique.
Any of the two fields can be assigned as the
primary key.
Other Keys - Candidate Key
⚫ Candidate Key - a field that could possibly
act as the primary key for the table.
⚫ Customer information table the candidate
keys are Cust_ID and TRN number(
because they both unique).
Other Keys - Composite Key
⚫ Composite Key - a primary key that
consists of two or more fields together.
⚫ In the table below observe that a course
may be offered several times for the year
and more than one lecturer teaches a
particular course.
CourseID Semester Lecturer Room_No Year

M10A Spring Brown SSLT 2005
M10A Summer Forbes N5 2004
M10A Spring Smith SSLT 2004
EC21A Spring Forbes IFLT 2005
EC21A Summer Brown IFLT 2004
Other Keys - Secondary or
Alternate Key
⚫ Secondary or Alternate Key - a candidate
key that has not been selected as the
primary key.
⚫ In this table the Cust_ID key was selected
as the Primary key and as result the
secondary key is TRN number.
Other Keys – Foreign Key
❑Foreign Key - a field in a table that is
has been linked with the primary key
field of another table .
❑ In the example below, the DVD ID in
the orders table is a foreign key
because it is the primary key in the
DVD Inventory table.
Microsoft Access Data Types
Data Type Description
Text Use for text or combinations
of text and numbers. 255
characters maximum

Memo Memo is used for larger


amounts of text. Stores up to
65,536 characters. Note: You
cannot sort a memo field.
However, they are searchable

Currency Use for currency. Holds up to


15 digits of whole dollars, plus
4 decimal places. Tip: You can
choose which country's
currency to use
Microsoft Access Data Types
Data Type Description

AutoNumber AutoNumber fields


automatically give each
record its own number,
usually starting at 1
Date/Time Use for dates and times

Yes/No A logical field can be displayed


as Yes/No, True/False, or
On/Off. In code, use the
constants True and False
(equivalent to -1 and
0).Note: Null values are not
allowed in Yes/No fields
Microsoft Access Data Types
Data type Description
Number Used to store numbers with or without
decimal places.

Ole Object Can store pictures, audio,


video, or other BLOBs (Binary
Large OBjects)

Hyperlink Contain links to other files,


including web pages
Lookup Wizard Let you type a list of options,
which can then be chosen from
a drop-down list
Microsoft Access Data Types
⚫ Number data type can have the
following formats:
Number format Description
Byte Allows whole numbers from
0 to 255
Integer Allows whole numbers
between -32,768 and 32,767
Long Integer Allows whole numbers
between -2,147,483,648 and
2,147,483,647
Single Single precision
floating-point. Will handle
most decimals
Double Double precision
floating-point. Will handle
most decimals
27
Conclusion
⚫ Every field has a data type. A field's data

type indicates the kind of data that the field


stores, such as large amounts of text or
attached files.
Conclusion
A data type is a field property, but it differs
from other field properties as follows:
⚫ You set a field's data type in the table
design grid, not in the Field Properties
pane.
⚫ A field's data type determines what other
properties the field has.
⚫ You must set a field's data type when you
create the field.
Questions???
Credits/ References

Adapted/modified from the


Information Technology
Database Management Workshop 2012
Presentation by:
Mrs. Collins-Robinson

You might also like