Introduction To Databases
Introduction To Databases
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:
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