0% found this document useful (0 votes)
4 views

Database Management (1)

A database is a structured collection of data stored in related tables, managed by Database Management Systems (DBMS) that facilitate data storage, retrieval, and security. The document outlines various database concepts, including types of keys, data types, and the advantages and disadvantages of using databases. It also covers the processes of creating databases, querying data, and generating reports and forms.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views

Database Management (1)

A database is a structured collection of data stored in related tables, managed by Database Management Systems (DBMS) that facilitate data storage, retrieval, and security. The document outlines various database concepts, including types of keys, data types, and the advantages and disadvantages of using databases. It also covers the processes of creating databases, querying data, and generating reports and forms.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 32

DATABASE

MANAGEMENT
By: S. Murray
What is a Database?

◦A database is a file composed of records, each


containing fields together with a set of operations for
searching, sorting, recombining, and other functions.
◦A database is a collection of data stored in a set of
related tables.
Manual and Computerized Databases

◦A manual database is a paper database where information


is written on cards or paper and stored in filing cabinets or
boxes.
◦Computerized databases are information stored on a
computer system that allows persons to quickly manipulate
and find information.
Database Management Systems
◦ A DBMS is the term for programs that handle the storage, modification and retrieval of
data, as well as controlling who has access to the information. E.g. Microsoft Access.
◦ The functions of a DBMS are:
◦ Data Storage, retrieval and updates
◦ Backup and Recovery – Recovers most recent information in the event of system
failure.
◦ Security – Must handle password allocation and checking, and allowing authorized
users access to their information.
◦ Management facilities for sharing a database – Ensures that no two persons can access
the same record at the same time in order to modify it.
Relational Database
◦A relational database has a collection of tables of data items, all of
which is formally described and organized.
Database Concepts
Terms Definition

Alternate Key Any candidate field that was not used as the primary key.

Attribute/Field/Column The smallest piece of data that can be stored.

Candidate Key It is a column or set of columns that can uniquely identify any record in a
table. The candidate key is a super key with no repeated attributes. If there is
only one candidate key, it becomes the primary key, if there are multiple
candidate keys, the designer must designate one as the primary key. Any
candidate key that is not the designated primary key is an alternate key.

Composite Key A combination of fields used to create a unique primary key.


Database Concepts
Terms Definition

Data Type Determines what kind of data can be entered as well as what operations the database can
perform with the data.
Entity A thing or object of importance about which data can be captured. E.g. People, places.

Form A database object that can be used for displaying, editing, searching and entering data.

Foreign Key One or more columns in a table intended to contain only values that match the related
primary key in a referenced table. It is a field in one table and a primary key in another.

Object Any component that makes up a database. Anything which we make from create
command is known as Database Object, i.e. tables, queries, reports, forms.
Database Concepts
Terms Definition

Primary Key A field whose values are unique so it can be used to access each record individually.
Query Asking specific questions about the data in the database. Used to retrieve data from the
database and the user can be selective with how much data that is to be returned.
Report A document produced by data in a database. Usually formatted results from tables and
queries.
Secondary Key A key that has not been selected as the primary key. A table can have can have many
secondary keys.
Table Consists of a collection of records about a specific topic.

Tuple/Record/Row Group of related fields in a table.


Advantages & Disadvantages of a Database
Advantages Disadvantages

◦ Easy access to data ◦ The computer(s) and peripherals required can


cost a lot.
◦ Can save enormous amounts of data
◦ If the computer or computer network, is not
◦ Data can be easily entered by keyboard or
working, then the database cannot be used.
scanner
◦ Security is very important as some people may
◦ Data can easily be changed or updated
attempt to get access to confidential data.
◦ Data only needs to be entered once. Sometimes involving illegally hacking into a
◦ Data can be checked on entry program or data.

◦ Passwords can be set to allow access only to ◦ The database file can become corrupt or
those with permission to use the database. infected by a computer virus. This can lead to
the file not working properly or not at all.
Advantages & Disadvantages of a Database
Advantages Disadvantages

◦ A database file can be automatically linked to ◦ Making a backup copy of the database is
others essential.
◦ Data can be imported and exported to other ◦ There is often a limit to the size of a database
programs. file.
◦ Some databases can be complicated to use
◦ Some databases require much time to be spent
on staff training, which can be costly.
◦ Data stored about people can be incorrect.
Creating a Database
Before creating a database and tables, the user must determine:
◦Field name – identifies the data stored in a field.
◦Filed type – also called data type, which tells the database program
what kind of data goes in the field such as text.
◦Field Length – determines the size of each field in a table.
◦Field description – allows you to describe the purpose of the field.
◦Field properties – includes checks to ensure that the data is valid.
Data Types
Data Types Type of data
Text Letters, numbers and a combination of both. Numbers that don’t require calculations.

Long Text Lengthy text or combinations of text and numbers.


Number Numeric data used in Mathematical calculations.
Date/Time Date and time values.
Currency Currency values and numeric data used in Mathematical calculations involving data
with decimal places.
AutoNumber A unique sequential (sequential) number or random number assigned by Access
whenever a new record is added to the table
Yes/No Yes and no values and fields that contain only one of two values (Yes/No, True/False,
or On/Off).
Hyperlink Text or combination of letters and numbers stored as text and used as a link to another
object or location.
Field Properties
Property Type Description

Field size Sets the maximum number of characters in a field.

Format Controls the way data appears in Datasheet view

Decimal Places Displays a set number of decimal places in Number and Currency fields only.

Input Mask Sets a pattern that determines the input format of data, such as the hyphens in a
telephone number.

Caption Specifies a label for the field that appears in the table and on forms and reports.

Default Value Displays a specified value for a field in new records.


Field Properties
Property Type Description

Required Specifies that the field cannot be left empty when data is entered into a record.

Allow zero Determines whether or not a field can be complete if it contains no data.

Indexed Speeds up retrieval of data in a field. All primary keys are automatically indexed.

Validation Rule Limits the data entered to meet a certain criteria.

Validation Text Displays a message when data is rejected as invalid.


Creating Databases
Create a database file

◦ Click the file tab


◦ Type the desired file name in
the box
◦ Click the create button.
Database Views in a Table
Datasheet View Design View
Relationships
◦ A relationship refers to linking two entities together. For example ITEMS are
stored in a STOREROOM and EMPLOYEES work in a DEPARTMENT.
◦ There are potentially two types of relationships which can exist between
entities:
◦ One-to-one relationships
◦ One to many relationships
Relationships
One to One One to Many

◦ This type of relationship takes place when one ◦ This type of relationship takes place when one
record from the primary table matches another record from the primary table matches many
record the related table. records from the other related table.
Creating Relationships
◦ Open the relationships window in the Database
Tools.
◦ Select the tables from the Show Tables dialogue.
◦ Drag Primary key (from the parent table) and release
over the foreign key (in the child table)
◦ Confirm options
When creating a relationship select:
◦ Enforce referential Integrity
◦ Cascade Update Related Fields
◦ Cascade Delete Related Fields
This ensures that the database maintains its integrity.
Querying a database
Query’s allow for meaningful data to be extracted from a database. Query’s may be used to:
◦ View data in a particular way
◦ To update a database
◦ To delete one or more records from the database
◦ As a source of records for reports
There are several types of queries; two of the most common being Select queries and Action
queries.
An action query is a query that makes changes to or moves many records in just one operation.
The changes made are irreversible. The four types of action queries are – Make table,
Append, Delete, Update
Querying a Database
◦ Go to Query Design area of the ribbon
◦ Create – Queries – Query Design
◦ Activate the Query design work area and add the
table(s) and or queries you need.
◦ Add the fields you want to show
◦ Indicate whether you want your data to be sorted
or grouped (Sort drop down)
◦ Type in the criteria that you want the system to
use to restrict the data.
◦ Run the Query and view the results, edit in the
Datasheet view if necessary.
◦ Save Query
Types of Queries
Make Table – An action query that creates a
Select Query
table from the data stipulated in the query
Action Queries
Update – Makes global changes to a group of
Append – Adds data to an existing table
records in one or more existing tables.
Action Queries
Delete Query - deletes a group of
records from one or more tables
Sorting and Filtering
◦ Sorting and filtering allows you to view data
records in a table in different ways.
◦ Sorting temporarily reorders the data in the
database file.
◦ Filtering selects the specific records the user
wants to be displayed.
Reports
◦ A database report is the formatted result of database queries and contains useful data for
decision-making and analysis.
◦ A report is an effective way to present your data in a printed format, because you have control over
appearance and size of data and headings.
◦ A report lets you specify:
◦ The fields to display.
◦ Which table(s) and or query (ies) must be used to supply the fields required.
◦ The order in which the records should be displayed.
◦ How records should be grouped.
◦ What statistics you want the database to calculate from the records (e.g. number of records, average).
Creating Reports
◦ Activate the report wizard
◦ Select the fields you want on your report
◦ Click ‘Next’
◦ Select Grouping levels for the report (if necessary)
◦ Click ‘Next’
◦ Select fields for sorting (optional)
◦ Click ‘Next’
◦ Retain defaults for the layout/Orientation of the report
(change if necessary)
◦ Click ‘Next’
◦ Type the title of your Report – then click ‘Finish’
◦ Check to ensure that your report is as you desire.
Creating Reports
Grouping Levels Layout and Orientation
Creating Reports
Sorting Title of Report
Creating Forms
◦ A form is a database object that you can use to
enter, edit, or display data from a table or a
query.
To create a form:
◦ Activate the Form wizard
◦ Click ‘Next’
◦ Select the fields you want on your Form
◦ Click ‘Next’
◦ Select layout
◦ Click ‘Next’
◦ Type the title of your Form – then click ‘Finish’
◦ Check to ensure that your form is as you desire.
Forms
Form Layouts Title of Form
References
◦ Campbell, H. (2014). Information technology for CSEC examinations:
Howard Campbell. Macmillan.
◦ Gay, G., & Blades, R. (2019). Oxford information technology for CSEC:
Third Edition.
◦ Microsoft Press. (2002). Microsoft computer dictionary (5th ed.). Microsoft.

You might also like