DPT Dbase Note
DPT Dbase Note
Database can be defined as a computer based record keeping system whose overall purpose is
to keep and maintain information. It can also be defined as a collection of information related to
a particular subject or purpose.
Advantages of database
1. Data Sharing: data in database can be shared btw two or more applications without
having to create a new file.
2. Avoid Inconsistency: this means that obtaining wrong or unreliable information from a
database.
3. Reducing Data Redundancy: here each application in a non-database system has its own
file which result in redundancy in stored data which led to waste in storage space.
4. Enforce Security: database administrator (DBA) ensures that only authorized users gain
access to data in a database.
5. Maintain Integrity: data in the database is always accurate i.e. it represents user’s
intention.
Components of a database
1. Data: this is basic raw facts, about people, places, events stored in a database.
2. Hardware: this refers to the physical components of a computer system.
3. Database software: database software are programs that handles request by the users
for access to the database. This types of applications are called database management
system (DB MS). And DBMS is a complex software that constructs, maintains database. It
provides the user interface between the users and the data in any existing database.
4. User of database: users of database can be categorized into:
Application Programmers: these are people that write a database program using
languages like java, C-languages etc.
Database Administrator: is the person in charge of changing the affairs of a
database environment.
Functions of a database Administrator
1. He determines what information is to be stored in the database.
2. He decides the storage structure of the database, and the access methods to be used in
accessing the database.
3. He liases with the end users so as to ensure that their demands are met.
4. He is responsible for making changes and adjustment when the need arises in the
database as well as monitoring the continuous performance of the database.
5. He ensures the security of data in the database.
Form
A form is a database object that you can use to create a user interface for a database
application.
Forms help you to display live data from the table. It mainly used to ease the process of data
entry or editing.
Report
A report is an object in desktop databases primarily used for formatting, calculating, printing,
and summarizing selected data. You can even customize the report’s look and feel.
Macros
Macros are mini computer programming constructs. They allow you to set up commands and
processes in your forms, like, searching, moving to another record, or running a formula.
Modules:
Modules are procedures (functions) which you can write using Visual Basic for
Applications (VBA).
Hyperlink Text or combinations of text and Each part of a Hyperlink data type allows you to
numbers stored. That text is used as store a maximum 2048
hyperlink address. characters.
Access Excel
All the data is stored one time, in Lots of worksheets or documents are a store with similar,
one place. repeated data.
Advantages of MS Access
Now in this MS Access Tutorial, we will learn the pros/benefits for using MS Access application:
Access offers a fully functional, relational database management system in minutes.
Easy to import data from multiple sources into Access
You can easily customize Access according to personal and company needs
Microsoft Access online works well with many of the development languages that work
on Windows OS
It is robust and flexible, and it can perform any challenging office or industrial database
tasks.
MS-Access allows you to link to data in its existing location and use it for viewing,
updating, querying, and reporting.
Allows you to create tables, queries, forms, and reports, and connect with the help of
Macros
Macros in Access is a simple programming construct with which you can use to add
functionality to your database.
Microsoft Access online can perform heterogeneous joins between various data sets
stored across different platforms
Disadvantages of MS Access
Here, are the cons for using MS Access
Microsoft Access database is useful for small-to-medium business sectors. However, it is
not useful for large-sized organizations
Lacks robustness compared to dbms systems like MS SQL Server or Oracle
All the information from your database is saved into one file. This can slow down reports,
queries, and forms
Technical limit is 255 concurrent users. However, the real-world limit is only 10 to 80
(depending on the type of application which you are using)
It requires a lot more learning and training compares with other Microsoft programs
In this unit, we will be covering the basic process of starting Access and
creating a database. This chapter will also explain how to create a desktop
database by using a template and how to build a database from scratch.
To create a database from a template, we first need to open MS Access and you will see the
following screen in which different Access database templates are displayed.
To view the all the possible databases, you can scroll down or you can also use the search box.
Let us enter project in the search box and press Enter. You will see the database templates related to project
management.
Select the first template. You will see more information related to this template.
After selecting a template related to your requirements, enter a name in the File name field and you can also
specify another location for your file if you want.
Now, press the Create option. Access will download that database template and open a new blank database as
shown in the following screenshot.
Now, click the Navigation pane on the left side and you will see all the other objects that come with this database.
Click the Projects Navigation and select the Object Type in the menu.
You will now see all the objects types — tables, queries, etc.
Create Blank Database
Sometimes database requirements can be so specific that using and modifying the existing
templates requires more work than just creating a database from scratch. In such case, we
make use of blank database.
Step 1: Let us now start by opening MS Access.
Step 2: Select Blank desktop database. Enter the name and click the Create button.
Step 3: Access will create a new blank database and will open up the table which is also completely blank.
Every field in a table has properties and these properties define the field's
characteristics and behavior. The most important property for a field is its data type.
A field's data type determines what kind of data it can store. MS Access supports
different types of data, each with a specific purpose.
The data type determines the kind of the values that users can store in any
given field.
Each field can store data consisting of only a single data type.
When you create a database, you store your data in tables. Because other database
objects depend so heavily on tables, you should always start your design of a
database by creating all of its tables and then creating any other object. Before you
create tables, carefully consider your requirements and determine all the tables that
you need.
Let us try and create the first table that will store the basic contact information
concerning the employees as shown in the following table:
This is where we left things off. We created the database and then Access automatically opened up this table-one-
datasheet view for a table.
Let us now go to the Field tab and you will see that it is also automatically created. The ID which is an AutoNumber
field acts as our unique identifier and is the primary key for this table. The ID field has already been created and we
now want to rename it to suit our conditions. This is an Employee table and this will be the unique identifier for our
employees.
Click on the Name & Caption option in the Ribbon and you will see the following dialog box.
Change the name of this field to EmployeeID to make it more specific to this table. Enter the other optional
information if you want and click Ok.
We now have our employee ID field with the caption Employee ID. This is automatically set to
auto number so we don't really need to change the data type.
Let us now add some more fields by clicking on click to add.
Choose Short Text as the field. When you choose short text, Access will then highlight that field name automatically
and all you have to do is type the field name.
Type FirstName as the field name. Similarly, add all the required fields as shown in the following screenshot.
Once all the fields are added, click the Save icon.
You will now see the Save As dialog box, where you can enter a table name for the table
Enter the name of your table in the Table Name field. Here the tbl prefix stands for table. Let us click Ok and you will
see your table in the navigation pane.
Table Design View
As we have already created one table using Datasheet View. We will now create another
table using the Table Design View. We will be creating the following fields in this table.
These tables will store some of the information for various book projects.
We now need to make ProjectID a primary key for this table, so let us select ProjectID and click on Primary Key
option in the ribbon.
You can now see a little key icon that will show up next to that field. This shows that the field
is part of the table’s primary key.
Let us save this table and give this table a name.
Click Ok and you can now see what this table looks like in the Datasheet View.
Let us click the datasheet view button on the top left corner of the ribbon.
If you ever want to make changes to this table or any specific field, you don't always have to go back to the Design
View to change it. You can also change it from the Datasheet View. Let us update the PStatus field as shown in the
following screenshot.
Once you created a table you can go ahead to add data to the various fields of the table.
CREATING QUERY, REPORT AND FORMS
1. In the Navigation Pane, select a table or query that contains the data.
2. Select Create > More Forms > Split Form.
Create a report
The Query Design window and Show Table dialog box both appear. Here
you need to select the tables and/or queries containing the data you want to
include in your new table.
3. Double-click the tables and queries you want to add and click Close.
Now add the fields you want to use in your new table.
4. Select the fields that you want to include and click Close.
5. Add any limiting criteria.
Now you need to change the query type to make it a Make Table query.
Access displays the Make Table dialog box. Here you need to tell Access
the name of the new table.
The Make Table query displays the records it will use to create the new
table.
2. Click View to return to Design View.
Now you can run the query to create the new table.
3. Click the Run button on the ribbon.
Access asks you to confirm the creation of the table.
4. Click Yes.
Access creates the new table based on the results of the Make Table query.