Database Management 1
Database Management 1
So what is a
‘’ a Database’’??
Definition of a Database:
a database is a collection of related data items
organised so as to provide consistent and
controlled access to the items.
Uses of Databases:
to provide consistent and controlled access to the data
Let say in a school the admission office stores all students files identified
using student admission numbers such as 201/2014,
Examples: -
- Access
- OpenOffice Database
- Microsoft SQL server
- Oracle
- FoxPro
- Dbase IV
- Lotus Approach
- Oracle’s MySQL Server.
Benefits of Using DBMS
1. Allow authorised users to add or delete records
3. Organise files and records for easy access , retrieval and sharing
- Queries
- Forms
- Reports
and
- memos
Database Models
A Database Model is a logical structure that determines how data is
stored , organised, and manipulated by DBMS.
Customers Supliers
Transactions
Therefore,
object-relational is an evolutionary hybrid model that has
capabilities to handle both relational and object-oriented
storage and manipulation of data.
Object- oriented model
This model purely support storage , access and manipulation of
objects.
Although, currently not popular in the market, OODBMS provides
unification of application and database development.
Types of queries:
Select
and
action queries.
Simply we can say that there exist 2 type of query.
Description
Type Description
Is the most common type of query used for searching and
Select Query retrieving data from one or more tables.
A select query lets the user specify the search criteria and
records that meet the criteria are displayed in a query data
sheet called dynaset.
Are queries used to make changes to records in a table. An action
query may be used to delete, update, add a group of records
from one table to another or create a table form from another
table.
Action Query
Types of Action Queries:
1. Update query: - updates data in a table
2. Append query: - adds data in a table from one or more tables.
3. Make table query: - creates a new table from a dynaset.
4. Delete Query: - Deletes specified records from one or more
tables.
Creating Queries using Wizard
The following are the steps to under take when creating a query using
wizard:
1. Ensure that the database you want to create a query for is open
2. Click the New button and then select Design View in the dialog box that
appears.
4. Drag each field or selected fields from the table shown on the upper part
of the design and into the field row on the lower part.
The following are important sections of a query design grid that are used to
specify the fields and criteria to be used to display the dynaset:
- Field row: - fields from a table to be used are arranged in this row. Each field
should occupy its column.
- Table row: – indicates the table providing the fields.
- Sort row: - by clicking the down arrow in the sort row, you can specify the sort
order ; that is ascending or descending or no sort.
- Show row:- by clicking the show row, you specify whether to display the field
in the query results. When the box is not checked, the field will not be
displayed.
- Criteria row: - is where you enter a condition or expression that will be used
by the query to display specific records.
- Or row: - used to specify an alternative condition. If for example you want to
display records of all employees from branches located in Lilongwe or
Blantyre, type Lilongwe in the criteria, and Blantyre in OR
Specifying query Criteria
In order to search for a particular set of records, you have to enter a
conditional statement or statements in the criteria row.
For example you have a table called employees with one of the fields salary,
you can display all the employees earning more than 5,000 by typing >5000
in the criteria row in the salary column.
To define criteria, use either relation or logical operators.
Relational operators include: less than, (<), greater than (>), greater or equal
to (>=), less than or equal to (<=) , not equal (<>), and equal to (=).