Download Introduction to MS-Access

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

Microsoft SQL Server wikipedia , lookup

IMDb wikipedia , lookup

Oracle Database wikipedia , lookup

Open Database Connectivity wikipedia , lookup

Functional Database Model wikipedia , lookup

Concurrency control wikipedia , lookup

Entity–attribute–value model wikipedia , lookup

Microsoft Access wikipedia , lookup

Ingres (database) wikipedia , lookup

Database wikipedia , lookup

Extensible Storage Engine wikipedia , lookup

Clusterpoint wikipedia , lookup

Microsoft Jet Database Engine wikipedia , lookup

Relational model wikipedia , lookup

ContactPoint wikipedia , lookup

Database model wikipedia , lookup

Transcript
1
Introduction to Microsoft Access 2007
Introduction
A database is an organized and structured set of related data. Every organization or
institution stores useful information pertaining to their business, employees or other
information, which help them in their smooth functioning. Even in our daily life, we
maintain a database like, our address book which contains the alphabetic records of
our friends and relatives. It contains information like, their names, addresses, phone
no., e-mail address, etc. A school maintains the records of its students, staff, fees,
salaries, etc. But it is very difficult to maintain a database manually, as the size of
database keeps changing. The records are added, deleted, modified to keep the
information up-to-date.
A computerized database is the best solution for all types of database related
problems. The software that helps to perform database related functions is called
Database Management System (DBMS). Various popular database management
software are Microsoft Access 2007, Open Office.org Base, SQL Server, Oracle,
Sybase, Visual FoxPro, etc.
Components of Database
As discussed earlier a database
is
a
collection
of
related
information. The information in a
database is stored in the tabular
format, such that any specific
piece of information can be
accessed if a reference point is
known. The main components of
a database are table, fields and
records.
2
Let us take the example of student database. Each row is the record of information
about each student like its Roll no., Name, Date of Birth, etc. So, the information
stored in a row is called a record.
Each column contains a specific type of information for all the records like first
column contains roll numbers of all the students. So, the information stored in a
column is called field.
Collection of all the fields and records together make a table.
A table organizes the data in the form of rows (Records) and columns (Fields)
A database is a collection of related information stored logically in the form of
various tables.
What is Microsoft Access 2007?
Microsoft Access 2007 is a database component of Microsoft Office 2007 family. It is
a Relational Database Management System (RDBMS) that allows you to store the
information in one or more table such that these tables can be related with each
other using a common field among them. So, instead of creating a single large table
and storing whole information in the same table, you can break the information in a
logical manner to store it in the different tables. It helps to avoid the duplicate
information and makes it easily available whenever needed.
Access Database Objects
Access 2007 lets you manage all the correlated tables from a single database file.
The Database in Access 2007 is stored with .accdb extension. The various objects
of Access database are:
1. Tables : Tables are the fundamental data building blocks. All types of data is
stored in the form of tables. Tables consist of rows and columns. Each column
represents a field and each row represents a record in the table. A database
3
can consist of one or more co-related tables to represent the complete
information.
2. Queries: Queries extract the data from the tables that matches certain
conditions.
3. Forms: Form is a convenient interface, used to add, modify or search the
records in the database tables / Queries.
4. Reports: Reports are the summarized results of information stored in tables or
queries. These are used to analyze the data presented in a specific manners.
5. Macros/Modules: Macros allow you to automate tasks whereas Modules
contain the programming codes (declaration, statements and procedures as
one named unit) used to perform customized operations.
Starting Microsoft Access 2007
To start Microsoft Access 2007:
 Click on Start button.
 Go on All Programs
 Microsoft Office 2007
 Click Microsoft Office Access 2007
4
Microsoft Office Access 2007 will start with a ‘Getting Started with Microsoft Office
Access’ screen, providing options to start with a new database or to open an existing
database.
The Left Pane of this screen includes Template categories to choose database
template from the Local templates or from the featured online templates. They
provide pre-designed data bases that can be customized as need to suit your
requirements.
 You can use New Blank Database option to create a new database from the
scratch.
 Choose Blank Database option at the top of this screen, you will be asked to
give a name to your database on the right-side of the screen. The default
database name is Database1 which is saved with .accdb extension. Give a
suitable name to your database in the File Name box and click create button.
 Following Access database window will appear, showing a default table named
Table1 opened in datasheet view along with the Table tools for designing the
tables for your newly created database.
The Access Window
Let us take a close look at Access database window before we start working with
database objects.
5
The Ribbon
Just like other components of Microsoft Office 2007 family of software’s, Microsoft
Access 2007 also has a tabbed ribbon which contains Access database commands
arranged in the various groups on different tabs.
Quick Access Toolbar
This Toolbar appears at the top left corner of Access window on the Title bar having
three buttons available by default i.e. Save, Undo and Redo. You can customize the
toolbar as per your need to change or add buttons on it.
Navigation Pane
This is the vertical pane available to the left side of Access Window. You can use it
as a control panel to make the information accessible to you.
Creating Table Using Datasheet View:
When you start with a new database, Access provides you a new blank table named
Table1 opened in datasheet view. You can add fields in this table as per your
requirements and feed data in the datasheet view. If you want to create another table
in the database you feed data in the datasheet view.
If you want to create another table in the database you can click on Table
button in the Tables group the Create Tab. Multiple tables get arranged in a tabbed
manner which can be used to quickly navigate among the tables. Access gives you a
default field in your table named ID having type Auto number which generates unique
values for the field during the data entry. If you want to rename this field, double click
6
on the field header showing name ID and type the suitable name. To change the
data type, use Data Type drop box available in Data Type & Formatting group
under the Datasheet tab.
To add new fields in
the Datasheet view
 Double click
on the next
column
header
showing the
name Add New Field.
 The default header will disappear, Type
the name of your new field and choose its
data type as discussed earlier. By default
Text data type is set for every new field
added in the table.
 Press Tab key to move to the next field
and repeat the process to create next field
and continue till all table fields are defined.
 Click Save As option in the Microsoft
Office menu to open Save As dialog box.
Give name to you table and click OK
button.
The newly created table will get listed under the All Tables group in the Navigation
Pane.
The structure of the table is created and now it is ready to store data in it.
 To enter the data in the table, select you table from the All Tables group in
the Navigation Pane.
7
 Double click to open it in the datasheet view with a new blank highlighted
row.
 Start typing the field values. The rows will increase automatically to enter
the next record.
Lab Activity -1
1. Create a new database named ‘Addresses’ in Microsoft Access.
2. Use Datasheet view to create a table with the following fields:
Roll No.,
Name,
Address,
Date of Birth,
Class,
Section
3. Save the table as ‘Student’ with no primary key field. (As the Roll No, field
will act as a primary key field.)
4. Now, open the table in Datasheet View and enter the following records in it:
1001 Anuj
1002 Anmol
40,Rajpur Rd,
10.05.93
VIII
A
BK-90, Shalimar Rd, 16.07.93
VIII
A
1003 Cheekirsha
92, Janak Puri
19.08.93
VIII
B
1004 Madhavi
JG-II Vikas Puri
25.02.93
VIII
B
B-50, Vivek Vihar
21.07.93
VIII
C
1005 Rohan
5. Now, close the table and also the database Addresses.
Modifying Tables:
Sometimes, even after creating and entering data in a table,
you realize the need of some changes in the structure of the
table like: to add a new field, to delete unwanted field, to
change the field name or to move a field. All these are easily
possible in the Datasheet View.
Inserting a New Field:
 Open the table in Datasheet View.
8
 Right click on the column header where you want to insert the field and choose
the option ‘Insert Column’ from the shortcut menu. A new field default name
Field 1 will appear.
 Double click the field name and give appropriate name to the new field.
Deleting Unwanted Field:
 Right click on the field header that you want to
delete from the table.
 Click ‘Delete Column’ option in the shortcut menu.
 A confirmation box appears. Click ‘Yes’ to delete
column along with its data from the table.
Renaming the field:
 In the Datasheet View, right click on the field
header whose name has to be changed and choose
‘Rename Column; option in the shortcut menu.
Or
Double click on the field header.
 Type the new name to replace the previous name
and press enter to confirm the new name.
9
Lab Activity -2
1. Open Access database ‘Addresses’ created in the previous activity.
2. Insert a new field between ‘Name’ and ‘Address’ field.
(Hint: Right click on the field ‘Address’ and click Insert Column.)
3. Give the heading ‘Last Name to the new column.
4. Rename the field Name as ‘First Name’.
5. Delete the columns ‘Class’ and ‘Section’ from the table.
6. Enter the following data in the new field ‘Last Name’:
7. Close the table and the database.
8. Close Microsoft Access.
Creating Table using Design View:
You can also use design view to create a new customized table.
 Click
on
Table
Design
button in the Tables group
under the Create Tab. A new
blank table will appear in the
design view with a default
table name as shown in
figure.
10
Table design view shows three columns as Field name, Data Type and Description.
 Select the first cell in the Field Name column and enter the field name (up to
64 characters including spaces) Press Tab key to move into the Data Type
column.
 By default data type ‘Text’ is selected. To change the
data type, click the Data type drop button and choose
appropriate data type from the list. Press Tab to move
into the Description column.
 Enter an optional description in it, if needed or press tab
key once again to move into the next row under the field
name column.
 Repeat the process to define the second field and
continue with the same process till all the fields are
defined.
 Save the table using Save As option in the Microsoft
Office menu.
Adding Primary Key Field
Primary key is a field in your table that helps to identify
each record uniquely in the table by assigning a unique
value in this field for all the records in your table. For
example; Roll number field in the student table helps to
identify each student with their unique roll number
assigned to each one of them.
A primary key field never accepts a duplicate value and it
can never contain an empty or Null value.
To explicitly set the primary key in a table:
 Select the Table in the Navigation Pane Right click and choose Design view
option in the shortcut menu to open the table in design mode.
11
 Select the field you want to use as Primary key field by clicking the row
selector of that field.
 Click Primary Key (
) option in the Tools group under the Design tab.
 A key indicator is added to the left of the field name in the row selector area.
 Save and Close the table.
12
Let’s Summarize

Database is a collection of logically related information.

Database Management System (DBMS) is software which helps to create
and manipulate the database.

Information in the database is stored in a tabular format consisting of rows
and columns.

Rows representing the complete information of individual items in the table
are called records.

Columns representing a specific piece of information for all the records are
called fields.

Microsoft Access is a powerful Relational Database Management System
(RDBMS) designed by Microsoft.

RDBMS allows creating various tables in a single database which can be
linked together on a common field.

Primary key field in a table stores unique information for all the records of
the table which helps to identify each record uniquely in a table.
Lab Activity -1
A. Create a new database named ‘School’ in Microsoft Access.
B. Create a new table in the database having fields:
C. Student ID, First Name, Last Name, Address and Phone no.
D. Rename the student ID field as Roll Number.
E. Give the name ‘Student Personal’ to your new table.
F. Set Roll number as your primary key field.
G. Open the newly created table in Datasheet View and enter the following
records in the table:
101
102
103
Raj Kapoor
Rajeev Sinha
Ronit Kapoor
75,Nyapuri
1246,Vikas Puri
Ramesh Nagar
Harayana
Delhi
Kolkota
9848723256
9854875682
8978585552
13
Objective Type Questions
A. Tick () the correct option:
1. __________________ are the fundamental data building blocks.
a. Forms
c. Macros
b. Tables
d. Reports
2. _______________ is a collection of related information stored in
various tables.
a. Field
c. Database
b. Record
d. Table
3. Following is/are the examples of Database:
a. Student
c. Employee
b. Contacts
d. All of these
4. Example/Examples of DBMS is/are:
a. Microsoft Access
c. Oracle
b. Sybase
d. All of these
5. Data in a table can be entered in ______________ view.
a. Design
c. Datasheet
b. Any of these two
d. None of these
B. Check whether the following statements are True or False:
1. DBMS is used to create or manipulate database.
(
)
2. The Extension name of Microsoft Access database file is .accbd.
(
3. RDBMS stands for Related Database Manipulate System.(
4. In a table, records are stored horizontally along the rows.
)
)
(
)
5. Forms are the database objects that are used to add, modify or
Delete the records.
(
C. Choose the correct word from the brackets to complete the
following statements:
1. _____________ is software which is used to create or manipulate
the database.
(Microsoft Access/ Microsoft Excel)
)
14
2. Microsoft Access is a _______________ which stores the information in
one or more tables.
( RDBMS/ DBMS)
3. Microsoft Access object that allows extracting information from the tables
on a specified condition is called _______. ( Module/Query)
4. Microsoft Access database is saved with an extension name___________.
( .mdb/.accdb)
5. _____________ field in a table stores unique values for each record of the
table.
( Primary key/Secondary key)
D. Match the following:
1. To extract filtered records
a. Forms
2. Basic data building blocks
b. Modules
3. Programming codes
c. Reports
4. User Interface
d. Tables
5. Summarized data
e. Queries
E. Word Puzzle:
There are eight Microsoft Access components in the following table, find and
write them in the space provided below:
1. _______________ 2. ___________
3.________________ 4.____________
5.________________6.____________
7._______________ 8. ____________
***********