You are on page 1of 3

9/25/2023

Preparing a database and manipulating the data


DATABASE MANAGEMENT SYSTEMS  Identifying Relationships: Identify the relationship between
entities and determine the cardinality of each relationships.
These are software that allow records to be entered in the  The relationship is the connection between entities. Types of
system and to be retrieved in a specified format. relationships include:
Examples: Ms Access, Paradox, Dbase, FoxPro, Sybase One to one
Database One to many
Many to one
What is a database?
Many too many
 A database is a collection of data that is stored in a
computer system.
 Databases allow their users to enter, access,
and analyze their data quickly and easily.

 In a one-to-one relationship, each record in Table A can only


MS ACCESS have one matching record in Table B and each record in Table
 MS Access is a database tool used to store, maintain and B can have only one matching record in Table B.
use a collection of information that is organized to serve  A one-to-many relationship A one-to-many relationship is the
a specific purpose. most common type of relationship. In a one-to many
relationship, a record in Table A can have many matching
 A database is a collection of related information
records in Table B, but a record in Table B has only one
organized to serve a specific purpose. matching record in Table A.
Benefits of using database to store information  A many-to-many relationship In a many-to-many relationship,
 Fast retrieval of information i.e. data is easier to find. a record in Table A can have many matching records in Table
 Easy to maintain accurate and up to date data. B, and a record in Table B can have many matching records in
Table A.

Benefits of using database to store information


 Easy to analyze and make summary reports on the stored data.
 Easy to protect your data from unauthorized access. Identifying attributes: The data elements that you want to
 Information can be accessed in many ways. save for each entity are called attributes. For example, about
the product that you sell, you may want to know the price, name
Preparing a database and manipulating the data of the manufacturer, etc.
 Identifying Entities: Types of information that are stored in a
database are called entities. These entities exist in four
kinds: people, things, events and locations. If the
information you want to include doesn't fit in these
categories, then it is probably not an entity but a property
of an entity, an attribute.

1
9/25/2023

Preparing a database and manipulating the data Database objects


Assigning keys. There are different keys  Database objects are : Tables, Queries, Forms, Reports, Macros,
Primary keys: One or more data attributes that uniquely identify an entity. Modules.
A key that consists of two or more attributes is called a composite key.  Tables: Collection of data about a specific subject e.g. customers,
All attributes part of a primary key must have a value in every record (which employees e.t.c. In a table, data is organized in fields (columns) and
cannot be left empty) and the combination of these attributes must be unique in records (rows) A table consists of:
the table. Field names -these are column headings for the table being created.
Foreign keys: This is an entity in reference to the primary key of another entity. Data types- the attribute of a field that determines the type of data it
It can also be part of a primary key, in that the attribute will be indicated
can hold e.g. text, Numeric, Currency etc.
primary key behind its name.
Description-- This column is optional but can be used to give a
detailed of the field name

Defining the attributes data type


The standard data types that every database knows and are most likely to be
used are:
 CHAR: Includes characters, numbers, and punctuations and has a
characteristic that is always have fixed length
 VARCHAR: (Variable Character Field ) is a data type which can
contain any type of data: numeric, characters, spaces or punctuation.
This data type stores character strings of up to 255 bytes in a variable-
length field.
 TEXT: stores any kind of text data..
 INT: (INTEGER ) stores whole numbers. Contains a positive or
negative whole number e.g. INT 10
 FLOAT, DOUBLE: both have varying capacities when it comes to the
number of decimal digits they can hold. float can hold up to 7 decimal
digits accurately while double can hold up to 15.

Normalization-  Queries- A query is a type of database search. It enables you to


 : it is a process of storing data in database retrieve data that has met conditions you specify, indicating
 Normalization makes your data model flexible and reliable. It data from tables. The word „query‟ literally means „to ask‟.
does generate some overhead because you usually get more  Forms -They are used for adding new data, editing or displaying
tables, but it enables you to do many things without having to existing data. Information entered directly in a form will appear
adjust it. in Tables automatically.
 Normalization the first form: States that there may be no  Reports- The desired result of any database is to provide
repeating groups of columns in an entity. information in the form of reports.
 Normalization the second form: States that all attributes of an  Modules -They are collection of codes using Visual Basic
entity should be fully dependent overall primary key. programming language.(codes)
 Normalization the third form: States that all attributes need to  Macros: Mini programs that automate custom tasks.
be directly dependent on the primary key and not on other
attributes.

2
9/25/2023

Auto number A unique sequential


Database definitions (incremented by 1) number or
 Field: This is any piece of information in a database random number assigned by Ms
Access whenever a record is
e.g. Names, Age, Birth date.
added. Auto
 Record: It is a collection of several related fields.
Yes/No Yes/No Yes or No values or fields
 Database File: This is a collection of several records.
PLANNING REQUIREMENTS
contains only one or two values
In order to plan an efficient database you need to ask yourself some (true/false, yes /no, on off)
questions, these include. OLE object To store images, documents
1. What information do I need to keep track on? (Object Linking and Graphics and objects such that
2. What is my hardware and software capability? Embedding ) Ms Excel spreadsheets, sounds
3. Who will be using the database?
can be embedded to Access
4. What are the projected future database needs?

Data type Use Example


Text (Default) text or combination of text & Mary, KAZ
numbers as well as numbers that don‟t 078w
require calculations such as phone KQ2534
numbers. The default size is 50
characters but up to 225 characters can
be stored
Memo Lengthy text or combination of text and Notes and
numbers. Can store up to 64,000 descriptions
characters

Data type Use Example


Number Numerical data used in 6634,76731,8
mathematical calculations, except 90987,33,978
that involving money
Date and time Dates and times values for the years 2-jan,
100 through 9999 17/8/90,
09:55AM 4-
march-2022
Currency Monetary values Ksh 5678, Ksh
9000

You might also like