8th STD Chap 3 Ms Access Ex
8th STD Chap 3 Ms Access Ex
8th STD Chap 3 Ms Access Ex
P
LEARN TO USB
3
O MS ACCESS2016
INTRODUCTION
A computer is an electronic machine or device that processes data to
give
information. People use computers to process data. Data simply refers to rar
raw
facts and figures. These may be in the form of numbers, letters, images.
sounds or a combination of these. Data needs to be processed to make it
ges,
meaningful and useful. When data is processed for some meaning, it becomes
information.
DATABASE
A collection of related tables with data is called a database. The data remains
in an organised order in a database. A
simple example of a database is the
attendance register of your
class, maintained by your class teacher. It
contains the name of each student of
your class with his/her roll number. A
personal telephone directory is also an example of a simple database.
Databases are very useful in
maintaining data.
Some advantages of database are:
easy retrieval of data reduction in data redundancy
reduction in data inconsistency easy sharing of data
easy manipulation of data
You
high data security
can
perform various kinds of operations on a
deletion, modification and updation. database like creatio
Examples Of Databases Used Everyday
Let us have a look at some classic cases of
everyday: databases used
In schools, colleges and
universities, we have to store
students' personal information,
information, information about academic information, fee
various courses,
information, etc. library
In
industry,
an
26
In research, extensive data as a part of any scientific
research activity in any field has to be maintained.
TYPES OF DATABASE
Database can be broadly categorised as:
FlatDatabase Relational Database Distributed Database
Flat Database: In this type of database, information is stored as a single file in a
tabular form which has no relation with the other databases. Electronic
spreadsheet is an example of a flat database. Such type of databases are suitable
for storing small amount of information.
Relational Database: A relational database is a set of tables containing data
fitted into some pre-defined categories. Each table (which is sometimes called a
relation) contains one or more data categories in columns. Each row contains a
unique instance of data for the categories defined by the columns.
For example, a typical business order entry database would include a table that
describes the customer details with columns for name, address and phone
number.
There are many RDBMS software available. Some of them are Oracle, FoxPro
and Microsoft Access.
Distributed Database : These type of databases are mainly used in a networked
environment where centralised database is distributed at multiple locations on
the network so that different users can access it without interfering each other.
DATABASE OBJECTS
All objects of a database are stored in a single file. These are managed through
the database window. Let us discuss the main objects of a database:
oputers
27
.
ans d 8 any two
Table is stored. Micre
the actual data
Table is a part of the database where
row. This
row 1S called record. R.
CTOSoft
Access stores the related entries in its Each
of detail in a record is stored in its
columns, known as fields.
type
the students of your class Can be
For example, in a table the n a m e s of all
and all the data entries und
stored in one field with the field name as Name'
the field names Name', 'Age', 'Address' together form the record of a particular
student.
Query
A query is used to extract information from a database. The output of a quer
is a record or a group of records that fulfill a certain condition. An example of
a query is to "get the record of the student with Roll No. 32".
Form
A form resembles the fill-in-the blank sheet that you fill completely by hand,
such as a job application. Hence, a form is a way to enter data into the
database. Microsoft Access links a form to a table and hence, stores the
information that you entered in the form into the table.
Report
Just forms are designed to be on-screen, reports are
as
designed to be
printed. With Access, one can design the reports quickly, based on the data of
the table.
Do You Know?
1. The overall design structure of a database is
known as Database Schema. It
describes the records and the relationships
among them.
2. The initial code name of MS Acess was
Cirrus.
MICROSOFT ACCESS
Microsoft Access is a popular Relational
Database Management System.
one of the
application software of Microsoft Office package. it
Microsoft Access is widely used by
individuals having small scale
within departmnents of
large corporations businesse
programmers to create customised systems and also usedcreation
for handling, by hobby
and
by hou
manipulation of data. It is a
development
computer databases for the Microsoft Windows environment used used toto create
In Microsoft
Access, the data is arranged in thefamily of operating systeim
piece of information form of tables. Every spe
in a table is known the
intersection of a column and a
as a value. A value is located
a
row.
28
amnuters8
Remember
The total mumber of values in a table is the number of rows multiplied by the
number of columns.
Home
Mare kepeahr
New
Searh
Recent Pioed
Nate late n p t a d
Daabesel ardb
The Microsoft Access opening screen appears as shown above. Now, you ca
Create a new database or open an existing one.
computers *
COMPONENTS OF MICROsOFT ACCESS WINDOW
Title Bar This is the topmost bar on the window and it displays the title
e
of the application i.e., Microsoft Access. It also contains Minimize
Maximize and Close buttons.
Ribbon: Ribbon replaces the traditional menus and toolbars. Ribbon is
designed in a manner to quickly find the commands that you need to
complete a task. Ribbon is divided into two parts: Tabs and Groups.
Quick Access Toolbar: This is displayed on the Title bar. This provides
the icons or shortcuts for performing standard operations like Save, Undo,
Redo, etc.
File Tab : It is the tab located in the upper-left corner of Microsoft Access
2016 screen. When you click File tab, you can see Microsoft Office
Backstage view. Backstage view shows the set of commands used to
manage database like creating, saving, opening, printing, etc.
Navigation Pane : When you open a database or create a new one, the names
of your database objects appear in the Navigation pane. The database objects
include tables, forms, reports, pages, macros and modules. It replaces the
database window used by earlier versions of Access.
Tabbed Documents: Microsoft Access 2016 displays your database
objects in tabbed documents instead of overlapping windows.
Status Bar : Status bar is displayed at the bottom of the main Microsoft
Access window. This shows the status of any process in the database.
Do You Know ?
Structured Query Language (SQL) is a programming language used to retrieve
and update information in a database.
30 J Compute
Creating A Blank Database Step-2: Type ark databere
File name
To create ablank database, follow the given steps:
Step-1: Click Blank databasefrom the
available templates.
Step-2: Type the name of the database in the Step-3:
File Name box.
Click Create
Home Create Extemal Data Database Toos Help Fiekds Table P Tell me what you want to do
Calicn (Detai
Dew
Al X A *
dpboerd Records Fd Tet Fomatng
Tabie
empty table is opened (Table l) in
which you can enter the data.
Recort 1of1
Datasheet Ve NUm LOc
Step-1: From the New window, click Studentfrom the available templates.
Step-2 Specify the name for the database in the File Name box.
Step-3: Click the Create button.
Step-1: Click Step-2: Choose
New Student a name
Students
Delanesr acx
Step-3: Click
Create button
computers b 31
Access creates and opens the database for you. By detault, a form is one
pened
where you can enter the data.
SWITCHING VIEWS
Access provides different views to work with your data. You can easily swito
from one view to another. There are two views to work with a table
It displays the view in a row/column format I t displays the view which allows you to enter
which allows you to view, enter or manipulate field names, datatypes and the descriptioninto
data. your table.
To switch between Views, simply click View from the Views group of Home
tab. From the drop down list, choose the view you want.
TABLE STRUCTURE (DATA TYPES) ans d 5 (main heading only)
The table structure indicates what kind of table has to be
created. A table
structure identifies the name, size and type of fields in a table.
A table stores various types of data. The data
entry varies according to the
type of fields in a table. Some data types are as follows:
Short Text: The data type Short Textt contains
letters, numbers and symbols
The numbers in a text field considered as text and cannot be used
are
tor
calculation. It can contain a combination of upto 255 characters.
For
example: Aman, Vita13, 9852305888 and A258297T.
Number: The data type Number contains
numeric values used n
used in
mathematical calculations. It does not
numbers. For
accept letters or other symbols exceP
example: 46, 2004, 1989 and 12345.
Currency : The data type Currency contains symbols for currency,
and commas wherever needed. For decima
example: F100, $45 and ¬20.
Date/Time: The data type Date/Time
contains
example: 01/01/2018, 01-01-2020 and 11:45 the date and For
time
am.
Long text :The data type
Long text
with all kinds of data. For contains
65,536
characters) lengthy text (up to o
am 10
years old and I live in New Delhi. example: Hello! My name is Rarne
,
32
a cnit
CREATING A TABLE USING DATASHEET VIEW
In the datasheet view. you can enter the data in the table
directly.
To ereate a table using datasheet view, follow the given
steps:
Step 1 Click the Create tab on the Ribbon.
Step 2 Click the Tablefrom the Tables group. Access creates a table and
selects Click to Add column, by default.
Step 3: Click in the column and type the data in it. Press Tab key to add a
new field to the table.
a 12
Step-1: Click All Acc..
on Create tab
Step-2: Click
on Table
Step-4: Now, save the table by clicking the Save button on the Quick Access
Toolbar.
Step-5: Give a suitable name to the table in the Save As dialog box.
Step-5:
Specify Name
AllAcc
Sve As All Ac. S «|
Step-4: Click
Save button Step-6:
Click OK
Computers
Practice Time
Create a database named Reminder which contains all the details of vo
friends Create a table Friends in it, which will have the following fields: ID
NAMES, PHONE N0 and ADDRESS.
Guidelines:
Step-1: Open Microsoft Access 2016 and click Blank database.
Step-2: Give database name as Reminder and click the Create button.
Step-3: Give the name of the fields and type the data in it.
Step-4: Save the table and name it Friends.
Step-3: Type the name ofa field in the Field Name column and press the Tab
key to move to the DataType column.
Step-4: An arrowappears for the drop down list in the Data Type column.
Click the arrow and select the data type according to your field name
from the list.
f Pimay y en Ro
Dete/Tme
Step-3: Type
fieldname and Step-5: Click
press Tab key
vM e
oStep-4: Select here to type a
Data Type Description
Step-5: Press Tab key to move to the Description column and type a
description of the field. The description of the field is optional
34 Im Computeri- 6
Step-6: Save the table after
,
adding all your fields by clicking the Save button
on the
Quick Access Toolbar. The Save As dialog box appears.
Step-7: Type the table name and click the OK button.
Database15: Database- CtUiersi Windowst0,Doc TableTools
computer editor
File Home Create Extemal Data Database Tools Help Design PTell me what you want to do
Primary Key iInsert Rows
View Delete Rows Property Inderes Create Data Rename/ Relationships Object
Modity Loolaups Sheet Macros Delete Mecro
Dependendies
Views Tools Shom/ide Feld, Record & Table bvents Relsdons
All Access... «Tablet x
Seorch Field Neme Data Type Descriptlon (Optional)
Names
Murt This column conteins the nemes of the stuc
Step-6: Roll No Number This field contains the roll numbers of the s
Click Save Field Propertes
General Lool1p
Field S
Format Step-7: Type
input Mask Table Name
Caption
Defult value
Save As
»Click OK
valldstion Rule
Validation Te
Required TbleMeme:
Allow Zero Length Sauden
No
Unicode Compresslon
Qanca
IME Mode Control
a*e* ** 1dada
Do You Know 2
The bottom half of the design view window
displays the Field Properties for the field
typeyou have selected. The Field Properties Outa Type
Remember
1. The table structure is created in the Design view ofa table.
2. Toenter dataintoatable, use Datasheetview.
Practice Time
Create a table structure as given. Field Name Data Type
Guidelines: Name Text
Step-1: Click Create tab > Table Design from Address Text
the Tables group. City Text
Step-2: Use the field names and data types as given. DOB Date/Time
Number
Step-3: Save the table. PIN
Computers 8:
PRIMARY KEY
A table should have atleast one field that has a unique value for each record
For example, in a school database, the Roll Number of each student uniquelv
identifies each student of a class. You might have the same name but you
never have the same Roll Number as your friend. So, in the school database,
the Roll Number field is the primary key.
A primary key does not allow Null Values and must always have a unique value.
ans d 3 A primary key is used to relate a table to foreign keys in other tables.
laya Vele
A Bed neme an be o 4 c n c n
vaianefe ddng a a F1 hip on led namet
Oeauva ae
Vaidason Rule A Nd nemean beLp n4rcnen
vaicaonYet
Yes
YesNo Dpas
ncode cormprnon
Ld
Microsoft Access asks you to create it dein aronship beeen ths le nd eepimay y for you t
Doyou wn to creeaprlmay y now
when you save the table.
Remember
A Candidate Key is used to identify a database record uniquely. There can he onao r
more than one candidate keys in a table, out ofwhich we can select a Primar
key.
VIEWING AND EDITING DATA IN ATABLE
ViewingATable
To view a table and its data, simply double-click the table name presens .
left pane. The table opens in the right pane displaying all its records. the
The horizontal rows are called records and the vertical columns are
are called
called fields.
36
Compute
e hwe
Access
bnpletes
click Hide Fields option. All Acc... O «
bies
Sdnt
Pom
Clheck toAdld
Step-4: To show a hidden field or fields, right- 1Kanlshk
2 Kanchan
click to get shortcut menu and click Hitesh
(New)
Unhide Fields.
campudar ediar
Eterma
Data oos Hep Feks TableP Tell me what you want to do
AliAcc gest to Smalest Ay databese alabase C\uers Wdoes t0Decumentity dela cputa edh
Add
Fle Home Extemal Deta Detabese lools Help Felds able P Tel me whet you want to do
a
Aapen pon Mer
Lst Waard Design Desn Fom Mee Forma
hide Feids
asis Son Ato 2
Fe Fa All Ac... Na
1Kanahi
Copy
P Erd epes
Click hereto ancha
Hitesh Eed Wdtn
hide fields (New Eeids
Uide fidd
unteee Feid
nd.
Click here to
unhide fields
Kageme ed
Oete Ped
37
Computers a
Manipulating The Data
to the data. The following
make followino changes in
means
Manipulation
modifications can be done on a table in Microsoft Access
: To add a new record, place
the cursor at the
Add a new record/row
last value of the last field/column and simply press the Tab key.
Add a To add a new column, right-click on the
new field/column :
A n e w field is inserted
column header and choose the Insert Field option.
to the left of selected field.
a record, simply click in the cell
Update a record: To update o r modify
the new value.
you want to update and type
Delete a row/column: To delete a particular row/column, select the
the row header column or
entire record or entire column by clicking on
header and press the Delete key. OR Right-click the mouse on row/column
header and select the Delete Record or Delete Field option. Click Yes to
confirm.
(Access 2007-2016 computer editor CE
My database: Database CUsersiWindows 101Documents\My databaseacdb
Fle Home Create Ertemal Data Database oos Help Felds 1able P Tel me wnat you wan My database : Database CAUsersiWindows 10\ DocumentsiMy database accdb
(Acress 2007-2016 compute ednar
eTe Fe'c
Delete Field serd
Practice Time
database 'Reminder
71. Open the records in the table 'Friends.
2. Select some
on this table.
different modification
operations
3. Apply
Moving A Field
i n a taoie a s needed at any pointof time
Access allows to change position the of a field
follow the given steps:
To m o v e a field,
D a t a s h e e t View.
Step-1: Open the table in the
Click on the field header which is to be moved and drag it horizontally
Step-2: towards left or right to point the new position of the field
R e l e a s e t h e m o u s e b u t t o n to d r o p n e neld a t i t s n e w l o c a t i o n
Step-3:
38 Can
MOVIN RECORDS
To move across the records of a table, Access provides an easy to use Navigation
bar that appears at the bottom when the table is opened in Datasheet View. The
various buttons present on the navigation bar are:
First Record 4Used to take you quickly to the first record ofthe table.
Previous Record |4 : Used to move backward by one record everytime when
clicked.
Next Record :Used to move forward by one record everytimewhen clicked.
Last Record : U s e d totakeyouquickly to the last record ofthe table,
New Record I t inserts a blank row at the end ofthe table to add a new record in
the the table.
SORTING DATA WITHIN A TABLE
Access provides a sorting feature to arrange the table records in an ascending or
descending order ona particular field value.
To sort the table data, follow the given steps
Step-1: Open the table in Datasheet View.
Select the field on which the records are to be arranged by clicking on
Step-2:
the column header.
Ascending
Step-3: Select Ascending or Descending command as
Descending
Filter
needed from the Sort Filter group on the Home Remcve Sot
tab to arrange the table records. Sort &Fiber
oputers
SEARCHING INADATABASE
data value you
are
lookingfor,
or, you
you ae not about the location of your
sure b e s i d e the
navigati
can make use of search box which appears
at the bottom
igation
bar to search it quickly in the table.
To searcha datavalue, follow the given steps
Step-1 Open the table in Datasheet Viewu Eternal Da Oatabse Toots p ete
Fil ome
Click Close
To close a database click File
tab
Close option from the
view. Microsoft Access will close the database for
Info
Backstage New
Opem My databae
you.
Save
To open an existing Access database, follow the given steps: Vnt Cone
Close
Step-2: Click Open option from the Backstage View. The Open window appears
Step-3: Click on Browse option. The Open dialog box appears
Step-4: Select the required database to open and click the Open button. The
selected database is opened.
Step-2
Opep Click Open ThsK Oeaaments
ees
Step-4: Select
the database
Step-3 Step-5
Click Browse Click Open
40
Computers
Kevboard Shorteut
Press Ctrl + S to save a
database
2 Press Ctrl O to open an existing database.
+
Table:1
Field NameCricketeriDName AgeCategory Strong Rnnts| Weak P'oints Average
Data Type Tet Text NumbrTet Tet Tet Number
Table:2
Field Name Match ID Cicketer ID Runs Scored Wickets Taken Catches
Data Type Text Text Number Number Number
Key
Ponrs
Database is a collection ofrelated tables with data.
Microsoft Access is a powerful program to create and manage databases.
Table is a collection of data about a specific topic.
A table structure identifies the name, size and types of various fields.
Primary key refers to afield (column) which uniquely identify each record in a table.
EXEBOLSUU
Multiple Choice Questions
1 Data is entered in. VleW.
41
computers
B. Fll in the blanks
2 What is the difference between Datasheet View and Design View in a table?
Computer 8
UNZON0
A. Activity
Name the data type that can be used to store the following data:
1. Agra Fort
2 [email protected]
3. 128
4. $127.00 *****
5. 3/11/2016 ****
6. True/False
B. Project Work
Design a table for school management system to maintain information about your
school's staff. It should have staff name, staff ID and the classes they are teaching,
as fields. Enter at least 5 records in these fields. Select a suitable field as the
primary key of the table and state your reason for choosing it.
icoiputers P 4